]> git.corax.cc Git - dwm/commitdiff
Stop the focus from following the pointer master
authorMatthias Kruk <m@m10k.eu>
Sun, 28 Feb 2021 22:17:46 +0000 (07:17 +0900)
committerMatthias Kruk <m@m10k.eu>
Sun, 28 Feb 2021 22:17:46 +0000 (07:17 +0900)
The focus-following-the-pointer code and the pointer-following-the-focus
code sometimes negatively interact, causing dwm to keep cycling through
the clients of a tag. The behavior is not obviously reproduceable and
appears to be a bug in a different part of dwm. For the time being,
stop the focus from following the pointer.

dwm.c

diff --git a/dwm.c b/dwm.c
index d4a50e4afe2082b1c60fd309e765a77d0adf6d1a..e59a415ff5480121cfcd76d4ec9b2cdcbce610b9 100755 (executable)
--- a/dwm.c
+++ b/dwm.c
@@ -217,7 +217,9 @@ static void drawbar(Monitor *m);
 static void drawbars(void);
 static void drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]);
 static void drawtext(const char *text, unsigned long col[ColLast], Bool invert);
+#ifndef M10K
 static void enternotify(XEvent *e);
+#endif /* ! M10K */
 static void expose(XEvent *e);
 static void focus(Client *c);
 static void focusin(XEvent *e);
@@ -237,7 +239,9 @@ static void manage(Window w, XWindowAttributes *wa);
 static void mappingnotify(XEvent *e);
 static void maprequest(XEvent *e);
 static void monocle(Monitor *m);
+#ifndef M10K
 static void motionnotify(XEvent *e);
+#endif /* ! M10K */
 static void movemouse(const Arg *arg);
 static Client *nexttiled(Client *c);
 static void pop(Client *);
@@ -320,13 +324,21 @@ static void (*handler[LASTEvent]) (XEvent *) = {
        [ConfigureRequest] = configurerequest,
        [ConfigureNotify] = configurenotify,
        [DestroyNotify] = destroynotify,
+#ifndef M10K
        [EnterNotify] = enternotify,
+#else
+       [EnterNotify] = NULL,
+#endif /* M10K */
        [Expose] = expose,
        [FocusIn] = focusin,
        [KeyPress] = keypress,
        [MappingNotify] = mappingnotify,
        [MapRequest] = maprequest,
+#ifndef M10K
        [MotionNotify] = motionnotify,
+#else
+       [MotionNotify] = NULL,
+#endif /* ! M10K */
        [PropertyNotify] = propertynotify,
        [ResizeRequest] = resizerequest,
        [UnmapNotify] = unmapnotify
@@ -931,6 +943,7 @@ drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
                pango_layout_set_attributes(dc.font.layout, NULL);
 }
 
+#ifndef M10K
 void
 enternotify(XEvent *e) {
        Client *c;
@@ -949,6 +962,7 @@ enternotify(XEvent *e) {
                return;
        focus(c);
 }
+#endif /* ! M10K */
 
 void
 expose(XEvent *e) {
@@ -1332,6 +1346,7 @@ monocle(Monitor *m) {
                resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, False);
 }
 
+#ifndef M10K
 void
 motionnotify(XEvent *e) {
        static Monitor *mon = NULL;
@@ -1345,7 +1360,9 @@ motionnotify(XEvent *e) {
                focus(NULL);
        }
        mon = m;
+       return;
 }
+#endif /* ! M10K */
 
 void
 movemouse(const Arg *arg) {