Bug 476692

Summary: Applet popups no longer flip vertically near the edge of a screen
Product: [Plasma] plasmashell Reporter: ratijas <me>
Component: ContainmentAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, notmart
Priority: NOR Keywords: qt6
Version First Reported In: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=476693
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description ratijas 2023-11-07 22:53:31 UTC
SUMMARY

In Plasma 5 times, compact applets on a desktop containment that are too close to the top of the screen for their popup to fit would open their popup at a flipped position — below compact applet. This behavior was lost during Plasma 6 refactoring, and now popups are merely pushed down by a screen's top edge, so they might overlap with compact applets. Combined with another bug (the one that clicking on a desktop no longer closes applet popups), it turns out tricky to close those popups: you need to focus them specifically and press Escape, for example.

STEPS TO REPRODUCE
1. Add a compact applet to the desktop, for example: Battery & Brightness, or Bluetooth.
2. Enter Edit Mode, and move an applet closer to the top on the screen/containment.
3. Exit Edit Mode.
4. Click on the applet's compact representation.

OBSERVED RESULT
Popup with applet's full representation opens, but it sometimes placed at the top of the screen, overlapping the compact representation. *Sometimes* because it seems that a restart of plasmashell might fix it.

EXPECTED RESULT
Popup placement should be consistently flipped vertically around compact representation.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0
Kernel Version: 6.5.9-arch2-1 (64-bit)
Graphics Platform: X11
Graphics Processor: NVIDIA GeForce GTX 970M/PCIe/SSE2

ADDITIONAL INFORMATION
I'm using single screen (laptop's built-in one), 100% scaling, nothing fancy.
Comment 1 Nate Graham 2023-11-08 21:13:02 UTC
Cannot reproduce this with a Digital Clock applet at the top of the screen. Clicking on it opens the calendar popup below the clock, not overlapping it. Tried with single and dual screen setups.

Maybe today's git master fixes it? There was a lot of churn in the past 24 hours.
Comment 2 ratijas 2023-11-09 00:24:21 UTC
Maybe. However, it still makes that slide-in animation from a wrong side (not flipped), so might as well repurpose this bug report or file a new one. What would you say?
Comment 3 Nate Graham 2023-11-09 22:02:33 UTC
Yes, I can reproduce that the animation slides in from the wrong side now.

If you can't reproduce the original issue anymore, I'd say let's close this and get a new one for the other issue.
Comment 4 Bug Janitor Service 2023-11-10 09:07:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-framework/-/merge_requests/954
Comment 5 David Edmundson 2023-11-16 09:04:25 UTC
Git commit 36c3b7019aa0cf17eb311829b7a1ba6b11d91024 by David Edmundson.
Committed on 16/11/2023 at 10:02.
Pushed by davidedmundson into branch 'master'.

PopupPlasmaWindow: Calculate slide direction dynamically

Currently the slide direction is based on the direction the popup
intended to be shown. If we're on the desktop and the direction is
flipped due to constrains this would not be handled.

M  +30   -17   src/plasmaquick/popupplasmawindow.cpp

https://invent.kde.org/plasma/plasma-framework/-/commit/36c3b7019aa0cf17eb311829b7a1ba6b11d91024