Bug 465917

Summary: Large widget popups open on the wrong monitor
Product: [Plasma] plasmashell Reporter: Riccardo Robecchi <sephiroth_pk>
Component: generic-multiscreenAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: aleixpol, chniucg, nate, notmart
Priority: NOR    
Version: 5.27.0   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: latest release of the KDE Qt patch collection
Sentry Crash Report:
Attachments: Screenshot of the issue

Description Riccardo Robecchi 2023-02-17 12:00:38 UTC
SUMMARY
Very large widget popups do not stay on the monitor where the parent panel widget is. As an example, I have a setup with two screens arranged vertically, each of which has a panel on top with the "Places" widget on it. The popup of this widget on the bottom screen can become tall enough that it is taller than the screen; in that case, it pops up on the monitor above, rather than on the bottom one. This is of course not ideal as it looks completely random and broken.

STEPS TO REPRODUCE
1. Click on a widget that shows a very tall popup

OBSERVED RESULT
The popup is shown on the wrong monitor.

EXPECTED RESULT
The popup is shown on the monitor where the widget is.

SOFTWARE/OS VERSIONS
Linux: KDE neon
KDE Plasma Version: 5.27.0
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Riccardo Robecchi 2023-02-17 12:02:26 UTC
Created attachment 156363 [details]
Screenshot of the issue
Comment 2 Nate Graham 2023-02-17 22:51:47 UTC
Hmm, if it's too tall to fit on the monitor you want it to open on, what should it do instead? Open there and look visually broken by having part of it get cut off?
Comment 3 Riccardo Robecchi 2023-02-19 12:28:55 UTC
I don't understand the logic of your question. Should people who only have one monitor which is too small for the widget see it broken, while people with multiple monitors see it correctly? Even within the group of those who use multiple monitors, should only people with vertically-arranged monitors see the widget displayed correctly (as the bug does not happen with horizontally-arranged monitors)?
Either way, I do not see why vertical arrangement of monitors should change the way widgets are treated, given that every and any other monitor arrangement does not influence it. If a widget becomes broken because it is too tall to be shown on a monitor, that is an implementation issue with the widget which shouldn't affect the way it is displayed in multi-monitor settings.
Just as a side note, the specific widget ("Places") becomes scrollable with just one monitor, so it doesn't look broken at all.
Comment 4 Nate Graham 2023-02-21 19:12:15 UTC
Let me ask another way:

If a widget popup doesn't fit on the monitor you want it to open on, where should happen instead? You previously said, "The popup [should be] shown on the monitor where the widget is." But part of it would get cut off if we did that, no?
Comment 5 Riccardo Robecchi 2023-02-21 23:32:11 UTC
I understand your point. In some cases, it might get cut off. The thing, however, is this: should the user having a larger screen make any difference? Should the larger screen make the experience look broken anyway by showing the widget popup where it is not supposed to be?

Let's suppose my setup is made of my laptop's FullHD screen and an external 4K screen. If I open a widget on the laptop's screen that's too big, it is shown on the 4K screen, looking broken because it is not where I expect it to be. But what happens if I have just the laptop's screen? The widget opens there anyway, and will look broken because it's too small. Among the two, I would say that showing the widget popup on the screen where the widget is is actually the best option, because it doesn't break the POLA.

More as an anecdote, but I haven't found a widget that was too big for the screen yet. They all resize to fit the screen, unless I am using a multi-monitor setup.
Comment 6 Nate Graham 2023-02-23 00:01:18 UTC
All right, you've convinced me! Makes sense.
Comment 7 Nate Graham 2023-02-28 19:19:09 UTC
*** Bug 466099 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2023-03-01 18:49:20 UTC
Ultimately this was traced to a Qt bug that we're now hitting in Plasma 5.27 due to changes on our side in how screen stuff works. It's now fixed in Qt with https://codereview.qt-project.org/c/qt/qtwayland/+/462780, which has been packported to our Qt 5 patch collection. You should get the fix as soon as your distro ships an update to the KDE Qt patch collection.