summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2023-04-01 20:08:13 +0300
committerCaolán McNamara <caolanm@redhat.com>2023-04-03 16:18:40 +0200
commitdacdb5a424601e9ee33f57cceb79f3835530654f (patch)
treebbee9fed8bca9ac1e6e0a08aac59145a40ab7f14
parenttdf#154545 sw Navigator: select & track nested bookmarks (diff)
downloadcore-dacdb5a424601e9ee33f57cceb79f3835530654f.tar.gz
core-dacdb5a424601e9ee33f57cceb79f3835530654f.zip
tdf#152979 qt: Re-add workaround for X11 modality change w/ hide/show
Essentially add back the workaround originally added in commit e770bacc85a0eec96de77068d61b03f374b3cdec Date: Sun Jun 2 21:01:33 2019 +0000 Qt5 workaround modal change after show bug but then dropped again in commit 2dc6bdd1d5789ace0500cad90f5d2eb930888bb9 Date: Wed Jun 5 17:39:45 2019 +0000 tdf#125692 SalObject always holds a SystemChildWindow , since it turns out that it is still needed for other use cases than the original one from tdf#125692, as the freeze of the basic IDE dialog dialog preview described in tdf#152979. The qt.qpa.xcb: internal error: void QXcbWindow::setNetWmStateOnUnmappedWindow() called on mapped window issue mentioned there is apparently also worked around in upstream Qt tests, s. this qtbase commit [1]: commit 3714e51436eebb64873c58dc36cf89ef8f139f09 Author: Volker Hilsheimer <volker.hilsheimer@qt.io> Date: Mon Sep 20 13:44:26 2021 +0200 QWidgetWindow: Stabilize test on Xcb Showing, hiding, and showing a window can result in the Xcb QPA plugin warning about qt.qpa.xcb: internal error: void QXcbWindow::setNetWmStateOnUnmappedWindow() called on mapped window The point of the test is to verify that we get a paint event on a window that is shown again after having been hidden, not to verify that async windowing systems can handle a show/hide/show sequence. So wait for the window being exposed before we hide it. Pick-to: 6.2 5.15 Change-Id: If91a9926613645e78e332dacff34bd57e4034b6f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Decrease the sleep from the original 250 ms to 100 ms, since tdf#152979 comment 14 mentions that this is enough. [1] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3714e51436eebb64873c58dc36cf89ef8f139f09 Change-Id: I57ed520d0df85b7a3bcf47c2f9314754649482ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149912 Tested-by: Jenkins Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com> (cherry picked from commit 574a5519e23e8ed50c54fb27587afb1b5b5c13c5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149883 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/qt5/QtFrame.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index 5517584b72d7..e580ea5df206 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -621,7 +621,16 @@ void QtFrame::SetModal(bool bModal)
// modality change is only effective if the window is hidden
if (bWasVisible)
+ {
pChild->hide();
+ if (QGuiApplication::platformName() == "xcb")
+ {
+ SAL_WARN("vcl.qt", "SetModal called after Show - apply delay");
+ // tdf#152979 give QXcbConnection some time to avoid
+ // "qt.qpa.xcb: internal error: void QXcbWindow::setNetWmStateOnUnmappedWindow() called on mapped window"
+ QThread::msleep(100);
+ }
+ }
pChild->setWindowModality(bModal ? Qt::WindowModal : Qt::NonModal);