Bug 367699

Summary: The file dialog fails to implement X11 WM_TRANSIENT_FOR correctly
Product: [Plasma] plasma-integration Reporter: Emmanuel Lepage Vallée <emmanuel.lepage>
Component: generalAssignee: Martin Flöser <mgraesslin>
Status: RESOLVED FIXED    
Severity: normal CC: bugs.kde.org
Priority: NOR    
Version First Reported In: 5.7.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://phabricator.kde.org/D2543
Latest Commit: Version Fixed/Implemented In: 5.7.5
Sentry Crash Report:

Description Emmanuel Lepage Vallée 2016-08-23 02:46:46 UTC
None of the file dialogs in KDE applications are correctly modal. This is the ID used for the WM_TRANSIENT_FOR is wrong and isn't a known xcb_window_t client (my guess it that its the root or something, but I didn't check). This violate the spec and doesn't make any sense.

Without the KDEPlasmaPlatformTheme.so QPA, the behavior is correct and compliant. With it, while the XPROPERTY is set, its value is wrong.

In AwesomeWM, I can confirm that none of the xcb_window_t clients matches the WM_TRANSIENT_FOR exposed by the plasma QPA.

Why is this important:

 * It may cause the file dialog to show on the wrong screen
 * It prevent some WM to place the dialog in the right workspace/activity
 * It breaks some WM modal dialog detection, however not all WMs are affected by this.

Reproducible: Always

Steps to Reproduce:
To reproduce, install xwininfo and use xprop

1) Using xwininfo, check the WinId of an application (like Kate).
2) Open a file dialog in the said application. 
3) Using xprop, get the WM_TRANSIENT_FOR value
4) See how they don't match

Actual Results:  
With the QPA, the WM_TRANSIENT_FOR doesn't match the "xwininfo: Window id:" row of xwininfo.

Expected Results:  
Without the QPA, the WM_TRANSIENT_FOR matches the "xwininfo: Window id:" row of xwininfo.

The bug is present in framework-integration. The bug isn't present in KDE4. I didn't test framework < 5.7, but those above it seem to have the issues.
Comment 1 Martin Flöser 2016-08-23 05:26:15 UTC
yep, looks wrong. Though KWin gets the modality correctly, though placement is wrong.
Comment 2 Martin Flöser 2016-08-23 05:39:49 UTC
Patch at https://phabricator.kde.org/D2543
Comment 3 Martin Flöser 2016-08-31 13:10:35 UTC
Git commit 4a50ee3212d734db4a1cdd4fc24308be23cdf7da by Martin Gräßlin.
Committed on 31/08/2016 at 13:09.
Pushed by graesslin into branch 'Plasma/5.7'.

Set transientParent window for file dialog

The file dialog did not set a proper WM_TRANSIENT_FOR hint. This change
ensures that the proper parent window is passed as the WM_TRANSIENT_FOR
hint.
FIXED-IN: 5.7.5

Test Plan: xprop+xwininfo on file dialog and parent window

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D2543

M  +1    -1    src/platformtheme/kdeplatformfiledialoghelper.cpp

http://commits.kde.org/plasma-integration/4a50ee3212d734db4a1cdd4fc24308be23cdf7da
Comment 4 Piotr Dobrogost 2019-07-21 16:50:33 UTC
Taking into account that KFind can be started directly should KFind be regarded as a file dialog or stand alone window?