[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm 24b964b 25/64: Ignore repeated `MappingNotify` eve
From: |
Chris Feng |
Subject: |
[elpa] externals/exwm 24b964b 25/64: Ignore repeated `MappingNotify` events |
Date: |
Thu, 17 Sep 2015 23:17:58 +0000 |
branch: externals/exwm
commit 24b964bb4af100b959a33215cc91b9c896c9359e
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>
Ignore repeated `MappingNotify` events
For some reason, `MappingNotify` events are generated quite frequently and
greatly impact the performance. This commit disables the complete refresh of
keyboard mapping.
---
exwm-input.el | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/exwm-input.el b/exwm-input.el
index 24aa94a..293fd67 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -139,13 +139,24 @@ It's updated in several occasions, and only used by
`exwm-input--set-focus'.")
(let ((obj (make-instance 'xcb:MappingNotify)))
(xcb:unmarshal obj data)
(with-slots (request first-keycode count) obj
- (cond ((= request xcb:Mapping:Modifier)
- ;; Modifier keys changed
- (xcb:keysyms:update-modifier-mapping exwm--connection))
- ((= request xcb:Mapping:Keyboard)
- ;; Only updated changed keys
- (xcb:keysyms:update-keyboard-mapping exwm--connection
- first-keycode count))))))
+ (cond
+ ((= request xcb:Mapping:Modifier)
+ ;; Modifier keys changed
+ (exwm--log "Update modifier mapping")
+ (xcb:keysyms:update-modifier-mapping exwm--connection)
+ )
+ ((= request xcb:Mapping:Keyboard)
+ ;; Only update changed keys
+ (with-slots (min-keycode max-keycode)
+ (xcb:get-setup exwm--connection)
+ ;; Since this operation is quite time-consuming, a complete refresh
+ ;; is forbidden as it's unlikely to bring any useful information
+ (unless (and (= min-keycode first-keycode)
+ (= max-keycode (+ first-keycode count -1)))
+ (exwm--log "Update keyboard mapping: %d ~ %d"
+ first-keycode (+ first-keycode count))
+ (xcb:keysyms:update-keyboard-mapping exwm--connection
+ first-keycode count))))))))
(defun exwm-input--on-ButtonPress (data synthetic)
"Handle ButtonPress event."
- [elpa] externals/exwm 14628a9 16/64: Fix race conditions when managing a window, (continued)
- [elpa] externals/exwm 14628a9 16/64: Fix race conditions when managing a window, Chris Feng, 2015/09/17
- [elpa] externals/exwm 5298489 18/64: Fix some input focus issues, Chris Feng, 2015/09/17
- [elpa] externals/exwm 3b9d0dd 17/64: Fixes for manage/unmanage window, Chris Feng, 2015/09/17
- [elpa] externals/exwm 42f4ec6 20/64: Show moved window by default, Chris Feng, 2015/09/17
- [elpa] externals/exwm 36bb579 21/64: Refresh when minibuffer grows (fix #10), Chris Feng, 2015/09/17
- [elpa] externals/exwm 2ad1a89 14/64: Various input fixes, Chris Feng, 2015/09/17
- [elpa] externals/exwm 84f0f03 15/64: Fix input focus lost after closing window, Chris Feng, 2015/09/17
- [elpa] externals/exwm 63402b0 19/64: Correct layout refresh problems, Chris Feng, 2015/09/17
- [elpa] externals/exwm edc70eb 22/64: Remove redundant code caused by the concurrency of events, Chris Feng, 2015/09/17
- [elpa] externals/exwm 2d4104a 23/64: Fix emacsclient bugs, Chris Feng, 2015/09/17
- [elpa] externals/exwm 24b964b 25/64: Ignore repeated `MappingNotify` events,
Chris Feng <=
- [elpa] externals/exwm 801185c 27/64: Fix buffer switch problems, Chris Feng, 2015/09/17
- [elpa] externals/exwm 1ce18af 28/64: Center floating windows by default, Chris Feng, 2015/09/17
- [elpa] externals/exwm 048994c 24/64: Remove redundant code caused by the concurrency of events (continued), Chris Feng, 2015/09/17
- [elpa] externals/exwm 35560a4 30/64: Minor fixes for emacsclient, Chris Feng, 2015/09/17
- [elpa] externals/exwm b755296 26/64: Remove redundant code caused by the concurrency of events (contd, 2), Chris Feng, 2015/09/17
- [elpa] externals/exwm 7bfd429 33/64: Honor `value-mask` field in ConfigureRequest event, Chris Feng, 2015/09/17
- [elpa] externals/exwm dba43b0 32/64: Fix input focus stealing, Chris Feng, 2015/09/17
- [elpa] externals/exwm d998b42 34/64: Provide hooks run when the floating state of a window changes (close #28), Chris Feng, 2015/09/17
- [elpa] externals/exwm 15ad591 35/64: Fix bug when moving a window to the current workspace, Chris Feng, 2015/09/17
- [elpa] externals/exwm 43b00d2 36/64: fix buffer renaming, Chris Feng, 2015/09/17