vcl/source/app/salvtables.cxx | 18 +++++++++++++----- vcl/source/window/dialog.cxx | 23 +++++++++++------------ vcl/unx/gtk3/gtk3gtkinst.cxx | 11 +++++++++-- 3 files changed, 33 insertions(+), 19 deletions(-)
New commits: commit 40d8bc87bb147057c1bed03656b9ada4869dd926 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jun 14 10:11:38 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jun 14 16:32:08 2019 +0200 disable 'Quit' when toggling a dialog hierarchy to 'busy' Change-Id: I28773e983014596f6c6b98ab9846bae0a4b3b9ad Reviewed-on: https://gerrit.libreoffice.org/74029 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 213521b339cd39b650564ce8a695da29225012b5) Reviewed-on: https://gerrit.libreoffice.org/74038 diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index ec660bf630b4..faa88a27c1da 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1607,7 +1607,10 @@ void TopLevelWindowLocker::incBusy(const weld::Window* pIgnore) pTopWin = Application::GetNextTopLevelWindow(pTopWin); } for (auto& a : aTopLevels) + { a->IncModalCount(); + a->ImplGetFrame()->NotifyModalHierarchy(true); + } m_aBusyStack.push(aTopLevels); } @@ -1619,6 +1622,7 @@ void TopLevelWindowLocker::decBusy() if (a->IsDisposed()) continue; a->DecModalCount(); + a->ImplGetFrame()->NotifyModalHierarchy(false); } m_aBusyStack.pop(); } commit 9ff8914166d6b26b654b10dbdb9d56b111b99ed4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jun 14 10:02:15 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jun 14 16:31:47 2019 +0200 broadcast up/down of welded native modal dialogs like vcl ones Change-Id: I61519f0ff92b912501f82e31d6cc3cae244208e6 Reviewed-on: https://gerrit.libreoffice.org/74028 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 7db198677d7907a1e146f0287ab742ee536f397f) Reviewed-on: https://gerrit.libreoffice.org/74037 diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index ae44d6b4480e..d001efdd1db3 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1071,15 +1071,11 @@ public: virtual void set_modal(bool bModal) override { - if (::Dialog* pDialog = dynamic_cast<::Dialog*>(m_xWindow.get())) - return pDialog->SetModalInputMode(bModal); - return m_xWindow->ImplGetFrame()->SetModal(bModal); + m_xWindow->ImplGetFrame()->SetModal(bModal); } virtual bool get_modal() const override { - if (const ::Dialog* pDialog = dynamic_cast<const ::Dialog*>(m_xWindow.get())) - return pDialog->IsModalInputMode(); return m_xWindow->ImplGetFrame()->GetModal(); } @@ -1331,6 +1327,18 @@ public: m_xDialog->add_button(xButton, nResponse, true); } + virtual void set_modal(bool bModal) override + { + if (get_modal() == bModal) + return; + m_xDialog->SetModalInputMode(bModal); + } + + virtual bool get_modal() const override + { + return m_xDialog->IsModalInputMode(); + } + virtual weld::Button* get_widget_for_response(int nResponse) override; virtual void set_default_response(int nResponse) override diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index ce83520c997a..ec660bf630b4 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -964,12 +964,6 @@ bool Dialog::ImplStartExecute() if ( pSVData->maWinData.mpCaptureWin ) pSVData->maWinData.mpCaptureWin->ReleaseMouse(); EnableInput(); - - if ( GetParent() ) - { - SalFrame* pFrame = GetParent()->ImplGetFrame(); - pFrame->NotifyModalHierarchy(true); - } } mbInExecute = true; @@ -1159,12 +1153,6 @@ void Dialog::EndDialog( long nResult ) } } - if (bModal && GetParent()) - { - SalFrame* pFrame = GetParent()->ImplGetFrame(); - pFrame->NotifyModalHierarchy(false); - } - mpDialogImpl->mnResult = nResult; if ( mpDialogImpl->mbStartedModal ) @@ -1222,6 +1210,13 @@ void Dialog::SetModalInputMode( bool bModal ) return; ImplGetFrame()->SetModal(bModal); + + if (GetParent()) + { + SalFrame* pFrame = GetParent()->ImplGetFrame(); + pFrame->NotifyModalHierarchy(bModal); + } + ImplSetModalInputMode(bModal); } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index ec1f6d4e28bd..d62fc9714ea4 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2937,6 +2937,7 @@ struct DialogRunner { m_xFrameWindow->IncModalCount(); ++m_nModalDepth; + m_xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(true); } } @@ -2946,6 +2947,7 @@ struct DialogRunner { m_xFrameWindow->DecModalCount(); --m_nModalDepth; + m_xFrameWindow->ImplGetFrame()->NotifyModalHierarchy(false); } } @@ -2996,13 +2998,18 @@ struct DialogRunner ~DialogRunner() { - if (m_xFrameWindow) + if (m_xFrameWindow && m_nModalDepth) { // if, like the calc validation dialog does, the modality was // toggled off during execution ensure that on cleanup the parent // is left in the state it was found - while (m_nModalDepth++ < 0) + SalFrame* pFrame = m_xFrameWindow->ImplGetFrame(); + do + { m_xFrameWindow->IncModalCount(); + pFrame->NotifyModalHierarchy(true); + } + while (++m_nModalDepth < 0); } } }; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits