diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-03-25 14:45:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-03-25 22:14:49 +0100 |
commit | 8fb0a3dd9f3dc68bdd5670d2d071e6f225111dc7 (patch) | |
tree | c5581e44ef79ea8cf320656889e39ebc810fc18a /vcl | |
parent | 06dac856e7749ec53d4180297b6672f2d2e2a4dd (diff) |
Resolves: tdf#124234 page leave signal missing on move to overflow deck
we were emitting page-entered but not emitting the page-leave signal
Change-Id: I64131631016331cf102d08244982148ac8c3c69c
Reviewed-on: https://gerrit.libreoffice.org/69685
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index d7286685dbcb..4dd06f61b4eb 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3570,6 +3570,11 @@ private: return; } + // check if we are allowed leave before attempting to resplit the notebooks + bool bAllow = !m_aLeavePageHdl.IsSet() || m_aLeavePageHdl.Call(get_current_page_ident()); + if (!bAllow) + return; + disable_notify_events(); // take the overflow pages, and put them back at the end of the normal one @@ -3579,11 +3584,13 @@ private: std::swap(m_nStartTabCount, m_nEndTabCount); split_notebooks(); + gtk_notebook_set_current_page(m_pNotebook, nNewPage); + enable_notify_events(); - // we want to call this outside enable_notify_events so that the main - // notebook switch-page callback is triggered - gtk_notebook_set_current_page(m_pNotebook, nNewPage); + // trigger main notebook switch-page callback + OString sNewIdent(get_page_ident(m_pNotebook, nNewPage)); + m_aEnterPageHdl.Call(sNewIdent); } static OString get_page_ident(GtkNotebook *pNotebook, guint nPage) |