Bug 447806 - "Enable native file dialogs" setting is enabled by default for appimages, despite the fact that the file picker will not display previews in that case
Summary: "Enable native file dialogs" setting is enabled by default for appimages, des...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: General (show other bugs)
Version: 5.0.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-02 00:28 UTC by tomtomtomreportingin
Modified: 2022-01-04 17:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomtomtomreportingin 2022-01-02 00:28:03 UTC
SUMMARY
I did not realize this until after a talk with a friend who had this setting enabled, and thus didn't realize file picker previews were a feature: For appimage users, "Enable native file dialogs" is enabled by default, despite the fact that having it enabled will grant an inferior file picker, such that the previews on the side of the file picker will not display at all.

STEPS TO REPRODUCE
1. Open Krita with a fresh profile.
2. File -> Open and select an image.

OBSERVED RESULT
There is no preview due to the fact that "Enable native file dialogs" is enabled by default.

EXPECTED RESULT
"Enable native file dialogs" should be disabled by default for appimages if it gives an objectively inferior experience. Or, if this is considered a bug with the setting itself, then the preview should properly display regardless of what the setting is set to.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian sid
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.88.0
Qt Version: 5.12.12 (appimage)
Comment 1 amyspark 2022-01-03 22:44:39 UTC
cc Halla, this was added in https://invent.kde.org/graphics/krita/-/commit/6bd71e8d115aad90f25a70db9c3d543741c4365c . Looks like it's supposed to be enabled only under Plasma?
Comment 2 Halla Rempt 2022-01-04 08:24:46 UTC
Appimages cannot and do not use native file dialogs at all because they cannot use either the gnome or the plasma Qt platform plugin. They will always use the Qt file dialog which _does_ have a preview pane, I implemented that myself. The checkbox is irrelevant for appimages, and we might want to hide it, but... That is really not worth spending time on, sorry, it's too trivial.

For non-appimage Linux builds, on Plasma we can use the native file dialog, but for Gnome we shouldn't because the GTK file dialog has a bug that means it hangs if there's an image on the clipboard.
Comment 3 tomtomtomreportingin 2022-01-04 08:29:24 UTC
"They will always use the Qt file dialog which _does_ have a preview pane, I implemented that myself. The checkbox is irrelevant for appimages"

As I describe in the bug report, at least in my experience and a friend's experience, enabling the option prevents the preview from actually displaying. It only shows the "Preview" text.
Comment 4 tomtomtomreportingin 2022-01-04 08:44:58 UTC
And since the option is enabled by default, file picker previews essentially become a "hidden feature" from the perspective of an appimage user, since they'll only see the "Preview" text, unless they think about disabling the somewhat obscured option that doesn't necessarily seem related.

If there's not supposed to be a difference in behavior for appimage users as you say, then that is the issue here. Toggling the option is affecting something it shouldn't be affecting.
Comment 5 Halla Rempt 2022-01-04 08:45:57 UTC
Oh, I get it now. Amyspark put me on the wrong track. It's their comit:

https://invent.kde.org/graphics/krita/-/commit/40ca59aee1b112e220e16c93039632629c3e52c8

Skip generating the preview with a native file dialog

Assigning to them.
Comment 6 amyspark 2022-01-04 14:09:00 UTC
Halla, you misunderstood the meaning of that commit. If there's a native dialog being displayed (option set to false), there's no point in generating the preview because the QFileDialog widget is invisible.

In this case, setting the QFileDialog::DontUseNativeDialog has no effect whatsoever, which leads us to a situation where the file dialog says "native" (the attribute being tested above is true) but the user sees otherwise. I'll check if there's any way to double-check this before skipping the preview generation.
Comment 7 Bug Janitor Service 2022-01-04 15:06:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1279
Comment 8 amyspark 2022-01-04 16:59:30 UTC
Git commit ad416d3c2f73cacd0bce4ce8add9a2755d1b769a by L. E. Segovia.
Committed on 04/01/2022 at 16:58.
Pushed by lsegovia into branch 'master'.

Fix inconsistency in preview visibility on AppImages

In AppImages, the Qt file picker will always be used regardless of the
value of QFileDialog::DontUseNativeDialog. This commit ensures the
preview is shown if there's a layout() present when the checkbox isn't
ticked, and disables the checkbox altogether on AppImages.
CCMAIL: kimageshop@kde.org

M  +7    -0    libs/ui/dialogs/kis_dlg_preferences.cc
M  +3    -1    libs/widgetutils/KisPreviewFileDialog.cpp
M  +8    -1    libs/widgetutils/KoFileDialog.cpp

https://invent.kde.org/graphics/krita/commit/ad416d3c2f73cacd0bce4ce8add9a2755d1b769a
Comment 9 amyspark 2022-01-04 17:00:21 UTC
Git commit d7cc52d168ce38910b26cc022c3145edc694de8a by L. E. Segovia.
Committed on 04/01/2022 at 17:00.
Pushed by lsegovia into branch 'krita/5.0.0'.

Fix inconsistency in preview visibility on AppImages

In AppImages, the Qt file picker will always be used regardless of the
value of QFileDialog::DontUseNativeDialog. This commit ensures the
preview is shown if there's a layout() present when the checkbox isn't
ticked, and disables the checkbox altogether on AppImages.
CCMAIL: kimageshop@kde.org
(cherry picked from commit ad416d3c2f73cacd0bce4ce8add9a2755d1b769a)

M  +7    -0    libs/ui/dialogs/kis_dlg_preferences.cc
M  +3    -1    libs/widgetutils/KisPreviewFileDialog.cpp
M  +8    -1    libs/widgetutils/KoFileDialog.cpp

https://invent.kde.org/graphics/krita/commit/d7cc52d168ce38910b26cc022c3145edc694de8a
Comment 10 amyspark 2022-01-04 17:00:39 UTC
Git commit 428c7993e3de81739ab030c9556bb41ca25269d2 by L. E. Segovia.
Committed on 04/01/2022 at 17:00.
Pushed by lsegovia into branch 'krita/5.0'.

Fix inconsistency in preview visibility on AppImages

In AppImages, the Qt file picker will always be used regardless of the
value of QFileDialog::DontUseNativeDialog. This commit ensures the
preview is shown if there's a layout() present when the checkbox isn't
ticked, and disables the checkbox altogether on AppImages.
CCMAIL: kimageshop@kde.org
(cherry picked from commit ad416d3c2f73cacd0bce4ce8add9a2755d1b769a)

M  +7    -0    libs/ui/dialogs/kis_dlg_preferences.cc
M  +3    -1    libs/widgetutils/KisPreviewFileDialog.cpp
M  +8    -1    libs/widgetutils/KoFileDialog.cpp

https://invent.kde.org/graphics/krita/commit/428c7993e3de81739ab030c9556bb41ca25269d2