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

Resolves: crash in double-split when first timeout hadn't expired yet

Change-Id: Ieba97589a3794cf5ed95839e20cc4028cfedae3a
Reviewed-on: https://gerrit.libreoffice.org/66018
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 4c89c6c7
......@@ -3039,6 +3039,7 @@ private:
gulong m_nSwitchPageSignalId;
gulong m_nOverFlowSwitchPageSignalId;
gulong m_nSizeAllocateSignalId;
guint m_nLaunchSplitTimeoutId;
bool m_bOverFlowBoxActive;
bool m_bOverFlowBoxIsStart;
int m_nStartTabCount;
......@@ -3364,6 +3365,7 @@ private:
int nCurrentPage = pThis->get_current_page();
pThis->split_notebooks();
pThis->set_current_page(nCurrentPage);
pThis->m_nLaunchSplitTimeoutId = 0;
return false;
}
......@@ -3374,7 +3376,7 @@ private:
// tabs in a single row when they would fit
void signal_notebook_size_allocate()
{
if (m_bOverFlowBoxActive)
if (m_bOverFlowBoxActive || m_nLaunchSplitTimeoutId)
return;
disable_notify_events();
gint nPages = gtk_notebook_get_n_pages(m_pNotebook);
......@@ -3385,7 +3387,7 @@ private:
GtkWidget* pTabWidget = gtk_notebook_get_tab_label(m_pNotebook, gtk_notebook_get_nth_page(m_pNotebook, i));
if (!gtk_widget_get_child_visible(pTabWidget))
{
g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, reinterpret_cast<GSourceFunc>(launch_split_notebooks), this, nullptr);
m_nLaunchSplitTimeoutId = g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, reinterpret_cast<GSourceFunc>(launch_split_notebooks), this, nullptr);
break;
}
}
......@@ -3407,6 +3409,7 @@ public:
, m_pOverFlowNotebook(GTK_NOTEBOOK(gtk_notebook_new()))
, m_nSwitchPageSignalId(g_signal_connect(pNotebook, "switch-page", G_CALLBACK(signalSwitchPage), this))
, m_nOverFlowSwitchPageSignalId(g_signal_connect(m_pOverFlowNotebook, "switch-page", G_CALLBACK(signalOverFlowSwitchPage), this))
, m_nLaunchSplitTimeoutId(0)
, m_bOverFlowBoxActive(false)
, m_bOverFlowBoxIsStart(false)
, m_nStartTabCount(0)
......
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