summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2018-02-02 15:51:47 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2018-02-03 12:06:58 +0100
commitc655759cefa56efdb0cb943bb5dada3ff75a963c (patch)
treeef945ea7131b6419d00828fa8661d86691563d83 /gtk
parent334acbfc39cc08869932ec046e4d13e6c4b64be6 (diff)
downloadgtk+-c655759cefa56efdb0cb943bb5dada3ff75a963c.tar.gz
Replace gdk_threads_add_timeout* with g_timeout_add()
The main GDK thread lock is not portable and deprecated. The only reason why gdk_threads_add_timeout() and gdk_threads_add_timeout_full() exist is to allow invoking a callback with the GDK lock held, in case 3rd party libraries still use the deprecated gdk_threads_enter()/gdk_threads_leave() API. Since we're removing the GDK lock, and we're releasing a new major API, such code cannot exist any more; this means we can use the GLib API for installing timeout callbacks. https://bugzilla.gnome.org/show_bug.cgi?id=793124
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkbutton.c4
-rw-r--r--gtk/gtkcalendar.c8
-rw-r--r--gtk/gtkcellrenderertext.c3
-rw-r--r--gtk/gtkdnd.c4
-rw-r--r--gtk/gtkentry.c31
-rw-r--r--gtk/gtkentrycompletion.c2
-rw-r--r--gtk/gtkexpander.c2
-rw-r--r--gtk/gtkfilechooserwidget.c2
-rw-r--r--gtk/gtkfilesystemmodel.c9
-rw-r--r--gtk/gtkgesturelongpress.c2
-rw-r--r--gtk/gtkgesturemultipress.c4
-rw-r--r--gtk/gtkiconview.c6
-rw-r--r--gtk/gtkmenu.c20
-rw-r--r--gtk/gtkmenuitem.c4
-rw-r--r--gtk/gtknotebook.c20
-rw-r--r--gtk/gtkprintoperation-win32.c4
-rw-r--r--gtk/gtkprintoperation.c6
-rw-r--r--gtk/gtkrange.c8
-rw-r--r--gtk/gtkrecentmanager.c2
-rw-r--r--gtk/gtkscrolledwindow.c4
-rw-r--r--gtk/gtkspinbutton.c8
-rw-r--r--gtk/gtkstackswitcher.c6
-rw-r--r--gtk/gtktextview.c34
-rw-r--r--gtk/gtktooltip.c16
-rw-r--r--gtk/gtktreeview.c29
-rw-r--r--gtk/gtkwindow.c2
-rw-r--r--gtk/inspector/misc-info.c2
-rw-r--r--gtk/inspector/statistics.c4
28 files changed, 112 insertions, 134 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index d43ecf5485..6f46594ac3 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -829,9 +829,7 @@ gtk_real_button_activate (GtkButton *button)
priv->grab_keyboard = device;
}
- priv->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT,
- button_activate_timeout,
- button);
+ priv->activate_timeout = g_timeout_add (ACTIVATE_TIMEOUT, button_activate_timeout, button);
g_source_set_name_by_id (priv->activate_timeout, "[gtk+] button_activate_timeout");
priv->button_down = TRUE;
gtk_button_update_state (button);
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 0899748f56..2d03959496 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -2486,10 +2486,10 @@ calendar_timer (gpointer data)
if (priv->need_timer)
{
priv->need_timer = FALSE;
- priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
+ priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
(GSourceFunc) calendar_timer,
- (gpointer) calendar, NULL);
+ calendar, NULL);
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
}
else
@@ -2510,10 +2510,10 @@ calendar_start_spinning (GtkCalendar *calendar,
if (!priv->timer)
{
priv->need_timer = TRUE;
- priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
+ priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
TIMEOUT_INITIAL,
(GSourceFunc) calendar_timer,
- (gpointer) calendar, NULL);
+ calendar, NULL);
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
}
}
diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c
index f0c7d07a4b..5838d9412e 100644
--- a/gtk/gtkcellrenderertext.c
+++ b/gtk/gtkcellrenderertext.c
@@ -1850,8 +1850,7 @@ gtk_cell_renderer_text_popup_unmap (GtkMenu *menu,
if (priv->entry_menu_popdown_timeout)
return;
- priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout,
- data);
+ priv->entry_menu_popdown_timeout = g_timeout_add (500, popdown_timeout, data);
g_source_set_name_by_id (priv->entry_menu_popdown_timeout, "[gtk+] popdown_timeout");
}
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index f072239b6d..571f69cd76 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -1349,9 +1349,7 @@ gtk_drag_drop (GtkDragSourceInfo *info,
if (info->icon_window)
gtk_widget_hide (info->icon_window);
- info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
- gtk_drag_abort_timeout,
- info);
+ info->drop_timeout = g_timeout_add (DROP_ABORT_TIME, gtk_drag_abort_timeout, info);
g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
}
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 04770910c5..f1bcf6473a 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -4741,8 +4741,9 @@ buffer_inserted_text (GtkEntryBuffer *buffer,
password_hint->position = position;
if (password_hint->source_id)
g_source_remove (password_hint->source_id);
- password_hint->source_id = gdk_threads_add_timeout (password_hint_timeout,
- (GSourceFunc)gtk_entry_remove_password_hint, entry);
+ password_hint->source_id = g_timeout_add (password_hint_timeout,
+ (GSourceFunc)gtk_entry_remove_password_hint,
+ entry);
g_source_set_name_by_id (password_hint->source_id, "[gtk+] gtk_entry_remove_password_hint");
}
}
@@ -8808,7 +8809,7 @@ gtk_entry_selection_bubble_popup_set (GtkEntry *entry)
g_source_remove (priv->selection_bubble_timeout_id);
priv->selection_bubble_timeout_id =
- gdk_threads_add_timeout (50, gtk_entry_selection_bubble_popup_show, entry);
+ g_timeout_add (50, gtk_entry_selection_bubble_popup_show, entry);
g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_entry_selection_bubble_popup_cb");
}
@@ -9223,18 +9224,18 @@ blink_cb (gpointer data)
else if (priv->cursor_visible)
{
hide_cursor (entry);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- entry);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
else
{
show_cursor (entry);
priv->blink_time += get_cursor_time (entry);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- entry);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
@@ -9251,9 +9252,9 @@ gtk_entry_check_cursor_blink (GtkEntry *entry)
if (!priv->blink_timeout)
{
show_cursor (entry);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- entry);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
@@ -9279,9 +9280,9 @@ gtk_entry_pend_cursor_blink (GtkEntry *entry)
if (priv->blink_timeout != 0)
g_source_remove (priv->blink_timeout);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- entry);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
show_cursor (entry);
}
diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c
index 7dcd7e54bd..ebb2fb10dd 100644
--- a/gtk/gtkentrycompletion.c
+++ b/gtk/gtkentrycompletion.c
@@ -2463,7 +2463,7 @@ gtk_entry_completion_changed (GtkWidget *widget,
completion->priv->device = device;
completion->priv->completion_timeout =
- gdk_threads_add_timeout (COMPLETION_TIMEOUT,
+ g_timeout_add (COMPLETION_TIMEOUT,
gtk_entry_completion_timeout,
completion);
g_source_set_name_by_id (completion->priv->completion_timeout, "[gtk+] gtk_entry_completion_timeout");
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 33c2d1345c..763d401c31 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -584,7 +584,7 @@ gtk_expander_drag_motion (GtkWidget *widget,
if (!priv->expanded && !priv->expand_timer)
{
- priv->expand_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
+ priv->expand_timer = g_timeout_add (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
g_source_set_name_by_id (priv->expand_timer, "[gtk+] expand_timeout");
}
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 47cec72be2..a494a22def 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -4280,7 +4280,7 @@ load_setup_timer (GtkFileChooserWidget *impl)
g_assert (priv->load_timeout_id == 0);
g_assert (priv->load_state != LOAD_PRELOAD);
- priv->load_timeout_id = gdk_threads_add_timeout (MAX_LOADING_TIME, load_timeout_cb, impl);
+ priv->load_timeout_id = g_timeout_add (MAX_LOADING_TIME, load_timeout_cb, impl);
g_source_set_name_by_id (priv->load_timeout_id, "[gtk+] load_timeout_cb");
priv->load_state = LOAD_PRELOAD;
}
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 386188d108..7350a4aeb8 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1146,11 +1146,10 @@ gtk_file_system_model_got_files (GObject *object, GAsyncResult *res, gpointer da
if (model->dir_thaw_source == 0)
{
freeze_updates (model);
- model->dir_thaw_source = gdk_threads_add_timeout_full (IO_PRIORITY + 1,
- 50,
- thaw_func,
- model,
- NULL);
+ model->dir_thaw_source = g_timeout_add_full (IO_PRIORITY + 1, 50,
+ thaw_func,
+ model,
+ NULL);
g_source_set_name_by_id (model->dir_thaw_source, "[gtk+] thaw_func");
}
diff --git a/gtk/gtkgesturelongpress.c b/gtk/gtkgesturelongpress.c
index 948b5de9ac..2630c84238 100644
--- a/gtk/gtkgesturelongpress.c
+++ b/gtk/gtkgesturelongpress.c
@@ -142,7 +142,7 @@ gtk_gesture_long_press_begin (GtkGesture *gesture,
gtk_gesture_get_point (gesture, sequence,
&priv->initial_x, &priv->initial_y);
- priv->timeout_id = gdk_threads_add_timeout (delay, _gtk_gesture_long_press_timeout, gesture);
+ priv->timeout_id = g_timeout_add (delay, _gtk_gesture_long_press_timeout, gesture);
g_source_set_name_by_id (priv->timeout_id, "[gtk+] _gtk_gesture_long_press_timeout");
}
diff --git a/gtk/gtkgesturemultipress.c b/gtk/gtkgesturemultipress.c
index 1f4f0e50af..ee925a0378 100644
--- a/gtk/gtkgesturemultipress.c
+++ b/gtk/gtkgesturemultipress.c
@@ -151,9 +151,7 @@ _gtk_gesture_multi_press_update_timeout (GtkGestureMultiPress *gesture)
settings = gtk_widget_get_settings (widget);
g_object_get (settings, "gtk-double-click-time", &double_click_time, NULL);
- priv->double_click_timeout_id = gdk_threads_add_timeout (double_click_time,
- _double_click_timeout_cb,
- gesture);
+ priv->double_click_timeout_id = g_timeout_add (double_click_time, _double_click_timeout_cb, gesture);
g_source_set_name_by_id (priv->double_click_timeout_id, "[gtk+] _double_click_timeout_cb");
}
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 0a7ed4be88..9246f9391e 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1851,8 +1851,7 @@ gtk_icon_view_motion (GtkEventController *controller,
icon_view->priv->event_last_y = icon_view->priv->mouse_x;
if (icon_view->priv->scroll_timeout_id == 0) {
- icon_view->priv->scroll_timeout_id = gdk_threads_add_timeout (30, rubberband_scroll_timeout,
- icon_view);
+ icon_view->priv->scroll_timeout_id = g_timeout_add (30, rubberband_scroll_timeout, icon_view);
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] rubberband_scroll_timeout");
}
}
@@ -6397,8 +6396,7 @@ gtk_icon_view_drag_motion (GtkWidget *widget,
{
if (icon_view->priv->scroll_timeout_id == 0)
{
- icon_view->priv->scroll_timeout_id =
- gdk_threads_add_timeout (50, drag_scroll_timeout, icon_view);
+ icon_view->priv->scroll_timeout_id = g_timeout_add (50, drag_scroll_timeout, icon_view);
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] drag_scroll_timeout");
}
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index ffcaafddd2..921592666c 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -3380,11 +3380,11 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
? -MENU_SCROLL_STEP2
: -MENU_SCROLL_STEP1;
- priv->scroll_timeout =
- gdk_threads_add_timeout (scroll_fast
- ? MENU_SCROLL_TIMEOUT2
- : MENU_SCROLL_TIMEOUT1,
- gtk_menu_scroll_timeout, menu);
+ priv->scroll_timeout = g_timeout_add (scroll_fast
+ ? MENU_SCROLL_TIMEOUT2
+ : MENU_SCROLL_TIMEOUT1,
+ gtk_menu_scroll_timeout,
+ menu);
g_source_set_name_by_id (priv->scroll_timeout, "[gtk+] gtk_menu_scroll_timeout");
}
else if (!enter && !in_arrow && priv->upper_arrow_prelight)
@@ -3451,11 +3451,11 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
? MENU_SCROLL_STEP2
: MENU_SCROLL_STEP1;
- priv->scroll_timeout =
- gdk_threads_add_timeout (scroll_fast
- ? MENU_SCROLL_TIMEOUT2
- : MENU_SCROLL_TIMEOUT1,
- gtk_menu_scroll_timeout, menu);
+ priv->scroll_timeout = g_timeout_add (scroll_fast
+ ? MENU_SCROLL_TIMEOUT2
+ : MENU_SCROLL_TIMEOUT1,
+ gtk_menu_scroll_timeout,
+ menu);
g_source_set_name_by_id (priv->scroll_timeout, "[gtk+] gtk_menu_scroll_timeout");
}
else if (!enter && !in_arrow && priv->lower_arrow_prelight)
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index e7bacd2a88..7dddb7adc9 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1568,9 +1568,7 @@ _gtk_menu_item_popup_submenu (GtkWidget *widget,
info->menu_item = menu_item;
info->trigger_event = gtk_get_current_event ();
- priv->timer = gdk_threads_add_timeout (popup_delay,
- gtk_menu_item_popup_timeout,
- info);
+ priv->timer = g_timeout_add (popup_delay, gtk_menu_item_popup_timeout, info);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_menu_item_popup_timeout");
return;
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 4e7e7dee46..b14449dc9b 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2738,9 +2738,9 @@ gtk_notebook_motion (GtkEventController *controller,
if (!priv->dnd_timer)
{
priv->has_scrolled = TRUE;
- priv->dnd_timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
+ priv->dnd_timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
scroll_notebook_timer,
- (gpointer) notebook);
+ notebook);
g_source_set_name_by_id (priv->dnd_timer, "[gtk+] scroll_notebook_timer");
}
}
@@ -3138,9 +3138,7 @@ gtk_notebook_drag_motion (GtkWidget *widget,
if (!priv->switch_tab_timer)
{
- priv->switch_tab_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
- gtk_notebook_switch_tab_timeout,
- widget);
+ priv->switch_tab_timer = g_timeout_add (TIMEOUT_EXPAND, gtk_notebook_switch_tab_timeout, widget);
g_source_set_name_by_id (priv->switch_tab_timer, "[gtk+] gtk_notebook_switch_tab_timeout");
}
}
@@ -4127,9 +4125,9 @@ gtk_notebook_timer (GtkNotebook *notebook)
if (priv->need_timer)
{
priv->need_timer = FALSE;
- priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
- (GSourceFunc) gtk_notebook_timer,
- (gpointer) notebook);
+ priv->timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
+ (GSourceFunc) gtk_notebook_timer,
+ notebook);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
}
else
@@ -4146,9 +4144,9 @@ gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
if (!priv->timer)
{
- priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
- (GSourceFunc) gtk_notebook_timer,
- (gpointer) notebook);
+ priv->timer = g_timeout_add (TIMEOUT_INITIAL,
+ (GSourceFunc) gtk_notebook_timer,
+ notebook);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
priv->need_timer = TRUE;
}
diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c
index 2d11bce5b0..71c5688f68 100644
--- a/gtk/gtkprintoperation-win32.c
+++ b/gtk/gtkprintoperation-win32.c
@@ -517,7 +517,7 @@ win32_poll_status_timeout (GtkPrintOperation *op)
win32_poll_status (op);
if (!gtk_print_operation_is_finished (op)) {
- op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
+ op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
(GSourceFunc)win32_poll_status_timeout,
op);
g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
@@ -561,7 +561,7 @@ win32_end_run (GtkPrintOperation *op,
{
op_win32->printerHandle = printerHandle;
win32_poll_status (op);
- op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
+ op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
(GSourceFunc)win32_poll_status_timeout,
op);
g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index cd2a082af3..68a2e1555c 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -3008,9 +3008,9 @@ print_pages (GtkPrintOperation *op,
G_CALLBACK (handle_progress_response), op);
priv->show_progress_timeout_id =
- gdk_threads_add_timeout (SHOW_PROGRESS_TIME,
- (GSourceFunc)show_progress_timeout,
- data);
+ g_timeout_add (SHOW_PROGRESS_TIME,
+ (GSourceFunc) show_progress_timeout,
+ data);
g_source_set_name_by_id (priv->show_progress_timeout_id, "[gtk+] show_progress_timeout");
data->progress = progress;
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index d6464e30f0..54b4186af3 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2890,9 +2890,7 @@ initial_timeout (gpointer data)
GtkRange *range = GTK_RANGE (data);
GtkRangePrivate *priv = range->priv;
- priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT,
- second_timeout,
- range);
+ priv->timer->timeout_id = g_timeout_add (TIMEOUT_REPEAT, second_timeout, range);
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] second_timeout");
return G_SOURCE_REMOVE;
}
@@ -2908,9 +2906,7 @@ gtk_range_add_step_timer (GtkRange *range,
priv->timer = g_new (GtkRangeStepTimer, 1);
- priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL,
- initial_timeout,
- range);
+ priv->timer->timeout_id = g_timeout_add (TIMEOUT_INITIAL, initial_timeout, range);
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] initial_timeout");
priv->timer->step = step;
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index b241ba251f..d6806da57c 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -1422,7 +1422,7 @@ gtk_recent_manager_changed (GtkRecentManager *manager)
*/
if (manager->priv->changed_timeout == 0)
{
- manager->priv->changed_timeout = gdk_threads_add_timeout (250, emit_manager_changed, manager);
+ manager->priv->changed_timeout = g_timeout_add (250, emit_manager_changed, manager);
g_source_set_name_by_id (manager->priv->changed_timeout, "[gtk+] emit_manager_changed");
}
else
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 7936c8b877..704d6c1581 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1161,7 +1161,7 @@ check_update_scrollbar_proximity (GtkScrolledWindow *sw,
indicator_set_over (indicator, TRUE);
else if (indicator_close && !on_other_scrollbar)
{
- indicator->over_timeout_id = gdk_threads_add_timeout (30, enable_over_timeout_cb, indicator);
+ indicator->over_timeout_id = g_timeout_add (30, enable_over_timeout_cb, indicator);
g_source_set_name_by_id (indicator->over_timeout_id, "[gtk+] enable_over_timeout_cb");
}
else
@@ -1381,7 +1381,7 @@ scroll_controller_scroll (GtkEventControllerScroll *scroll,
_gtk_scrolled_window_get_overshoot (scrolled_window, NULL, NULL))
{
priv->scroll_events_overshoot_id =
- gdk_threads_add_timeout (50, start_scroll_deceleration_cb, scrolled_window);
+ g_timeout_add (50, start_scroll_deceleration_cb, scrolled_window);
g_source_set_name_by_id (priv->scroll_events_overshoot_id,
"[gtk+] start_scroll_deceleration_cb");
}
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index af5784bfd3..1f28ceef2b 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -775,7 +775,7 @@ start_spinning (GtkSpinButton *spin,
{
priv->timer_step = step;
priv->need_timer = TRUE;
- priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
+ priv->timer = g_timeout_add (TIMEOUT_INITIAL,
(GSourceFunc) gtk_spin_button_timer,
(gpointer) spin);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_spin_button_timer");
@@ -1153,9 +1153,9 @@ gtk_spin_button_timer (GtkSpinButton *spin_button)
if (priv->need_timer)
{
priv->need_timer = FALSE;
- priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT,
- (GSourceFunc) gtk_spin_button_timer,
- (gpointer) spin_button);
+ priv->timer = g_timeout_add (TIMEOUT_REPEAT,
+ (GSourceFunc) gtk_spin_button_timer,
+ spin_button);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_spin_button_timer");
}
else
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index 36c2f2ea27..5495591ab8 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -327,9 +327,9 @@ gtk_stack_switcher_drag_motion (GtkWidget *widget,
if (button && !priv->switch_timer)
{
- priv->switch_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
- gtk_stack_switcher_switch_timeout,
- self);
+ priv->switch_timer = g_timeout_add (TIMEOUT_EXPAND,
+ gtk_stack_switcher_switch_timeout,
+ self);
g_source_set_name_by_id (priv->switch_timer, "[gtk+] gtk_stack_switcher_switch_timeout");
}
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 9dbfa52537..171467c0b0 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -5877,16 +5877,16 @@ blink_cb (gpointer data)
}
else if (visible)
{
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- text_view);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
else
{
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- text_view);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
priv->blink_time += get_cursor_time (text_view);
}
@@ -5935,9 +5935,9 @@ gtk_text_view_check_cursor_blink (GtkTextView *text_view)
{
gtk_text_layout_set_cursor_visible (priv->layout, TRUE);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- text_view);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
@@ -5967,9 +5967,9 @@ gtk_text_view_pend_cursor_blink (GtkTextView *text_view)
gtk_text_view_stop_cursor_blink (text_view);
gtk_text_layout_set_cursor_visible (priv->layout, TRUE);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- text_view);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
@@ -7327,8 +7327,7 @@ gtk_text_view_drag_gesture_update (GtkGestureDrag *gesture,
if (text_view->priv->scroll_timeout != 0) /* reset on every motion event */
g_source_remove (text_view->priv->scroll_timeout);
- text_view->priv->scroll_timeout =
- gdk_threads_add_timeout (50, selection_scan_timeout, text_view);
+ text_view->priv->scroll_timeout = g_timeout_add (50, selection_scan_timeout, text_view);
g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] selection_scan_timeout");
gtk_text_view_selection_bubble_popup_unset (text_view);
@@ -8021,8 +8020,7 @@ gtk_text_view_drag_motion (GtkWidget *widget,
if (!priv->scroll_timeout)
{
- priv->scroll_timeout =
- gdk_threads_add_timeout (100, drag_scan_timeout, text_view);
+ priv->scroll_timeout = g_timeout_add (100, drag_scan_timeout, text_view);
g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] drag_scan_timeout");
}
@@ -9086,9 +9084,7 @@ gtk_text_view_selection_bubble_popup_set (GtkTextView *text_view)
if (priv->selection_bubble_timeout_id)
g_source_remove (priv->selection_bubble_timeout_id);
- priv->selection_bubble_timeout_id =
- gdk_threads_add_timeout (50, gtk_text_view_selection_bubble_popup_show,
- text_view);
+ priv->selection_bubble_timeout_id = g_timeout_add (50, gtk_text_view_selection_bubble_popup_show, text_view);
g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_text_view_selection_bubble_popup_cb");
}
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index eed1a56380..80b340a70a 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -965,10 +965,10 @@ gtk_tooltip_hide_tooltip (GtkTooltip *tooltip)
if (!tooltip->browse_mode_timeout_id)
{
tooltip->browse_mode_timeout_id =
- gdk_threads_add_timeout_full (0, timeout,
- tooltip_browse_mode_expired,
- g_object_ref (tooltip),
- g_object_unref);
+ g_timeout_add_full (0, timeout,
+ tooltip_browse_mode_expired,
+ g_object_ref (tooltip),
+ g_object_unref);
g_source_set_name_by_id (tooltip->browse_mode_timeout_id, "[gtk+] tooltip_browse_mode_expired");
}
}
@@ -1029,10 +1029,10 @@ gtk_tooltip_start_delay (GdkDisplay *display)
else
timeout = HOVER_TIMEOUT;
- tooltip->timeout_id = gdk_threads_add_timeout_full (0, timeout,
- tooltip_popup_timeout,
- g_object_ref (display),
- g_object_unref);
+ tooltip->timeout_id = g_timeout_add_full (0, timeout,
+ tooltip_popup_timeout,
+ g_object_ref (display),
+ g_object_unref);
g_source_set_name_by_id (tooltip->timeout_id, "[gtk+] tooltip_popup_timeout");
}
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 85711511e7..fb0c380e6f 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -3486,7 +3486,7 @@ do_prelight (GtkTreeView *tree_view,
if (tree_view->priv->hover_expand)
{
tree_view->priv->auto_expand_timeout =
- gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
+ g_timeout_add (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->auto_expand_timeout, "[gtk+] auto_expand_timeout");
}
}
@@ -7122,8 +7122,7 @@ add_scroll_timeout (GtkTreeView *tree_view)
{
if (tree_view->priv->scroll_timeout == 0)
{
- tree_view->priv->scroll_timeout =
- gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
+ tree_view->priv->scroll_timeout = g_timeout_add (150, scroll_row_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->scroll_timeout, "[gtk+] scroll_row_timeout");
}
}
@@ -7687,7 +7686,7 @@ gtk_tree_view_drag_motion (GtkWidget *widget,
pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE))
{
tree_view->priv->open_dest_timeout =
- gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
+ g_timeout_add (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->open_dest_timeout, "[gtk+] open_row_timeout");
}
else
@@ -10811,9 +10810,9 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view,
}
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
- (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
- tree_view);
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
+ tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
/* send focus-in event */
@@ -14383,8 +14382,8 @@ gtk_tree_view_search_preedit_changed (GtkIMContext *im_context,
{
g_source_remove (tree_view->priv->typeselect_flush_timeout);
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
- (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
}
@@ -14437,8 +14436,10 @@ static void
gtk_tree_view_search_enable_popdown (GtkWidget *widget,
gpointer data)
{
- guint id;
- id = gdk_threads_add_timeout_full (G_PRIORITY_HIGH, 200, gtk_tree_view_real_search_enable_popdown, g_object_ref (data), g_object_unref);
+ guint id = g_timeout_add_full (G_PRIORITY_HIGH, 200,
+ gtk_tree_view_real_search_enable_popdown,
+ g_object_ref (data),
+ g_object_unref);
g_source_set_name_by_id (id, "[gtk+] gtk_tree_view_real_search_enable_popdown");
}
@@ -14482,7 +14483,7 @@ gtk_tree_view_search_scroll_event (GtkWidget *widget,
{
g_source_remove (tree_view->priv->typeselect_flush_timeout);
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
@@ -14559,7 +14560,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
{
g_source_remove (tree_view->priv->typeselect_flush_timeout);
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
@@ -14812,7 +14813,7 @@ gtk_tree_view_search_init (GtkWidget *entry,
{
g_source_remove (tree_view->priv->typeselect_flush_timeout);
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 296aa5dc1f..3e20ca80c7 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -10690,7 +10690,7 @@ _gtk_window_schedule_mnemonics_visible (GtkWindow *window)
return;
window->priv->mnemonics_display_timeout_id =
- gdk_threads_add_timeout (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, window);
+ g_timeout_add (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, window);
g_source_set_name_by_id (window->priv->mnemonics_display_timeout_id, "[gtk+] schedule_mnemonics_visible_cb");
}
diff --git a/gtk/inspector/misc-info.c b/gtk/inspector/misc-info.c
index 2c364187a3..6d7ddb2377 100644
--- a/gtk/inspector/misc-info.c
+++ b/gtk/inspector/misc-info.c
@@ -542,7 +542,7 @@ map (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_inspector_misc_info_parent_class)->map (widget);
- sl->priv->update_source_id = gdk_threads_add_timeout_seconds (1, update_info, sl);
+ sl->priv->update_source_id = g_timeout_add_seconds (1, update_info, sl);
update_info (sl);
}
diff --git a/gtk/inspector/statistics.c b/gtk/inspector/statistics.c
index 5bf6e7c145..bce187b9d6 100644
--- a/gtk/inspector/statistics.c
+++ b/gtk/inspector/statistics.c
@@ -151,9 +151,7 @@ toggle_record (GtkToggleButton *button,
if (gtk_toggle_button_get_active (button))
{
- sl->priv->update_source_id = gdk_threads_add_timeout_seconds (1,
- update_type_counts,
- sl);
+ sl->priv->update_source_id = g_timeout_add_seconds (1, update_type_counts, sl);
update_type_counts (sl);
}
else