steamcompmgr: write back NET_WM_STATE on state changes - #2322
Conversation
|
There are several issues with the way gamescope handles (un)fullscreen requests:
Setting the atom on the window synchronously after receving the request, before the window has had a chance to be resized, probably violates the EWMH spec ("The Window Manager MUST keep this property updated to reflect the current state of the window."). Additionally, the Steam window is always considered fullscreen (see I think it'd be worth looking into decoupling the resizing of a window that requested (un)fullscreen from focus handling. |
|
Thanks for the feedback! I moved the window resizing to a helper function, and it is now called in Then, Regarding Steam, we use There is one preexisting issue that I found, which is that going out of fullscreen only restores geometry for fixed-size windows, the resizable clients need to restore themselves. The spec says that "the Window Manager is responsible for restoring the original geometry after a switch from fullscreen back to normal window", so it's something we should fix (not sure if here or in a followup). I have tried this both with Firefox (toggling fullscreen a YouTube video still works), and also launching Steam, which is always in big picture mode and in fullscreen. Then I tried launching a game, and toggling fullscreen, and the behaviour appears correct, and identical to how it looks on master. 2026-08-14_12-50-20.mp42026-08-14_12-57-48.mp42026-08-14_12-46-25.mp42026-08-14_12-56-30.mp4 |
| if (w->isFullscreen) atoms[count++] = ctx->atoms.netWMStateFullscreenAtom; | ||
| if (w->skipTaskbar) atoms[count++] = ctx->atoms.netWMStateSkipTaskbarAtom; | ||
| if (w->skipPager) atoms[count++] = ctx->atoms.netWMStateSkipPagerAtom; | ||
| XChangeProperty(ctx->dpy, w->xwayland().id, ctx->atoms.netWMStateAtom, |
There was a problem hiding this comment.
Does firefox care about _NET_WM_STATE_SKIP_TASKBAR and _NET_WM_STATE_SKIP_PAGER?
This code unconditionally calls XChangeProperty(), even if none of these 3 properties has actually changed. It would probably be better and safer to first call XGetWindowProperty() and to change only the properties we care about, leaving the others (including those that gamescope doesn't handle) unchanged.
Gamescope honors
NET_WM_STATEclient messages by updating its internal window state, but never writes the property back onto the client window. Clients like Firefox only consider a state change acknowledged after receiving aPropertyNotifyon that property, so fullscreen requests never completed (See Firefox bug 1867649). This patch writes the state back to the window.Tested using Firefox 153, and
gamescope -- firefox, then navigating to YouTube and playing a video, and enabling and disabling fullscreen.Note: While I'm working on supporting running Firefox natively on Wayland in Gamescope, this is a fix for running it using XWayland.
@oSoMoN