branch: externals/exwm
commit 9193b5c37982f4b33e8ed2b4de56764674f84db5
Author: Sergey Trofimov <[email protected]>
Commit: GitHub <[email protected]>
Set the default xcursor on init. (#180)
* exwm-floating.el (exwm-floating--init): Don't initialize the cursor
module, we initialize it `exwm--init' directly now.
* exwm.el (exwm--init-xcursor): Initialize the cursor. (fixes #179)
(exwm--init): Call it.
---
exwm-floating.el | 1 -
exwm.el | 11 +++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/exwm-floating.el b/exwm-floating.el
index c4bca0c6aa..81ca779fcb 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -733,7 +733,6 @@ Both DELTA-X and DELTA-Y default to 1. This command should
be bound locally."
"Initialize floating module."
(exwm--log)
;; Initialize cursors for moving/resizing a window
- (xcb:cursor:init exwm--connection)
(setq exwm-floating--cursor-move
(xcb:cursor:load-cursor exwm--connection "fleur")
exwm-floating--cursor-top-left
diff --git a/exwm.el b/exwm.el
index 1277b45796..f0452ea11f 100644
--- a/exwm.el
+++ b/exwm.el
@@ -1034,6 +1034,16 @@ manager. If t, replace it, if nil, abort and ask the
user if `ask'."
(xcb:+request exwm--connection se))
(setq exwm--wmsn-window new-owner))))
+(defun exwm--init-xcursor ()
+ "Initialize Xcursor for connection.
+Set the default cursor to `left_ptr'"
+ (xcb:cursor:init exwm--connection)
+ (xcb:+request exwm--connection
+ (make-instance 'xcb:ChangeWindowAttributes
+ :window exwm--root
+ :value-mask xcb:CW:Cursor
+ :cursor (xcb:cursor:load-cursor exwm--connection
"left_ptr"))))
+
(cl-defun exwm--init (&optional frame)
"Initialize EXWM.
FRAME, if given, indicates the X display EXWM should manage."
@@ -1090,6 +1100,7 @@ FRAME, if given, indicates the X display EXWM should
manage."
(add-hook 'delete-terminal-functions 'exwm--on-delete-terminal)
(exwm--lock)
(exwm--init-icccm-ewmh)
+ (exwm--init-xcursor)
(exwm-layout--init)
(exwm-floating--init)
(exwm-manage--init)