Search code examples
ubuntuxfcexrandr

Disable user interactions for a specific screen on Linux


We have a PC with two physical monitors and a desktop app that is used to serve customers. Our use case is as follows:

  1. Screen A is used by the employee
  2. Screen B is facing the customer

The OS is Ubuntu (Xubuntu 18.04 Bionic to be specific) running LightDM.

What is needed is to make the employee unable to move the mouse pointer, drag windows or otherwise interact with the screen B, so that it's only used for displaying information.

In other words, it has to be part of the desktop from the display point of view, but be excluded from the desktop in terms of availability for the user.

I tried to look at xrandr options, but failed to find any fitting my purpose. Any ideas?


Solution

  • We could finally solve this using the ZaphodHeads Intel driver option (the machine has an onboard dualhead Intel card). The relevant piece of Xorg.conf:

    Section "Device"
        Identifier     "Intel0"
        Driver         "intel"
        BusID          "PCI:0:2:0"
        Screen         0
        Option         "MonitorDP" "DP1"
        Option         "ZaphodHeads" "DP1"
    EndSection
    
    Section "Device"
        Identifier     "Intel1"
        Driver         "intel"
        BusID          "PCI:0:2:0"
        Screen         1
        Option         "MonitorVGA" "VGA1"
        Option         "ZaphodHeads" "VGA1"
    EndSection
    
    Section "Monitor"
        Identifier     "MonitorDP"
        Option         "DPMS"
    EndSection
    
    Section "Monitor"
        Identifier     "MonitorVGA"
        Option         "DPMS"
    EndSection
    
    Section "Screen"
        Identifier     "Screen0"
        Option         "AutoServerLayout" "on"
        Device         "Intel0"
        Monitor        "MonitorDP"
        SubSection     "Display"
            Viewport   0 0
            Depth      24
            Modes      "1280x1024"
        EndSubSection
    EndSection
    
    Section "Screen"
        Identifier     "Screen1"
        Option         "AutoServerLayout" "on"
        Device         "Intel1"
        Monitor        "MonitorVGA"
        SubSection     "Display"
            Viewport   0 0
            Depth      24
            Modes      "1280x1024"
        EndSubSection
    EndSection
    
    Section "ServerLayout"
        Identifier     "Multihead"
        Option         "AutoServerLayout" "on"
        Screen         0  "Screen0"
        Screen         1  "Screen1"
    EndSection