Bug 510928 - Some hotplugging events result in monitor layout having a gap, trapping mouse on one screen
Summary: Some hotplugging events result in monitor layout having a gap, trapping mouse...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (other bugs)
Version First Reported In: 6.5.0
Platform: CachyOS Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen
Depends on:
Blocks:
 
Reported: 2025-10-22 19:35 UTC by thecaptain
Modified: 2025-12-09 21:05 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Screenshot of the invalid layout the was automatically applied (132.23 KB, image/png)
2025-10-22 19:35 UTC, thecaptain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thecaptain 2025-10-22 19:35:29 UTC
Created attachment 186017 [details]
Screenshot of the invalid layout the was automatically applied

SUMMARY
Some hotplugging event involving a 2560x1600 16:10 laptop screen, and a 4k 16:9 TV results in a screen position layout getting set that has a gap between the two screens. The effect of this is that the mouse (and thus windows) are trapped on one screen.

This is particularly problematic if the settings screen is on the screen that the mouse is trapped on the other side of the gap from. This prevents accessing the Display Configuration page where the issue can be rectified, without some window manager shortcuts that many may not be familiar with.

It probably has something to do with the discrepancy in aspect ratios, as the gap is about the same size as the difference between the geometry of 16:10 and 16:9.

I've been seeing this since 6.4.*, but I also only started using mixed aspect ratio monitors during 6.4.*, so it may have been present before then.

I'm running 6.5 now, and it is unfortunately still present :/

I have two different 16:9 TVs that I attach to this laptop, and it only seems to happen with one of them, so there is likely some interplay with stored screen layouts. The settings panel does note that its positioning validation knows that the screen positioning is illegal... so, perhaps this validation should be happening earlier in the pipeline, during the actual application of saved positioning, and rejecting such invalid layouts, rather than applying them anyway? Idk. Just spitballing.

STEPS TO REPRODUCE
1. Have a 16:10 laptop
2. Attach a 16:9 monitor or TV
3. Observe issue. (See above for speculation about how this state might be reached. It may be much more common than said speculation though.)

OBSERVED RESULT


EXPECTED RESULT
There shouldn't be a gap between the screens in the display layout, and it should be possible to get the mouse from one screen to the other, over the moat (or, just, no moat is probably sufficient).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: CachyOS 6.17
KDE Plasma Version: Plasma 6.5 (from the Arch Extra-Testing repo)
KDE Frameworks Version: 
Qt Version: 6.10

ADDITIONAL INFORMATION

See attached image for demonstration of invalid screen geometry
Comment 1 Zamundaaa 2025-10-22 21:18:09 UTC
Did you maybe change the scale factor since you last connected the other screen? If so, that's bug 479952

> so, perhaps this validation should be happening earlier in the pipeline, during the actual application of saved positioning, and rejecting such invalid layouts, rather than applying them anyway? Idk. Just spitballing.
Hmm, just checking if the setup is likely to be problematic and generating a completely new one would be a relatively quick and easy option. Ideally of course we'd fix it up instead of throwing it away entirely instead though.
Comment 2 thecaptain 2025-10-24 14:52:41 UTC
(In reply to Zamundaaa from comment #1)
> Did you maybe change the scale factor since you last connected the other
> screen? If so, that's bug 479952
> 
> > so, perhaps this validation should be happening earlier in the pipeline, during the actual application of saved positioning, and rejecting such invalid layouts, rather than applying them anyway? Idk. Just spitballing.
> Hmm, just checking if the setup is likely to be problematic and generating a
> completely new one would be a relatively quick and easy option. Ideally of
> course we'd fix it up instead of throwing it away entirely instead though.

I have another monitor that I connect the laptop to elsewhere, and they do have different scale factors. But, I've only seen if happen on the other monitor. Though, notably, I rarely actually use the laptop screen on the alternative monitor. However, I haven't changed the scale on any screen in a few weeks, at least that I can recall, but I have witnessed the issue multiple times in that timespan, even after fixing the screen geometry in the Display Configuration section of the Settings application.
Comment 3 Bug Janitor Service 2025-11-08 03:47:53 UTC Comment hidden (spam)
Comment 4 thecaptain 2025-11-09 05:40:55 UTC
Is there something else that is needed for this to get out of NEEDSINFO?

The issue has been continuing on 6.5.1. I've seen new invalid layouts appear since my last report, with much larger gaps. The external screen has also come back on with bad overscan issues.

Let me know if there's anything else you need so that this can get moved on to CONFIRMED.
Comment 5 Bug Janitor Service 2025-11-24 03:46:18 UTC Comment hidden (spam)
Comment 6 Zamundaaa 2025-11-24 11:36:02 UTC
You can/should remove needsinfo yourself when answering questions. Unfortunately bugzilla doesn't do that automatically
Comment 7 Nate Graham 2025-12-09 21:05:22 UTC
Can you paste the output of `kscreen-doctor -o` when it's in this state?