Bug 499179 - "Open Folder" dialog visually breaks after resizing places panel splitter to the right with a narrow window width
Summary: "Open Folder" dialog visually breaks after resizing places panel splitter to ...
Status: CONFIRMED
Alias: None
Product: plasma-integration
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.2.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-27 03:47 UTC by iodreamify
Modified: 2025-04-28 16:22 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
video (281.88 KB, video/webm)
2025-01-27 03:47 UTC, iodreamify
Details

Note You need to log in before you can comment on or make changes to this bug.
Description iodreamify 2025-01-27 03:47:40 UTC
Created attachment 177705 [details]
video

SUMMARY
If you resize the places column to the left all the widgets lose their coordinates and go outside the window's view until you resize the main window. 
The journal is spammed with: "xdg-desktop-portal-kde[1396]: This plugin supports grabbing the mouse only for popup windows" 

STEPS TO REPRODUCE
1. call an open folder desktop portal window
2. resize the places column to the left 
3. resize the main window to fix it

OBSERVED RESULT
widgets break and lose their position

EXPECTED RESULT
resizing of places panel works correctly 

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Kernel Version: 6.12.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon 660M
Comment 1 Nate Graham 2025-01-27 21:07:08 UTC
Cannot reproduce with either the portal-based open folder dialog, or the non-portal one. Does this issue reproduce with the non-portal dialog as well? You can invoke one as follows:

Right-click desktop > Desktop & Wallpaper > Wallpaper type: Slideshow > Folders: Add
Comment 2 iodreamify 2025-01-27 21:14:23 UTC
(In reply to Nate Graham from comment #1)
> Cannot reproduce with either the portal-based open folder dialog, or the
> non-portal one. Does this issue reproduce with the non-portal dialog as
> well? You can invoke one as follows:
> 
> Right-click desktop > Desktop & Wallpaper > Wallpaper type: Slideshow >
> Folders: Add

yes, exactly same behaviour
Comment 3 iodreamify 2025-01-27 23:30:53 UTC
I've noticed if the initial window size is big enough(something like 1277x613px) so the resize column can move even a little, this bug goes away and the resize range for the draggable element works well. But if the window is small enough(for me 1024x613px) so the column can't be resized it triggers the bug and widgets break.
Comment 4 Nate Graham 2025-01-28 00:47:41 UTC
Thanks. I can't reproduce any of this; no matter what size the folder chooser dialog is for me, I'm not able to break it as shown. Tracey, can you figure out how to break it?
Comment 5 TraceyC 2025-01-28 17:53:06 UTC
I am able to reproduce this in git-master
1. Right-click desktop > Desktop & Wallpaper > Wallpaper type: Slideshow > Folders: Add
2. Make the window more narrow (I can reproduce with 371 x 555)
3. Resize the Places column

Changing the icon size in the left panel changes exactly how the window is misbehaving; it always misbehaves.

(In reply to iodreamify from comment #0)
> Created attachment 177705 [details]
> video

I noticed in the screen recording that there are no window decoration in the folder dialog. Do you have those disabled for just this dialog or for Dolphin generally?
Comment 6 iodreamify 2025-01-28 18:02:51 UTC
> (In reply to iodreamify from comment #0)
> > Created attachment 177705 [details]
> > video
> 
> I noticed in the screen recording that there are no window decoration in the
> folder dialog. Do you have those disabled for just this dialog or for
> Dolphin generally?

no, nothing is disabled. this was just recorded with Spectacle after choosing the "Select window" option in the screencasting portal. It just usually leaves out the window borders as far as i know.
Comment 7 Nate Graham 2025-01-30 17:05:38 UTC
Thanks Tracey; I can reproduce it now! I was dragging the splitter to the left, which wasn't doing it. If I make the window super narrow and drag the splitter to the right, I can reproduce the issue 100% of the time.
Comment 8 Luke Horwell 2025-02-19 22:11:36 UTC
The width of the sidebar also doesn't happen to be saved under the directory picker, but does under the file picker. Reported that as BUG 500435.

If the kdialog package is installed, another way to get to this dialog is run:
> kdialog --getexistingdirectory
Comment 9 Luke Horwell 2025-02-20 17:27:33 UTC
I've created a merge request that fixes this (and 2 other bugs):
https://invent.kde.org/plasma/plasma-integration/-/merge_requests/168

(Bug janitor might not stop by since I didn't reference the bug in the description originally - suggestion at BUG 500476)
Comment 10 Bug Janitor Service 2025-03-11 16:32:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-integration/-/merge_requests/170
Comment 11 Nate Graham 2025-03-11 16:38:20 UTC
Git commit e803b44a2ae339182564932990c436f3c0d6c533 by Nate Graham, on behalf of Luke Horwell.
Committed on 11/03/2025 at 16:30.
Pushed by ngraham into branch 'master'.

KDirSelectDialog: Fix sidebar sizing bugs
Related: bug 421247, bug 500435

499179 can't be considered fully fixed yet, as it could still rarely happen
depending on the initial state.

M  +10   -4    qt5/src/platformtheme/kdirselectdialog.cpp
M  +10   -4    qt6/src/platformtheme/kdirselectdialog.cpp

https://invent.kde.org/plasma/plasma-integration/-/commit/e803b44a2ae339182564932990c436f3c0d6c533
Comment 12 Nate Graham 2025-03-11 16:45:36 UTC
Git commit 2885b098a2275ddce9021248b6bf788b4879f42e by Nate Graham.
Committed on 11/03/2025 at 16:31.
Pushed by ngraham into branch 'Plasma/6.3'.

KDirSelectDialog: Fix sidebar sizing bugs
Related: bug 421247, bug 500435

499179 can't be considered fully fixed yet, as it could still rarely happen
depending on the initial state.



(cherry picked from commit e803b44a2ae339182564932990c436f3c0d6c533)

5d91e668 KDirSelectDialog: Improve layout sizing issues
fd59d54c KDirSelectDialog: Save sidebar width

Co-authored-by: Luke Horwell <code@horwell.me>

M  +10   -4    qt5/src/platformtheme/kdirselectdialog.cpp
M  +10   -4    qt6/src/platformtheme/kdirselectdialog.cpp

https://invent.kde.org/plasma/plasma-integration/-/commit/2885b098a2275ddce9021248b6bf788b4879f42e
Comment 13 Luke Horwell 2025-03-11 19:10:25 UTC
Thanks for the merge! I couldn't with good coincidence declare this bug as "fixed" after using my patched fix for weeks. Of the many times I use the directory picker in programs, the bug struck at me once (so, very rare). My sidebar looked smaller then my usual, and dragging it out to the right as described in this report caused a broken layout glitch.

The quick fix is to dismiss the directory picker; open the file ~/.config/kdeglobals and delete the keys under the group [DirSelect Dialog]. It won't glitch again or be reproducible afterwards. Can't quite put my finger on why this happens, or how to replicate, but still an improvement then always glitching out!

Since it's been cherry picked, the improvement should be available starting with 6.3.3 to re-test.
Comment 14 Luke Horwell 2025-03-11 21:59:56 UTC
* Correction to previous comment: It was cherry picked into the Plasma 6.3.3 branch, but missed the 6.3.3 release:
https://invent.kde.org/plasma/plasma-integration/-/commits/2885b098a2275ddce9021248b6bf788b4879f42e
Comment 15 Roke Julian Lockhart Beedell 2025-04-26 10:40:54 UTC
(In reply to Luke Horwell from comment #13)

> The quick fix is to dismiss the directory picker; open the file ~/.config/kdeglobals and delete the keys under the group [DirSelect Dialog].

For me, I *only* needed to remove `History Items[$e]=`'s content, per https://discuss.kde.org/t/can-anyone-else-resize-the-panel-of-the-directory-picker-portal/33180/8?u=rokejulianlockhart.
Comment 16 Luke Horwell 2025-04-26 14:45:47 UTC
Thanks for the feedback! The layout glitch makes sense now. It happens because KHistoryComboBox has combo items that are far too long and is fighting with the QSplitter. It might need a maximum width dynamically set, or something similiar to tame it from taking all the space.

To replicate, put a ridiculously long path in `~/.config/kdeglobals`, such as:

[DirSelect Dialog]
History Items[$e]=file:///path/to/something/really/really/long/that/is/really/going/too/far/and/messes/with/the/dialog/dir/picker

Right now, I'm not up for putting up a layout fight, so consider this bug triaged for the taking!

Related: There is BUG 400054 regarding the history being stored in kdeglobals in the first place (it should be per app in an *rc file, like KFileDialog). Personally, I never use this history feature/drop down. If it was removed in KDirSelectDialog for a standard QLineEdit, that *could* solve the problem too.