emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/exwm c75a8b8 3/3: Prevent Emacs cursor style change whe


From: Chris Feng
Subject: [elpa] externals/exwm c75a8b8 3/3: Prevent Emacs cursor style change when pointer is in an X window
Date: Sat, 19 Sep 2015 02:10:35 +0000

branch: externals/exwm
commit c75a8b82ec2747a6fe7fc4b3a0dfaf1adca7ea64
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Prevent Emacs cursor style change when pointer is in an X window
    
    * exwm-input.el (exwm-input--on-KeyPress-char-mode): Compensate FocusOut
      event by sending a synthetic FocusIn event to prevent the change of cursor
      style (e.g. box to hollow) when pointer is in an X window.
---
 exwm-input.el |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/exwm-input.el b/exwm-input.el
index afa619b..042467b 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -268,6 +268,21 @@ It's updated in several occasions, and only used by 
`exwm-input--set-focus'.")
   (with-slots (detail state) key-press
     (let ((keysym (xcb:keysyms:keycode->keysym exwm--connection detail state))
           event)
+      ;; Compensate FocusOut event (prevent cursor style change)
+      (unless (eq major-mode 'exwm-mode)
+        (let ((id (frame-parameter nil 'exwm-window-id)))
+          (xcb:+request exwm--connection
+              (make-instance 'xcb:SendEvent
+                             :propagate 0
+                             :destination id
+                             :event-mask xcb:EventMask:StructureNotify
+                             :event
+                             (xcb:marshal
+                              (make-instance 'xcb:FocusIn
+                                             :detail xcb:NotifyDetail:Inferior
+                                             :event id
+                                             :mode xcb:NotifyMode:Normal)
+                              exwm--connection)))))
       (when (and keysym (setq event (xcb:keysyms:keysym->event keysym state)))
         (when (eq major-mode 'exwm-mode)
           (setq exwm-input--temp-line-mode t



reply via email to

[Prev in Thread] Current Thread [Next in Thread]