Bug 506097 - Bug in Display Configuration (off by one) causes gaps between screens that `xrandr` can see
Summary: Bug in Display Configuration (off by one) causes gaps between screens that `x...
Status: CONFIRMED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (other bugs)
Version First Reported In: 6.3.5
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords: multiscreen
Depends on:
Blocks:
 
Reported: 2025-06-24 09:30 UTC by armin.novak
Modified: 2025-09-13 06:31 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.6
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description armin.novak 2025-06-24 09:30:55 UTC
I'm using debian 13 with kde/plasma  (6.3 I think)
Now, I got a setup of 3 3840x2160 monitors side by side.

When I arrange them in System Settings/Display Configuration side by side `xrandr` tells me:
```
DP-2 connected primary 3840x2160+7682+0 (normal left inverted right x axis y axis) 607mm x 345mm
DP-3 connected 3840x2160+0+477 (normal left inverted right x axis y axis) 607mm x 345mm
DP-4 connected 3840x2160+3841+269 (normal left inverted right x axis y axis) 607mm x 345mm
```

when I do the same on debian 13/gnome I get:
```
DP-2 connected 3840x2160+7680+743 (normal left inverted right x axis y axis) 610mm x 350mm
DP-3 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 610mm x 350mm
DP-4 connected 3840x2160+3840+345 (normal left inverted right x axis y axis) 610mm x 350mm
```

Since the `Display Configuration` tool does not allow creating layouts with gaps in it this looks like an off by one error.
Comment 1 Nate Graham 2025-06-24 19:21:18 UTC
Does this result in any user-facing issues?

Does it happen on Wayland too?
Comment 2 armin.novak 2025-06-25 07:30:57 UTC
This happens in both, `X11` and `wayland` session, also with `XWayland`.

This affects all `FreeRDP` based clients that want to use `/multimon` mode because remote windows does not support gaps and the whole screen then is garbled (wrong resolutions, offsets, ...). (by default such a gap prevents a connection to succeed, this is what I did find during tests - the reason it now bails out early)
Comment 3 Zamundaaa 2025-06-26 11:32:53 UTC
FreeRDP not working with slightly out of the ordinary display configurations is a FreeRDP bug, please report it to them.

I can't reproduce this on 6.4, so I assume it's fixed with https://invent.kde.org/plasma/kwin/-/merge_requests/7665.
Comment 4 armin.novak 2025-06-26 18:20:59 UTC
> FreeRDP not working with slightly out of the ordinary display configurations
> is a FreeRDP bug, please report it to them.
> 
FreeRDP has a requirement of no gaps. The configuration tool is lying about the layout (it tells there are no gaps). This is your issue.

> I can't reproduce this on 6.4, so I assume it's fixed with
> https://invent.kde.org/plasma/kwin/-/merge_requests/7665.

Just did install a fedora 42 on that system, just to check:
1. form the iso plasma 6.3 was installed. Issue confirmed there.
2. dnf upgrade to plasma 6.4
3. reboot, just to be safe
4. and again, the layout is wrong, just like reported. not fixed.
5. just to be sure, try the config tool again and retry, same result.
Comment 5 armin.novak 2025-06-26 18:37:17 UTC
ok, your referenced pull request gave me an idea.
If i change the default of 165% scaling then, depending on some rounding issue, the values are correct (or off by one)

so it is indeed related to that, but just not (yet) fully fixed.
Comment 6 armin.novak 2025-06-27 06:33:36 UTC
so, to clarify:

1. I can reproduce with plasma 6.4 (the current one with fedora 42)
2. I only need 2 monitors to reproduce
3. The key factor is the scaling of the monitor at 0/0

so, the rounding of https://invent.kde.org/plasma/kwin/-/merge_requests/7665 sometimes ends up on the wrong end (therefore the +1 pixel gap)
Comment 7 Zamundaaa 2025-07-03 16:46:36 UTC
hmm, right, with fractional scaling it'll still happen with the MR.

(In reply to armin.novak from comment #4)
> FreeRDP has a requirement of no gaps.
That requirement is terrible though. A gap-less Wayland output configuration can have gaps in Xwayland. I'm not sure that is avoidable.
Comment 8 armin.novak 2025-07-09 10:56:23 UTC
> > FreeRDP has a requirement of no gaps.
> That requirement is terrible though.
well, it is what it is. RDP does not support gaps and the xfreerdp client will not get a resolution for that. (sdl3 on the other hand runs natively on wayland, so should not have that issue as long as the wayland session does not have gaps)

> A gap-less Wayland output configuration can have gaps in Xwayland. I'm not sure that is avoidable.
how so? This sounds like integer rounding basics?
In the merge request above you do calculate the resolution from the size and scaling settings of the monitor, but you do not do proper rounding so you end up with wrong resolution / offset values