Skip to content

Set mode of rotated output simpler and correctly

Roman Gilg requested to merge romangg/xserver:xwl-output into master

I noticed when working on display management downstream that rotations of outputs did corrupt the cursor input for Xwayland clients. Looking into it I discovered the mode seems to be set incorrectly in xwl-output when we have xdg-output support.

The mode update code was also unnecessarily complex (double negation), so it is simplified a bit.

What I'm wondering is that I couldn't find any other reports of this problem which seems rather obvious on rotated outputs (the lower area of an output can't be reached with the cursor when in portrait mode). So while in theory the change makes sense to me some more data points from other compositors could be useful.

As of my session see following xrandr output with a single rotated display:

Master branch

Screen 0: minimum 16 x 16, current 1200 x 1920, maximum 32767 x 32767
XWAYLAND0 connected 1920x1200+0+0 right (normal left inverted right x axis y axis) 290mm x 180mm
   1200x1920     59.87*+
   1152x864      59.78  
   1024x768      59.68  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   720x480       59.71  
   640x400       59.20  
   320x200       58.96  
   1024x576      59.90  
   864x486       59.45  
   720x400       59.55  
   640x350       59.77

Patched

Screen 0: minimum 16 x 16, current 1200 x 1920, maximum 32767 x 32767
XWAYLAND0 connected 1200x1920+0+0 right (normal left inverted right x axis y axis) 290mm x 180mm
   1920x1200     59.88*+
   1600x1200     59.87  
   1440x1080     59.87  
   1400x1050     59.86  
   1280x1024     59.76  
   1280x960      59.94  
   1152x864      59.78  
   1024x768      59.68  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1680x1050     59.85  
   1440x900      59.89  
   1280x800      59.81  
   720x480       59.71  
   640x400       59.20  
   320x200       58.96  
   1920x1080     59.88  
   1600x900      59.82  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.45  
   720x400       59.55  
   640x350       59.77  
Edited by Roman Gilg

Merge request reports