vcl/unx/gtk3/gtk3gtkinst.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
New commits: commit 9065ec06776fb21519e4a474a52cb051332489d4 Author: Caolán McNamara <caol...@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/55329 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@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 { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits