Solved xfce with dual displays defaults to mirror

FreeBSD 11-STABLE:

Code:
FreeBSD donald 11.0-STABLE FreeBSD 11.0-STABLE #0 r314941: Thu Mar  9 19:39:31 UTC 2017     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

NVidia card:

Code:
vgapci0@pci0:1:0:0:   class=0x030000 card=0x115410de chip=0x107d10de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GF119 [NVS 310]'

X11 configuration:

Code:
# cat /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
Section "Device"
        Identifier "Card0"
        Driver     "nvidia"
        # BusID    "PCI:1:0:0"
EndSection

XFCE is started from ~/.xinitrc:

Code:
exec /usr/local/bin/startxfce4 --with-ck-launch

My problem is that XFCE always defaults to mirroring my 2 displays whenever monitors are reconnected (for example turned off and then on). I disable the "Mirror displays" options in Displays settings, but XFCE does not keep this configuration.
 
I would add a line in ~/.xinitrc, e.g. I have the following which works fine:
Code:
xrandr --output DVI-I-1 --auto --output DP-0 --auto --left-of DVI-I-1
(You'll have to use the actual names reported by xrandr)
However, I don't use XFCE, it may have its own setting...
 
Thank you, I have a similar line in my ~/.xinitrc. This helps when I log in the first time. But after I turn my monitors off and then on - displays are mirrored again. Similar if power management puts the monitors to sleep and then I wake them up. I think I need to find a place where XFCE initializes displays - to put this command there.
 
XFCE keeps its settings in ~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml.
However, I thought that there is a way to set it via Menu->Settings->Display.
 
What about these two utilities. I would check them out too since your using nvidia drivers.

x11/nvidia-settings Display Control Panel for X NVidia driver
x11/nvidia-xconfig Tool to manipulate X configuration files for the NVidia driver

My thoughts are this feature may be handled by the video driver.
 
I looked into XFCE displays.xml file - for some reason it is overwritten every time XFCE inits monitors.

I thought about trying NVidia settings - let me go that route and I'll report back...
 
I looked into XFCE displays.xml file - for some reason it is overwritten every time XFCE inits monitors.

I thought about trying NVidia settings - let me go that route and I'll report back...
 
My existing xorg config is very simple:

Code:
# cat /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf
Section "Device"
        Identifier "Card0"
        Driver     "nvidia"
        # BusID    "PCI:1:0:0"
EndSection

I added there configuration generated by nvidia-setting:

Code:
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 378.13  (root@110amd64-default-job-04)  Tue Mar 14 01:46:59 UTC 2017

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL U2515H"
    HorizSync       30.0 - 113.0
    VertRefresh     56.0 - 86.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVS 310"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-2"
    Option         "metamodes" "DP-2: nvidia-auto-select +0+0, DP-3: nvidia-auto-select +2560+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

It works only the first time I log in. After I turn the monitors off and back again - XFCE or something else resets displays to mirror. BTW I do not have this issue with other DEs like Mate or Lumina.

Here is the relevant part from /var/log/Xorg.0.log where I log in and have correct display layout, then turn monitors off and back on:

Code:
[698700.734] (--) NVIDIA(GPU-0):
[698708.031] (II) NVIDIA(0): Setting mode "DP-2: nvidia-auto-select @2560x1440 +0+0 {ViewPortIn=2560x1440, ViewPortOut=2560x1440+0+0}, DP-3: nvidia-auto-select @2560x1440 +2560+0 {ViewPortIn=2560x1440, ViewPortOut=2560x1440+0+0}"
[698708.368] (--) NVIDIA(GPU-0): DFP-0: disconnected
[698708.368] (--) NVIDIA(GPU-0): DFP-0: Internal TMDS
[698708.368] (--) NVIDIA(GPU-0): DFP-0: 165.0 MHz maximum pixel clock
[698708.368] (--) NVIDIA(GPU-0):
[698708.370] (--) NVIDIA(GPU-0): DFP-1: disconnected
[698708.370] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[698708.370] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[698708.370] (--) NVIDIA(GPU-0):
[698708.370] (--) NVIDIA(GPU-0): DELL U2515H (DFP-2): connected
[698708.370] (--) NVIDIA(GPU-0): DELL U2515H (DFP-2): Internal DisplayPort
[698708.370] (--) NVIDIA(GPU-0): DELL U2515H (DFP-2): 480.0 MHz maximum pixel clock
[698708.370] (--) NVIDIA(GPU-0):
[698708.371] (--) NVIDIA(GPU-0): DELL U2515H (DFP-3): connected
[698708.371] (--) NVIDIA(GPU-0): DELL U2515H (DFP-3): Internal DisplayPort
[698708.371] (--) NVIDIA(GPU-0): DELL U2515H (DFP-3): 480.0 MHz maximum pixel clock
[698708.371] (--) NVIDIA(GPU-0):
[698708.391] (--) NVIDIA(GPU-0): DFP-0: disconnected
[698708.391] (--) NVIDIA(GPU-0): DFP-0: Internal TMDS
[698708.391] (--) NVIDIA(GPU-0): DFP-0: 165.0 MHz maximum pixel clock
[698708.391] (--) NVIDIA(GPU-0):
[698708.392] (--) NVIDIA(GPU-0): DFP-1: disconnected
[698708.392] (--) NVIDIA(GPU-0): DFP-1: Internal TMDS
[698708.392] (--) NVIDIA(GPU-0): DFP-1: 165.0 MHz maximum pixel clock
[698708.392] (--) NVIDIA(GPU-0):
[698708.392] (--) NVIDIA(GPU-0): DELL U2515H (DFP-2): connected
[698708.392] (--) NVIDIA(GPU-0): DELL U2515H (DFP-2): Internal DisplayPort
[698708.392] (--) NVIDIA(GPU-0): DELL U2515H (DFP-2): 480.0 MHz maximum pixel clock
[698708.392] (--) NVIDIA(GPU-0):
[698708.393] (--) NVIDIA(GPU-0): DELL U2515H (DFP-3): connected
[698708.393] (--) NVIDIA(GPU-0): DELL U2515H (DFP-3): Internal DisplayPort
[698708.393] (--) NVIDIA(GPU-0): DELL U2515H (DFP-3): 480.0 MHz maximum pixel clock
[698708.393] (--) NVIDIA(GPU-0):
 
I've just run xfce4-display-settings to check: it recognizes my setup and let me chose what I want.
What do you see in yours?
xfce-dual-monitor.png
 
After I power-cycle monitors I see the "Mirror displays" always enabled. I have to manually uncheck it and then I see the same picture as yours.
 
Accidentally solved by playing with a different compositor (Compton) and then disabling it. Without compositor running my 2 monitors are recognized and configured correctly.
 
Back
Top