[hackers] [tabbed][PATCH] Removes recursion while mouse is over window

From: bolshoytoster <toasterbig_AT_gmail.com>
Date: Mon, 18 Apr 2022 17:12:35 +0100

In the focusin function, it calls focus, which calls
XSetInputFocus, which sends the focusin event.

This can cause consistent ~90% cpu usage fo Xorg while the mouse
is over the window.

This patch just gets rid of the call to XSetInputFocus and breaks
the recursion. I'm not sure what the call does, but I've had no
problem with input so it's probably fine to remove.
---
 tabbed.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/tabbed.c b/tabbed.c
index eafe28a..56660c0 100644
--- a/tabbed.c
+++ b/tabbed.c
_AT_@ -465,7 +465,6 @@ focus(int c)
 
 	resize(c, ww, wh - bh);
 	XRaiseWindow(dpy, clients[c]->win);
-	XSetInputFocus(dpy, clients[c]->win, RevertToParent, CurrentTime);
 	sendxembed(c, XEMBED_FOCUS_IN, XEMBED_FOCUS_CURRENT, 0, 0);
 	sendxembed(c, XEMBED_WINDOW_ACTIVATE, 0, 0, 0);
 	xsettitle(win, clients[c]->name);
-- 
2.35.1
Received on Mon Apr 18 2022 - 18:12:35 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 19 2022 - 05:36:33 CEST