Bug 444873 - xdg-desktop-portal's FileChooser not focused
Summary: xdg-desktop-portal's FileChooser not focused
Status: RESOLVED FIXED
Alias: None
Product: neon
Classification: KDE Neon
Component: Snaps (show other bugs)
Version: unspecified
Platform: Snap Linux
: NOR normal
Target Milestone: ---
Assignee: Neon Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-03 09:36 UTC by Maximilian Federle
Modified: 2022-06-09 07:30 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 Maximilian Federle 2021-11-03 09:36:17 UTC
SUMMARY

See https://forum.snapcraft.io/t/file-chooser-not-focused/22269

Snaps that use the kde-neon extension use the host's xdg-desktop-portal implementation.
However, FileChooser dialogs (open & save) open behind the application window because Qt sends the application's window id in the wrong format (dec instead of hex).

The upstream patch correcting this problem: https://github.com/qt/qtbase/commit/acaabc9108dfe75530960cf8e3ec4f3602cd82e0.patch

I guess this would need to be added in https://invent.kde.org/neon/qt/qtbase/-/tree/Neon/release/debian/patches, but I lack the time and skills to test building a deb with this patch to create a PR. 

https://forum.snapcraft.io/t/file-chooser-not-focused/22269
STEPS TO REPRODUCE
1. Run any snap that uses kde-neon
2. Open file dialog


OBSERVED RESULT
The file dialog opens out of focus in the background (at least on Gnome)

EXPECTED RESULT

The file dialog should open in the foreground, as it is the case with Gtk applications.
Comment 1 Maximilian Federle 2021-11-04 09:40:39 UTC
I created a PR: https://invent.kde.org/neon/qt/qtbase/-/merge_requests/3
Comment 2 Maximilian Federle 2021-11-10 09:09:17 UTC
This was fixed with https://invent.kde.org/neon/qt/qtbase/-/commit/3043f743331d474b12440bfe2eb467e44dfbb3ea
kde-frameworks-5-qt-5-15-3-core20 revision 7 has hit stable and solves the issue for kde-neon snaps.
Comment 3 Andreas Sturmlechner 2022-06-09 07:30:39 UTC
Please contribute this patch to Qt5PatchCollection next time so everyone will benefit, not just Neon.

Issue tracker: https://invent.kde.org/qt/backports-tracker/-/issues/306
Repository: https://invent.kde.org/qt/qt/qtbase