diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-05-05 20:53:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-05-06 11:30:54 +0200 |
commit | 8f29d128c52a4f58116fe5474222a929937d0050 (patch) | |
tree | 39a55627dfcb419365084ea6c1e24059f23f568e | |
parent | 1ea27111034c5581a356b90b93f3741ca17f311e (diff) |
do focus in after all other focus handlers are run
Change-Id: Ia0ddbc0181e90d0657534ad6198b21948bf47e26
Reviewed-on: https://gerrit.libreoffice.org/71829
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 81694aa208b4..b1c7cf963d3f 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -1256,11 +1256,15 @@ protected: GtkWidget* m_pWidget; GtkInstanceBuilder* m_pBuilder; + DECL_LINK(async_signal_focus_in, void*, void); + static gboolean signalFocusIn(GtkWidget*, GdkEvent*, gpointer widget) { GtkInstanceWidget* pThis = static_cast<GtkInstanceWidget*>(widget); - SolarMutexGuard aGuard; - pThis->signal_focus_in(); + // in e.g. function wizard RefEdits we want to select all when we get focus + // but there are pending gtk handlers which change selection after our handler + // post our focus in event to happen after those finish + Application::PostUserEvent(LINK(pThis, GtkInstanceWidget, async_signal_focus_in)); return false; } @@ -2061,6 +2065,11 @@ public: } }; +IMPL_LINK_NOARG(GtkInstanceWidget, async_signal_focus_in, void*, void) +{ + signal_focus_in(); +} + namespace { OString MapToGtkAccelerator(const OUString &rStr) |