Bug 482468 - Plasma 6 Floating Panel unfloat distance is more than the designed 12px
Summary: Plasma 6 Floating Panel unfloat distance is more than the designed 12px
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: 6.0.0
Platform: Other Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6
: 484761 485857 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-05 13:36 UTC by João Sousa
Modified: 2024-05-03 15:02 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.5


Attachments
Screenshot examples (182.01 KB, image/jpeg)
2024-03-05 13:36 UTC, João Sousa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description João Sousa 2024-03-05 13:36:35 UTC
Created attachment 166426 [details]
Screenshot examples

SUMMARY
The desktop Floating Panel on Plasma 6 unfloats as soon as a window is tiled nearby the panel if using tiling padding lower than 28 pixels. Same issue no matter if a vertical or horizontal panel is used and no matter what panel width is set. To keep the panel in floating mode we are required to use tiling padding of 28 pixels or more - which is undesirable and brings a huge gap size between windows.

The floating panel typically uses a gap of 9 pixels from screen edges so I typically use a tiling window padding of exactly 9 pixels so that windows are perfectly visually aligned with the panel edges (unfloated) and the screen/desktop edges. This worked fine previously with Plasma 5. No longer works on Plasma 6. Please fix it.

STEPS TO REPRODUCE
1. Enable System Setting > Window Management > Desktop Effects > Window Management > Tiling Editor (Meta+T);
2. (Meta+T) Set a Window Tiling Layout with padding of 27 pixels or lower (9 pixels in my case);
3. Tile any open window next to the panel and observe the panel unfloat. (screenshot example attached)

OBSERVED RESULT
The desktop Floating Panel on Plasma 6 unfloats as soon as a window is tiled nearby the panel if using tiling padding lower than 28 pixels. (screenshot example attached)

EXPECTED RESULT
The Panel should keep the floating mode *regardless* of the padding width set on the tiling layout. The Panel floating mode gap/padding next to any tiled windows should be exactly the same as the tiling padding width - as is on Plasma 5. (screenshot example attached)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS 24.05 (unstable)
(available in About System)
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
Kernel Version: 6.7.7 (64-bit)
Graphics Platform: Wayland
Comment 1 João Sousa 2024-03-05 13:50:01 UTC
Small correction to the SUMMARY:

- Where it reads:
The floating panel typically uses a gap of 9 pixels from screen edges so I typically use a tiling window padding of exactly 9 pixels so that windows are perfectly visually aligned with the panel edges (unfloated)...

- It should be read:
The floating panel typically uses a gap of 9 pixels from screen edges so I use a tiling window padding of exactly 9 pixels so that windows are perfectly aligned visually with the panel edges (floating)...
Comment 2 fanzhuyifan 2024-03-05 15:48:37 UTC
Can reproduce the part where the panel defloats more than 12px away

https://invent.kde.org/plasma/plasma-desktop/-/blob/master/desktoppackage/contents/views/Panel.qml?ref_type=heads#L115

The part about the panel defloating when a window is tiled nearby (closer than 12px in this case) is intentional, so I am going to change the title to better reflect the problem.
Comment 3 João Sousa 2024-03-05 21:48:13 UTC
Thank you for the clarification. So I guess that design setting changed from the Plasma 5 panel then? Any reason why? In my use case seem lost functionality. I did a quick check on the code you have linked to. Assuming that there is a good and valid reason for that design change I would then question:

1. The panel floating mode seems to be designed with a default 8px gap distance from screen edges (and not 9px as I have mentioned on my report). Any chance that this 8px value can be used instead for the "property int defloatDistance"? That would potentially allow the use of an identical value of 8 px as minimal tiling window padding?

2. Ideally, we should be able to customise the panel floating gap distance from edges. Any chance for it? For those of us wo like to keep it simetrical/coherent we would then use the same value on the tiling window padding. And that gap/distance would be kept between the floating panel edge to any tiled window next to it.
Comment 4 fanzhuyifan 2024-03-30 18:17:37 UTC
*** Bug 484761 has been marked as a duplicate of this bug. ***
Comment 5 Bharadwaj Raju 2024-03-30 19:48:50 UTC
(In reply to João Sousa from comment #3)
> Thank you for the clarification. So I guess that design setting changed from
> the Plasma 5 panel then? Any reason why?

The reason is written as a comment in that code. It avoids an issue (https://bugs.kde.org/show_bug.cgi?id=476743) with KWin's snap-to-panel behavior.

>  The panel floating mode seems to be designed with a default 8px gap distance from screen edges (and not 9px as I have mentioned on my report). Any chance that this 8px value can be used instead for the "property int defloatDistance"? That would potentially allow the use of an identical value of 8 px as minimal tiling window padding?

I tested multiple values, including 8px. It wasn't enough, I found we needed a 12px distance to avoid the snap-to-panel behavior from activating.

Other potential solutions can be investigated. Nate suggested disabling the snapping completely when in floating mode.
Comment 6 Bug Janitor Service 2024-04-06 18:25:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4218
Comment 7 fanzhuyifan 2024-04-20 23:45:56 UTC
*** Bug 485857 has been marked as a duplicate of this bug. ***
Comment 8 Bug Janitor Service 2024-04-21 17:16:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/2215
Comment 9 fanzhuyifan 2024-04-22 14:02:21 UTC
Git commit d6180e441c1f32b360783b0b80a8eb4945c1a63d by Yifan Zhu.
Committed on 22/04/2024 at 13:51.
Pushed by fanzhuyifan into branch 'master'.

Panel: don't double count floatingPadding

When the panel is floating, geometryByDistance already adds
floatingPadding to both top and bottom. Don't double count it when
calculating the defloat geometry.
FIXED-IN: 6.0.5

M  +6    -1    desktoppackage/contents/views/Panel.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/d6180e441c1f32b360783b0b80a8eb4945c1a63d
Comment 10 Nate Graham 2024-04-26 03:25:22 UTC
Git commit 8ead01b399ea783c53024b5412c1f6602415adbd by Nate Graham, on behalf of Yifan Zhu.
Committed on 26/04/2024 at 03:01.
Pushed by ngraham into branch 'Plasma/6.0'.

Panel: don't double count floatingPadding

When the panel is floating, geometryByDistance already adds
floatingPadding to both top and bottom. Don't double count it when
calculating the defloat geometry.
FIXED-IN: 6.0.5


(cherry picked from commit d6180e441c1f32b360783b0b80a8eb4945c1a63d)

M  +6    -1    desktoppackage/contents/views/Panel.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/8ead01b399ea783c53024b5412c1f6602415adbd