Bug 462750

Summary: File Dialog ignores modal flag
Product: [Plasma] xdg-desktop-portal-kde Reporter: Rob Hall <robxnanocode>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: aleixpol, jgrulich, nate, nicolas.fella
Priority: NOR    
Version First Reported In: 5.26.3   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Rob Hall 2022-12-07 17:27:11 UTC
SUMMARY
The xdg-desktop-portal specification allows programs to request a modal file chooser dialog, but the KDE implementation creates a non-modal dialog regardless of the flag.

STEPS TO REPRODUCE
This happens no matter what the application, but it can easily be seen in Firefox.
1. In a terminal, enter `GTK_USE_PORTAL=1 firefox`.
2. When Firefox opens, press Ctrl+S to open the save dialog. The dialog should be the KDE portal one.
3. Attempt to click on the main program window while the dialog is still open.

OBSERVED RESULT
The window is not modal and can still be interacted with. This could lead to unexpected behaviour in applications which don't expect the application to be modified by the user once the dialog is open.

EXPECTED RESULT
The window should be blocked from interaction until the file dialog is closed. This is the behaviour when the portal is not active, and also the behaviour of the gtk and gnome implementations of the portal.

SOFTWARE/OS VERSIONS
KDE neon unstable 20221204-1117
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Comment 1 Rob Hall 2022-12-07 19:29:01 UTC
Turns out my previous comment wasn't quite right. The gtk and gnome portal implementations don't make a modal dialog unless the desktop is Gnome. I guess this needs to be implemented in the window manager instead.
Comment 2 Nicolas Fella 2022-12-13 17:16:27 UTC
Is this on X11 or Wayland? or both?
Comment 3 Rob Hall 2022-12-13 18:07:51 UTC
I just checked again and it happens on both, although there is a difference between the two. On Wayland, the file dialog has its own taskbar icon and it can go behind the application window, while on X11 it doesn't have an icon and always stays on top.
Comment 4 Rob Hall 2024-02-27 23:53:58 UTC
This has been fixed in GTK 4.10.