Kaydet (Commit) 9065ec06 authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#117991 let focus change get processed before selection change

Change-Id: I78999730bc942733d7498415d920d94f2422ac6f
Reviewed-on: https://gerrit.libreoffice.org/55329Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst f8b59486
...@@ -3080,11 +3080,18 @@ private: ...@@ -3080,11 +3080,18 @@ private:
gulong m_nChangedSignalId; gulong m_nChangedSignalId;
gulong m_nRowActivatedSignalId; gulong m_nRowActivatedSignalId;
DECL_LINK(async_signal_changed, void*, void);
static void signalChanged(GtkTreeView*, gpointer widget) static void signalChanged(GtkTreeView*, gpointer widget)
{ {
GtkInstanceTreeView* pThis = static_cast<GtkInstanceTreeView*>(widget); GtkInstanceTreeView* pThis = static_cast<GtkInstanceTreeView*>(widget);
SolarMutexGuard aGuard; //tdf#117991 selection change is sent before the focus change, and focus change
pThis->signal_changed(); //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) static void signalRowActivated(GtkTreeView*, GtkTreePath*, GtkTreeViewColumn*, gpointer widget)
...@@ -3390,6 +3397,10 @@ public: ...@@ -3390,6 +3397,10 @@ public:
} }
}; };
IMPL_LINK_NOARG(GtkInstanceTreeView, async_signal_changed, void*, void)
{
signal_changed();
}
class GtkInstanceSpinButton : public GtkInstanceEntry, public virtual weld::SpinButton class GtkInstanceSpinButton : public GtkInstanceEntry, public virtual weld::SpinButton
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment