[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 9 16:00:53 UTC 2020
sc/source/ui/inc/tabview.hxx | 2 ++
sc/source/ui/view/tabview2.cxx | 16 +++++++++-------
2 files changed, 11 insertions(+), 7 deletions(-)
New commits:
commit 98e8bb0a5bb9d93fb1ba6476c0fdb1c7277ed68c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jul 9 15:07:38 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jul 9 18:00:15 2020 +0200
tdf#134688 run error dialog async and keep the events in the one event loop
instead of a sub loop which helps to not lose the mouse release where
the dialog was shown on the mouse press
Change-Id: If0baf15e85aff7a28ca058e2626b58802d0dad08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98451
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index a46c76666145..794e10fb8241 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -137,6 +137,8 @@ private:
FuPoor* pDrawActual;
FuPoor* pDrawOld;
+ std::shared_ptr<weld::MessageDialog> m_xMessageBox;
+
std::array<VclPtr<ScGridWindow>, 4> pGridWin;
std::array<VclPtr<ScColBar>, 2> pColBar;
std::array<VclPtr<ScRowBar>, 2> pRowBar;
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 97e5dd9babd9..450c512e01d9 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1431,13 +1431,15 @@ void ScTabView::ErrorMessage(const char* pGlobStrId)
}
}
- std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pParent,
- VclMessageType::Info, VclButtonsType::Ok,
- ScResId(pGlobStrId)));
- xInfoBox->run();
-
- if (bFocus)
- pParent->grab_focus();
+ m_xMessageBox.reset(Application::CreateMessageDialog(pParent,
+ VclMessageType::Info, VclButtonsType::Ok,
+ ScResId(pGlobStrId)));
+ weld::Window* pGrabOnClose = bFocus ? pParent : nullptr;
+ m_xMessageBox->runAsync(m_xMessageBox, [this, pGrabOnClose](sal_Int32 /*nResult*/) {
+ m_xMessageBox.reset();
+ if (pGrabOnClose)
+ pGrabOnClose->grab_focus();
+ });
}
void ScTabView::UpdatePageBreakData( bool bForcePaint )
More information about the Libreoffice-commits
mailing list