Bug 454578 - Mirrored displays are set to 1,0 instead of the 0,0 of the second display, causing desktop misbehaviour
Summary: Mirrored displays are set to 1,0 instead of the 0,0 of the second display, ca...
Status: RESOLVED DUPLICATE of bug 455394
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_kscreen (show other bugs)
Version: 5.24.5
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-29 15:51 UTC by mikeoosting@riseup.net
Modified: 2022-11-12 15:05 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mikeoosting@riseup.net 2022-05-29 15:51:45 UTC
SUMMARY

In system settings > display configuration, when I drag my second display on top of the first to mirror it, it will snap to a position that it initially reports as 0,0 while snapping it into place. But clicking on the screens again will show that one of them (usually the primary display) is actually at 1,0 instead of the expected 0,0, and there is no way to make it properly snap to 0,0 within the settings GUI as it will always snap back to that 1,0 position no matter which monitor you drag onto which or from where. Checking the newest profile in ~/.local/share/kscreen confirms that the position is at 1,0:

        "pos": {
            "x": 1,
            "y": 0
        },

Both displays are 1920x1080, connected to the GPU directly and in the same orientation, both at 100% scale with no overscan. One is connected by Displayport and one HDMI, and I've confirmed the same behaviour with another DVI-connected monitor as well. I don't have a second Displayport monitor to test dual Displayport or additional HDMI ports on the GPU to test dual HDMI. The Displayport monitor is a 165hz freesync monitor and the others are 60hz, but I've tried disabling freesync and setting the monitor to 60hz and it resulted in the same behaviour.

This causes various issues. Occasionally randomly, but usually after launching something fullscreen, all icons/widgets on the desktop will disappear and the wallpaper will be shifted over one pixel. After this has happened, clicking on the leftmost and rightmost pixel columns of the screen will shift the wallpaper back and forth one pixel and alternatively reveal or hide the desktop icons, as if revealing the second display underneath and slightly offset from the first. Once this behaviour has started, clicking the leftmost/rightmost pixel columns on the screen will always do this until a restart, at which point mirroring will seem to work again for a while.

This issue seems to occur on both Wayland and X11, but on X11 is easily fixable by the "Replica of:" setting in Display Configuration which perfectly mirrors the displays every time. On Wayland just due to the way displays are handled differently there is no such setting, and manually editing the value in the profile in ~/.local/share/kscreen and then running "kquitapp5 plasmashell || killall plasmashell && kstart5 plasmashell" doesn't solve it either. In fact, if the desktop is not already misbehaving and you do this, it will cause the bug to occur immediately, I find.

STEPS TO REPRODUCE

1. Drag and drop a display of the same resolution and orientation on top of another in the Display Configuration GUI in Systems Settings
2. The display you are moving will snap to the same position as the first, and while still holding the left mouse button down, the position of the display will be reported as 0,0
3. Let go of the left mouse button and then click apply
4. Then keep double clicking on the display to reveal its position and the position of the display underneath it, one of them will show a position of 1,0.
5. Go to ~/.local/share/kscreen and check the newest profile saved there then look for "pos" and check the reported x/y values for both displays. One of them will be 1 instead of 0.
6. Try to edit all "pos" values for both screens to be 0, save, and then run: 
kquitapp5 plasmashell || killall plasmashell && kstart5 plasmashell
If the bug isn't already occurring, it will occur now.

OBSERVED RESULT

One of the mirrored screens, usually the primary display, is at position 1,0 instead of 0,0, sometimes causing misbehaviour of desktop icons and wallpapers, making the wallpaper shift by a pixel column and desktop icons disappear. Manually editing the position in the profile will not solve the issue.

EXPECTED RESULT

Both monitors are at position 0,0 and are perfectly mirrored.

SOFTWARE/OS VERSIONS

Fedora 36 KDE Spin, Kernel 5.17.11
KDE Plasma 5.24.5
Kscreen 5.24.5
Qt Version 5.15.3
Comment 1 Trent M 2022-08-04 02:43:18 UTC
I am actually experiencing this as well, but not with *mirrored* displays, but rather *vertically stacked* displays. You can reproduce this by just trying to stack the displays vertically in the GUI display configuration. If they already are, drag one away and then drag it back. You'll notice that when you check on the positions, one of them is going to be X = 1 no matter what you do. It just won't let two displays share X = 0 at all. There could be some sort of bad assumption regarding how displays are arranged that is biased toward horizontal arrangements; if you only arrange displays horizontally, it makes sense that you never want them to have the same X position.

It causes some really weird breakages when you have the displays misaligned by just one pixel. I had some nasty graphical glitches when I went back to Intel-as-Primary, that went away once I was able to get the displays horizontally aligned via manual configuration.
Comment 2 Felix Yan 2022-09-17 19:31:47 UTC
Confirming the problem.

Arch Linux 5.19.9-zen1
KDE Plasma 5.25.5
Kscreen 5.25.5
Qt 5.15.6-kde
Comment 3 Nate Graham 2022-11-12 15:05:41 UTC
Ultimately the same root cause as Bug 455394, which is now fixed in Plasma 5.26.4.

*** This bug has been marked as a duplicate of bug 455394 ***