[dev] dwm: regression e.g. on WebKit reparents

From: Christian Neukirchen <chneukirchen_AT_gmail.com>
Date: Mon, 27 Aug 2012 23:40:45 +0200

Hi,

I noticed that when WebKit-based browsers (I tested dwb and surf) spawn
plugins such as mozplugger which xembed other tools (I tested xpdf and
mupdf), keyboard events are not passed to the embedded window, while
mouse clicks work. (It works correctly in cwm, mcwm, fvwm, goomwwm,
dwm 5.8.)

I bisected this down to this commit:
http://hg.suckless.org/dwm/rev/7e2a8fec8d6c

+void
+setfocus(Client *c) {
+ if (!c->neverfocus)
+ XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
+ sendevent(c, wmatom[WMTakeFocus]);
+}

The problem seems to be, as far as I understand, sending WMTakeFocus to
the client, which redirects the focus to the *parent* window again, thus
losing focus on the embedded window. (Interestingly, this problem
doesn't appear when one runs surf or dwb in tabbed, or mozplugger in
Firefox.)

I hope someone with more clue of the X11 protocol can figure out how to
fix this.

(Testing even more, the same bug exists in twm and openbox!
Cf. http://lists.suckless.org/dev/1104/7548.html
I'm not sure it's a real dwm bug then or rather one in WebKit... of the
above mentioned, only goomwwm seems to use WM_TAKE_FOCUS, but it works
there. I can't figure out why.)

Thank you,
-- 
Christian Neukirchen  <chneukirchen_AT_gmail.com>  http://chneukirchen.org
Received on Mon Aug 27 2012 - 23:40:45 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 27 2012 - 23:48:05 CEST