[gtk+] gtk: Don't use GDK_THREADS_ENTER/LEAVE macros internally



commit 8d0e88bac77c81bbe3e9ae62639bbc9629c195dd
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 28 14:52:40 2012 +0200

    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.

 gtk/a11y/gailmisc.c          |    4 ++--
 gtk/gtkclipboard-wayland.c   |    4 ++--
 gtk/gtkclipboard.c           |   24 ++++++++++++------------
 gtk/gtkdialog.c              |    4 ++--
 gtk/gtkfilechooserdefault.c  |   14 +++++++-------
 gtk/gtkmain.c                |   16 ++++++++--------
 gtk/gtkprinter.c             |    4 ++--
 gtk/gtkprintoperation-unix.c |    8 ++++----
 gtk/gtkprintoperation.c      |    4 ++--
 gtk/gtktoolitemgroup.c       |    4 ++--
 gtk/gtktreeview.c            |    4 ++--
 11 files changed, 45 insertions(+), 45 deletions(-)
---
diff --git a/gtk/a11y/gailmisc.c b/gtk/a11y/gailmisc.c
index 038a889..6b7e5fb 100644
--- a/gtk/a11y/gailmisc.c
+++ b/gtk/a11y/gailmisc.c
@@ -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
diff --git a/gtk/gtkclipboard-wayland.c b/gtk/gtkclipboard-wayland.c
index ef8366e..3ed3b4e 100644
--- a/gtk/gtkclipboard-wayland.c
+++ b/gtk/gtkclipboard-wayland.c
@@ -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);
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index 368b413..e0b736f 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -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);
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 87b46a3..b88ca5f 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -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);
 
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index cec6852..2db244d 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -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;
 }
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 596a3fb..cce6416 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -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);
diff --git a/gtk/gtkprinter.c b/gtk/gtkprinter.c
index ada20b5..fac0136 100644
--- a/gtk/gtkprinter.c
+++ b/gtk/gtkprinter.c
@@ -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 ();  
     }
 }
 
diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c
index adb3f55..59db658 100644
--- a/gtk/gtkprintoperation-unix.c
+++ b/gtk/gtkprintoperation-unix.c
@@ -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;
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index 937889d..8cb69d3 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -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;
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index 8221571..b61e1a1 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -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;
 }
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 7bb7fc9..686310c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -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;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]