Bug 462930 - With a vertical panel, System tray becomes vertically centered too aggressively
Summary: With a vertical panel, System tray becomes vertically centered too aggressively
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: master
Platform: Other Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-12-11 19:49 UTC by Nate Graham
Modified: 2023-01-06 15:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.102


Attachments
Sometimes inappropriately vertically centered (417.92 KB, image/jpeg)
2022-12-11 19:49 UTC, Nate Graham
Details
...But sometimes fine when there are fewer System Tray icons (593.15 KB, image/jpeg)
2022-12-11 19:49 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
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