Bug 477317 - Non-floating Panel with "Fit Content" does not take the correct width on plasmashell start if Digital Clock is present, but resizes to correct width if "Edit Mode" is activated
Summary: Non-floating Panel with "Fit Content" does not take the correct width on plas...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6
: 483272 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-11-21 08:41 UTC by Bacteria
Modified: 2024-04-24 20:13 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: Partially fixed in 6.0.3; fully fixed in Plasma 6.1 with Qt 6.7.1


Attachments
panel width wrong on plasmashell start but fixes itself in "edit mode" (181.42 KB, video/webm)
2023-11-21 08:41 UTC, Bacteria
Details
panel with incorrect width -- system tray cut off (60.55 KB, image/png)
2023-12-15 00:48 UTC, fanzhuyifan
Details
panel corrects itself after clicking edit (101.00 KB, image/png)
2023-12-15 00:50 UTC, fanzhuyifan
Details
panel with icons only task manager (68.39 KB, image/png)
2024-02-02 15:58 UTC, fanzhuyifan
Details
still happening on neon unstable.. (22.97 KB, image/png)
2024-02-03 16:52 UTC, fanzhuyifan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bacteria 2023-11-21 08:41:54 UTC
Created attachment 163337 [details]
panel width wrong on plasmashell start but fixes itself in "edit mode"

SUMMARY
Panel with "Fit Content" does not take the correct width if Digital Clock is present but resizes to correct width if "Edit Mode" is activated.

STEPS TO REPRODUCE
1. Add a new Empty Panel in horizontal mode
2. Set Panel length to "Fit Content"
3. Add Digital Clock widget and configure it to show date "Always beside time"

OBSERVED RESULT
The panel lenght is shorter than it should be.

EXPECTED RESULT
The panel should have the appropriate length to accomodate Digital Clock widget

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: git master
KDE Frameworks Version: git master
Qt Version: 6.6.0

ADDITIONAL INFORMATION
For the default mode of Digital Clock, the panel width is fine but any configuration that takes more width causes this issue.
Comment 1 Bacteria 2023-11-21 08:44:09 UTC
From what I can understand, the issue occurs because Digital Clock does not provide any minimumWidth/minimumHeight which results in the default width and height getting assigned by the Panel.
Comment 2 Niccolò Venerandi 2023-11-24 10:54:37 UTC
Mhh, cannot reproduce here :-/
Comment 3 Bacteria 2023-11-24 15:36:46 UTC
(In reply to Niccolò Venerandi from comment #2)
> Mhh, cannot reproduce here :-/

Oops sorry, I forgot to mention that this is reproducible only when the plasmashell starts. So after configuring the clock widget as mentioned above, restart the plasmashell.
Comment 4 Niccolò Venerandi 2023-11-26 10:30:10 UTC
Yepp, I had tried that with no luck
Comment 5 Nate Graham 2023-11-26 17:20:09 UTC
Also cannot reproduce after configuring everything as directed and restarting plasmashell.

Can you try again with today's packages? Maybe it got fixed in the last few days. Thanks!
Comment 6 Bacteria 2023-12-03 10:31:16 UTC
I can still reproduce it on the latest git master with Qt 6.6.1.
Comment 7 Bacteria 2023-12-03 10:33:26 UTC
Okay, so I can't reproduce when the Floating panel is enabled. Here are the updated instructions for reproducing this:

1. Add a new Empty Panel in horizontal mode
2. Set Panel length to "Fit Content"
3. Add Digital Clock widget and configure it to show date "Always beside time"
4. Disable Floating Panel
5. Restart plasmashell
Comment 8 Nate Graham 2023-12-04 21:34:43 UTC
Can reproduce with those exact steps.
Comment 9 Marco Martin 2023-12-08 11:51:43 UTC
I can reproduce it, and is specific on wayland only, on x11 starts fine.
Comment 10 Marco Martin 2023-12-08 11:55:12 UTC
also ,as soon the time changes (and the size hints of the clock do) the panel resizes itself to the correct size
Comment 11 Bug Janitor Service 2023-12-11 11:54:07 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libplasma/-/merge_requests/1011
Comment 12 Bug Janitor Service 2023-12-11 13:51:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1915
Comment 13 Marco Martin 2023-12-11 15:50:50 UTC
Git commit 281e61914f3ebc82df4076d0a40ce91a0ada9ecc by Marco Martin.
Committed on 11/12/2023 at 16:50.
Pushed by mart into branch 'master'.

Don't delay the size binding

Make the binding from panel preferred size to panel length immediate
instead of delayed, it makes things easier to debug

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

https://invent.kde.org/plasma/plasma-desktop/-/commit/281e61914f3ebc82df4076d0a40ce91a0ada9ecc
Comment 14 Nate Graham 2023-12-11 16:55:00 UTC
Issue is fixed with that commit.
Comment 15 fanzhuyifan 2023-12-15 00:48:41 UTC
Created attachment 164171 [details]
panel with incorrect width -- system tray cut off

Reopening since I can still reproduce with a nonfloating panel set to fit content with digital clock and system tray.

On login the system tray is cut off. The panel fixes itself when I click edit.
Comment 16 fanzhuyifan 2023-12-15 00:50:28 UTC
Created attachment 164172 [details]
panel corrects itself after clicking edit
Comment 17 fanzhuyifan 2023-12-20 18:29:20 UTC
Remarked as confirmed since  @mart  also mentions he could reproduce this on gitlab. https://invent.kde.org/plasma/libplasma/-/merge_requests/1011
Comment 18 Nate Graham 2024-01-12 14:05:18 UTC
Fixed for realsies with https://invent.kde.org/frameworks/kirigami/-/commit/f36f6e6ffe5f622af112f07631466687d49ec349 now.
Comment 19 fanzhuyifan 2024-01-15 16:07:34 UTC
(In reply to Nate Graham from comment #18)
> Fixed for realsies with
> https://invent.kde.org/frameworks/kirigami/-/commit/
> f36f6e6ffe5f622af112f07631466687d49ec349 now.

I saw this once again on neon unstable latest : ( 

The system tray is cut off.
Comment 20 Marco Martin 2024-01-19 09:36:07 UTC
(In reply to Nate Graham from comment #18)
> Fixed for realsies with
> https://invent.kde.org/frameworks/kirigami/-/commit/
> f36f6e6ffe5f622af112f07631466687d49ec349 now.

note this patch is about the blurry icons bug, not this one
Comment 21 Nate Graham 2024-02-02 15:13:04 UTC
Can't reproduce anymore; looks like this has gotten fixed by now!
Comment 22 fanzhuyifan 2024-02-02 15:34:04 UTC
(In reply to Nate Graham from comment #21)
> Can't reproduce anymore; looks like this has gotten fixed by now!

Just reproduced yesterday on latest neon unstable......
Comment 23 Nate Graham 2024-02-02 15:51:54 UTC
How were you able to reproduce it? What were the exact steps? I couldn't with the steps in comment 7.
Comment 24 fanzhuyifan 2024-02-02 15:58:53 UTC
Created attachment 165475 [details]
panel with icons only task manager

(In reply to Nate Graham from comment #23)
> How were you able to reproduce it? What were the exact steps? I couldn't
> with the steps in comment 7.

For me this randomly happens on login on a fit content non-floating panel with digital clock and system tray -- with small, but nonzero probability the system tray is cut off. I see this around once everyday (so not that often)

A similar thing happens more often with a fit content non-floating panel including the icons-only task manager -- when I login or restart plasmashell, I get something in the attached screenshot. This happens around half of the time. Do you think this is a separate issue?
Comment 25 Bacteria 2024-02-02 15:59:57 UTC
For a while I didn't see the bug but since last week I am seeing the bug again.

Also, the system tray is also affected and should probably be reflected in the title.
Comment 26 fanzhuyifan 2024-02-02 16:02:02 UTC
(In reply to Bacteria from comment #25)
> For a while I didn't see the bug but since last week I am seeing the bug
> again.

Are you also on git master?

> Also, the system tray is also affected and should probably be reflected in
> the title.

Yeah for me the cause seems to be the system tray.
Comment 27 Bacteria 2024-02-02 16:06:38 UTC
> Are you also on git master?

Yes. My build is 3 days old though. I am doing a fresh build right now.
Comment 28 fanzhuyifan 2024-02-03 16:52:15 UTC
Created attachment 165503 [details]
still happening on neon unstable..
Comment 29 Nate Graham 2024-02-05 20:08:55 UTC
My mistake, sorry. I was testing with the original steps to reproduce, not the newer steps in comment 7. I can still reproduce the issue when following those steps.
Comment 30 Bacteria 2024-02-15 09:20:11 UTC
Just did a fresh build from git master and I can't reproduce the issue using comment 7. Can someone else on git master confirm this?
Comment 31 Nate Graham 2024-02-15 16:00:02 UTC
It's still happening here, unfortunately.
Comment 32 Nate Graham 2024-03-06 17:10:09 UTC
*** Bug 482098 has been marked as a duplicate of this bug. ***
Comment 33 Nate Graham 2024-03-08 22:40:25 UTC
Now I can't reproduce it either. If no one can, let's finally call it fixed until someone sees it again.
Comment 34 fanzhuyifan 2024-03-10 02:37:00 UTC
(In reply to Nate Graham from comment #33)
> Now I can't reproduce it either. If no one can, let's finally call it fixed
> until someone sees it again.

Just saw this again :(.

Plasma 6.1 dev build, wayland, arch linux.
Comment 35 Bug Janitor Service 2024-03-22 16:00:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4124
Comment 36 Marco Martin 2024-03-25 09:43:24 UTC
Git commit c9642b6c862ea9146f10c99b8e52b379e954affb by Marco Martin.
Committed on 25/03/2024 at 09:38.
Pushed by mart into branch 'master'.

Always set a fixed size

when the resize mode is fitcontent, always set a fixed size for the panel
(both setMinimumSize and setMaximumSize as the same size) because this
should be the only place where the panel is resized, and every other attempt
from either anywhere else in Qt or kwin should be denied

M  +1    -1    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/c9642b6c862ea9146f10c99b8e52b379e954affb
Comment 37 Marco Martin 2024-03-25 10:02:57 UTC
Git commit 6016a816d5788a7a621f9bdaef194979229081f4 by Marco Martin.
Committed on 25/03/2024 at 09:43.
Pushed by mart into branch 'Plasma/6.0'.

Always set a fixed size

when the resize mode is fitcontent, always set a fixed size for the panel
(both setMinimumSize and setMaximumSize as the same size) because this
should be the only place where the panel is resized, and every other attempt
from either anywhere else in Qt or kwin should be denied


(cherry picked from commit c9642b6c862ea9146f10c99b8e52b379e954affb)

c9642b6c Always set a fixed size

M  +1    -1    shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/6016a816d5788a7a621f9bdaef194979229081f4
Comment 38 Marco Martin 2024-04-12 09:24:05 UTC
Git commit 4e37c1d1c23773df6dff95ae11b58df8b04ab3f4 by Marco Martin.
Committed on 12/04/2024 at 09:23.
Pushed by mart into branch 'master'.

Never set minimum/maximum size

a long time ago we used minimum/maximum window sizes
for the minimum and maximum length of the panel, but now this
is not necessary anymore as they are stored separatedly.

setting minimum then maximum then resizing can sometimes cause
several subsequent resize attempts, and a wrong order of setminimum/setMaximum
can even fail the resize completely

The size is saved as a private member as source of truth: when we reposition the panel
we can have not yet received a configure event of the last size we called resize()
upon, making that former resize fail

M  +18   -54   shell/panelview.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/4e37c1d1c23773df6dff95ae11b58df8b04ab3f4
Comment 39 Nate Graham 2024-04-12 14:34:18 UTC
*** Bug 483272 has been marked as a duplicate of this bug. ***