Bug 404874 - KFileWidget: preview causes widget duplication on Mac
Summary: KFileWidget: preview causes widget duplication on Mac
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Open/save dialogs (show other bugs)
Version: git master
Platform: Compiled Sources macOS
: NOR major
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-27 17:14 UTC by RJVB
Modified: 2024-06-27 20:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot showing the described issue (245.18 KB, image/png)
2019-02-27 17:14 UTC, RJVB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2019-02-27 17:14:32 UTC
Created attachment 118402 [details]
Screenshot showing the described issue

SUMMARY
Activating the embedded preview in the KFileWidget causes a duplication of the entire KFileWidget (but not the surrounding dialog), which may cause a crash (deep in the cocoa platform QPA, on exit or when the dialog is destroyed; under the QSplitter dtor to be more precise).
The duplicate widget appears under the dialog, and becomes the widget to interact with although the toolbar remains usable (and linked) in both widgets.

STEPS TO REPRODUCE
1. Start kfilewidgettest_gui.app/Contents/MacOS/kfilewidgettest_gui from the KIO tests
2. enable preview mode if not already enabled
3. navigate and move the dialog around.

OBSERVED RESULT
The duplicate widget opens and the original KFileWidget becomes mostly a ghost. The toolbar will float on top of the original dialog and its contents; the rest remains on a lower level.

EXPECTED RESULT
Behaviour as under X11.
This is also what happens when Qt is built for X11 or when using the xcb QPA with an otherwise Cocoa build, which suggests that the preview mode does something that is not properly cross-platform.

SOFTWARE/OS VERSIONS
Mac OS X: 10.9.5 
KDE Frameworks Version: 5.52.0 ; KIO is built from a more recent master branch checkout.
Qt Version: 5.9.7

ADDITIONAL INFORMATION
This happens both with my osx-integration QPT and without it. The screenshot was made after disabling that plugin, = in stock cocoa mode.
Comment 1 Kai Uwe Broulik 2019-02-28 09:02:34 UTC
This looks eerily similar to QTBUG-59017, maybe it's a similar root cause (check the comments in that bug report for what's going on)
Comment 2 RJVB 2019-02-28 09:19:30 UTC
https://bugreports.qt.io/browse/QTBUG-48130 , calling winId() or otherwise turning a window native?

That would mean that I might not get the issue if I start the test app with the env. variable that forces Qt to use native windows all the time (or, the KFileWidget gets duplicated all the time).

(I hope the KP I got yesterday wasn't due to me tinkering with this ... or maybe I should hope that it is...)