mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
Avoid using `set-mouse-position' to warp pointer
* exwm-workspace.el (exwm-workspace-switch): Warp pointer with the WarpPointer request.
This commit is contained in:
parent
e6527227b3
commit
4d43e3119a
1 changed files with 12 additions and 3 deletions
|
@ -607,9 +607,18 @@ for internal use only."
|
||||||
'exwm-outer-id)))
|
'exwm-outer-id)))
|
||||||
(when (or (> win-x (frame-pixel-width frame))
|
(when (or (> win-x (frame-pixel-width frame))
|
||||||
(> win-y (frame-pixel-height)))
|
(> win-y (frame-pixel-height)))
|
||||||
(set-mouse-position frame
|
(xcb:+request exwm--connection
|
||||||
(/ (frame-width frame) 2)
|
(make-instance 'xcb:WarpPointer
|
||||||
(/ (frame-height frame) 2)))))
|
:src-window xcb:Window:None
|
||||||
|
:dst-window (frame-parameter frame
|
||||||
|
'exwm-outer-id)
|
||||||
|
:src-x 0
|
||||||
|
:src-y 0
|
||||||
|
:src-width 0
|
||||||
|
:src-height 0
|
||||||
|
:dst-x (/ (frame-pixel-width frame) 2)
|
||||||
|
:dst-y (/ (frame-pixel-height frame) 2)))
|
||||||
|
(xcb:flush exwm--connection))))
|
||||||
(when (frame-live-p old-frame)
|
(when (frame-live-p old-frame)
|
||||||
(with-selected-frame old-frame
|
(with-selected-frame old-frame
|
||||||
(run-hooks 'focus-out-hook)))
|
(run-hooks 'focus-out-hook)))
|
||||||
|
|
Loading…
Reference in a new issue