Bug 462930

Summary: With a vertical panel, System tray becomes vertically centered too aggressively
Product: [Plasma] plasmashell Reporter: Nate Graham <nate>
Component: PanelAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: niccolo.venerandi
Priority: NOR Keywords: regression
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.102
Attachments: Sometimes inappropriately vertically centered
...But sometimes fine when there are fewer System Tray icons

Description Nate Graham 2022-12-11 19:49:19 UTC
Created attachment 154511 [details]
Sometimes inappropriately vertically centered

With the new behavior to center panel popups if they could be positioned in a centered position on the panel and still overlap their CompactRepresentation, the System Tray becomes vertically centered quite frequently when using a vertical panel and there are a lot of System Tray icons. See the attached screenshots.

I think the issue is that the "I can center" calculation only requires that *any* of the CompactRepresentation be under/beside the popup to consider the popup center-able. This is fine when using a horizontal panel, and fine for widgets with small CompactRepresentations with a vertical panel.

But the System Tray's CompactRepresentation becomes very large as it gets more icons, which increases the liklihood of inappropriately triggering "I can center" behavior.

Conceivably the same issue could happen on a horizontal panel too with a sufficiently enormous set of System Tray icons. Less likely, but still possible.

Potential ideas to resolve this:
- If the popup could be positioned either centered or touching a screen edge, prefer the screen edge
- Require that the *majority* of a widget's CompactRepresentation be under the popup when it's centered, not just any of it
Comment 1 Nate Graham 2022-12-11 19:49:47 UTC
Created attachment 154512 [details]
...But sometimes fine when there are fewer System Tray icons
Comment 2 Bug Janitor Service 2022-12-12 16:41:38 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/667
Comment 3 Nate Graham 2023-01-06 15:36:31 UTC
Git commit da6483166b84fbec47cd5d2cb52cbc1d44231cba by Nate Graham, on behalf of Niccolò Venerandi.
Committed on 06/01/2023 at 15:36.
Pushed by ngraham into branch 'master'.

Dialog: Only center panel popup if it still would cover two thirds of its panel widget

Otherwise the centering logic kicks in too aggressively for large widgets like System Tray.
FIXED-IN: 5.102

M  +3    -2    src/plasmaquick/dialog.cpp

https://invent.kde.org/frameworks/plasma-framework/commit/da6483166b84fbec47cd5d2cb52cbc1d44231cba