summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-05 12:35:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-05 16:00:39 +0200
commit9065ec06776fb21519e4a474a52cb051332489d4 (patch)
tree406e8ba713fba0b7fbd7c93903a082576f352faf
parentf8b59486ca61d8e4471fac2bff3441526921dba0 (diff)
tdf#117991 let focus change get processed before selection change
Change-Id: I78999730bc942733d7498415d920d94f2422ac6f Reviewed-on: https://gerrit.libreoffice.org/55329 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx15
1 files changed, 13 insertions, 2 deletions
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
{