Skip to content

Draft: xwayland: Allow switching to/from fullscreen

The xdg-shell protocol has a very smart mechanism when it comes to state changes.

If the client can handle the transition to/from fullscreen, the compositor will rely on that, otherwise it will just resize the surface to match the fullscreen size.

But that's not what we want in Xwayland, because that means an XRandR change to match the neww fulslcreen size, whereas most of the time, switching an existing Xwayland rootful session to fullscreen means keeping the existing resolution, so that the application running within Xwayland rootful does not need to support the fullscreen size itself.

Instead, better use the same mechanism that we use when starting fullscreen, ie a viewport.

For this to work, Xwayland needs to get the pending state from the xdg_ toplevel configure handle, adjust the state internally, and apply it in the xdg_surface.configure().

With libdecor, this is similar, instead of resizing the surfce we setup the viewport when fullscreen to achieve the desired transition.

Merge request reports