mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-27 14:57:59 +01:00
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.
This commit is contained in:
parent
26ebc32e60
commit
c75a8b82ec
1 changed files with 15 additions and 0 deletions
|
@ -268,6 +268,21 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
|
||||||
(with-slots (detail state) key-press
|
(with-slots (detail state) key-press
|
||||||
(let ((keysym (xcb:keysyms:keycode->keysym exwm--connection detail state))
|
(let ((keysym (xcb:keysyms:keycode->keysym exwm--connection detail state))
|
||||||
event)
|
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 (and keysym (setq event (xcb:keysyms:keysym->event keysym state)))
|
||||||
(when (eq major-mode 'exwm-mode)
|
(when (eq major-mode 'exwm-mode)
|
||||||
(setq exwm-input--temp-line-mode t
|
(setq exwm-input--temp-line-mode t
|
||||||
|
|
Loading…
Reference in a new issue