mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-30 16:07:59 +01:00
Fix some input focus issues
* Fix input focus lost after moving window to another workspace * Enhance `exwm-reset` to provide user a way to reset input focus when it's lost unexpectedly
This commit is contained in:
parent
3b9d0dd921
commit
52984898ec
2 changed files with 11 additions and 5 deletions
|
@ -181,14 +181,17 @@ The optional FORCE option is for internal use only."
|
||||||
(if exwm--floating-frame
|
(if exwm--floating-frame
|
||||||
;; Move the floating frame is enough
|
;; Move the floating frame is enough
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ReparentWindow
|
(make-instance 'xcb:ReparentWindow
|
||||||
:window (frame-parameter exwm--floating-frame
|
:window (frame-parameter exwm--floating-frame
|
||||||
'exwm-outer-id)
|
'exwm-outer-id)
|
||||||
:parent (frame-parameter frame 'exwm-window-id)
|
:parent (frame-parameter frame 'exwm-window-id)
|
||||||
:x 0 :y 0))
|
:x 0 :y 0))
|
||||||
;; Move the window itself
|
;; Move the window itself
|
||||||
(bury-buffer)
|
(bury-buffer)
|
||||||
(exwm-layout--hide id)
|
(exwm-layout--hide id)
|
||||||
|
;; Force update input focus
|
||||||
|
(setq exwm-input--focus-id xcb:Window:None)
|
||||||
|
(exwm-input--update-focus)
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ReparentWindow
|
(make-instance 'xcb:ReparentWindow
|
||||||
:window id
|
:window id
|
||||||
|
|
3
exwm.el
3
exwm.el
|
@ -198,6 +198,9 @@
|
||||||
(with-current-buffer (window-buffer)
|
(with-current-buffer (window-buffer)
|
||||||
(when (eq major-mode 'exwm-mode)
|
(when (eq major-mode 'exwm-mode)
|
||||||
(when exwm--fullscreen (exwm-layout-unset-fullscreen))
|
(when exwm--fullscreen (exwm-layout-unset-fullscreen))
|
||||||
|
;; Force update input focus
|
||||||
|
(setq exwm-input--focus-id xcb:Window:None)
|
||||||
|
(exwm-input--update-focus)
|
||||||
(exwm-input-grab-keyboard))))
|
(exwm-input-grab-keyboard))))
|
||||||
|
|
||||||
(defmacro exwm--with-current-id (id &rest body)
|
(defmacro exwm--with-current-id (id &rest body)
|
||||||
|
|
Loading…
Reference in a new issue