MATE Multi-Display Glitches with Marco

I use MATE desktop and that comes with x11-wm/marco. I've noticed some minor (yet annoying) glitches with the window manager which are especially visible on a multiple display setup. I have 4 displays. Three are 1920x1080 arranged in a row, and the forth is a 3840 x 2160 on the top center. If it's at all relevant this is FreeBSD 12.2-RELEASE p4 64-bit, MATE desktop 1.24.1, and an NVIDIA graphics adapter. The only thing I have in my xorg.conf is (under /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf)

Code:
Section "Device"
        Identifier "NVIDIA GTX 780 Ti"
        Driver     "nvidia"
        BusID "PCI:1:0:0"
EndSection

There are two issues that plague me:

This first is when I move windows between screens. The window will 'shift" underneath my mouse cursor as it crosses over to another display. If the window was resized before moving (doesn't matter how long ago) it will also shrink down to it's previous size while also getting shifted. This one is really difficult to reproduce but occurs often. I don't think it's random, but I have yet to figure out the pattern. I'm suspecting it's time based.

The second issue is of window placement. It doesn't seem like it's very intelligent and doesn't always remember positions. I've noticed this more with non-GTK and non-Qt apps like Firefox and Thunderbird. Positioning of the window follows the mouse cursor, even if I've previously opened the window/app. When I talk about "being opened previously", I mean this as "since the installation and first login" of the system. Ironically, with new windows (ones that have never been opened before), they get placed at the top left corner of the top screen.

There are other issues such being unable to move VirtualBox windows, disappearing desktop icons (a known issue due to the positioning of screens that should be addressed by this), and window focus.
 
It sounds like you might have a combination of HiDPI and non-HiDPI displays? What are models?

Can you provide the output of nvidia-smi?
 
Here are the models as detected by Xorg. (They are correct).

Code:
[ 33362.998] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-0): connected
[ 33362.998] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-0): Internal TMDS
[ 33362.998] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-0): 330.0 MHz maximum pixel clock
[ 33362.998] (--) NVIDIA(GPU-0):
[ 33363.035] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-1): connected
[ 33363.035] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-1): Internal TMDS
[ 33363.035] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-1): 340.0 MHz maximum pixel clock
[ 33363.035] (--) NVIDIA(GPU-0):
[ 33363.038] (--) NVIDIA(GPU-0): DFP-2: disconnected
[ 33363.038] (--) NVIDIA(GPU-0): DFP-2: Internal TMDS
[ 33363.038] (--) NVIDIA(GPU-0): DFP-2: 165.0 MHz maximum pixel clock
[ 33363.038] (--) NVIDIA(GPU-0):
[ 33363.054] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-3): connected
[ 33363.054] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-3): Internal TMDS
[ 33363.054] (--) NVIDIA(GPU-0): ViewSonic VX2452 Series (DFP-3): 330.0 MHz maximum pixel clock
[ 33363.054] (--) NVIDIA(GPU-0):
[ 33363.055] (--) NVIDIA(GPU-0): ViewSonic VX4380 SERIES (DFP-4): connected
[ 33363.055] (--) NVIDIA(GPU-0): ViewSonic VX4380 SERIES (DFP-4): Internal DisplayPort
[ 33363.055] (--) NVIDIA(GPU-0): ViewSonic VX4380 SERIES (DFP-4): 960.0 MHz maximum pixel clock

As requested...

Code:
# nvidia-smi
Tue Mar  9 03:45:29 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.39       Driver Version: 460.39       CUDA Version: N/A      |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 780 Ti  Off  | 00000000:01:00.0 N/A |                  N/A |
| 41%   49C    P2    N/A /  N/A |    490MiB /  3021MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 780 Ti  Off  | 00000000:02:00.0 N/A |                  N/A |
| 29%   28C    P8    N/A /  N/A |      2MiB /  3022MiB |     N/A      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                              
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
 
Interesting that the GPU has two addressable GPUs yet all displays are on the same GPU. I've seen this in Quadro cards however displays a split between the two GPUs.

I wonder if there's any type of issues with having two GPUs yet only one is being used. Normally if it was split between the two you would need to use TwinView (old nvidia tech) or Base Mosaic (newer tech) to stitch the two GPUs into a single desktop.

You can freely drag windows between all displays? Any chance $DISPLAY is different on any of them or is it all :0?

I'd recommend moving that .conf file out of the .d dir and xorg.conf if it's there, run nvidia-settings, X Server Display Config., Click Advanced Button. Is there an Enable Base Mosaic checkbox under the GUI display layout? If so is it checked? If not check it, setup the display layout by dragging the displays, save xorg.conf, restart X. Do you see any difference?

If you don't have a Base Mosaic option it doesn't seem the ppi between the displays is large enough to really notice however atleast for gdm on Xorg/gdm should be setting a proper dpi via Xft.dpi. Any chance you're changing that in .Xresources or .Xdefaults? If not any using Base Mosaic isn't an option or doesn't show any difference then I'm out of ideas other than maybe your GPU is bad.
 
I probably should have mentioned it in my first post. I do have two GPU's but only one is active. That's the reason behind having that xorg.conf.d/nvidia.conf file. Without it X11 gets confused by the two GPU's and fails to start. I figured that out from a post I found in these forums.

No .Xresources or .Xdefaults, just an .Xauthority file:

Code:
ls .X*
.Xauthority

Here's a screenshot of the NVIDIA X Server Settings as it is currently configured (after hitting the advanced button):
Screenshot-at-2021-03-10%2004-39-00-nvidia-settings.png


I don't know how to check for the $DISPLAY variable, but I am freely able to move stuff between displays. Except of course for this glitch.
 
Ok so that better explains the smi output. Since they're all on the same GPU BaseMosaic won't be an option. So no checkbox.

To get that display layout you would need to have an xorg.conf with a metamode line? What does that xorg.conf look like? If you don't have a xorg.conf file or a .conf file that configures the layout how are getting that layout? You're not using xrandr at X startup to generate the layout? If so I'd recommend generating the xorg.conf via nvidia-settings and move that old .conf out of .d. What does that xorg.conf look like?

When does the window shift? Only when dragging from the top display to the bottoms or when drag between any combination?
 
Ah, I didn't remember about xrandr(), but now that you mention it I do remember setting that up sometime in the beginning using x11/arandr:

~/.screenlayout/layout.sh
Code:
#!/bin/sh
xrandr --output DVI-I-0 --off --output DVI-I-1 --primary --mode 1920x1080 --pos 1920x2160 --rotate normal --output HDMI-0 --mode 1920x1080 --pos 0x2160 --rotate normal --output DP-0 --off --output DVI-D-0 --mode 1920x1080 --pos 3840x2160 --rotate normal --output DP-1 --mode 3840x2160 --pos 0x0 --rotate normal

I don't remember why I used that approach instead of the NVIDIA tool. Maybe it's because I read somewhere that it's best to avoid having an xorg.conf file? Anyway, I'm fine going the xorg.conf route if that works better. I'll try that as soon as I get a chance to tinker around with stuff.

I don't think I've ever ran into the windows shifting issue when dragging stuff between the top screen and the bottom ones. But I hardly ever do that anyways. Most of the moving occurs between the three bottom screens, and the problem occurs no matter which direction.
 
Yeah, there's something odd going on with the way nvidia-setting is seeing the current layout and the way that layout is executed in that xrandr command. That is unless if you moved that 4k display in the rendering then took the screenshot?

Based off the command it seems it would be


------------------
|.......................|
|..........4k.........|
|.......................|
--------------------------
|...........|...........|...........|
|...HD...|...HD...|...HD...|
|...........|...........|...........|
--------------------------

But it seems the 4k is shifted.

xrandr order can sometimes be crazy. Just drop/drap/snap the displays and let nvidia-settings generate the xorg.conf
 
Generated a xorg.conf file and moved away ~/.screenlayout/layout.sh.

Code:
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 460.39

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Option         "Xinerama" "0"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "ViewSonic VX2452 Series"
    HorizSync       24.0 - 82.0
    VertRefresh     50.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 780 Ti"
    BusID          "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "DVI-I-1: nvidia-auto-select +1920+2160, HDMI-0: nvidia-auto-select +0+2160, DVI-D-0: nvidia-auto-select +3840+2160, DP-1: nvidia-auto-select +800+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

It's better so far in that my login screen now has the monitors arranged correctly :D
But.. something was still applying a layout after I logged in. After checking around I found ~/.config/monitors.xml. I moved away the file, tried again, and this time the layout from the xorg.conf was sticking.
 
Ok so I think that's the problem then the ~/.config/monitors.xml file. If you insist you might be able to change back the xrandr if you choose. I always like to use nvidia-settings when possible if it's a not a 1xN layout.
 
Oh well, that didn't work. Still having the issue with shifting windows. Best way I can describe it is imagine moving the window, and as it crosses the screen it gets "held" up at the edge of the screen (like hitting a wall) while the mouse continues to move unaffected. The window break past the edge of the screen but the mouse pointer is already far ahead.

Maybe it's the mouse? I have a Logitech G903. I'll try using another mouse for a while.
 
It's possible you can go the other way around too... remove the xorg.conf return the simple .d file with the 0:1 pciid and fully config the displays with mate's tools that generate monitors.xml.

It sounds as if there's overlapping displays. mate/gnome has a really bad track record with totally trashing existing xorg layouts then applying their own. You might have to ditch xorg.conf and use their tools to configure it.


That's gnome 3 and mutter.

I know Red Hat patches gnome products to keep xorg.conf compat around but I wouldn't be surprised of it didn't get changed upstream.

btw if your display out from monitors.xml isn't applied during gdm you need to copy ~/.config/monitors.xml to ~gdm/monitors.xml all users (gdm runs as the gdm user... I think on freebsd too) need to have their own display layout.



Can you try something that's not mate/gnome/gdm with the purely xorg.conf config?
 
I use x11/sddm (something to do with .login_conf not be read in other display managers). It looks like (according to this page) I need to put a script in /usr/local/share/sddm/scripts and enable it in /usr/local/etc/sddm.conf.d/my_config_file.conf. I'll go ahead and try that.

(also, it's not the mouse, got the same thing with this other one.)
I can also test out NomadBSD to see if I get the same problem.

EDIT: Also just noticed that the xorg.conf kinda messed around with my Wacom tablet, so definitely going to go back to using monitors.xml
 
I can also test out NomadBSD to see if I get the same problem.
Using a different distro might be a bit extreme here. I would just remove mate for the time being and try a wm that doesn't touch any layouts or have any fancy features. Try fvwm and see if it's isolated to mate/macro.

But it seems you're on to something with the sticky edges.
 
Back
Top