[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Apr 30 19:53:27 UTC 2021
vcl/source/app/salvtables.cxx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
New commits:
commit 0527539a8d228daadcd30428553bff7d96bf8434
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Apr 30 16:15:33 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Apr 30 21:52:50 2021 +0200
don't grab focus if we already have focus
for cases like the combobox of tdf#138281 so we don't end up
selecting the content if we already had focus
Change-Id: I2294b2d17d56e5282d7d84859eb9002ebb3b9ada
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114938
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index f482d4ee7145..e3541057da60 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -271,7 +271,12 @@ void SalInstanceWidget::set_can_focus(bool bCanFocus)
m_xWidget->SetStyle(nStyle);
}
-void SalInstanceWidget::grab_focus() { m_xWidget->GrabFocus(); }
+void SalInstanceWidget::grab_focus()
+{
+ if (has_focus())
+ return;
+ m_xWidget->GrabFocus();
+}
bool SalInstanceWidget::has_focus() const { return m_xWidget->HasFocus(); }
More information about the Libreoffice-commits
mailing list