Bug 443251 - File dialog doesn't remember its size
Summary: File dialog doesn't remember its size
Status: RESOLVED DUPLICATE of bug 427875
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (show other bugs)
Version: 5.22.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jan Grulich
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-10-03 10:17 UTC by popov895
Modified: 2021-12-11 20:06 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
chromium-1 (108.18 KB, image/png)
2021-12-07 20:43 UTC, slartibart70
Details
chromium-2 (152.92 KB, image/png)
2021-12-07 20:43 UTC, slartibart70
Details
chromium-3 (167.79 KB, image/png)
2021-12-07 20:44 UTC, slartibart70
Details
firefox (110.93 KB, image/png)
2021-12-07 20:44 UTC, slartibart70
Details
chromium-4 (68.86 KB, image/png)
2021-12-09 08:19 UTC, slartibart70
Details

Note You need to log in before you can comment on or make changes to this bug.
Description popov895 2021-10-03 10:17:04 UTC
SUMMARY

Open/save file dialog in Firefox doesn't remember its size.

I don't see this issue on openSUSE Tumbleweed because (I assume) it uses kmozillahelper (https://github.com/openSUSE/kmozillahelper) instead of xdg-desktop-portal-kde.

STEPS TO REPRODUCE

1. Open Firefox
2. Open file dialog (press Ctrl+O or Ctrl+S), resize it and close
3. Open file dialog again

OBSERVED RESULT

File dialog doesn't restore its size.

EXPECTED RESULT

File dialog restores its size.

SOFTWARE/OS VERSIONS

Operating System: KDE neon 5.22
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
KDE Applications Version: 21.08.1
Qt Version: 5.15.3
Graphics Platform: X11
Comment 1 Bug Janitor Service 2021-11-11 14:30:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/53
Comment 2 popov895 2021-11-14 18:10:23 UTC
Git commit 8b1e5c4da68c089771999129cfeaaa7b3e5475bb by Eugene Popov.
Committed on 13/11/2021 at 16:35.
Pushed by apol into branch 'Plasma/5.23'.

Save/restore file dialog window size

This MR makes the file dialog to save/restore its window size, making it more user friendly.

M  +13   -0    src/filechooser.cpp
M  +3    -0    src/filechooser.h

https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/8b1e5c4da68c089771999129cfeaaa7b3e5475bb
Comment 3 Aleix Pol 2021-11-14 18:12:35 UTC
Git commit b07660a760d65849e40c44382717c90213bcae62 by Aleix Pol, on behalf of Eugene Popov.
Committed on 14/11/2021 at 18:12.
Pushed by apol into branch 'master'.

Save/restore file dialog window size

This MR makes the file dialog to save/restore its window size, making it more user friendly.

M  +13   -0    src/filechooser.cpp
M  +3    -0    src/filechooser.h

https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/b07660a760d65849e40c44382717c90213bcae62
Comment 4 slartibart70 2021-12-03 09:16:43 UTC
Hi,
i'm having issues since upgrading to 5.23.4 (on fedora34)
Example:
chrome browser, do a save of a resource, the saveas dialog is displayed initially in a very small size and does not(!) remeber its resized size when downloading a resource again.
This never  happened before (5.23.3)

Operating System: Fedora 34
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.6-100.fc34.x86_64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-7820HQ CPU @ 2.90GHz
Memory: 31,1 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 630
Comment 5 popov895 2021-12-03 12:20:25 UTC
Can you provide a screenshot?
Comment 6 slartibart70 2021-12-05 12:53:15 UTC
well, i tried with
google-chrome, chromium-freeworld and edge (beta).
The initial file-dialog was small (like 640x480 ... too compressed to be useful). Any resize was ok, but not taken into account for the next download.
Then i started firefox, tested the same (and we have other saveAs dialogs, of course). Then back to chrome-based.
First noticeable thing: the super small saveas dialog was replaced by a usable one (better sized, but not the same size as the FF one)

Playing around with chrome based browsers, selecting images of websites, save image as, resize the dialog (don't save, just quit the dialog).
The saveas window keeps its ('usable') size, but does not remeber the previously selected size.
Same tests in firefox: saveas, resize, don't save. Repeat on another image. Sizing of the saveas dialog are kept for any new images to be saved

Yes, ff and chrome are based on different frameworks (clearly to be seen in the saveas dialog, ff seems to use gtk, chrome qt based dialogs)
Still annoying

Maybe this is the wrong bugticket here, as you only mentioned 'remember size in FF' in the description.
So, where should we put this bug then? Any help?
Comment 7 popov895 2021-12-05 13:42:30 UTC
Can you provide screenshots of both Chrome and Firefox dialogs? Is xdg-desktop-portal-kde package installed? Does ~/xdg-desktop-portal-kde file exist? And if it exists, could you provide its contents?
Comment 8 slartibart70 2021-12-07 20:42:50 UTC
The only file having *desktop-portal* in its name was
~/.config/xdg-desktop-portal-kderc

[Audio Preview Settings]
Autoplay=false

[FileDialogSize]
eDP-1 DP-2 Height 2560x1440=672
eDP-1 DP-2 Height 3840x2160=672
eDP-1 DP-2 Width 2560x1440=1171
eDP-1 DP-2 Width 3840x2160=1171

[KFileDialog Settings]
Recent Files[$e]=...
Recent URLs[$e]=file:$HOME/Downloads...
detailViewIconSize=16

===

Installed Packages
xdg-desktop-portal.x86_64                                 1.8.1-3.fc34    @updates                                    
xdg-desktop-portal-gtk.x86_64                             1.8.0-2.fc34    @fedora                                     
xdg-desktop-portal-kde.x86_64                             5.23.4-1.fc34   @copr:copr.fedorainfracloud.org:zawertun:kde

I also added screenshots of the saveAs dialog of chromium.
1. saveas with default size, cancel
2. saveas, resize dialog, cancel
3. saveas again, back to default size

Contrast this to the kate editor: 
1. saveAs, resize dialog, cancel
2. saveAs - dialog appears in the previously resized size (this is what i would expect)

I also added a screenshot of firefox saveAs dialog.
Here, as with kate, the saveas dialog keeps its previously resized size
Comment 9 slartibart70 2021-12-07 20:43:43 UTC
Created attachment 144322 [details]
chromium-1
Comment 10 slartibart70 2021-12-07 20:43:58 UTC
Created attachment 144323 [details]
chromium-2
Comment 11 slartibart70 2021-12-07 20:44:13 UTC
Created attachment 144324 [details]
chromium-3
Comment 12 slartibart70 2021-12-07 20:44:32 UTC
Created attachment 144325 [details]
firefox
Comment 13 popov895 2021-12-07 23:25:36 UTC
Hmm, can't reproduce on the same system (except I tested on Fedora 35). Try to delete ~/.config/xdg-desktop-portal-kderc.
Comment 14 slartibart70 2021-12-09 08:19:17 UTC
Deleting the file sure has an impact:
now it's back to 640x480 (my guess was correct)
see screenshot

the (new) file contents are:
cat xdg-desktop-portal-kderc 
[FileDialogSize]
eDP-1 DP-2 Height 3840x2160=480
eDP-1 DP-2 Width 3840x2160=640

[KFileDialog Settings]
detailViewIconSize=16


In your testing, do you also have a 2 monitor setup?
here it's: 
- laptop: 2560x1440 (internal)
- 4K screen: 3840x2160 (dp-2)

This surely resembles another problem with this specific (X11) setup: the kate editor does not retain its size when it's closed and starts on the 2nd screen in a 640x480 window.
see here:
https://bugs.kde.org/show_bug.cgi?id=423191

Maybe the 2nd screen is the problem?
(kate is well if operating just on a single screen)
Comment 15 slartibart70 2021-12-09 08:19:56 UTC
Created attachment 144385 [details]
chromium-4
Comment 16 slartibart70 2021-12-09 08:29:26 UTC
another thing:
as long as this file xdg-desktop-portal-kderc was created new, the file dialog never remembers its size, instead, the file will get modified for the resized size, but if you close the dialog, then it's back to 640x480
Closing/restarting chrome does not help.

What helps though, is to restore the old file - which had
cat xdg-desktop-portal-kderc 
[Audio Preview Settings]
Autoplay=false

[FileDialogSize]
eDP-1 DP-2 Height 2560x1440=672
eDP-1 DP-2 Height 3840x2160=672
eDP-1 DP-2 Width 2560x1440=1171
eDP-1 DP-2 Width 3840x2160=1171


besides some data for
[KFileDialog Settings]
Recent Files[$e]
and
Recent URLs[$e]=

Then the filesize dialog sticks to the settings in the file, and never changes its size settings any more

For me, this seems like the software does not expect 4 entries in [FileDialogSize] and just doesn't do anything then with it? (so my settings remain?) But, if only two entries exist, then they will be overwritten with some insane default values of 640x480?
(whoever comes up with such a size these days is another riddle to me, to be honest...)
Comment 17 slartibart70 2021-12-09 08:38:26 UTC
i would like to set the status to reopen again (esp. regarding the kate problem as well)
Comment 18 popov895 2021-12-09 11:56:49 UTC
Thank you for the information.

> do you also have a 2 monitor setup?
No, I don't.

I still have a few questions for you:
1. Does saving/restoring file dialog size work properly on single monitor setup?
2. Are the updated width/height written to the ~/.config/xdg-desktop-portal-kderc  after the file dialog is closed?
3. Does the manually changed width/height in the ~/.config/xdg-desktop-portal-kderc apply to the newly opened file dialog?
Comment 19 slartibart70 2021-12-11 19:39:25 UTC
This gets worse (in a 2 monitor setup): now even the dolphin main window does not remember its size any more!!

BUT, now i see a pattern:
like in the kate-case, the multi-monitor window sizing is severly broken

ok, findings:
1)
- open a shell on laptop screen, type 'dolphin'.
- dolphin opens on laptop screen
- resize the window, close it
- run dolphin on commandline again 
- dolphin remembers its previous size

2) 
- open a shell on 4k screen , type dolphin
- dolphin opens on 4k screen 
- resize dolphin window, close it
- restart dolphin on commandline, it opens again on 4k screen but with the previous size


3) 
- run dolphin within bash on laptop screen
- it appears on laptop screen. Resize it (e.g. make it absurdly long), close it
- go to bash on 4k screen, run dolphin
- dolphin opens on 4k screen with the absurdly long size as done on laptop screen

So, window size parameters are ONLY remembered, if the dialog (dolphin, saveas, ...) is displayed (and resized) on screen 1.
The explains my chromium saveas-dialog... i started chromium accidentially once only on laptop screen and resized the saveas dialog (this sizing will then be remembered, normally my chromium** browser start on 4k screen only). Therefore i have some sane size-settings. 

But, the default values of saveas/dolphin/others? (well, yes, kate of course) on 4k screen when they have never been displayed on screen1 (laptop) is .... 640x480 (or close to it).

I really don't think this is a 'good' workaround to explain users to move the dialog to screen1 and resize so that the windows remember their sizes???
Please investigate (and fix).... :-D


btw, i updated to most current versions:
Operating System: Fedora 34
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Kernel Version: 5.15.6-100.fc34.x86_64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-7820HQ CPU @ 2.90GHz
Memory: 31,1 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 630

and
dolphin-21.12.0-1.fc34.x86_64
dolphin-libs-21.12.0-1.fc34.x86_64
Comment 20 popov895 2021-12-11 20:06:07 UTC

*** This bug has been marked as a duplicate of bug 427875 ***