summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <william.jon.mccann@gmail.com>2013-07-09 16:44:04 -0400
committerWilliam Jon McCann <william.jon.mccann@gmail.com>2013-07-11 17:08:15 -0400
commit57fc8763e930911f97b6e9fc9edebafb887db2b3 (patch)
tree34e928277f9b2fa4c5fd3e6e4526967c4e0a66a9 /gtk/gtknotebook.c
parent0efeb96dab93f93e15137f5b16a0132e7c9f4369 (diff)
downloadgtk+-57fc8763e930911f97b6e9fc9edebafb887db2b3.tar.gz
Deprecate and ignore the timeout-initial and timeout-repeat settings
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 2b4d832e67..b44c84aac6 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -104,6 +104,10 @@
#define FRAMES_PER_SECOND 45
#define MSECS_BETWEEN_UPDATES (1000 / FRAMES_PER_SECOND)
+#define TIMEOUT_INITIAL 500
+#define TIMEOUT_REPEAT 50
+#define TIMEOUT_EXPAND 500
+
typedef struct _GtkNotebookPage GtkNotebookPage;
typedef enum
@@ -3368,8 +3372,6 @@ gtk_notebook_motion_notify (GtkWidget *widget,
GtkNotebookPage *page;
GtkNotebookArrow arrow;
GtkNotebookPointerPosition pointer_position;
- GtkSettings *settings;
- guint timeout;
gint x_win, y_win;
page = priv->cur_page;
@@ -3433,10 +3435,7 @@ gtk_notebook_motion_notify (GtkWidget *widget,
if (!priv->dnd_timer)
{
priv->has_scrolled = TRUE;
- settings = gtk_widget_get_settings (GTK_WIDGET (notebook));
- g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
-
- priv->dnd_timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+ priv->dnd_timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
scroll_notebook_timer,
(gpointer) notebook);
}
@@ -3700,9 +3699,7 @@ gtk_notebook_drag_motion (GtkWidget *widget,
GtkNotebookPrivate *priv = notebook->priv;
GtkAllocation allocation;
GdkRectangle position;
- GtkSettings *settings;
GtkNotebookArrow arrow;
- guint timeout;
GdkAtom target, tab_target;
GList *tab;
gboolean retval = FALSE;
@@ -3775,10 +3772,7 @@ gtk_notebook_drag_motion (GtkWidget *widget,
if (!priv->switch_tab_timer)
{
- settings = gtk_widget_get_settings (widget);
-
- g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
- priv->switch_tab_timer = gdk_threads_add_timeout (timeout,
+ priv->switch_tab_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
gtk_notebook_switch_tab_timeout,
widget);
}
@@ -4834,14 +4828,8 @@ gtk_notebook_timer (GtkNotebook *notebook)
if (priv->need_timer)
{
- GtkSettings *settings;
- guint timeout;
-
- settings = gtk_widget_get_settings (GTK_WIDGET (notebook));
- g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
-
priv->need_timer = FALSE;
- priv->timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+ priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
(GSourceFunc) gtk_notebook_timer,
(gpointer) notebook);
}
@@ -4856,16 +4844,10 @@ static void
gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
{
GtkNotebookPrivate *priv = notebook->priv;
- GtkWidget *widget = GTK_WIDGET (notebook);
if (!priv->timer)
{
- GtkSettings *settings = gtk_widget_get_settings (widget);
- guint timeout;
-
- g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
-
- priv->timer = gdk_threads_add_timeout (timeout,
+ priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
(GSourceFunc) gtk_notebook_timer,
(gpointer) notebook);
priv->need_timer = TRUE;