Re: [dev] Bug when unfocusing/focusing GTK3 windows

From: Josh Rickmar <>
Date: Fri, 17 Aug 2012 09:16:55 -0400

Eckehard Berns <> wrote:

> On Thu, Aug 16, 2012 at 07:03:10PM -0400, Josh Rickmar wrote:
> > This is a focusing issue that was noticed when we (me and many of the
> > the other xombrero devs) noticed when we switched our browser from
> > GTK2 to GTK3. If a GTK3 window is shown and focused on one tag, and I
> > switch to another tag with no windows on it, whenever I switch back to
> > the tag with the GTK3 window, the toplevel GtkWindow no longer has its
> > it-active and has-toplevel-focus properties set to true.
> I'm pretty sure this is a GTK3 bug since I saw strange focusing behavior
> with other window managers too. Not this behavior, but unexpected behavior
> non the less.
> On my system the following patch to dwm seems to work around the GTK3
> focus problem:
> --- a/dwm.c 2012-07-09 10:28:59.106043161 +0200
> +++ b/dwm.c 2012-08-17 12:02:11.618822311 +0200
> _AT_@ -865,6 +865,7 @@
> else {
> XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
> XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
> + XFlush(dpy);
> }
> selmon->sel = c;
> drawbars();
> --
> Eckehard Berns

Sorry, but that doesn't seem to work for me. (Were you testing using
xombrero? we added a pretty horrible hack to fake a focus-in event
under certain conditions so help minimize this problem, before it was
discovered this was a bug either in the WM or GTK. I removed this
hack before testing this dwm patch.)

One of our spectrwm devs says he believes he found the bug. I don't
know WM code so I may be putting words in his mouth here.. but I
believe it was something about calling an unmap on all other windows
first, then an unmap on windows in the current workspace, which meant
newly mapped windows were totally obscuring the GTK3 window, causing a
VisibilityNotify state VisibilityFullyObscured. Don't ask me what all
that means :)

No idea if this is the same problem in dwm, but I suppose it's worth
looking into.

Josh Rickmar

Received on Fri Aug 17 2012 - 15:16:55 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 17 2012 - 15:24:03 CEST