[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - vcl/unx

Caolán McNamara caolanm at redhat.com
Tue Jun 5 14:22:10 UTC 2018


 vcl/unx/gtk3/gtk3gtkinst.cxx |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit fb63ec23b4ae3cff771934714f0bad003123cdd0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 5 12:35:33 2018 +0100

    tdf#117991 let focus change get processed before selection change
    
    Change-Id: I78999730bc942733d7498415d920d94f2422ac6f
    Reviewed-on: https://gerrit.libreoffice.org/55330
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 78d81061bb34..cc927fe89742 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3080,11 +3080,18 @@ private:
     gulong m_nChangedSignalId;
     gulong m_nRowActivatedSignalId;
 
+    DECL_LINK(async_signal_changed, void*, void);
+
     static void signalChanged(GtkTreeView*, gpointer widget)
     {
         GtkInstanceTreeView* pThis = static_cast<GtkInstanceTreeView*>(widget);
-        SolarMutexGuard aGuard;
-        pThis->signal_changed();
+        //tdf#117991 selection change is sent before the focus change, and focus change
+        //is what will cause a spinbutton that currently has the focus to set its contents
+        //as the spin button value. So any LibreOffice callbacks on
+        //signal-change would happen before the spinbutton value-change occurs.
+        //To avoid this, send the signal-change to LibreOffice to occur after focus-change
+        //has been processed
+        Application::PostUserEvent(LINK(pThis, GtkInstanceTreeView, async_signal_changed));
     }
 
     static void signalRowActivated(GtkTreeView*, GtkTreePath*, GtkTreeViewColumn*, gpointer widget)
@@ -3390,6 +3397,10 @@ public:
     }
 };
 
+IMPL_LINK_NOARG(GtkInstanceTreeView, async_signal_changed, void*, void)
+{
+    signal_changed();
+}
 
 class GtkInstanceSpinButton : public GtkInstanceEntry, public virtual weld::SpinButton
 {


More information about the Libreoffice-commits mailing list