Bug 427390

Summary: Qt 5.12.9: File open dialog doesn't show up in Krita
Product: [Frameworks and Libraries] flatpak-platform-plugin Reporter: Peter Eszlari <peter.eszlari>
Component: generalAssignee: Jan Grulich <jgrulich>
Status: RESOLVED UPSTREAM    
Severity: normal CC: jgrulich
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: dbus-monitor --session
krita non-native file dialog

Description Peter Eszlari 2020-10-06 14:29:38 UTC
Created attachment 132148 [details]
dbus-monitor --session

https://github.com/flathub/org.kde.krita/pull/26

flatpak install --user https://dl.flathub.org/build-repo/28379/org.kde.krita.flatpakref


quote from Dmitry Kazakov:

"2. [blocking] For some reason Krita has Preferences->Global->Miscellaneous->"Enable native file dialogs" enabled by default. It makes File->Open menu action do nothing. Even though in normal Krita build this option is disabled by this code:

if (qgetenv("XDG_CURRENT_DESKTOP") == "KDE") {
    dontUseNative = false;
}

NOTE: in the previous builds this option has also bee enabled, but KDE's file dialogs worked fine. Now they don't."
Comment 1 Jan Grulich 2020-10-06 14:39:46 UTC
There is an empty filter:
>struct {
>   string "j2k "
>   array [
>   ]
>}

Which is being rejected by xdg-desktop-portal:
>error time=1601994515.731923 sender=:1.45 -> destination=:1.72 >error_name=org.freedesktop.portal.Error.InvalidArgument reply_serial=13
>   string "invalid filter: no filters"

Can you check whether this filter is empty on Krita side?
Comment 2 Peter Eszlari 2020-10-06 14:51:57 UTC
Created attachment 132150 [details]
krita non-native file dialog
Comment 3 Jan Grulich 2020-10-06 14:59:54 UTC
Hmm, possibly this:
https://github.com/qt/qtbase/commit/d55165b9c472a30958ef392cb52234041159279e

But it should already be in Qt 5.12.
Comment 4 Jan Grulich 2020-10-06 15:05:14 UTC
And I can reproduce it even with Qt 5.15.
Comment 5 Jan Grulich 2020-10-07 06:28:22 UTC
Looks like a Krita fault:
(gdb) p nameFilter
$17 = "j2k ( )"

So we indeed get an empty filter, but in Qt we should probably just ignore those to avoid this failure.
Comment 6 Jan Grulich 2020-10-07 06:41:02 UTC
Qt fix: https://codereview.qt-project.org/c/qt/qtbase/+/316508
Comment 7 Jan Grulich 2020-10-07 07:45:16 UTC
Closing as this is a Qt issue / Krita issue and actually flatpak-platform-plugin is no longer a thing.