From 0d4ffe9a63422f30752bf886ab23ab1b8d2b10f9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 11 Nov 2020 20:24:30 +0000 Subject: tdf#138078 only call GetFocus if we gained focus from an unfocused state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7733cdb2bbed8e39dbbafd63b360513ab9ad5e6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105612 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/vcl/customweld.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/vcl') diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx index df7b97e070d7..b19b64bf980e 100644 --- a/include/vcl/customweld.hxx +++ b/include/vcl/customweld.hxx @@ -65,8 +65,10 @@ public: virtual void Hide() { m_pDrawingArea->hide(); } void GrabFocus() { + bool bHadFocus = m_pDrawingArea->has_focus(); m_pDrawingArea->grab_focus(); - if (m_pDrawingArea->has_focus()) + // tdf#138078 only call GetFocus if we gained focus from an unfocused state + if (!bHadFocus && m_pDrawingArea->has_focus()) GetFocus(); } bool HasFocus() const { return m_pDrawingArea->has_focus(); } -- cgit