diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-02-21 17:19:18 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-02-21 21:14:45 +0100 |
commit | 35701e731728bc010b19e5ebb154c3fe6682647e (patch) | |
tree | 730237baa6af2d7437dfee19883de1769b67e551 /vcl | |
parent | 7bc3ac14a88206ed3cafa123e92877e0a47cfb15 (diff) |
wrong "to-page" reported in split notebooks
and when switching decks we need that notification to occur too
Change-Id: Ica3c83ad34e072faf044c6d4667f34756688de09
Reviewed-on: https://gerrit.libreoffice.org/68171
Tested-by: Jenkins
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, 11 insertions, 2 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index b0c0e13b5e7e..7910ae85948c 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3183,6 +3183,13 @@ private: void signal_switch_page(int nNewPage) { + if (m_bOverFlowBoxIsStart) + { + auto nOverFlowLen = m_bOverFlowBoxActive ? gtk_notebook_get_n_pages(m_pOverFlowNotebook) - 1 : 0; + // add count of overflow pages, minus the extra tab + nNewPage += nOverFlowLen; + } + bool bAllow = !m_aLeavePageHdl.IsSet() || m_aLeavePageHdl.Call(get_current_page_ident()); if (!bAllow) { @@ -3246,9 +3253,11 @@ 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); } static OString get_page_ident(GtkNotebook *pNotebook, guint nPage) |