! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Add support for _NET_WM_STATE_FOCUSED
Status:
RESOLVED: FIXED
Severity:
enhancement

Comments

Description John Lindgren editbugs 2014-08-03 04:31:19 CEST
Created attachment 5590 
Add support for _NET_WM_STATE_FOCUSED property

From investigating the GTK+ bug:
https://bugzilla.gnome.org/show_bug.cgi?id=734159

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 [1], 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.

http://cgit.freedesktop.org/xdg/xdg-specs/commit/?id=e34d84a17341bb82af38fb84c6c070bb58b6d5b5
Comment 1 Simon Steinbeiss editbugs 2014-10-22 11:44:48 CEST
Hi, would be great if you could indeed update it to work with master! Thanks in advance!
Comment 2 Olivier Fourdan editbugs 2014-10-22 14:49:22 CEST
Do we need to introduce yet another internal flag CLIENT_FLAG_FOCUSED for this, can't we use the existing one?
Comment 3 John Lindgren editbugs 2014-10-23 00:23:00 CEST
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.
Comment 4 Josh Palmer 2014-10-24 10:22:06 CEST
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.
Comment 5 Olivier Fourdan editbugs 2014-10-24 10:30:59 CEST
(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.
Comment 6 Josh Palmer 2014-10-24 10:45:27 CEST
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.
Comment 7 Olivier Fourdan editbugs 2014-10-24 11:06:17 CEST
(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)
Comment 8 Simon Steinbeiss editbugs 2014-10-24 11:09:25 CEST
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
Comment 9 Josh Palmer 2014-10-26 21:19:58 CET
reverted to 4.11.1 which sadly didn't fix it. Thanks for trying though.
Comment 10 Forest 2014-11-27 21:31:19 CET
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.
Comment 11 Simon Steinbeiss editbugs 2014-11-27 23:59:58 CET
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?
Comment 12 John Lindgren editbugs 2014-11-28 06:48:45 CET
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.
Comment 13 Forest 2014-11-28 21:00:38 CET
See also: bug 10144.
Comment 14 Simon Steinbeiss editbugs 2014-12-01 16:23:38 CET
*** Bug 10144 has been marked as a duplicate of this bug. ***
Comment 15 Forest 2014-12-01 23:56:51 CET
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.
Comment 16 Olivier Fourdan editbugs 2014-12-05 22:27:31 CET
Pushed to git (slightly modified).

Thanks for the patch!
Comment 17 John Lindgren editbugs 2014-12-06 00:27:02 CET
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.
Comment 18 Forest 2014-12-11 06:04:45 CET
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.)

Bug #11067

Reported by:
John Lindgren
Reported on: 2014-08-03
Last modified on: 2014-12-11
Duplicates (1):
  • 10144 The :backdrop selector in gtk themes doesn't work in xfwm

People

Assignee:
Olivier Fourdan
CC List:
4 users

Version

Version:
4.10.1

Attachments

Additional information