blob: bb38f0ae7e8e691332c1894d6c2abdb407d4fe09 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
From 15cb084b099abe22b2d25a860b8739a81614cc48 Mon Sep 17 00:00:00 2001
From: Daniel Guihot <daniel@guihot.net>
Date: Wed, 16 Sep 2026 05:06:40 +1000
Subject: [PATCH] pointerlock: ignore pointer focus changes while fullscreen
enternotify() and motionnotify() change the selected monitor and focus
when the pointer crosses a monitor edge. A fullscreen client can lose
focus from mouse movement alone. Keep the focus on it while
lockfullscreen is set, the same policy focusstack() already follows.
---
dwm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dwm.c b/dwm.c
index 53b393e..4872c7b 100644
--- a/dwm.c
+++ b/dwm.c
@@ -763,6 +763,8 @@ enternotify(XEvent *e)
Monitor *m;
XCrossingEvent *ev = &e->xcrossing;
+ if (lockfullscreen && selmon->sel && selmon->sel->isfullscreen)
+ return;
if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
return;
c = wintoclient(ev->window);
@@ -1132,6 +1134,8 @@ motionnotify(XEvent *e)
Monitor *m;
XMotionEvent *ev = &e->xmotion;
+ if (lockfullscreen && selmon->sel && selmon->sel->isfullscreen)
+ return;
if (ev->window != root)
return;
if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) {
--
2.55.0
|