mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
notebook: consolidate code to remove the switch tab timer
https://bugzilla.gnome.org/show_bug.cgi?id=684415
This commit is contained in:
parent
67fec32d27
commit
42da600eb1
@ -1674,6 +1674,18 @@ gtk_notebook_get_property (GObject *object,
|
||||
* gtk_notebook_drag_data_get
|
||||
* gtk_notebook_drag_data_received
|
||||
*/
|
||||
static void
|
||||
remove_switch_tab_timer (GtkNotebook *notebook)
|
||||
{
|
||||
GtkNotebookPrivate *priv = notebook->priv;
|
||||
|
||||
if (priv->switch_tab_timer)
|
||||
{
|
||||
g_source_remove (priv->switch_tab_timer);
|
||||
priv->switch_tab_timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_notebook_destroy (GtkWidget *widget)
|
||||
{
|
||||
@ -1701,11 +1713,7 @@ gtk_notebook_destroy (GtkWidget *widget)
|
||||
priv->source_targets = NULL;
|
||||
}
|
||||
|
||||
if (priv->switch_tab_timer)
|
||||
{
|
||||
g_source_remove (priv->switch_tab_timer);
|
||||
priv->switch_tab_timer = 0;
|
||||
}
|
||||
remove_switch_tab_timer (notebook);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_notebook_parent_class)->destroy (widget);
|
||||
}
|
||||
@ -3789,11 +3797,7 @@ gtk_notebook_drag_motion (GtkWidget *widget,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (priv->switch_tab_timer)
|
||||
{
|
||||
g_source_remove (priv->switch_tab_timer);
|
||||
priv->switch_tab_timer = 0;
|
||||
}
|
||||
remove_switch_tab_timer (notebook);
|
||||
}
|
||||
|
||||
return (target == tab_target) ? TRUE : FALSE;
|
||||
@ -3807,13 +3811,8 @@ gtk_notebook_drag_leave (GtkWidget *widget,
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
||||
GtkNotebookPrivate *priv = notebook->priv;
|
||||
|
||||
if (priv->switch_tab_timer)
|
||||
{
|
||||
g_source_remove (priv->switch_tab_timer);
|
||||
priv->switch_tab_timer = 0;
|
||||
}
|
||||
|
||||
stop_scrolling (GTK_NOTEBOOK (widget));
|
||||
remove_switch_tab_timer (notebook);
|
||||
stop_scrolling (notebook);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user