summaryrefslogtreecommitdiff
path: root/include/vcl/customweld.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-11 20:24:30 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-11-12 09:47:08 +0100
commit0d4ffe9a63422f30752bf886ab23ab1b8d2b10f9 (patch)
tree9d1f6d0f9dbcbf9e0dcb90efad4af523615d1fe3 /include/vcl/customweld.hxx
parent9e0ff8d1929b9925473f9efc54fd7bd0c90611c2 (diff)
tdf#138078 only call GetFocus if we gained focus from an unfocused state
Change-Id: I7733cdb2bbed8e39dbbafd63b360513ab9ad5e6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105612 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/vcl/customweld.hxx')
-rw-r--r--include/vcl/customweld.hxx4
1 files changed, 3 insertions, 1 deletions
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(); }