I'd had problems with multiple monitors and Xfce4 before, but somehow the issue had fixed itself without me having to investigate too much. Then, for reasons that are not clear, the dual monitor setup I'd had on Debian jessie just stopped working. I saw mirrored displays, using the background defined for the second screen.
The xrandr
commands issued both before and after xfce4
started seemed to be ignored, although if I ran the xrandr command
in a terminal window, that worked.. Was xfce4 doing stuff without
my knowledge? If it was, it must be storing the monitor names that
xrandr used. I grepped all the files under the .config
directory which identified the file
~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml
as containing references to the monitors.
Once I'd found this file, the reason for the xfce4 display was obvious: the two screens had somehow ended up being overlayed at the same location, 0,0.
<?xml version="1.0" encoding="UTF-8"?> <channel name="displays" version="1.0"> <property name="Default" type="empty"> <property name="Layout" type="string" value="Screens"/> <property name="NumScreens" type="int" value="2"/> <property name="VGA-0" type="string" value="Monitor"> <property name="Resolution" type="string" value="1920x1080"/> <property name="RefreshRate" type="double" value="60.000000"/> <property name="Rotation" type="int" value="0"/> <property name="Reflection" type="string" value="0"/> <property name="Primary" type="bool" value="false"/> <property name="Position" type="empty"> <property name="X" type="int" value="0"/> <property name="Y" type="int" value="0"/> </property> <property name="Active" type="bool" value="true"/> </property> <property name="DVI-0" type="string" value="LG Electronics 22""> <property name="Active" type="bool" value="true"/> <property name="Resolution" type="string" value="1920x1080"/> <property name="RefreshRate" type="double" value="59.933878"/> <property name="Rotation" type="int" value="0"/> <property name="Reflection" type="string" value="0"/> <property name="Primary" type="bool" value="false"/> <property name="Position" type="empty"> <property name="X" type="int" value="0"/> <property name="Y" type="int" value="0"/> </property> </property> </property> </channel>
The simple fix was to change the second monitor's location to have
an X value of 1920, so the displays.xml
file now looks
like:
<?xml version="1.0" encoding="UTF-8"?> <channel name="displays" version="1.0"> <property name="Default" type="empty"> <property name="Layout" type="string" value="Screens"/> <property name="NumScreens" type="int" value="2"/> <property name="VGA-0" type="string" value="Monitor"> <property name="Resolution" type="string" value="1920x1080"/> <property name="RefreshRate" type="double" value="60.000000"/> <property name="Rotation" type="int" value="0"/> <property name="Reflection" type="string" value="0"/> <property name="Primary" type="bool" value="false"/> <property name="Position" type="empty"> <property name="X" type="int" value="0"/> <property name="Y" type="int" value="0"/> </property> <property name="Active" type="bool" value="true"/> </property> <property name="DVI-0" type="string" value="LG Electronics 22""> <property name="Active" type="bool" value="true"/> <property name="Resolution" type="string" value="1920x1080"/> <property name="RefreshRate" type="double" value="59.933878"/> <property name="Rotation" type="int" value="0"/> <property name="Reflection" type="string" value="0"/> <property name="Primary" type="bool" value="false"/> <property name="Position" type="empty"> <property name="X" type="int" value="1920"/> <property name="Y" type="int" value="0"/> </property> </property> </property> </channel>
Now I know the name of the file to tweak, there are plenty of references to it via Google; I don't understand how I had not stumbled over them earlier.