Skip to content

xwayland: Do not resize when running fullscreen

This is to address a regression when running Xwayland rootful and fullscreen where the (emulated) resolution would be reset to the native resolution any time focus is lost by Xwayland.

When running fullscreen, if an X11 client has changed the resolution, Xwayland is using a viewport to emulate the expected resolution.

When changing focus, the Wayland compositor will send a configure with the actual surface size, not the size of the emulated XRandR resolution.

As a result, changing focus while XRandR emulation (and hence the viewport) in active in Xwayland will revert the resolution to the actual output size, defeating the XRandR emulation.

To avoid that issue, only change the size when not running fullscreen, otherwise reset the fullscreen mode to adjust the new size.

To reproduce:

  1. Run Xwayland fullscree nat a custom resolution:
    $ Xwayland -geometry 800x600 -fullscreen -noreset :12 &
  2. Change focus and back
  3. Check the xrandr resolution:
    $ DISPLAY=:12 xrandr -q

Expected result:

   […]
   928x580       59.88  
   864x486       59.92  
   800x600       59.86*  
   800x500       59.50  
   […]

Actual result:

Some other native resolution instead.

   […]
   1920x1080     59.96*  
   […]
   928x580       59.88  
   864x486       59.92  
   800x600       59.86  
   800x500       59.50  
   […]

This is a fix for commit 53b6d4db (xwayland: Apply root toplevel configure dimensions) which introduced that regression.
/cc @kennylevinsen

Edited by Olivier Fourdan

Merge request reports

Loading