Review Request 112685: Fix KWindowSystem::setMainWindow
Aurélien Gâteau
agateau at kde.org
Thu Sep 12 14:55:48 UTC 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112685/
-----------------------------------------------------------
(Updated Sept. 12, 2013, 4:55 p.m.)
Review request for KDE Frameworks and Martin Gräßlin.
Changes
-------
Make sure mainWindow is deleted when subWidget is. Unfortunately, using a QScopedPointer does not work because the window must remain valid until QXcbWindow::show() is called. I am not completely happy with the use of QObject::destroyed(), but it felt more explicit than the alternative,
static_cast<QObject *>(mainWindow)->setParent(subWidget);
which feels backward.
Regarding the Q_ASSERT(), since the window is created quite indirectly (by setting an attribute) and since QWidget::windowHandle() is marked as "preliminary", I think it makes sense to keep it to track potential behavior changes, but I don't have a strong opinion on it: I can drop it if you prefer.
Description
-------
Due to changes in the way Qt5 handles windows, old code was not working
anymore (Qt::WA_X11BypassTransientForHint attribute is ignored by Qt5).
New code takes advantage of Qt5 support for handling foreign windows
provided by QWindow::fromWinId().
Diffs (updated)
-----
tier1/kwindowsystem/CMakeLists.txt 3db68d5
tier1/kwindowsystem/src/kwindowsystem_x11.cpp bcfaf17
tier1/kwindowsystem/tests/CMakeLists.txt PRE-CREATION
tier1/kwindowsystem/tests/setmainwindowtest.cpp PRE-CREATION
Diff: http://git.reviewboard.kde.org/r/112685/diff/
Testing
-------
Added a new manual test.
Thanks,
Aurélien Gâteau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130912/f33b6060/attachment.html>
More information about the Kde-frameworks-devel
mailing list