[gtk+] notebook: consolidate code to remove the switch tab timer
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] notebook: consolidate code to remove the switch tab timer
- Date: Mon, 22 Oct 2012 22:42:57 +0000 (UTC)
commit 42da600eb193e3423ab7810380ae39bac95d47fd
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Sep 19 17:01:00 2012 -0400
notebook: consolidate code to remove the switch tab timer
https://bugzilla.gnome.org/show_bug.cgi?id=684415
gtk/gtknotebook.c | 33 ++++++++++++++++-----------------
1 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index c414a16..a1469ef 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1675,6 +1675,18 @@ gtk_notebook_get_property (GObject *object,
* 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)
{
GtkNotebook *notebook = GTK_NOTEBOOK (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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]