From a3a6ff25f5749207dbfae3d22ec5f2a3c8623d9a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 7 Aug 2020 10:32:37 +0100 Subject: block gen's focus in/out callbacks from grab_focus like gtk's MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6102022495f5ffe644b4aa2b71df2fcf4e0a7b6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100299 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/app/salvtables.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vcl/source') diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 3c95b11eeb33..03d95b7bb219 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -258,7 +258,12 @@ void SalInstanceWidget::set_can_focus(bool bCanFocus) m_xWidget->SetStyle(nStyle); } -void SalInstanceWidget::grab_focus() { m_xWidget->GrabFocus(); } +void SalInstanceWidget::grab_focus() +{ + disable_notify_events(); + m_xWidget->GrabFocus(); + enable_notify_events(); +} bool SalInstanceWidget::has_focus() const { return m_xWidget->HasFocus(); } @@ -529,6 +534,8 @@ SystemWindow* SalInstanceWidget::getSystemWindow() { return m_xWidget->GetSystem void SalInstanceWidget::HandleEventListener(VclWindowEvent& rEvent) { + if (notify_events_disabled()) + return; if (rEvent.GetId() == VclEventId::WindowGetFocus) m_aFocusInHdl.Call(*this); else if (rEvent.GetId() == VclEventId::WindowLoseFocus) -- cgit