Skip to content

x11: Handle monitors without outputs

xrandr --setmonitor allows one to replace an output with several monitors. This is useful to split a wide screen into two virtual monitors. Due to some oddity with X11, two monitors cannot share the same output. Therefore, when splitting an output, only the first monitor will get the physical output. The other ones need to be declared without an output.

xrandr --setmonitor HDMI-00 1280/266x960/200+0+0 HDMI-0
xrandr --setmonitor HDMI-01 1280/266x960/200+1280+0 none
xrandr --setmonitor HDMI-02 1280/266x960/200+2560+0 none
xrandr --setmonitor HDMI-03 1920/400x1200/250+0+960 none
xrandr --setmonitor HDMI-04 1920/400x1200/250+1920+960 none

Because of this, GTK will not consider the additional monitors when displaying menus, combo boxes and other non-managed windows. Instead, they will be displayed on the firts monitor. This makes GTK applications difficult to use and sometimes, combo boxes do not appear at all.

Previously, GDK just skipped monitors without an attached output. This patch ensures GDK will use these monitors by creating a fake output. This does not introduce any change for people not splitting outputs into several monitors. For other people, this fixes the problem of displaying non-managed windows at the correct position.

As for refresh rates, EDID and subpixel orders that may be incorrect by the use of a fake output, this is already the case when cloning an output (the monitor has two outputs and we use only the first one) or merging several outputs (same). Alternatively, if GDK wants to report outputs and not monitors, it should query for outputs and not monitors. That should also fix the issue.

Fix #2013 (closed)

Merge request reports