diff options
author | Aleksei Nikiforov <darktemplar@basealt.ru> | 2019-02-25 11:48:07 +0300 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2019-02-27 21:12:22 +0100 |
commit | ccb2ab39935892230e04f536596a0b49a3529f5a (patch) | |
tree | 978d970ca6e911d2b3acb4d01eafbc0dba63a70d | |
parent | 5f9104ef6f42d9d42ce3ec564affcba88889e76c (diff) |
tdf#119720 KDE5: Don't show hidden windows on modality change
This change fixes clipping and drawing issues
for document recovery window and other modal windows.
Change-Id: I005254d4cd2598f4f2d02ba7e7bbf7388affe36c
Reviewed-on: https://gerrit.libreoffice.org/68307
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit 5e8276e665490d961c333f788469a5ecdb996d16)
Reviewed-on: https://gerrit.libreoffice.org/68413
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 6d96f7926c0f..841350f95704 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -482,13 +482,21 @@ void Qt5Frame::SetModal(bool bModal) { if (isWindow()) { - if (m_pTopLevel) - m_pTopLevel->setVisible(true); + bool wasVisible = windowHandle()->isVisible(); + // modality change is only effective if the window is hidden - windowHandle()->hide(); + if (wasVisible) + { + windowHandle()->hide(); + } + windowHandle()->setModality(bModal ? Qt::WindowModal : Qt::NonModal); - // and shown again - windowHandle()->show(); + + // and shown again if it was visible + if (wasVisible) + { + windowHandle()->show(); + } } } |