Created attachment 5590
Add support for _NET_WM_STATE_FOCUSED property
From investigating the GTK+ bug:
GTK3 applications (and client-side decorations in particular) aren't drawn any differently whether they are focused or unfocused, because GTK3 is looking for the _NET_WM_STATE_FOCUSED property , which xfwm4 doesn't currently support.
My patch adds support for _NET_WM_STATE_FOCUSED, reusing the same logic that decides when xfwm4's own titlebars should be drawn as focused or unfocused. The patch applies to 4.10.1; I can update it for master if needed.
Hi, would be great if you could indeed update it to work with master! Thanks in advance!
Do we need to introduce yet another internal flag CLIENT_FLAG_FOCUSED for this, can't we use the existing one?
XFWM_FLAG_FOCUS seems to be used to remember the focused window on inactive workspaces. So I don't think it's really the same as CLIENT_FLAG_FOCUSED. I can look at the code a bit more and see if it would be possible to combine the two flags.
Sorry to jump into this convo, but I was about to make a bug report before I saw this one and thought it could be related.
I am having some trouble with the new Borderlands game and xfwm. When I launch it fullscreen it doesn't grab the KB and mouse. It loads all the way to the main menu but it is unresponsive to either. Sometimes if I am lucky I can shift+tab to bring up the steam overlay and then alt+tab out and back in and if the game doesn't crash then things are as expected. Usually it crashes though.
I should add that I am playing at 5760x1080 with 3 monitors. It is fine @ 1920x1080. It does work with gnome-shell (but eww). If not Ill file a report and see where it goes.
(In reply to Josh Palmer from comment #4)
> Sorry to jump into this convo, [...]
That particular issue you describe seems completely unrelated to this bug and actually I doubt this in an xfce/xfwm4 bug at all.
that was fast! thanks for the reply. It definitely seems like a focus issue since alt+tabbing in/out fixes it whether it's related to this or not.
It sucks being probably one of only a handful of linux gamers trying to play on 3 monitors... it's pretty much impossible to get/find help when things don't work as expected and I can't figure it out myself. Aspyr (who ported the game to linux) basically said "everything about your setup is unsupported so we can't help you" =/
Thanks again, ill probably try the xfce forums and see if anyone has a clue.
(In reply to Josh Palmer from comment #6)
> that was fast! thanks for the reply. It definitely seems like a focus issue
> since alt+tabbing in/out fixes it whether it's related to this or not.
If you reckon it's a focus issue then it could be xfwm4, but a different issue than this one (read different bug)
If it's a focus issue, it might be connected to this bug, which is a regression of 4.11.2 (you can test whether it is that bug by trying out previous versions, e.g. 4.11.1): https://bugzilla.xfce.org/show_bug.cgi?id=11167
reverted to 4.11.1 which sadly didn't fix it. Thanks for trying though.
What are the maintainers' thoughts on this patch? I've been hoping for _NET_WM_STATE_FOCUSED support in xfwm, and if this patch looks good to you folks, I'll probably apply it on my own system until it shows up in Xubuntu.
Created attachment 5777
Updated patch against git master (4.11)
@John and Olivier: I've updated the attached patch for master and used the XFWM_FLAG_FOCUS as suggested by Olivier. The functionality of the patch is still OK and I've tested switching workspaces (since this is what the XFWM_FLAG_FOCUS is otherwise used for) and all seems to work as intended/before. Could you guys give this some testing/review?
I apologize for not getting any more work in on this. I don't have Git versions of the XFCE libraries installed right now to test with. The new patch looks fine to me at first glance, with the caveat that I don't completely understand the semantics of the existing focus flag.
See also: bug 10144.
*** Bug 10144 has been marked as a duplicate of this bug. ***
Is it possible the latest patch might trigger a bug in window minimizing/maximizing/restoring? I used it for a while, and application windows started vertically-maximizing when I brought them out of minimized state, but only sometimes. I saw this in at least three different applications, and the problem went away when I reverted to the unpatched xfwm4. I'll test some more when I get a chance.
Pushed to git (slightly modified).
Thanks for the patch!
Nicely done. Much cleaner than my original patch. Calling clientGetFocus() neatly sidesteps the question of which flag to use--I wish I had thought of that.
Confirmed: Simon Steinbeiss' "Updated patch against git master (4.11)" caused some of my application windows to vertically maximize when they should not have. The patch that Olivier Fourdan applied to git (c7aa46f) does not cause this problem. (At least not in the two days during which I've been running it.)