[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm 1364f80 4/6: Add support for automatic cursor warp
From: |
Chris Feng |
Subject: |
[elpa] externals/exwm 1364f80 4/6: Add support for automatic cursor warping |
Date: |
Mon, 16 Jul 2018 12:04:47 -0400 (EDT) |
branch: externals/exwm
commit 1364f80f09668a16358aa8f509266bae41d55685
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>
Add support for automatic cursor warping
* exwm-workspace.el (exwm-workspace-warp-cursor): New user option.
(exwm-workspace-switch): Automatically warp cursor after workspace
switch.
---
exwm-workspace.el | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/exwm-workspace.el b/exwm-workspace.el
index 9031721..935d9d1 100644
--- a/exwm-workspace.el
+++ b/exwm-workspace.el
@@ -47,6 +47,10 @@ deleted, moved, etc)."
"Non-nil to show buffers on other workspaces."
:type 'boolean)
+(defcustom exwm-workspace-warp-cursor nil
+ "Non-nil to warp cursor automatically after workspace switch."
+ :type 'boolean)
+
(defcustom exwm-workspace-number 1
"Initial number of workspaces."
:type 'integer)
@@ -595,6 +599,17 @@ for internal use only."
(make-instance 'xcb:ewmh:set-_NET_CURRENT_DESKTOP
:window exwm--root :data index))
(xcb:flush exwm--connection))
+ (when exwm-workspace-warp-cursor
+ (with-slots (win-x win-y)
+ (xcb:+request-unchecked+reply exwm--connection
+ (make-instance 'xcb:QueryPointer
+ :window (frame-parameter frame
+ 'exwm-outer-id)))
+ (when (or (> win-x (frame-pixel-width frame))
+ (> win-y (frame-pixel-height)))
+ (set-mouse-position frame
+ (/ (frame-width frame) 2)
+ (/ (frame-height frame) 2)))))
(when (frame-live-p old-frame)
(with-selected-frame old-frame
(run-hooks 'focus-out-hook)))
- [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 <=
- [elpa] externals/exwm 6be7298 2/6: Also send a WM_TAKE_FOCUS when setting focus with SetInputFocus, Chris Feng, 2018/07/16
- [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