Avoid unnecessary input focus changes in line-mode

* exwm-input.el (exwm-input--grab-keyboard, exwm-input--release-keyboard):
Grab keys on X windows instead to prevent unexpected input focus changes.

* exwm-workspace.el (exwm-workspace--show-minibuffer): The workaround for
cursor flickering issue is no more needed.
This commit is contained in:
Chris Feng 2016-03-01 18:51:09 +08:00
parent 74555b25c2
commit 93e42136e3
2 changed files with 3 additions and 14 deletions

View file

@ -325,9 +325,7 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
(when (xcb:+request-checked+request-check exwm--connection (when (xcb:+request-checked+request-check exwm--connection
(make-instance 'xcb:GrabKey (make-instance 'xcb:GrabKey
:owner-events 0 :owner-events 0
:grab-window :grab-window id
(with-current-buffer (exwm--id->buffer id)
exwm--container)
:modifiers xcb:ModMask:Any :modifiers xcb:ModMask:Any
:key xcb:Grab:Any :key xcb:Grab:Any
:pointer-mode xcb:GrabMode:Async :pointer-mode xcb:GrabMode:Async
@ -342,9 +340,7 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
(when (xcb:+request-checked+request-check exwm--connection (when (xcb:+request-checked+request-check exwm--connection
(make-instance 'xcb:UngrabKey (make-instance 'xcb:UngrabKey
:key xcb:Grab:Any :key xcb:Grab:Any
:grab-window :grab-window id
(with-current-buffer (exwm--id->buffer id)
exwm--container)
:modifiers xcb:ModMask:Any)) :modifiers xcb:ModMask:Any))
(exwm--log "Failed to release keyboard for #x%x" id)) (exwm--log "Failed to release keyboard for #x%x" id))
(setq exwm--on-KeyPress #'exwm-input--on-KeyPress-char-mode))) (setq exwm--on-KeyPress #'exwm-input--on-KeyPress-char-mode)))

View file

@ -513,14 +513,7 @@ The optional FORCE option is for internal use only."
(make-instance 'xcb:MapWindow (make-instance 'xcb:MapWindow
:window (frame-parameter exwm-workspace--minibuffer :window (frame-parameter exwm-workspace--minibuffer
'exwm-container))) 'exwm-container)))
(xcb:flush exwm--connection) (xcb:flush exwm--connection))
;; Unfortunately we need the following lines to workaround a cursor
;; flickering issue for line-mode floating X windows. They just make the
;; minibuffer appear to be focused.
(with-current-buffer (window-buffer (minibuffer-window
exwm-workspace--minibuffer))
(setq cursor-in-non-selected-windows
(frame-parameter exwm-workspace--minibuffer 'cursor-type))))
(defun exwm-workspace--hide-minibuffer () (defun exwm-workspace--hide-minibuffer ()
"Hide the minibuffer frame." "Hide the minibuffer frame."