mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 13:11:13 +00:00
gtk: Don't use GDK_THREADS_ENTER/LEAVE macros internally
These are just wrappers for the functions, and we want to deprecate them. Stopping to use them internally is a good first step.
This commit is contained in:
parent
144a5687c9
commit
8d0e88bac7
@ -26,13 +26,13 @@ G_DEFINE_TYPE (GailMisc, _gail_misc, ATK_TYPE_MISC)
|
||||
static void
|
||||
gail_misc_threads_enter (AtkMisc *misc)
|
||||
{
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
|
||||
static void
|
||||
gail_misc_threads_leave (AtkMisc *misc)
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -674,9 +674,9 @@ gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
|
||||
|
||||
if (g_main_loop_is_running (closure->loop))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (closure->loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
|
||||
g_main_loop_unref (closure->loop);
|
||||
|
@ -1410,9 +1410,9 @@ gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
|
||||
|
||||
if (g_main_loop_is_running (results.loop))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (results.loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
|
||||
g_main_loop_unref (results.loop);
|
||||
@ -1463,9 +1463,9 @@ gtk_clipboard_wait_for_text (GtkClipboard *clipboard)
|
||||
|
||||
if (g_main_loop_is_running (results.loop))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (results.loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
|
||||
g_main_loop_unref (results.loop);
|
||||
@ -1531,9 +1531,9 @@ gtk_clipboard_wait_for_rich_text (GtkClipboard *clipboard,
|
||||
|
||||
if (g_main_loop_is_running (results.loop))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (results.loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
|
||||
g_main_loop_unref (results.loop);
|
||||
@ -1591,9 +1591,9 @@ gtk_clipboard_wait_for_image (GtkClipboard *clipboard)
|
||||
|
||||
if (g_main_loop_is_running (results.loop))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (results.loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
|
||||
g_main_loop_unref (results.loop);
|
||||
@ -1646,9 +1646,9 @@ gtk_clipboard_wait_for_uris (GtkClipboard *clipboard)
|
||||
|
||||
if (g_main_loop_is_running (results.loop))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (results.loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
|
||||
g_main_loop_unref (results.loop);
|
||||
@ -2132,9 +2132,9 @@ gtk_clipboard_store (GtkClipboard *clipboard)
|
||||
|
||||
if (g_main_loop_is_running (clipboard->store_loop))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (clipboard->store_loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
|
||||
g_main_loop_unref (clipboard->store_loop);
|
||||
|
@ -1106,9 +1106,9 @@ gtk_dialog_run (GtkDialog *dialog)
|
||||
|
||||
ri.loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (ri.loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
g_main_loop_unref (ri.loop);
|
||||
|
||||
|
@ -2249,7 +2249,7 @@ add_idle_while_impl_is_alive (GtkFileChooserDefault *impl, GCallback callback)
|
||||
static gboolean
|
||||
edited_idle_cb (GtkFileChooserDefault *impl)
|
||||
{
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
g_source_destroy (impl->edited_idle);
|
||||
impl->edited_idle = NULL;
|
||||
@ -2287,7 +2287,7 @@ edited_idle_cb (GtkFileChooserDefault *impl)
|
||||
impl->edited_new_text = NULL;
|
||||
}
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -6779,14 +6779,14 @@ file_system_model_got_thumbnail (GObject *object, GAsyncResult *res, gpointer da
|
||||
if (queried == NULL)
|
||||
return;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
/* now we know model is valid */
|
||||
|
||||
/* file was deleted */
|
||||
if (!_gtk_file_system_model_get_iter_for_file (model, &iter, file))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -6800,7 +6800,7 @@ file_system_model_got_thumbnail (GObject *object, GAsyncResult *res, gpointer da
|
||||
|
||||
g_object_unref (info);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -9333,7 +9333,7 @@ search_entry_activate_cb (GtkEntry *entry,
|
||||
static gboolean
|
||||
focus_entry_idle_cb (GtkFileChooserDefault *impl)
|
||||
{
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
g_source_destroy (impl->focus_entry_idle);
|
||||
impl->focus_entry_idle = NULL;
|
||||
@ -9341,7 +9341,7 @@ focus_entry_idle_cb (GtkFileChooserDefault *impl)
|
||||
if (impl->search_entry)
|
||||
gtk_widget_grab_focus (impl->search_entry);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -1158,9 +1158,9 @@ gtk_main (void)
|
||||
|
||||
if (g_main_loop_is_running (main_loops->data))
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
gdk_flush ();
|
||||
}
|
||||
|
||||
@ -1235,9 +1235,9 @@ gtk_events_pending (void)
|
||||
{
|
||||
gboolean result;
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
result = g_main_context_pending (NULL);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -1258,9 +1258,9 @@ gtk_events_pending (void)
|
||||
gboolean
|
||||
gtk_main_iteration (void)
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_context_iteration (NULL, TRUE);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
if (main_loops)
|
||||
return !g_main_loop_is_running (main_loops->data);
|
||||
@ -1282,9 +1282,9 @@ gtk_main_iteration (void)
|
||||
gboolean
|
||||
gtk_main_iteration_do (gboolean blocking)
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_context_iteration (NULL, blocking);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
if (main_loops)
|
||||
return !g_main_loop_is_running (main_loops->data);
|
||||
|
@ -1264,9 +1264,9 @@ gtk_enumerate_printers (GtkPrinterFunc func,
|
||||
{
|
||||
printer_list->loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (printer_list->loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -383,9 +383,9 @@ unix_end_run (GtkPrintOperation *op,
|
||||
g_object_ref (op);
|
||||
if (!op_unix->data_sent)
|
||||
{
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (op_unix->loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
}
|
||||
g_main_loop_unref (op_unix->loop);
|
||||
op_unix->loop = NULL;
|
||||
@ -876,9 +876,9 @@ _gtk_print_operation_platform_backend_run_dialog (GtkPrintOperation *op,
|
||||
find_printer (printer_name,
|
||||
(GFunc) found_printer, &rdata);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (rdata.loop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
g_main_loop_unref (rdata.loop);
|
||||
rdata.loop = NULL;
|
||||
|
@ -3064,9 +3064,9 @@ print_pages (GtkPrintOperation *op,
|
||||
priv->rloop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
g_object_ref (op);
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
g_main_loop_run (priv->rloop);
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
g_main_loop_unref (priv->rloop);
|
||||
priv->rloop = NULL;
|
||||
|
@ -1861,7 +1861,7 @@ gtk_tool_item_group_animation_cb (gpointer data)
|
||||
gint64 timestamp = gtk_tool_item_group_get_animation_timestamp (group);
|
||||
gboolean retval;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
/* Enque this early to reduce number of expose events. */
|
||||
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (group));
|
||||
@ -1874,7 +1874,7 @@ gtk_tool_item_group_animation_cb (gpointer data)
|
||||
|
||||
retval = (priv->animation_timeout != NULL);
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
@ -7166,7 +7166,7 @@ drag_scan_timeout (gpointer data)
|
||||
GtkTreeViewColumn *column = NULL;
|
||||
GdkRectangle visible_rect;
|
||||
|
||||
GDK_THREADS_ENTER ();
|
||||
gdk_threads_enter ();
|
||||
|
||||
tree_view = GTK_TREE_VIEW (data);
|
||||
|
||||
@ -7204,7 +7204,7 @@ drag_scan_timeout (gpointer data)
|
||||
}
|
||||
}
|
||||
|
||||
GDK_THREADS_LEAVE ();
|
||||
gdk_threads_leave ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user