diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 9 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 16 |
2 files changed, 9 insertions, 16 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 317770c367c3..b50ebb6a46b6 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -260,12 +260,7 @@ void SalInstanceWidget::set_can_focus(bool bCanFocus) m_xWidget->SetStyle(nStyle); } -void SalInstanceWidget::grab_focus() -{ - disable_notify_events(); - m_xWidget->GrabFocus(); - enable_notify_events(); -} +void SalInstanceWidget::grab_focus() { m_xWidget->GrabFocus(); } bool SalInstanceWidget::has_focus() const { return m_xWidget->HasFocus(); } @@ -547,8 +542,6 @@ 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) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index f8cc467b5e0e..5dd7dc92ffd8 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2505,9 +2505,9 @@ public: virtual void grab_focus() override { - disable_notify_events(); + if (has_focus()) + return; gtk_widget_grab_focus(m_pWidget); - enable_notify_events(); } virtual bool has_focus() const override @@ -8703,7 +8703,8 @@ public: virtual void grab_focus() override { - disable_notify_events(); + if (has_focus()) + return; gtk_widget_grab_focus(m_pWidget); if (!gtk_container_get_focus_child(GTK_CONTAINER(m_pWidget))) { @@ -8711,7 +8712,6 @@ public: gtk_container_set_focus_child(GTK_CONTAINER(m_pWidget), GTK_WIDGET(pItem)); } gtk_widget_child_focus(gtk_container_get_focus_child(GTK_CONTAINER(m_pWidget)), GTK_DIR_TAB_FORWARD); - enable_notify_events(); } virtual ~GtkInstanceToolbar() override @@ -9345,9 +9345,9 @@ public: virtual void grab_focus() override { - disable_notify_events(); + if (has_focus()) + return; gtk_entry_grab_focus_without_selecting(m_pEntry); - enable_notify_events(); } virtual void set_alignment(TxtAlign eXAlign) override @@ -15643,12 +15643,12 @@ public: virtual void grab_focus() override { - disable_notify_events(); + if (has_focus()) + return; if (m_pEntry) gtk_widget_grab_focus(m_pEntry); else gtk_widget_grab_focus(m_pToggleButton); - enable_notify_events(); } virtual bool has_focus() const override |