window-x11: Add Xwayland fullscreen games workaround

This series adds a workaround for X11 games which use xrandr to change the resolution in combination with NET_WM_STATE_FULLSCREEN when going fullscreen.

Newer versions of Xwayland support the xrandr part of this by supporting "fake" xrandr resolution changes in combination with using WPviewport to scale the app's window (at the fake resolution) to fill the entire monitor.

Apps using xrandr in combination with NET_WM_STATE_FULLSCREEN expect the fullscreen window to have the size of the (fake) xrandr resolution since when running on regular Xorg the resolution will actually be changed and after that going fullscreen through NET_WM_STATE_FULLSCREEN will size the window to be equal to the new resolution.

Note on older versions of Xwayland meta_window_x11_get_randr_monitor_resolution will always return the Windows' monitor width and height, so then this is a no-op.

In combination with the Xwayland changes this has been tested with the following gaming libs / games:

  • SDL 1.2 2d game: lbrickbuster2
  • SDL 2.0 2d game: "SDL_RENDER_DRIVER=software shippy"
  • SDL 2.0 3d game: shippy, supertux2
  • SFML: etr, marshooter
  • clanlib-0.6 game: auriferous, clanbomber
  • clanlib-1.0 game: trophy
  • clanlib-2.3 game: methane, does not seem to do resolution changes for fs
  • allegro4 2d game: worminator, lacewing
  • allegro4 3d game: machineball
  • OGRE: funguloids

Of these tests, the SDL-2.0 SFLM and OGRE tests need the mutter workaround this series adds.

Merge request reports