while (offset != 0)
{
- current = gtk_notebook_search_page (notebook, current, offset < 0 ? STEP_PREV : STEP_NEXT, TRUE);
+ current = gtk_notebook_search_page (notebook, current,
+ offset < 0 ? STEP_PREV : STEP_NEXT,
+ TRUE);
+
+ if (!current)
+ {
+ gboolean wrap_around;
+
+ g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)),
+ "gtk-keynav-wrap-around", &wrap_around,
+ NULL);
+
+ if (wrap_around)
+ current = gtk_notebook_search_page (notebook, NULL,
+ offset < 0 ? STEP_PREV : STEP_NEXT,
+ TRUE);
+ else
+ break;
+ }
+
offset += offset < 0 ? 1 : -1;
}
if (current)
gtk_notebook_switch_page (notebook, current->data, -1);
else
- gdk_display_beep (gtk_widget_get_display (GTK_WIDGET (notebook)));
+ gtk_widget_error_bell (GTK_WIDGET (notebook));
}
static GtkDirectionType
GtkNotebookPointerPosition pointer_position;
GList *element, *first_tab;
- GDK_THREADS_ENTER ();
-
priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
pointer_position = get_pointer_position (notebook);
gdk_window_raise (priv->drag_window);
}
- GDK_THREADS_LEAVE ();
-
return TRUE;
}
settings = gtk_widget_get_settings (GTK_WIDGET (notebook));
g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
- priv->dnd_timer = g_timeout_add (timeout * SCROLL_DELAY_FACTOR,
- (GSourceFunc) scroll_notebook_timer,
+ priv->dnd_timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
+ scroll_notebook_timer,
(gpointer) notebook);
}
}
GList *tab;
gint x, y;
- GDK_THREADS_ENTER ();
-
notebook = GTK_NOTEBOOK (data);
priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
gtk_notebook_switch_focus_tab (notebook, tab);
}
- GDK_THREADS_LEAVE ();
-
return FALSE;
}
settings = gtk_widget_get_settings (widget);
g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
- priv->switch_tab_timer = g_timeout_add (timeout,
- (GSourceFunc) gtk_notebook_switch_tab_timeout,
+ priv->switch_tab_timer = gdk_threads_add_timeout (timeout,
+ gtk_notebook_switch_tab_timeout,
widget);
}
}
new_page = gtk_notebook_search_page (notebook, notebook->focus_tab,
search_direction, TRUE);
+ if (!new_page)
+ {
+ gboolean wrap_around;
+
+ g_object_get (gtk_widget_get_settings (GTK_WIDGET (notebook)),
+ "gtk-keynav-wrap-around", &wrap_around,
+ NULL);
+
+ if (wrap_around)
+ new_page = gtk_notebook_search_page (notebook, NULL,
+ search_direction, TRUE);
+ }
+
if (new_page)
gtk_notebook_switch_focus_tab (notebook, new_page);
else
- gdk_display_beep (gtk_widget_get_display (GTK_WIDGET (notebook)));
-
+ gtk_widget_error_bell (GTK_WIDGET (notebook));
+
return TRUE;
}
}
}
-static gint
+static gboolean
gtk_notebook_timer (GtkNotebook *notebook)
{
gboolean retval = FALSE;
- GDK_THREADS_ENTER ();
-
if (notebook->timer)
{
gtk_notebook_do_arrow (notebook, notebook->click_child);
g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
notebook->need_timer = FALSE;
- notebook->timer = g_timeout_add (timeout * SCROLL_DELAY_FACTOR,
+ notebook->timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
(GSourceFunc) gtk_notebook_timer,
(gpointer) notebook);
}
retval = TRUE;
}
- GDK_THREADS_LEAVE ();
-
return retval;
}
g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
- notebook->timer = g_timeout_add (timeout,
+ notebook->timer = gdk_threads_add_timeout (timeout,
(GSourceFunc) gtk_notebook_timer,
(gpointer) notebook);
notebook->need_timer = TRUE;