[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm 6be7298 2/6: Also send a WM_TAKE_FOCUS when settin
From: |
Chris Feng |
Subject: |
[elpa] externals/exwm 6be7298 2/6: Also send a WM_TAKE_FOCUS when setting focus with SetInputFocus |
Date: |
Mon, 16 Jul 2018 12:04:47 -0400 (EDT) |
branch: externals/exwm
commit 6be729847e78576df599cbf70512e3f9e436114b
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>
Also send a WM_TAKE_FOCUS when setting focus with SetInputFocus
* exwm-input.el (exwm-input--set-focus): Send an extra WM_TAKE_FOCUS
event to workaround the key replay issue with Xorg 1.20 when keyboard
is grabbed.
---
exwm-input.el | 51 +++++++++++++++++++++------------------------------
1 file changed, 21 insertions(+), 30 deletions(-)
diff --git a/exwm-input.el b/exwm-input.el
index 1534108..55949aa 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -158,36 +158,27 @@ This value should always be overwritten.")
"Set input focus to window ID in a proper way."
(when (exwm--id->buffer id)
(with-current-buffer (exwm--id->buffer id)
- (cond
- ((and (not exwm--hints-input)
- (memq xcb:Atom:WM_TAKE_FOCUS exwm--protocols))
- (when (= (frame-parameter nil 'exwm-id)
- (slot-value (xcb:+request-unchecked+reply exwm--connection
- (make-instance 'xcb:GetInputFocus))
- 'focus))
- (exwm--log "Focus on #x%x with WM_TAKE_FOCUS" id)
- (exwm-input--update-timestamp
- (lambda (timestamp id)
- (let ((event (make-instance 'xcb:icccm:WM_TAKE_FOCUS
- :window id
- :time timestamp)))
- (setq event (xcb:marshal event exwm--connection))
- (xcb:+request exwm--connection
- (make-instance 'xcb:icccm:SendEvent
- :destination id
- :event event))
- (exwm-input--set-active-window id)
- (xcb:flush exwm--connection)))
- id)))
- (t
- (exwm--log "Focus on #x%x with SetInputFocus" id)
- (xcb:+request exwm--connection
- (make-instance 'xcb:SetInputFocus
- :revert-to xcb:InputFocus:Parent
- :focus id
- :time xcb:Time:CurrentTime))
- (exwm-input--set-active-window id)
- (xcb:flush exwm--connection))))))
+ (exwm-input--update-timestamp
+ (lambda (timestamp id send-input-focus)
+ (when send-input-focus
+ (xcb:+request exwm--connection
+ (make-instance 'xcb:SetInputFocus
+ :revert-to xcb:InputFocus:Parent
+ :focus id
+ :time timestamp)))
+ (let ((event (make-instance 'xcb:icccm:WM_TAKE_FOCUS
+ :window id
+ :time timestamp)))
+ (setq event (xcb:marshal event exwm--connection))
+ (xcb:+request exwm--connection
+ (make-instance 'xcb:icccm:SendEvent
+ :destination id
+ :event event)))
+ (exwm-input--set-active-window id)
+ (xcb:flush exwm--connection))
+ id
+ (or exwm--hints-input
+ (not (memq xcb:Atom:WM_TAKE_FOCUS exwm--protocols)))))))
(defun exwm-input--update-timestamp (callback &rest args)
"Fetch the latest timestamp from the server and feed it to CALLBACK.
- [elpa] externals/exwm updated (0680be1 -> f45e9b9), Chris Feng, 2018/07/16
- [elpa] externals/exwm 1364f80 4/6: Add support for automatic cursor warping, Chris Feng, 2018/07/16
- [elpa] externals/exwm 6be7298 2/6: Also send a WM_TAKE_FOCUS when setting focus with SetInputFocus,
Chris Feng <=
- [elpa] externals/exwm f45e9b9 6/6: Fix XTerm crash on startup, Chris Feng, 2018/07/16
- [elpa] externals/exwm c1b6a29 3/6: Shrink Emacs frames with X request, Chris Feng, 2018/07/16
- [elpa] externals/exwm 4bb2d87 1/6: Revert "Grab & Replay key events with XI2 and XTEST", Chris Feng, 2018/07/16
- [elpa] externals/exwm bc5f0b3 5/6: ; Use `derived-mode-p'., Chris Feng, 2018/07/16