diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-01-10 10:44:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-01-11 14:09:25 +0100 |
commit | 71fad56863301f47f19fdd47ab93099ad098474e (patch) | |
tree | 6b55287b924215cec427b43046b15547c24b2e0d /vcl | |
parent | d8d148c96d7cdd96948240ac30b3aeacfb5aa7ca (diff) |
Resolves: tdf#122404 unlock just the toplevels that were locked
push what toplevels got locked to just unlock those ones. otherwise the just
dismissed toplevel may still be present in the Application toplevel list.
merge all the similar examples of this.
Change-Id: I77c0d55d1e4b3bcc3b8d88fef00ba289edd1e831
Reviewed-on: https://gerrit.libreoffice.org/66080
Tested-by: Jenkins
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/dialog.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 285b7c21da15..a1d8cf1e6a6c 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -43,6 +43,7 @@ #include <vcl/layout.hxx> #include <vcl/svapp.hxx> #include <vcl/event.hxx> +#include <vcl/waitobj.hxx> #include <vcl/wrkwin.hxx> #include <vcl/button.hxx> #include <vcl/mnemonic.hxx> @@ -1532,4 +1533,28 @@ void ModelessDialog::Activate() Dialog::Activate(); } +void TopLevelWindowLocker::incBusy(const vcl::Window* pIgnore) +{ + // lock any toplevel windows from being closed until busy is over + std::vector<VclPtr<vcl::Window>> aTopLevels; + vcl::Window *pTopWin = Application::GetFirstTopLevelWindow(); + while (pTopWin) + { + if (pTopWin != pIgnore) + aTopLevels.push_back(pTopWin); + pTopWin = Application::GetNextTopLevelWindow(pTopWin); + } + for (auto& a : aTopLevels) + a->IncModalCount(); + m_aBusyStack.push(aTopLevels); +} + +void TopLevelWindowLocker::decBusy() +{ + // unlock locked toplevel windows from being closed now busy is over + for (auto& a : m_aBusyStack.top()) + a->DecModalCount(); + m_aBusyStack.pop(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |