]> Pileus Git - ~andy/gtk/commitdiff
Replace a lot of idle and timeout calls by the new gdk_threads api.
authorMatthias Clasen <mclasen@redhat.com>
Fri, 22 Dec 2006 19:10:43 +0000 (19:10 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 22 Dec 2006 19:10:43 +0000 (19:10 +0000)
2006-12-22  Matthias Clasen  <mclasen@redhat.com>

        * *.c: Replace a lot of idle and timeout calls by
        the new gdk_threads api.

70 files changed:
ChangeLog
demos/gtk-demo/images.c
demos/gtk-demo/pixbufs.c
demos/pixbuf-demo.c
demos/testanimation.c
demos/testpixbuf.c
docs/tools/widgets.c
examples/gtkdial/gtkdial.c
examples/progressbar/progressbar.c
gdk/directfb/gdkwindow-directfb.c
gdk/gdk.h
gdk/gdkwindow.c
gdk/win32/gdkinput-win32.c
gtk/gtkbutton.c
gtk/gtkcalendar.c
gtk/gtkcellrenderertext.c
gtk/gtkclipboard.c
gtk/gtkclist.c
gtk/gtkcombo.c
gtk/gtkcombobox.c
gtk/gtkcontainer.c
gtk/gtkdnd.c
gtk/gtkentry.c
gtk/gtkexpander.c
gtk/gtkfilechooserdefault.c
gtk/gtkfilesystemunix.c
gtk/gtkfilesystemwin32.c
gtk/gtkicontheme.c
gtk/gtkiconview.c
gtk/gtkimage.c
gtk/gtklist.c
gtk/gtkmenu.c
gtk/gtkmenuitem.c
gtk/gtknotebook.c
gtk/gtkpathbar.c
gtk/gtkprintoperation-unix.c
gtk/gtkprintoperation-win32.c
gtk/gtkprintoperation.c
gtk/gtkprintunixdialog.c
gtk/gtkrange.c
gtk/gtkrecentchooserdefault.c
gtk/gtkrecentchoosermenu.c
gtk/gtkrecentmanager.c
gtk/gtkselection.c
gtk/gtkspinbutton.c
gtk/gtkstatusicon.c
gtk/gtktext.c
gtk/gtktextview.c
gtk/gtktoolbar.c
gtk/gtktooltips.c
gtk/gtktreeview.c
gtk/gtkuimanager.c
gtk/gtkwindow.c
modules/printbackends/cups/gtkprintbackendcups.c
perf/gtkwidgetprofiler.c
tests/autotestfilechooser.c
tests/autotestfilesystem.c
tests/stresstest-toolbar.c
tests/testassistant.c
tests/testcombo.c
tests/testcombochange.c
tests/testdnd.c
tests/testentrycompletion.c
tests/testmenus.c
tests/testmerge.c
tests/testsocket_common.c
tests/teststatusicon.c
tests/testtext.c
tests/testtoolbar.c
tests/testtreeflow.c

index f7afb996fff4d3ddc15ab4a1abec18fc25065217..05cc5c5a8d16671a0453f87dd086ab2749c582ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-12-22  Matthias Clasen  <mclasen@redhat.com>
 
+       * *.c: Replace a lot of idle and timeout calls by
+       the new gdk_threads api. 
+
        * gdk/gdk.symbols:
        * gdk/gdk.h:
        * gdk/gdk.c: Add functions to allow threadsafe handling
index 7fc1fa7c141df47aecf0f81e53a2e513a1dffb3b..ce22eb56aaae14772a734ebb24a15ca8fb26e879 100644 (file)
@@ -255,7 +255,7 @@ start_progressive_loading (GtkWidget *image)
    * The timeout simply simulates a slow data source by inserting
    * pauses in the reading process.
    */
-  load_timeout = g_timeout_add (150,
+  load_timeout = gdk_threads_add_timeout (150,
                                progressive_timeout,
                                image);
 }
index 18dd1ff81693eae9e768cee46687cc7ef4590733..5fad5aa7f7a84cd0520bf7bd9c2385a07f83a162 100644 (file)
@@ -187,7 +187,9 @@ timeout (gpointer data)
                               : MAX (127, fabs (255 * cos (f * 2.0 * G_PI)))));
     }
 
+  GDK_THREADS_ENTER ();
   gtk_widget_queue_draw (da);
+  GDK_THREADS_LEAVE ();
 
   frame_num++;
   return TRUE;
index eaacf83f5977b26ddf568feab2acc87dc7797564..dd6923bbccada63daf06c608817fd7d072de2157 100644 (file)
@@ -225,7 +225,7 @@ main (int argc, char **argv)
 
        gtk_container_add (GTK_CONTAINER (window), da);
 
-       timeout_id = g_timeout_add (FRAME_DELAY, timeout, NULL);
+       timeout_id = gdk_threads_add_timeout (FRAME_DELAY, timeout, NULL);
 
        gtk_widget_show_all (window);
        gtk_main ();
index 5b2da4a228bb55e0ed233e20abd38702d94c0d19..029f69c9b79a8651171ad1eea761a58be256ab84 100644 (file)
@@ -301,7 +301,7 @@ start_progressive_loading (GtkWidget *image)
    * The timeout simply simulates a slow data source by inserting
    * pauses in the reading process.
    */
-  lc->load_timeout = g_timeout_add (100,
+  lc->load_timeout = gdk_threads_add_timeout (100,
                                     progressive_timeout,
                                     image);
 }
index 676171bb4392c41e8a06d9b8e13e01297c1db76a..84011004a98940c50113267500a6875a90e2553d 100644 (file)
@@ -628,7 +628,7 @@ main (int argc, char **argv)
 
                        status.readlen = readlen;
 
-                        status.timeout = g_timeout_add (100, update_timeout, &status);
+                        status.timeout = gdk_threads_add_timeout (100, update_timeout, &status);
                 }
 #endif
        }
index 2675632b632045252ed801264dba3d5fc79b1183..dc90b86cf05715fdb7efb9e0f5fc41b9bc28de32 100644 (file)
@@ -90,7 +90,7 @@ static void
 realize_callback (GtkWidget  *widget,
                  WidgetInfo *info)
 {
-  g_timeout_add (500, (GSourceFunc)adjust_size_callback, info);
+  gdk_threads_add_timeout (500, (GSourceFunc)adjust_size_callback, info);
 }
 
 static WidgetInfo *
index 5ea5962614f40ce5cbca8adbb00f805c0c6c219b..5749e92ad85439e4b3d3fd01bb192abbca556f54 100644 (file)
@@ -585,8 +585,8 @@ gtk_dial_update_mouse( GtkDial *dial, gint x, gint y )
              if (dial->timer)
                g_source_remove (dial->timer);
 
-             dial->timer = g_timeout_add (SCROLL_DELAY_LENGTH,
-                                          (GtkFunction) gtk_dial_timer,
+             dial->timer = gdk_threads_add_timeout (SCROLL_DELAY_LENGTH,
+                                          (GSourceFunc) gtk_dial_timer,
                                           (gpointer) dial);
            }
        }
index aefebab3b4b3e38175c22e5670c1dea3ca17679a..fb219d0b8285f80ad037cd3a4189e7fec0475867 100644 (file)
@@ -134,7 +134,7 @@ int main( int   argc,
     gtk_widget_show (pdata->pbar);
 
     /* Add a timer callback to update the value of the progress bar */
-    pdata->timer = g_timeout_add (100, progress_timeout, pdata);
+    pdata->timer = gdk_threads_add_timeout (100, progress_timeout, pdata);
 
     separator = gtk_hseparator_new ();
     gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
index ffa11e9838d177ff69f8a13a0a56ed179b8128e6..0a683de033157b9e5a684354a5e509ae82905ee6 100644 (file)
@@ -100,9 +100,7 @@ gdk_window_directfb_process_all_updates (void)
 static gboolean
 gdk_window_update_idle (gpointer data)
 {
-  GDK_THREADS_ENTER ();
   gdk_window_directfb_process_all_updates ();
-  GDK_THREADS_LEAVE ();
   
   return FALSE;
 }
@@ -115,7 +113,7 @@ gdk_window_schedule_update (GdkWindow *window)
 
   if (!update_idle)
     {
-      update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
+      update_idle = gdk_threads_add_idle (GDK_PRIORITY_REDRAW,
                                     gdk_window_update_idle, NULL, NULL);
     }
 }
index 861198d474470d4449ecb460e971284ba7828b3d..016b59054097fb892493341064d73cd5a84e7184 100644 (file)
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -209,6 +209,23 @@ guint    gdk_threads_add_timeout          (guint          interval,
                                            gpointer       data);
 
 
+guint gdk_threads_add_idle_full (gint           priority,
+                GSourceFunc    function,
+                gpointer       data,
+                GDestroyNotify notify);
+guint gdk_threads_add_idle (GSourceFunc    function,
+                gpointer       data);
+
+guint gdk_threads_add_timeout_full (gint           priority,
+    guint          interval,
+    GSourceFunc    function,
+    gpointer       data,
+    GDestroyNotify notify);
+guint gdk_threads_add_timeout (guint interval,
+    GSourceFunc    function,
+    gpointer       data);
+
+
 #ifdef G_THREADS_ENABLED
 #  define GDK_THREADS_ENTER()  G_STMT_START {  \
       if (gdk_threads_lock)                    \
index e3201c45b2e06efef903118f5783dbf4ab09ca4a..66428f5478ca26383bbeeb4e7d9cac43d1430aba 100644 (file)
@@ -2240,9 +2240,7 @@ static gboolean debug_updates = FALSE;
 static gboolean
 gdk_window_update_idle (gpointer data)
 {
-  GDK_THREADS_ENTER ();
   gdk_window_process_all_updates ();
-  GDK_THREADS_LEAVE ();
   
   return FALSE;
 }
@@ -2255,7 +2253,7 @@ gdk_window_schedule_update (GdkWindow *window)
 
   if (!update_idle)
     {
-      update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
+      update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
                                     gdk_window_update_idle, NULL, NULL);
     }
 }
index c7bb9a3aa6ceb3ca276c949c3b2997c436ec6212..357037577d29765a2ade69465af375df9de37feb 100644 (file)
@@ -690,7 +690,7 @@ set_ignore_core (gboolean ignore)
     }
   else
     if (!ignore_core_timer)
-      ignore_core_timer = g_timeout_add (PROXIMITY_OUT_DELAY,
+      ignore_core_timer = gdk_threads_add_timeout (PROXIMITY_OUT_DELAY,
                                         ignore_core_timefunc, NULL);
 }
 #endif /* HAVE_WINTAB */
index 4c51a47d68493229109b4033cdc053f5a8f2eb7a..471d73887db3b5a24f23119c736c5dc8606016db 100644 (file)
@@ -1490,12 +1490,8 @@ gtk_real_button_released (GtkButton *button)
 static gboolean
 button_activate_timeout (gpointer data)
 {
-  GDK_THREADS_ENTER ();
-  
   gtk_button_finish_activate (data, TRUE);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -1520,7 +1516,7 @@ gtk_real_button_activate (GtkButton *button)
 
       gtk_grab_add (widget);
       
-      button->activate_timeout = g_timeout_add (ACTIVATE_TIMEOUT,
+      button->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT,
                                                button_activate_timeout,
                                                button);
       button->button_down = TRUE;
index ca862424f40695a85f0181d0537edae85c96ae25..5e9f6cada83959c48dcac6073820172925580058 100644 (file)
@@ -2374,8 +2374,6 @@ calendar_timer (gpointer data)
   GtkCalendarPrivate *priv = GTK_CALENDAR_GET_PRIVATE (calendar);
   gboolean retval = FALSE;
   
-  GDK_THREADS_ENTER ();
-
   if (priv->timer)
     {
       calendar_arrow_action (calendar, priv->click_child);
@@ -2389,7 +2387,7 @@ calendar_timer (gpointer data)
           g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
 
          priv->need_timer = FALSE;
-         priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
+         priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
                                            timeout * SCROLL_DELAY_FACTOR,
                                            (GSourceFunc) calendar_timer,
                                            (gpointer) calendar, NULL);
@@ -2398,8 +2396,6 @@ calendar_timer (gpointer data)
        retval = TRUE;
     }
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
@@ -2420,7 +2416,7 @@ calendar_start_spinning (GtkCalendar *calendar,
       g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
 
       priv->need_timer = TRUE;
-      priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
+      priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
                                        timeout,
                                        (GSourceFunc) calendar_timer,
                                        (gpointer) calendar, NULL);
index 70b6f732ee43be75cf36d2498b13d93ace08a111..0b8de55d24f3492d75b48ca8b6c29f9a271f6948 100644 (file)
@@ -1741,8 +1741,6 @@ popdown_timeout (gpointer data)
 {
   GtkCellRendererTextPrivate *priv;
 
-  GDK_THREADS_ENTER ();
-
   priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (data);
 
   priv->entry_menu_popdown_timeout = 0;
@@ -1750,8 +1748,6 @@ popdown_timeout (gpointer data)
   if (!GTK_WIDGET_HAS_FOCUS (priv->entry))
     gtk_cell_renderer_text_editing_done (GTK_CELL_EDITABLE (priv->entry), data);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -1768,7 +1764,7 @@ gtk_cell_renderer_text_popup_unmap (GtkMenu *menu,
   if (priv->entry_menu_popdown_timeout)
     return;
 
-  priv->entry_menu_popdown_timeout = g_timeout_add (500, popdown_timeout,
+  priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout,
                                                     data);
 }
 
index 96ebea5bcebd1bcb71ec041aa8a2be5720e35619..a2f0fcb765d40d07d37712cc26661b37c422b60d 100644 (file)
@@ -1862,6 +1862,8 @@ gtk_clipboard_store (GtkClipboard *clipboard)
   if (!gdk_display_supports_clipboard_persistence (clipboard->display))
     return;
 
+  g_object_ref (clipboard);
+
   clipboard_widget = get_clipboard_widget (clipboard->display);
   clipboard->notify_signal_id = g_signal_connect (clipboard_widget, "selection_notify_event",
                                                  G_CALLBACK (gtk_clipboard_selection_notify), clipboard);
@@ -1893,6 +1895,8 @@ gtk_clipboard_store (GtkClipboard *clipboard)
   clipboard->notify_signal_id = 0;
   
   clipboard->storing_selection = FALSE;
+
+  g_object_unref (clipboard);
 }
 
 /* Stores all clipboard selections on all displays, called from
index 22129cd3b7d999e364dda94172d3f9a8a1235776..652c2e9ff91ae23994495fa9beb2e6d06709b51d 100644 (file)
@@ -5264,7 +5264,7 @@ gtk_clist_motion (GtkWidget      *widget,
       if (clist->htimer)
        return FALSE;
 
-      clist->htimer = g_timeout_add
+      clist->htimer = gdk_threads_add_timeout
        (SCROLL_TIME, (GSourceFunc) horizontal_timeout, clist);
 
       if (!((x < 0 && clist->hadjustment->value == 0) ||
@@ -5296,7 +5296,7 @@ gtk_clist_motion (GtkWidget      *widget,
       if (clist->vtimer)
        return FALSE;
 
-      clist->vtimer = g_timeout_add (SCROLL_TIME,
+      clist->vtimer = gdk_threads_add_timeout (SCROLL_TIME,
                                     (GSourceFunc) vertical_timeout, clist);
 
       if (clist->drag_button &&
@@ -7039,26 +7039,18 @@ do_fake_motion (GtkWidget *widget)
 static gint
 horizontal_timeout (GtkCList *clist)
 {
-  GDK_THREADS_ENTER ();
-
   clist->htimer = 0;
   do_fake_motion (GTK_WIDGET (clist));
 
-  GDK_THREADS_LEAVE ();
-  
   return FALSE;
 }
 
 static gint
 vertical_timeout (GtkCList *clist)
 {
-  GDK_THREADS_ENTER ();
-
   clist->vtimer = 0;
   do_fake_motion (GTK_WIDGET (clist));
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
index 5dd45e470c4a9d400418b248f38f42b3413fda09..10d10b2991cd12ff8a2c609820e9cbc6b07fc4e9 100644 (file)
@@ -69,7 +69,7 @@ static void         gtk_combo_unrealize                (GtkWidget        *widget);
 static void         gtk_combo_destroy            (GtkObject        *combo);
 static GtkListItem *gtk_combo_find               (GtkCombo         *combo);
 static gchar *      gtk_combo_func               (GtkListItem      *li);
-static gint         gtk_combo_focus_idle         (GtkCombo         *combo);
+static gboolean     gtk_combo_focus_idle         (GtkCombo         *combo);
 static gint         gtk_combo_entry_focus_out    (GtkEntry         *entry,
                                                  GdkEventFocus    *event,
                                                  GtkCombo         *combo);
@@ -411,6 +411,7 @@ gtk_combo_entry_focus_out (GtkEntry * entry, GdkEventFocus * event, GtkCombo * c
                            g_cclosure_new_object (G_CALLBACK (gtk_combo_focus_idle),
                                                   G_OBJECT (combo)));
       g_source_attach (focus_idle, NULL);
+       g_source_unref (focus_idle);
       
       /*g_signal_stop_emission_by_name (entry, "focus_out_event"); */
       return TRUE;
index 900b931b453b147d745b3f24c55afcc7e70c3004..dfa61facdbb741be3945555b355db9ca0c2cbaf6 100644 (file)
@@ -3032,8 +3032,6 @@ list_popup_resize_idle (gpointer user_data)
   GtkComboBox *combo_box;
   gint x, y, width, height;
 
-  GDK_THREADS_ENTER ();
-
   combo_box = GTK_COMBO_BOX (user_data);
 
   if (combo_box->priv->tree_view &&
@@ -3047,8 +3045,6 @@ list_popup_resize_idle (gpointer user_data)
 
   combo_box->priv->resize_idle_id = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -3057,7 +3053,7 @@ gtk_combo_box_list_popup_resize (GtkComboBox *combo_box)
 {
   if (!combo_box->priv->resize_idle_id)
     combo_box->priv->resize_idle_id = 
-      g_idle_add (list_popup_resize_idle, combo_box);
+      gdk_threads_add_idle (list_popup_resize_idle, combo_box);
 }
 
 static void
@@ -3582,7 +3578,7 @@ gtk_combo_box_list_button_pressed (GtkWidget      *widget,
 
   combo_box->priv->auto_scroll = FALSE;
   if (combo_box->priv->scroll_timer == 0)
-    combo_box->priv->scroll_timer = g_timeout_add (SCROLL_TIME, 
+    combo_box->priv->scroll_timer = gdk_threads_add_timeout (SCROLL_TIME, 
                                                   (GSourceFunc) gtk_combo_box_list_scroll_timeout, 
                                                   combo_box);
 
@@ -3776,8 +3772,6 @@ gtk_combo_box_list_scroll_timeout (GtkComboBox *combo_box)
 {
   gint x, y;
 
-  GDK_THREADS_ENTER ();
-
   if (combo_box->priv->auto_scroll)
     {
       gdk_window_get_pointer (combo_box->priv->tree_view->window, 
@@ -3785,8 +3779,6 @@ gtk_combo_box_list_scroll_timeout (GtkComboBox *combo_box)
       gtk_combo_box_list_auto_scroll (combo_box, x, y);
     }
 
-  GDK_THREADS_LEAVE ();
-
   return TRUE;
 }
 
@@ -5175,8 +5167,6 @@ popdown_idle (gpointer data)
 {
   GtkComboBox *combo_box;
 
-  GDK_THREADS_ENTER ();
-
   combo_box = GTK_COMBO_BOX (data);
   
   gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (combo_box));
@@ -5184,8 +5174,6 @@ popdown_idle (gpointer data)
 
   g_object_unref (combo_box);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -5193,7 +5181,7 @@ static void
 popdown_handler (GtkWidget *widget,
                 gpointer   data)
 {
-  g_idle_add (popdown_idle, g_object_ref (data));
+  gdk_threads_add_idle (popdown_idle, g_object_ref (data));
 }
 
 static gboolean
@@ -5201,8 +5189,6 @@ popup_idle (gpointer data)
 {
   GtkComboBox *combo_box;
 
-  GDK_THREADS_ENTER ();
-
   combo_box = GTK_COMBO_BOX (data);
 
   if (GTK_IS_MENU (combo_box->priv->popup_widget) &&
@@ -5217,8 +5203,6 @@ popup_idle (gpointer data)
 
   combo_box->priv->popup_idle_id = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -5253,7 +5237,7 @@ gtk_combo_box_start_editing (GtkCellEditable *cell_editable,
    */  
   if (combo_box->priv->is_cell_renderer && 
       combo_box->priv->cell_view && !combo_box->priv->tree_view)
-    combo_box->priv->popup_idle_id = g_idle_add (popup_idle, combo_box);
+    combo_box->priv->popup_idle_id = gdk_threads_add_idle (popup_idle, combo_box);
 }
 
 
index 1d9181626f1874b369a3ad718539339332834b41..b7ced4e359d5ef5d8ee482e529b1781d7e43b07c 100644 (file)
@@ -1088,8 +1088,6 @@ gtk_container_get_resize_container (GtkContainer *container)
 static gboolean
 gtk_container_idle_sizer (gpointer data)
 {
-  GDK_THREADS_ENTER ();
-
   /* we may be invoked with a container_resize_queue of NULL, because
    * queue_resize could have been adding an extra idle function while
    * the queue still got processed. we better just ignore such case
@@ -1112,8 +1110,6 @@ gtk_container_idle_sizer (gpointer data)
 
   gdk_window_process_all_updates ();
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -1151,7 +1147,7 @@ _gtk_container_queue_resize (GtkContainer *container)
                {
                  GTK_PRIVATE_SET_FLAG (resize_container, GTK_RESIZE_PENDING);
                  if (container_resize_queue == NULL)
-                   g_idle_add_full (GTK_PRIORITY_RESIZE,
+                   gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE,
                                     gtk_container_idle_sizer,
                                     NULL, NULL);
                  container_resize_queue = g_slist_prepend (container_resize_queue, resize_container);
index a3559137e0ee455bc061f4d8875a0554e83f8aad..939f5f2cde6afc9950aaaf34a0ec889d10707d2e 100644 (file)
@@ -3453,7 +3453,7 @@ gtk_drag_drop_finished (GtkDragSourceInfo *info,
           * to respond really late, we still are OK.
           */
          gtk_drag_clear_source_info (info->context);
-         g_timeout_add (ANIM_STEP_TIME, gtk_drag_anim_timeout, anim);
+         gdk_threads_add_timeout (ANIM_STEP_TIME, gtk_drag_anim_timeout, anim);
        }
     }
 }
@@ -3531,7 +3531,7 @@ gtk_drag_drop (GtkDragSourceInfo *info,
        gtk_widget_hide (info->icon_window);
        
       gdk_drag_drop (info->context, time);
-      info->drop_timeout = g_timeout_add (DROP_ABORT_TIME,
+      info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
                                          gtk_drag_abort_timeout,
                                          info);
     }
@@ -3680,8 +3680,6 @@ gtk_drag_anim_timeout (gpointer data)
   gint x, y;
   gboolean retval;
 
-  GDK_THREADS_ENTER ();
-  
   if (anim->step == anim->n_steps)
     {
       gtk_drag_source_info_destroy (anim->info);
@@ -3711,8 +3709,6 @@ gtk_drag_anim_timeout (gpointer data)
       retval = TRUE;
     }
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
@@ -3812,8 +3808,6 @@ gtk_drag_update_idle (gpointer data)
   GdkDragAction possible_actions;
   guint32 time;
 
-  GDK_THREADS_ENTER ();
-
   info->update_idle = 0;
     
   if (info->last_event)
@@ -3847,8 +3841,6 @@ gtk_drag_update_idle (gpointer data)
 
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -3859,7 +3851,7 @@ gtk_drag_add_update_idle (GtkDragSourceInfo *info)
    * from the last move can catch up before we move again.
    */
   if (!info->update_idle)
-    info->update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW + 5,
+    info->update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW + 5,
                                         gtk_drag_update_idle,
                                         info,
                                         NULL);
@@ -4185,16 +4177,12 @@ gtk_drag_abort_timeout (gpointer data)
   GtkDragSourceInfo *info = data;
   guint32 time = GDK_CURRENT_TIME;
 
-  GDK_THREADS_ENTER ();
-
   if (info->proxy_dest)
     time = info->proxy_dest->proxy_drop_time;
 
   info->drop_timeout = 0;
   gtk_drag_drop_finished (info, FALSE, time);
   
-  GDK_THREADS_LEAVE ();
-  
   return FALSE;
 }
 
index 2656a316c46ac2ef9af49b17395c5452aee66dc0..011ee01ba12859b86897884edd877db1a2bcd6a4 100644 (file)
@@ -3072,8 +3072,6 @@ recompute_idle_func (gpointer data)
 {
   GtkEntry *entry;
 
-  GDK_THREADS_ENTER ();
-
   entry = GTK_ENTRY (data);
 
   entry->recompute_idle = 0;
@@ -3086,8 +3084,6 @@ recompute_idle_func (gpointer data)
       update_im_cursor_location (entry);
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -3099,7 +3095,7 @@ gtk_entry_recompute (GtkEntry *entry)
   
   if (!entry->recompute_idle)
     {
-      entry->recompute_idle = g_idle_add_full (G_PRIORITY_HIGH_IDLE + 15, /* between resize and redraw */
+      entry->recompute_idle = gdk_threads_add_idle_full (G_PRIORITY_HIGH_IDLE + 15, /* between resize and redraw */
                                               recompute_idle_func, entry, NULL); 
     }
 }
@@ -3126,13 +3122,9 @@ append_char (GString *str,
 static gboolean
 gtk_entry_remove_password_hint (gpointer data)
 {
-  GDK_THREADS_ENTER();
-
   /* Force the string to be redrawn, but now without a visible character */
   gtk_entry_recompute (GTK_ENTRY (data));
 
-  GDK_THREADS_LEAVE();
-
   return FALSE;
 }
 
@@ -3299,7 +3291,7 @@ gtk_entry_create_layout (GtkEntry *entry,
               password_hint->password_hint_length = 0;
 
               password_hint->password_hint_timeout_id =
-                g_timeout_add (password_hint_timeout,
+                gdk_threads_add_timeout (password_hint_timeout,
                                (GSourceFunc) gtk_entry_remove_password_hint,
                                entry);
             }
@@ -5325,8 +5317,6 @@ blink_cb (gpointer data)
   GtkEntryPrivate *priv; 
   gint blink_timeout;
 
-  GDK_THREADS_ENTER ();
-
   entry = GTK_ENTRY (data);
   priv = GTK_ENTRY_GET_PRIVATE (entry);
  
@@ -5351,7 +5341,7 @@ blink_cb (gpointer data)
   else if (entry->cursor_visible)
     {
       hide_cursor (entry);
-      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+      entry->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
                                            blink_cb,
                                            entry);
     }
@@ -5359,13 +5349,11 @@ blink_cb (gpointer data)
     {
       show_cursor (entry);
       priv->blink_time += get_cursor_time (entry);
-      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+      entry->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
                                            blink_cb,
                                            entry);
     }
 
-  GDK_THREADS_LEAVE ();
-
   /* Remove ourselves */
   return FALSE;
 }
@@ -5382,7 +5370,7 @@ gtk_entry_check_cursor_blink (GtkEntry *entry)
       if (!entry->blink_timeout)
        {
          show_cursor (entry);
-         entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+         entry->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
                                                blink_cb,
                                                entry);
        }
@@ -5408,7 +5396,7 @@ gtk_entry_pend_cursor_blink (GtkEntry *entry)
       if (entry->blink_timeout != 0)
        g_source_remove (entry->blink_timeout);
       
-      entry->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
+      entry->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
                                            blink_cb,
                                            entry);
       show_cursor (entry);
@@ -5432,8 +5420,6 @@ gtk_entry_completion_timeout (gpointer data)
 {
   GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data);
 
-  GDK_THREADS_ENTER ();
-
   completion->priv->completion_timeout = 0;
 
   if (completion->priv->filter_model &&
@@ -5470,8 +5456,6 @@ gtk_entry_completion_timeout (gpointer data)
   else if (GTK_WIDGET_VISIBLE (completion->priv->popup_window))
     _gtk_entry_completion_popdown (completion);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -5698,7 +5682,7 @@ gtk_entry_completion_changed (GtkWidget *entry,
     }
 
   completion->priv->completion_timeout =
-    g_timeout_add (COMPLETION_TIMEOUT,
+    gdk_threads_add_timeout (COMPLETION_TIMEOUT,
                    gtk_entry_completion_timeout,
                    completion);
 }
index 33333d5f12bf185417fb22cadd9ef76835a31152..e078da7e8ba05e08ea35b522ef7475fdc61548df 100644 (file)
@@ -1004,7 +1004,7 @@ gtk_expander_drag_motion (GtkWidget        *widget,
       settings = gtk_widget_get_settings (widget);
       g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
 
-      priv->expand_timer = g_timeout_add (timeout, (GSourceFunc) expand_timeout, expander);
+      priv->expand_timer = gdk_threads_add_timeout (timeout, (GSourceFunc) expand_timeout, expander);
     }
 
   return TRUE;
@@ -1276,8 +1276,6 @@ gtk_expander_animation_timeout (GtkExpander *expander)
   GdkRectangle area;
   gboolean finish = FALSE;
 
-  GDK_THREADS_ENTER();
-
   if (GTK_WIDGET_REALIZED (expander))
     {
       get_expander_bounds (expander, &area);
@@ -1317,8 +1315,6 @@ gtk_expander_animation_timeout (GtkExpander *expander)
       gtk_widget_queue_resize (GTK_WIDGET (expander));
     }
 
-  GDK_THREADS_LEAVE();
-
   return !finish;
 }
 
@@ -1331,7 +1327,7 @@ gtk_expander_start_animation (GtkExpander *expander)
     g_source_remove (priv->animation_timeout);
 
   priv->animation_timeout =
-               g_timeout_add (50,
+               gdk_threads_add_timeout (50,
                               (GSourceFunc) gtk_expander_animation_timeout,
                               expander);
 }
index d1ca6306a80316bc6dc4cef474d8a95bbc7ae228..d2abc315e29dd7f6e138dcc5a9ad404d8f89e3b7 100644 (file)
@@ -5709,8 +5709,6 @@ load_timeout_cb (gpointer data)
 
   profile_start ("start", NULL);
 
-  GDK_THREADS_ENTER ();
-
   impl = GTK_FILE_CHOOSER_DEFAULT (data);
   g_assert (impl->load_state == LOAD_PRELOAD);
   g_assert (impl->load_timeout_id != 0);
@@ -5721,8 +5719,6 @@ load_timeout_cb (gpointer data)
 
   load_set_model (impl);
 
-  GDK_THREADS_LEAVE ();
-
   profile_end ("end", NULL);
 
   return FALSE;
@@ -5735,7 +5731,7 @@ load_setup_timer (GtkFileChooserDefault *impl)
   g_assert (impl->load_timeout_id == 0);
   g_assert (impl->load_state != LOAD_PRELOAD);
 
-  impl->load_timeout_id = g_timeout_add (MAX_LOADING_TIME, load_timeout_cb, impl);
+  impl->load_timeout_id = gdk_threads_add_timeout (MAX_LOADING_TIME, load_timeout_cb, impl);
   impl->load_state = LOAD_PRELOAD;
 }
 
index 2496c56f1a8d811904536ebe540193b72c2b26c6..43ebe055509e2196262f97384f2ea0644643fc2c 100644 (file)
@@ -254,8 +254,7 @@ static GtkFileInfo *create_file_info              (GtkFileFolderUnix *folder_uni
                                                   struct stat *statbuf,
                                                   const char *mime_type);
 
-static gboolean execute_callbacks_idle (gpointer data);
-static void execute_callbacks (gpointer data);
+static gboolean execute_callbacks (gpointer data);
 
 static gboolean fill_in_names     (GtkFileFolderUnix  *folder_unix,
                                   GError            **error);
@@ -700,7 +699,7 @@ struct callback_info
 
 
 
-static void
+static gboolean
 execute_callbacks (gpointer data)
 {
   GSList *l;
@@ -747,18 +746,6 @@ execute_callbacks (gpointer data)
   system_unix->execute_callbacks_idle_id = 0;
 }
 
-static gboolean
-execute_callbacks_idle (gpointer data)
-{
-  GDK_THREADS_ENTER ();
-
-  execute_callbacks(data);
-
-  GDK_THREADS_LEAVE ();
-
-  return FALSE;
-}
-
 static void
 queue_callback (GtkFileSystemUnix   *system_unix,
                enum callback_types  type,
@@ -791,7 +778,7 @@ queue_callback (GtkFileSystemUnix   *system_unix,
   system_unix->callbacks = g_slist_append (system_unix->callbacks, info);
 
   if (!system_unix->execute_callbacks_idle_id)
-    system_unix->execute_callbacks_idle_id = g_idle_add (execute_callbacks_idle, system_unix);
+    system_unix->execute_callbacks_idle_id = gdk_threads_add_idle (execute_callbacks, system_unix);
 }
 
 static GtkFileSystemHandle *
@@ -865,8 +852,6 @@ load_folder (gpointer data)
   GtkFileFolderUnix *folder_unix = data;
   GSList *children;
 
-  GDK_THREADS_ENTER ();
-
   if ((folder_unix->types & STAT_NEEDED_MASK) != 0)
     fill_in_stats (folder_unix);
 
@@ -884,8 +869,6 @@ load_folder (gpointer data)
 
   g_signal_emit_by_name (folder_unix, "finished-loading", 0);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -1020,7 +1003,7 @@ gtk_file_system_unix_get_folder (GtkFileSystem                  *file_system,
   /* Start loading the folder contents in an idle */
   if (!folder_unix->load_folder_id)
     folder_unix->load_folder_id =
-      g_idle_add ((GSourceFunc) load_folder, folder_unix);
+      gdk_threads_add_idle ((GSourceFunc) load_folder, folder_unix);
 
   return handle;
 }
index 167f56c9bd2706ad2f725b0571e3ecdaaf8970e1..3128406a9862f9af54b35e8e33933f86f1c4f21a 100644 (file)
@@ -239,8 +239,7 @@ static GtkFileInfo *create_file_info       (GtkFileFolderWin32        *folder_wi
                                            WIN32_FILE_ATTRIBUTE_DATA *wfad,
                                            const char                *mime_type);
 
-static gboolean execute_callbacks_idle (gpointer data);
-static void execute_callbacks (gpointer data);
+static gboolean execute_callbacks (gpointer data);
 
 static gboolean fill_in_names        (GtkFileFolderWin32  *folder_win32,
                                      GError             **error);
@@ -336,7 +335,9 @@ check_volumes (gpointer data)
   g_return_val_if_fail (system_win32, FALSE);
 
   if (system_win32->drives != GetLogicalDrives())
-    g_signal_emit_by_name (system_win32, "volumes-changed", 0);
+               {
+                       g_signal_emit_by_name (system_win32, "volumes-changed", 0);
+               }
 
   return TRUE;
 }
@@ -370,7 +371,7 @@ gtk_file_system_win32_init (GtkFileSystemWin32 *system_win32)
   /* Set up an idle handler for volume changes. Once a second should
    * be enough.
    */
-  system_win32->timeout = g_timeout_add_full (0, 1000, check_volumes, system_win32, NULL);
+  system_win32->timeout = gdk_threads_add_timeout_full (0, 1000, check_volumes, system_win32, NULL);
 
   system_win32->handles = g_hash_table_new (g_direct_hash, g_direct_equal);
 
@@ -809,7 +810,7 @@ struct callback_info
 
 
 
-static void
+static gboolean
 execute_callbacks (gpointer data)
 {
   GSList *l;
@@ -854,18 +855,8 @@ execute_callbacks (gpointer data)
     g_object_unref (system_win32);
 
   system_win32->execute_callbacks_idle_id = 0;
-}
 
-static gboolean
-execute_callbacks_idle (gpointer data)
-{
-  GDK_THREADS_ENTER ();
-
-  execute_callbacks(data);
-
-  GDK_THREADS_LEAVE ();
-
-  return FALSE;
+  return FALSE:
 }
 
 static void
@@ -900,7 +891,7 @@ queue_callback (GtkFileSystemWin32  *system_win32,
   system_win32->callbacks = g_slist_append (system_win32->callbacks, info);
 
   if (!system_win32->execute_callbacks_idle_id)
-    system_win32->execute_callbacks_idle_id = g_idle_add (execute_callbacks_idle, system_win32);
+    system_win32->execute_callbacks_idle_id = gdk_threads_add_idle (execute_callbacks, system_win32);
 }
 
 static GtkFileSystemHandle *
@@ -1007,8 +998,6 @@ load_folder (gpointer data)
   GtkFileFolderWin32 *folder_win32 = data;
   GSList *children;
 
-  GDK_THREADS_ENTER ();
-
   if ((folder_win32->types & STAT_NEEDED_MASK) != 0)
     fill_in_stats (folder_win32);
 
@@ -1026,8 +1015,6 @@ load_folder (gpointer data)
 
   g_signal_emit_by_name (folder_win32, "finished-loading", 0);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -1136,7 +1123,7 @@ gtk_file_system_win32_get_folder (GtkFileSystem                 *file_system,
   /* Start loading the folder contents in an idle */
   if (!folder_win32->load_folder_id)
     folder_win32->load_folder_id =
-      g_idle_add ((GSourceFunc) load_folder, folder_win32);
+      gdk_threads_add_idle ((GSourceFunc) load_folder, folder_win32);
 
   return handle;
 }
index f04fa73a8f5b0e3c329944a7bb02fd69887a9b09..e986b400612c78b3ea6a45e8f9d2b07448593f55 100644 (file)
@@ -591,8 +591,6 @@ reset_styles_idle (gpointer user_data)
   GtkIconTheme *icon_theme;
   GtkIconThemePrivate *priv;
 
-  GDK_THREADS_ENTER ();
-
   icon_theme = GTK_ICON_THEME (user_data);
   priv = icon_theme->priv;
 
@@ -604,8 +602,6 @@ reset_styles_idle (gpointer user_data)
 
   priv->reset_styles_idle = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -621,7 +617,7 @@ do_theme_change (GtkIconTheme *icon_theme)
 
   if (!priv->reset_styles_idle)
     priv->reset_styles_idle = 
-      g_idle_add_full (GTK_PRIORITY_RESIZE - 2, 
+      gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 2, 
                       reset_styles_idle, icon_theme, NULL);
 }
 
index f3f55c6c0b69cb3373abc9eba229c6d605f4eb3c..45280f63c4e38ec2d13dacb0f77072094e71432e 100644 (file)
@@ -1461,8 +1461,6 @@ rubberband_scroll_timeout (gpointer data)
   GtkIconView *icon_view;
   gdouble value;
 
-  GDK_THREADS_ENTER ();
-  
   icon_view = data;
 
   value = MIN (icon_view->priv->vadjustment->value +
@@ -1474,8 +1472,6 @@ rubberband_scroll_timeout (gpointer data)
 
   gtk_icon_view_update_rubberband (icon_view);
   
-  GDK_THREADS_LEAVE ();
-
   return TRUE;
 }
 
@@ -1510,7 +1506,7 @@ gtk_icon_view_motion (GtkWidget      *widget,
          icon_view->priv->event_last_y = event->y;
 
          if (icon_view->priv->scroll_timeout_id == 0)
-           icon_view->priv->scroll_timeout_id = g_timeout_add (30, rubberband_scroll_timeout, 
+           icon_view->priv->scroll_timeout_id = gdk_threads_add_timeout (30, rubberband_scroll_timeout, 
                                                                icon_view);
        }
       else 
@@ -3067,16 +3063,12 @@ layout_callback (gpointer user_data)
 {
   GtkIconView *icon_view;
 
-  GDK_THREADS_ENTER ();
-
   icon_view = GTK_ICON_VIEW (user_data);
   
   icon_view->priv->layout_idle_id = 0;
 
   gtk_icon_view_layout (icon_view);
   
-  GDK_THREADS_LEAVE();
-
   return FALSE;
 }
 
@@ -3086,7 +3078,7 @@ gtk_icon_view_queue_layout (GtkIconView *icon_view)
   if (icon_view->priv->layout_idle_id != 0)
     return;
 
-  icon_view->priv->layout_idle_id = g_idle_add (layout_callback, icon_view);
+  icon_view->priv->layout_idle_id = gdk_threads_add_idle (layout_callback, icon_view);
 }
 
 static void
@@ -5868,12 +5860,8 @@ drag_scroll_timeout (gpointer data)
 {
   GtkIconView *icon_view = GTK_ICON_VIEW (data);
 
-  GDK_THREADS_ENTER ();
-
   gtk_icon_view_autoscroll (icon_view);
 
-  GDK_THREADS_LEAVE ();
-
   return TRUE;
 }
 
@@ -6270,7 +6258,7 @@ gtk_icon_view_drag_motion (GtkWidget      *widget,
       if (icon_view->priv->scroll_timeout_id == 0)
        {
          icon_view->priv->scroll_timeout_id =
-           g_timeout_add (50, drag_scroll_timeout, icon_view);
+           gdk_threads_add_timeout (50, drag_scroll_timeout, icon_view);
        }
 
       if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
@@ -6911,8 +6899,6 @@ gtk_icon_view_item_accessible_idle_do_action (gpointer data)
   GtkIconView *icon_view;
   GtkTreePath *path;
 
-  GDK_THREADS_ENTER ();
-
   item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (data);
   item->action_idle_handler = 0;
 
@@ -6924,8 +6910,6 @@ gtk_icon_view_item_accessible_idle_do_action (gpointer data)
       gtk_tree_path_free (path);
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -6950,7 +6934,7 @@ gtk_icon_view_item_accessible_action_do_action (AtkAction *action,
     {
     case ACTION_ACTIVATE:
       if (!item->action_idle_handler)
-        item->action_idle_handler = g_idle_add (gtk_icon_view_item_accessible_idle_do_action, item);
+        item->action_idle_handler = gdk_threads_add_idle (gtk_icon_view_item_accessible_idle_do_action, item);
       break;
     default:
       g_assert_not_reached ();
index 6e5509e9afb3c29b497da5af7c641562620ab0c3..b20f34cdccff70ed1bd863525a909499a039a29c 100644 (file)
@@ -1356,8 +1356,6 @@ animation_timeout (gpointer data)
 {
   GtkImage *image;
 
-  GDK_THREADS_ENTER ();
-
   image = GTK_IMAGE (data);
   
   image->data.anim.frame_timeout = 0;
@@ -1366,7 +1364,7 @@ animation_timeout (gpointer data)
 
   if (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter) >= 0)
     image->data.anim.frame_timeout =
-      g_timeout_add (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter),
+      gdk_threads_add_timeout (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter),
                      animation_timeout,
                      image);
 
@@ -1375,8 +1373,6 @@ animation_timeout (gpointer data)
   if (GTK_WIDGET_DRAWABLE (image))
     gdk_window_process_updates (GTK_WIDGET (image)->window, TRUE);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -1677,7 +1673,7 @@ gtk_image_expose (GtkWidget      *widget,
                 
                 if (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter) >= 0)
                   image->data.anim.frame_timeout =
-                    g_timeout_add (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter),
+                    gdk_threads_add_timeout (gdk_pixbuf_animation_iter_get_delay_time (image->data.anim.iter),
                                    animation_timeout,
                                    image);
               }
index 4c97eeb1428eb11ea0994643eea475487e0eadce..c53c378da0e8893f10e6c34e47a9d5d78ed666ab 100644 (file)
@@ -557,7 +557,7 @@ gtk_list_motion_notify (GtkWidget      *widget,
     {
       if (list->htimer == 0)
        {
-         list->htimer = g_timeout_add
+         list->htimer = gdk_threads_add_timeout
            (SCROLL_TIME, (GSourceFunc) gtk_list_horizontal_timeout, widget);
          
          if (!((x < adj->value && adj->value <= 0) ||
@@ -605,7 +605,7 @@ gtk_list_motion_notify (GtkWidget      *widget,
 
   if (!((y < 0 && focus_row == 0) ||
        (y > widget->allocation.height && focus_row >= length - 1)))
-    list->vtimer = g_timeout_add (SCROLL_TIME,
+    list->vtimer = gdk_threads_add_timeout (SCROLL_TIME,
                                  (GSourceFunc) gtk_list_vertical_timeout,
                                  list);
 
@@ -2338,26 +2338,18 @@ do_fake_motion (GtkWidget *list)
 static gint
 gtk_list_horizontal_timeout (GtkWidget *list)
 {
-  GDK_THREADS_ENTER ();
-
   GTK_LIST (list)->htimer = 0;
   do_fake_motion (list);
   
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
 static gint
 gtk_list_vertical_timeout (GtkWidget *list)
 {
-  GDK_THREADS_ENTER ();
-
   GTK_LIST (list)->vtimer = 0;
   do_fake_motion (list);
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
index 7460061231ab9392f35a1c7450380a192e102965..70f9f9b4edcaea86e383dd3b4519b4e07fd3b96a 100644 (file)
@@ -3022,8 +3022,6 @@ gtk_menu_scroll_timeout (gpointer  data)
   GtkSettings *settings;
   gboolean     touchscreen_mode;
 
-  GDK_THREADS_ENTER ();
-
   menu = GTK_MENU (data);
 
   settings = gtk_widget_get_settings (GTK_WIDGET (menu));
@@ -3033,8 +3031,6 @@ gtk_menu_scroll_timeout (gpointer  data)
 
   gtk_menu_do_timeout_scroll (menu, touchscreen_mode);
 
-  GDK_THREADS_LEAVE ();
-
   return TRUE;
 }
 
@@ -3046,8 +3042,6 @@ gtk_menu_scroll_timeout_initial (gpointer data)
   guint        timeout;
   gboolean     touchscreen_mode;
 
-  GDK_THREADS_ENTER ();
-
   menu = GTK_MENU (data);
 
   settings = gtk_widget_get_settings (GTK_WIDGET (menu));
@@ -3060,9 +3054,7 @@ gtk_menu_scroll_timeout_initial (gpointer data)
 
   gtk_menu_remove_scroll_timeout (menu);
 
-  menu->timeout_id = g_timeout_add (timeout, gtk_menu_scroll_timeout, menu);
-
-  GDK_THREADS_LEAVE ();
+  menu->timeout_id = gdk_threads_add_timeout (timeout, gtk_menu_scroll_timeout, menu);
 
   return FALSE;
 }
@@ -3082,7 +3074,7 @@ gtk_menu_start_scrolling (GtkMenu *menu)
 
   gtk_menu_do_timeout_scroll (menu, touchscreen_mode);
 
-  menu->timeout_id = g_timeout_add (timeout, gtk_menu_scroll_timeout_initial,
+  menu->timeout_id = gdk_threads_add_timeout (timeout, gtk_menu_scroll_timeout_initial,
                                     menu);
 }
 
@@ -3228,7 +3220,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
                     -MENU_SCROLL_STEP2 : -MENU_SCROLL_STEP1;
 
                   menu->timeout_id =
-                    g_timeout_add (scroll_fast ?
+                    gdk_threads_add_timeout (scroll_fast ?
                                    MENU_SCROLL_TIMEOUT2 : MENU_SCROLL_TIMEOUT1,
                                    gtk_menu_scroll_timeout, menu);
                 }
@@ -3322,7 +3314,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
                     MENU_SCROLL_STEP2 : MENU_SCROLL_STEP1;
 
                   menu->timeout_id =
-                    g_timeout_add (scroll_fast ?
+                    gdk_threads_add_timeout (scroll_fast ?
                                    MENU_SCROLL_TIMEOUT2 : MENU_SCROLL_TIMEOUT1,
                                    gtk_menu_scroll_timeout, menu);
                 }
@@ -3485,8 +3477,6 @@ gtk_menu_stop_navigating_submenu_cb (gpointer user_data)
   GtkMenu *menu = user_data;
   GdkWindow *child_window;
 
-  GDK_THREADS_ENTER ();
-
   gtk_menu_stop_navigating_submenu (menu);
   
   if (GTK_WIDGET_REALIZED (menu))
@@ -3507,8 +3497,6 @@ gtk_menu_stop_navigating_submenu_cb (gpointer user_data)
        }
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE; 
 }
 
@@ -3682,7 +3670,7 @@ gtk_menu_set_submenu_navigation_region (GtkMenu          *menu,
                    "gtk-menu-popdown-delay", &popdown_delay,
                    NULL);
 
-      menu->navigation_timeout = g_timeout_add (popdown_delay,
+      menu->navigation_timeout = gdk_threads_add_timeout (popdown_delay,
                                                gtk_menu_stop_navigating_submenu_cb, menu);
 
 #ifdef DRAW_STAY_UP_TRIANGLE
index ae87c0530443abe2c318c8ab6a4b93f501ea9e96..35e5bff58a085f1bac8093d836a455e9b89b7fd0 100644 (file)
@@ -902,7 +902,7 @@ gtk_real_menu_item_select (GtkItem *item)
        {
          GdkEvent *event = gtk_get_current_event ();
          
-         menu_item->timer = g_timeout_add (popup_delay,
+         menu_item->timer = gdk_threads_add_timeout (popup_delay,
                                            gtk_menu_item_select_timeout,
                                            menu_item);
          if (event &&
@@ -1018,8 +1018,6 @@ gtk_menu_item_select_timeout (gpointer data)
   GtkMenuItem *menu_item;
   GtkWidget *parent;
   
-  GDK_THREADS_ENTER ();
-
   menu_item = GTK_MENU_ITEM (data);
 
   parent = GTK_WIDGET (menu_item)->parent;
@@ -1032,8 +1030,6 @@ gtk_menu_item_select_timeout (gpointer data)
        GTK_MENU_SHELL (menu_item->submenu)->ignore_enter = TRUE;
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;  
 }
 
index 19a584c6185dc9c624a6a6ca8c177814d43d18ab..1448a52073010fdddfbfc8e0443a2ce2474472ee 100644 (file)
@@ -2744,8 +2744,6 @@ scroll_notebook_timer (gpointer data)
   GtkNotebookPointerPosition pointer_position;
   GList *element, *first_tab;
 
-  GDK_THREADS_ENTER ();
-
   priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
   pointer_position = get_pointer_position (notebook);
 
@@ -2767,8 +2765,6 @@ scroll_notebook_timer (gpointer data)
       gdk_window_raise (priv->drag_window);
     }
 
-  GDK_THREADS_LEAVE ();
-
   return TRUE;
 }
 
@@ -2875,8 +2871,8 @@ gtk_notebook_motion_notify (GtkWidget      *widget,
              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);
            }
        }
@@ -3090,8 +3086,6 @@ gtk_notebook_switch_tab_timeout (gpointer data)
   GList *tab;
   gint x, y;
 
-  GDK_THREADS_ENTER ();
-
   notebook = GTK_NOTEBOOK (data);
   priv = GTK_NOTEBOOK_GET_PRIVATE (notebook);
 
@@ -3108,8 +3102,6 @@ gtk_notebook_switch_tab_timeout (gpointer data)
       gtk_notebook_switch_focus_tab (notebook, tab);
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -3189,8 +3181,8 @@ gtk_notebook_drag_motion (GtkWidget      *widget,
           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);
        }
     }
@@ -4076,13 +4068,11 @@ gtk_notebook_redraw_arrows (GtkNotebook *notebook)
     }
 }
 
-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);
@@ -4096,7 +4086,7 @@ gtk_notebook_timer (GtkNotebook *notebook)
           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);
        }
@@ -4104,8 +4094,6 @@ gtk_notebook_timer (GtkNotebook *notebook)
        retval = TRUE;
     }
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
@@ -4121,7 +4109,7 @@ gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
 
       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;
index c695ba5b045bb625c1cbbef852a62e185bc52cb7..8be9848f9da8e20bb4bb31d7b43733ed568b3e02 100644 (file)
@@ -755,8 +755,6 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
 {
   gboolean retval = FALSE;
 
-  GDK_THREADS_ENTER ();
-
   if (path_bar->timer)
     {
       if (path_bar->scrolling_up)
@@ -773,7 +771,7 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
 
          path_bar->need_timer = FALSE;
 
-         path_bar->timer = g_timeout_add (timeout * SCROLL_DELAY_FACTOR,
+         path_bar->timer = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
                                           (GSourceFunc)gtk_path_bar_scroll_timeout,
                                           path_bar);
        }
@@ -781,8 +779,6 @@ gtk_path_bar_scroll_timeout (GtkPathBar *path_bar)
        retval = TRUE;
     }
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
@@ -828,7 +824,7 @@ gtk_path_bar_slider_button_press (GtkWidget      *widget,
       g_object_get (settings, "gtk-timeout-initial", &timeout, NULL);
 
       path_bar->need_timer = TRUE;
-      path_bar->timer = g_timeout_add (timeout,
+      path_bar->timer = gdk_threads_add_timeout (timeout,
                                       (GSourceFunc)gtk_path_bar_scroll_timeout,
                                       path_bar);
     }
index 2739f1de5f9c6b18ccf3ea9ad525e56a5657b5a2..4c72940c56810ae4d9220a37c9c5482994330832 100644 (file)
@@ -310,6 +310,7 @@ unix_end_run (GtkPrintOperation *op,
 
   if (wait)
     {
+      g_object_ref (op);
       if (!op_unix->data_sent)
        {
          GDK_THREADS_LEAVE ();  
@@ -317,6 +318,8 @@ unix_end_run (GtkPrintOperation *op,
          GDK_THREADS_ENTER ();  
        }
       g_main_loop_unref (op_unix->loop);
+      op_unix->loop = NULL;
+      g_object_unref (op);
     }
 }
 
index 159ed6d2ed7caeee5dc6341dc36bbd72415a7bd7..5df99a9ee99e36e1aae8b817fe31eac0f90f4350 100644 (file)
@@ -469,7 +469,7 @@ win32_poll_status_timeout (GtkPrintOperation *op)
   win32_poll_status (op);
 
   if (!gtk_print_operation_is_finished (op))
-    op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
+    op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
                                          (GSourceFunc)win32_poll_status_timeout,
                                          op);
   g_object_unref (op);
@@ -510,7 +510,7 @@ win32_end_run (GtkPrintOperation *op,
     {
       op_win32->printerHandle = printerHandle;
       win32_poll_status (op);
-      op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
+      op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
                                            (GSourceFunc)win32_poll_status_timeout,
                                            op);
     }
index 943223a20e637186455643c272a8be2207566a2e..bf634e77af0f6c1e484f5a62871aca8860d617c0 100644 (file)
@@ -383,8 +383,6 @@ preview_print_idle_done (gpointer data)
   GtkPrintOperation *op;
   PreviewOp *pop = (PreviewOp *) data;
 
-  GDK_THREADS_ENTER ();
-  
   op = GTK_PRINT_OPERATION (pop->preview);
 
   cairo_surface_finish (pop->surface);
@@ -398,8 +396,6 @@ preview_print_idle_done (gpointer data)
 
   gtk_print_operation_preview_end_preview (pop->preview);
   g_free (pop);
-  
-  GDK_THREADS_LEAVE ();
 }
 
 static gboolean
@@ -410,8 +406,6 @@ preview_print_idle (gpointer data)
   gboolean retval = TRUE;
   cairo_t *cr;
 
-  GDK_THREADS_ENTER ();
-
   pop = (PreviewOp *) data;
   op = GTK_PRINT_OPERATION (pop->preview);
 
@@ -425,8 +419,6 @@ preview_print_idle (gpointer data)
   if (op->priv->nr_of_pages <= pop->page_nr)
     retval = FALSE;
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
@@ -454,10 +446,10 @@ preview_ready (GtkPrintOperationPreview *preview,
   pop->page_nr = 0;
   pop->print_context = context;
 
-  g_idle_add_full (G_PRIORITY_DEFAULT_IDLE + 10,
-                  preview_print_idle,
-                  pop,
-                  preview_print_idle_done);
+  gdk_threads_add_idle_full (G_PRIORITY_DEFAULT_IDLE + 10,
+                            preview_print_idle,
+                            pop,
+                            preview_print_idle_done);
 }
 
 
@@ -1918,8 +1910,6 @@ print_pages_idle_done (gpointer user_data)
   PrintPagesData *data;
   GtkPrintOperationPrivate *priv;
 
-  GDK_THREADS_ENTER ();
-
   data = (PrintPagesData*)user_data;
   priv = data->op->priv;
 
@@ -1946,8 +1936,6 @@ print_pages_idle_done (gpointer user_data)
   g_object_unref (data->op);
 
   g_free (data);
-
-  GDK_THREADS_LEAVE ();
 }
 
 static void
@@ -2030,8 +2018,6 @@ print_pages_idle (gpointer user_data)
   GtkPageSetup *page_setup;
   gboolean done = FALSE;
 
-  GDK_THREADS_ENTER ();
-
   data = (PrintPagesData*)user_data;
   priv = data->op->priv;
 
@@ -2162,8 +2148,6 @@ print_pages_idle (gpointer user_data)
 
   update_progress (data);
 
-  GDK_THREADS_LEAVE ();
-
   return !done;
 }
   
@@ -2181,14 +2165,10 @@ handle_progress_response (GtkWidget *dialog,
 static gboolean
 show_progress_timeout (PrintPagesData *data)
 {
-  GDK_THREADS_ENTER ();
-
   gtk_window_present (GTK_WINDOW (data->progress));
 
   data->op->priv->show_progress_timeout_id = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -2226,7 +2206,7 @@ print_pages (GtkPrintOperation       *op,
                        G_CALLBACK (handle_progress_response), op);
 
       priv->show_progress_timeout_id = 
-       g_timeout_add (SHOW_PROGRESS_TIME, 
+       gdk_threads_add_timeout (SHOW_PROGRESS_TIME, 
                       (GSourceFunc)show_progress_timeout,
                       data);
 
@@ -2265,22 +2245,24 @@ print_pages (GtkPrintOperation       *op,
       priv->manual_orientation = TRUE;
     }
   
-  priv->print_pages_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE + 10,
-                                              print_pages_idle, 
-                                              data, 
-                                              print_pages_idle_done);
+  priv->print_pages_idle_id = gdk_threads_add_idle_full (G_PRIORITY_DEFAULT_IDLE + 10,
+                                                        print_pages_idle, 
+                                                        data, 
+                                                        print_pages_idle_done);
   
   /* Recursive main loop to make sure we don't exit  on sync operations  */
   if (priv->is_sync)
     {
       priv->rloop = g_main_loop_new (NULL, FALSE);
 
+      g_object_ref (op);
       GDK_THREADS_LEAVE ();
       g_main_loop_run (priv->rloop);
       GDK_THREADS_ENTER ();
       
       g_main_loop_unref (priv->rloop);
       priv->rloop = NULL;
+      g_object_unref (op);
     }
 }
 
index 41338de145fc6e4074cf01030f5dd0698558551d..b0ec3a0e4089c3a857e8989f3ceab8cdcdb5bb2c 100644 (file)
@@ -1125,7 +1125,7 @@ schedule_idle_mark_conflicts (GtkPrintUnixDialog *dialog)
   if (priv->mark_conflicts_id != 0)
     return;
 
-  priv->mark_conflicts_id = g_idle_add (mark_conflicts_callback,
+  priv->mark_conflicts_id = gdk_threads_add_idle (mark_conflicts_callback,
                                        dialog);
 }
 
index c6c6e56ddafa18c48349987ee7e2b39b3da71ae3..696198a1be4cb62d1339a423a35d4eec8686852c 100644 (file)
@@ -3297,10 +3297,8 @@ second_timeout (gpointer data)
 {
   GtkRange *range;
 
-  GDK_THREADS_ENTER ();
   range = GTK_RANGE (data);
   gtk_range_scroll (range, range->timer->step);
-  GDK_THREADS_LEAVE ();
   
   return TRUE;
 }
@@ -3312,16 +3310,13 @@ initial_timeout (gpointer data)
   GtkSettings *settings;
   guint        timeout;
 
-  GDK_THREADS_ENTER ();
   settings = gtk_widget_get_settings (GTK_WIDGET (data));
   g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
 
   range = GTK_RANGE (data);
-  range->timer->timeout_id = g_timeout_add (timeout * SCROLL_DELAY_FACTOR,
+  range->timer->timeout_id = gdk_threads_add_timeout (timeout * SCROLL_DELAY_FACTOR,
                                             second_timeout,
                                             range);
-  GDK_THREADS_LEAVE ();
-
   /* remove self */
   return FALSE;
 }
@@ -3341,7 +3336,7 @@ gtk_range_add_step_timer (GtkRange      *range,
 
   range->timer = g_new (GtkRangeStepTimer, 1);
 
-  range->timer->timeout_id = g_timeout_add (timeout,
+  range->timer->timeout_id = gdk_threads_add_timeout (timeout,
                                             initial_timeout,
                                             range);
   range->timer->step = step;
@@ -3368,11 +3363,9 @@ update_timeout (gpointer data)
 {
   GtkRange *range;
 
-  GDK_THREADS_ENTER ();
   range = GTK_RANGE (data);
   gtk_range_update_value (range);
   range->update_timeout_id = 0;
-  GDK_THREADS_LEAVE ();
 
   /* self-remove */
   return FALSE;
@@ -3383,7 +3376,7 @@ gtk_range_reset_update_timer (GtkRange *range)
 {
   gtk_range_remove_update_timer (range);
 
-  range->update_timeout_id = g_timeout_add (UPDATE_DELAY,
+  range->update_timeout_id = gdk_threads_add_timeout (UPDATE_DELAY,
                                             update_timeout,
                                             range);
 }
index 9a64f80d13dbdaf4f8b0c468849b527731df92a1..df8a70c5647012e17b7b05ef55210188cdc82db8 100644 (file)
@@ -754,8 +754,6 @@ load_recent_items (gpointer user_data)
   const gchar *uri, *name;
   gboolean retval;
   
-  GDK_THREADS_ENTER ();
-  
   impl = GTK_RECENT_CHOOSER_DEFAULT (user_data);
   
   g_assert ((impl->load_state == LOAD_EMPTY) ||
@@ -767,8 +765,6 @@ load_recent_items (gpointer user_data)
       impl->recent_items = gtk_recent_chooser_get_items (GTK_RECENT_CHOOSER (impl));
       if (!impl->recent_items)
         {
-          GDK_THREADS_LEAVE ();
-
          impl->load_state = LOAD_FINISHED;
           
           return FALSE;
@@ -831,8 +827,6 @@ load_recent_items (gpointer user_data)
       retval = TRUE;
     }
   
-  GDK_THREADS_LEAVE ();
-  
   return retval;
 }
 
@@ -841,8 +835,6 @@ cleanup_after_load (gpointer user_data)
 {
   GtkRecentChooserDefault *impl;
   
-  GDK_THREADS_ENTER ();
-  
   impl = GTK_RECENT_CHOOSER_DEFAULT (user_data);
 
   if (impl->load_id != 0)
@@ -864,8 +856,6 @@ cleanup_after_load (gpointer user_data)
              (impl->load_state == LOAD_FINISHED));
 
   set_busy_cursor (impl, FALSE);
-  
-  GDK_THREADS_LEAVE ();
 }
 
 /* clears the current model and reloads the recently used resources */
@@ -888,7 +878,7 @@ reload_recent_items (GtkRecentChooserDefault *impl)
   set_busy_cursor (impl, TRUE);
 
   impl->load_state = LOAD_EMPTY;
-  impl->load_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE + 30,
+  impl->load_id = gdk_threads_add_idle_full (G_PRIORITY_HIGH_IDLE + 30,
                                   load_recent_items,
                                   impl,
                                   cleanup_after_load);
index 7dbd7999db797ec37c6c77e0fad49220850ef0ce..eba0068872eee763a266b01726fd328b9b3e7263 100644 (file)
@@ -969,8 +969,6 @@ idle_populate_func (gpointer data)
   gboolean retval;
   GtkWidget *item;
 
-  GDK_THREADS_ENTER ();
-
   pdata = (MenuPopulateData *) data;
   priv = pdata->menu->priv;
 
@@ -1076,8 +1074,6 @@ check_and_return:
   else
     retval = TRUE;
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
@@ -1106,7 +1102,7 @@ gtk_recent_chooser_menu_populate (GtkRecentChooserMenu *menu)
   /* dispose our menu items first */
   gtk_recent_chooser_menu_dispose_items (menu);
   
-  menu->priv->populate_id = g_idle_add_full (G_PRIORITY_HIGH_IDLE + 30,
+  menu->priv->populate_id = gdk_threads_add_idle_full (G_PRIORITY_HIGH_IDLE + 30,
                                             idle_populate_func,
                                             pdata,
                                             idle_populate_clean_up);
index d99aefd38b4e3dd3efa2c7c3e6c57934204d1ae3..b991f7d6b0537cbcb60d97dd40802478fe60e2e4 100644 (file)
@@ -296,7 +296,7 @@ gtk_recent_manager_init (GtkRecentManager *manager)
   priv->filename = g_build_filename (g_get_home_dir (),
                                     GTK_RECENTLY_USED_FILE,
                                     NULL);
-  priv->poll_timeout = g_timeout_add (POLL_DELTA,
+  priv->poll_timeout = gdk_threads_add_timeout (POLL_DELTA,
                                      gtk_recent_manager_poll_timeout,
                                      manager);
 
@@ -508,7 +508,7 @@ gtk_recent_manager_set_filename (GtkRecentManager *manager,
     }
 
   priv->filename = g_strdup (filename);
-  priv->poll_timeout = g_timeout_add (POLL_DELTA,
+  priv->poll_timeout = gdk_threads_add_timeout (POLL_DELTA,
                                      gtk_recent_manager_poll_timeout,
                                      manager);
 
index 451e5d860ee91753c2adde0f8f507a8e8e7a02d0..5a88069aab071f4ffcf730a9af982a0bc75748cc 100644 (file)
@@ -152,8 +152,8 @@ struct _GtkRetrievalInfo
 
 /* Local Functions */
 static void gtk_selection_init              (void);
-static gint gtk_selection_incr_timeout      (GtkIncrInfo      *info);
-static gint gtk_selection_retrieval_timeout (GtkRetrievalInfo *info);
+static gboolean gtk_selection_incr_timeout      (GtkIncrInfo      *info);
+static gboolean gtk_selection_retrieval_timeout (GtkRetrievalInfo *info);
 static void gtk_selection_retrieval_report  (GtkRetrievalInfo *info,
                                             GdkAtom           type,
                                             gint              format,
@@ -1090,7 +1090,8 @@ gtk_selection_convert (GtkWidget *widget,
   
   current_retrievals = g_list_append (current_retrievals, info);
   gdk_selection_convert (widget->window, selection, target, time_);
-  g_timeout_add (1000, (GSourceFunc) gtk_selection_retrieval_timeout, info);
+  gdk_threads_add_timeout (1000,
+      (GSourceFunc) gtk_selection_retrieval_timeout, info);
   
   return TRUE;
 }
@@ -2260,7 +2261,7 @@ _gtk_selection_request (GtkWidget *widget,
                             gdk_window_get_events (info->requestor) |
                             GDK_PROPERTY_CHANGE_MASK);
       current_incrs = g_list_append (current_incrs, info);
-      g_timeout_add (1000, (GSourceFunc) gtk_selection_incr_timeout, info);
+      gdk_threads_add_timeout (1000, (GSourceFunc) gtk_selection_incr_timeout, info);
     }
   
   /* If it was a MULTIPLE request, set the property to indicate which
@@ -2449,8 +2450,6 @@ gtk_selection_incr_timeout (GtkIncrInfo *info)
   GList *tmp_list;
   gboolean retval;
 
-  GDK_THREADS_ENTER ();
-  
   /* Determine if retrieval has finished by checking if it still in
      list of pending retrievals */
   
@@ -2486,8 +2485,6 @@ gtk_selection_incr_timeout (GtkIncrInfo *info)
       retval = TRUE;           /* timeout will happen again */
     }
   
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
@@ -2693,14 +2690,12 @@ _gtk_selection_property_notify (GtkWidget       *widget,
  *   results:
  *************************************************************/
 
-static gint
+static gboolean
 gtk_selection_retrieval_timeout (GtkRetrievalInfo *info)
 {
   GList *tmp_list;
   gboolean retval;
 
-  GDK_THREADS_ENTER ();
-  
   /* Determine if retrieval has finished by checking if it still in
      list of pending retrievals */
   
@@ -2734,8 +2729,6 @@ gtk_selection_retrieval_timeout (GtkRetrievalInfo *info)
       retval =  TRUE;          /* timeout will happen again */
     }
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
index bcd360bbc4918cc2ac47d1d8653c3c80e0ae254c..741924551e4340c11f01c5a67de442b02808d1f0 100644 (file)
@@ -112,7 +112,7 @@ static void gtk_spin_button_state_changed  (GtkWidget          *widget,
                                            GtkStateType        previous_state);
 static void gtk_spin_button_draw_arrow     (GtkSpinButton      *spin_button, 
                                            GtkArrowType        arrow_type);
-static gint gtk_spin_button_timer          (GtkSpinButton      *spin_button);
+static gboolean gtk_spin_button_timer          (GtkSpinButton      *spin_button);
 static void gtk_spin_button_stop_spinning  (GtkSpinButton      *spin);
 static void gtk_spin_button_value_changed  (GtkAdjustment      *adjustment,
                                            GtkSpinButton      *spin_button); 
@@ -1036,7 +1036,7 @@ start_spinning (GtkSpinButton *spin,
 
       spin->timer_step = step;
       spin->need_timer = TRUE;
-      spin->timer = g_timeout_add (timeout,
+      spin->timer = gdk_threads_add_timeout (timeout,
                                   (GSourceFunc) gtk_spin_button_timer,
                                   (gpointer) spin);
     }
@@ -1176,8 +1176,6 @@ gtk_spin_button_timer (GtkSpinButton *spin_button)
 {
   gboolean retval = FALSE;
   
-  GDK_THREADS_ENTER ();
-
   if (spin_button->timer)
     {
       if (spin_button->click_child == GTK_ARROW_UP)
@@ -1193,7 +1191,7 @@ gtk_spin_button_timer (GtkSpinButton *spin_button)
           g_object_get (settings, "gtk-timeout-repeat", &timeout, NULL);
 
          spin_button->need_timer = FALSE;
-         spin_button->timer = g_timeout_add (timeout,
+         spin_button->timer = gdk_threads_add_timeout (timeout,
                                              (GSourceFunc) gtk_spin_button_timer, 
                                              (gpointer) spin_button);
        }
@@ -1214,8 +1212,6 @@ gtk_spin_button_timer (GtkSpinButton *spin_button)
        }
     }
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
index f9d5215f70dc1bc5d43b38234c978b3daaf27f12..43fcdf46ca25c810c00b1f3e169eb8cb8ae9c895 100755 (executable)
@@ -1574,7 +1574,7 @@ gtk_status_icon_enable_blinking (GtkStatusIcon *status_icon)
       gtk_status_icon_blinker (status_icon);
 
       priv->blinking_timeout =
-       g_timeout_add (BLINK_TIMEOUT, 
+       gdk_threads_add_timeout (BLINK_TIMEOUT, 
                       (GSourceFunc) gtk_status_icon_blinker, 
                       status_icon);
     }
index 6070b617dd4dae1837d076a40f37576303d5fe70..eda58aad6fad525c1157a70c59ef51c00eaa7438 100644 (file)
@@ -1580,8 +1580,6 @@ gtk_text_scroll_timeout (gpointer data)
   gint x, y;
   GdkModifierType mask;
   
-  GDK_THREADS_ENTER ();
-
   text = GTK_TEXT (data);
   
   text->timer = 0;
@@ -1601,8 +1599,6 @@ gtk_text_scroll_timeout (gpointer data)
       gdk_event_free (event);
     }
 
-  GDK_THREADS_LEAVE ();
-  
   return FALSE;
 }
 
@@ -1803,7 +1799,7 @@ gtk_text_motion_notify (GtkWidget      *widget,
     {
       if (text->timer == 0)
        {
-         text->timer = g_timeout_add (SCROLL_TIME, 
+         text->timer = gdk_threads_add_timeout (SCROLL_TIME, 
                                       gtk_text_scroll_timeout,
                                       text);
          
index 3a88622631540c29dcfbe3acf0508a77260f3f27..d5664a85101858afc7a4a185e6f76b8c612eeeff 100644 (file)
@@ -3240,8 +3240,6 @@ first_validate_callback (gpointer data)
 {
   GtkTextView *text_view = data;
 
-  GDK_THREADS_ENTER ();
-  
   /* Note that some of this code is duplicated at the end of size_allocate,
    * keep in sync with that.
    */
@@ -3250,8 +3248,6 @@ first_validate_callback (gpointer data)
 
   gtk_text_view_flush_first_validate (text_view);
   
-  GDK_THREADS_LEAVE ();
-  
   return FALSE;
 }
 
@@ -3261,8 +3257,6 @@ incremental_validate_callback (gpointer data)
   GtkTextView *text_view = data;
   gboolean result = TRUE;
 
-  GDK_THREADS_ENTER ();
-  
   DV(g_print(G_STRLOC"\n"));
   
   gtk_text_layout_validate (text_view->layout, 2000);
@@ -3275,8 +3269,6 @@ incremental_validate_callback (gpointer data)
       result = FALSE;
     }
 
-  GDK_THREADS_LEAVE ();
-
   return result;
 }
 
@@ -3294,14 +3286,14 @@ gtk_text_view_invalidate (GtkTextView *text_view)
   
   if (!text_view->first_validate_idle)
     {
-      text_view->first_validate_idle = g_idle_add_full (GTK_PRIORITY_RESIZE - 2, first_validate_callback, text_view, NULL);
+      text_view->first_validate_idle = gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 2, first_validate_callback, text_view, NULL);
       DV (g_print (G_STRLOC": adding first validate idle %d\n",
                    text_view->first_validate_idle));
     }
       
   if (!text_view->incremental_validate_idle)
     {
-      text_view->incremental_validate_idle = g_idle_add_full (GTK_TEXT_VIEW_PRIORITY_VALIDATE, incremental_validate_callback, text_view, NULL);
+      text_view->incremental_validate_idle = gdk_threads_add_idle_full (GTK_TEXT_VIEW_PRIORITY_VALIDATE, incremental_validate_callback, text_view, NULL);
       DV (g_print (G_STRLOC": adding incremental validate idle %d\n",
                    text_view->incremental_validate_idle));
     }
@@ -4513,8 +4505,6 @@ blink_cb (gpointer data)
   gboolean visible;
   gint blink_timeout;
 
-  GDK_THREADS_ENTER ();
-
   text_view = GTK_TEXT_VIEW (data);
   priv = GTK_TEXT_VIEW_GET_PRIVATE (text_view);
 
@@ -4540,12 +4530,12 @@ blink_cb (gpointer data)
       text_view->blink_timeout = 0;
     } 
   else if (visible)
-    text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+    text_view->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
                                              blink_cb,
                                              text_view);
   else 
     {
-      text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+      text_view->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
                                                blink_cb,
                                                text_view);
       priv->blink_time += get_cursor_time (text_view);
@@ -4565,8 +4555,6 @@ blink_cb (gpointer data)
 
   text_window_invalidate_cursors (text_view->text_window);
 
-  GDK_THREADS_LEAVE ();
-
   /* Remove ourselves */
   return FALSE;
 }
@@ -4595,7 +4583,7 @@ gtk_text_view_check_cursor_blink (GtkTextView *text_view)
            {
              gtk_text_layout_set_cursor_visible (text_view->layout, TRUE);
              
-             text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+             text_view->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
                                                        blink_cb,
                                                        text_view);
            }
@@ -4624,7 +4612,7 @@ gtk_text_view_pend_cursor_blink (GtkTextView *text_view)
       gtk_text_view_stop_cursor_blink (text_view);
       gtk_text_layout_set_cursor_visible (text_view->layout, TRUE);
       
-      text_view->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
+      text_view->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
                                                blink_cb,
                                                text_view);
     }
@@ -5558,13 +5546,11 @@ move_mark_to_pointer_and_scroll (GtkTextView *text_view,
                G_STRLOC, text_view->first_validate_idle));
 }
 
-static gint
+static gboolean
 selection_scan_timeout (gpointer data)
 {
   GtkTextView *text_view;
 
-  GDK_THREADS_ENTER ();
-  
   text_view = GTK_TEXT_VIEW (data);
 
   DV(g_print (G_STRLOC": calling move_mark_to_pointer_and_scroll\n"));
@@ -5572,8 +5558,6 @@ selection_scan_timeout (gpointer data)
                                      gtk_text_buffer_get_mark (get_buffer (text_view),
                                                                "insert"));
 
-  GDK_THREADS_LEAVE ();
-  
   return TRUE; /* remain installed. */
 }
 
@@ -5585,8 +5569,6 @@ drag_scan_timeout (gpointer data)
   GtkTextView *text_view;
   GtkTextIter newplace;
 
-  GDK_THREADS_ENTER ();
-  
   text_view = GTK_TEXT_VIEW (data);
 
   get_iter_at_pointer (text_view, &newplace);
@@ -5600,8 +5582,6 @@ drag_scan_timeout (gpointer data)
                                 text_view->dnd_mark,
                                 DND_SCROLL_MARGIN, FALSE, 0.0, 0.0);
 
-  GDK_THREADS_LEAVE ();
-  
   return TRUE;
 }
 
@@ -5753,7 +5733,7 @@ selection_motion_event_handler (GtkTextView    *text_view,
     g_source_remove (text_view->scroll_timeout);
   
   text_view->scroll_timeout =
-    g_timeout_add (50, selection_scan_timeout, text_view);
+    gdk_threads_add_timeout (50, selection_scan_timeout, text_view);
 
   return TRUE;
 }
@@ -6335,7 +6315,7 @@ gtk_text_view_drag_motion (GtkWidget        *widget,
     g_source_remove (text_view->scroll_timeout);
       
   text_view->scroll_timeout =
-    g_timeout_add (50, drag_scan_timeout, text_view);
+    gdk_threads_add_timeout (50, drag_scan_timeout, text_view);
 
   /* TRUE return means don't propagate the drag motion to parent
    * widgets that may also be drop sites.
index 0dd959d9a5eb445b151d0341baaa968ede77ea00..c2032e9fb2f4e73cd2340752b2c301799b53c327 100644 (file)
@@ -1116,8 +1116,6 @@ slide_idle_handler (gpointer data)
   GtkToolbarPrivate *priv;
   GList *list;
   
-  GDK_THREADS_ENTER ();
-  
   priv = GTK_TOOLBAR_GET_PRIVATE (toolbar);
   
   if (priv->need_sync)
@@ -1193,7 +1191,6 @@ slide_idle_handler (gpointer data)
   priv->is_sliding = FALSE;
   priv->idle_id = 0;
 
-  GDK_THREADS_LEAVE();
   return FALSE;
 }
 
@@ -1230,7 +1227,7 @@ gtk_toolbar_begin_sliding (GtkToolbar *toolbar)
   priv->is_sliding = TRUE;
   
   if (!priv->idle_id)
-    priv->idle_id = g_idle_add (slide_idle_handler, toolbar);
+    priv->idle_id = gdk_threads_add_idle (slide_idle_handler, toolbar);
   
   rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
   vertical = (toolbar->orientation == GTK_ORIENTATION_VERTICAL);
index d203082d7cfdeb0355e0cd6286b13f6fe4f0148e..458f9e4109d90c87a0ab8b3c0758d9348033fe2f 100644 (file)
@@ -446,21 +446,17 @@ gtk_tooltips_draw_tips (GtkTooltips *tooltips)
   gtk_widget_show (tooltips->tip_window);
 }
 
-static gint
+static gboolean
 gtk_tooltips_timeout (gpointer data)
 {
   GtkTooltips *tooltips = (GtkTooltips *) data;
 
-  GDK_THREADS_ENTER ();
-  
   if (tooltips->active_tips_data != NULL &&
       GTK_WIDGET_DRAWABLE (tooltips->active_tips_data->widget))
     gtk_tooltips_draw_tips (tooltips);
 
   tooltips->timer_tag = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -620,7 +616,7 @@ gtk_tooltips_start_delay (GtkTooltips *tooltips,
        delay = STICKY_DELAY;
       else
        delay = tooltips->delay;
-      tooltips->timer_tag = g_timeout_add (delay,
+      tooltips->timer_tag = gdk_threads_add_timeout (delay,
                                           gtk_tooltips_timeout,
                                           (gpointer) tooltips);
     }
index 53580419ff048ef5053df2e3f8a2fa326b5e4c9a..c50119a554b4368fc164d5eb3080c0fcbfecf48f 100644 (file)
@@ -459,7 +459,7 @@ static void gtk_tree_view_tree_window_to_tree_coords (GtkTreeView *tree_view,
                                                      gint        *tx,
                                                      gint        *ty);
 
-static gint scroll_row_timeout                       (gpointer     data);
+static gboolean scroll_row_timeout                       (gpointer     data);
 static void remove_scroll_timeout                    (GtkTreeView *tree_view);
 
 static guint tree_view_signals [LAST_SIGNAL] = { 0 };
@@ -2980,8 +2980,6 @@ auto_expand_timeout (gpointer data)
   GtkTreeView *tree_view = GTK_TREE_VIEW (data);
   GtkTreePath *path;
 
-  GDK_THREADS_ENTER ();
-
   if (tree_view->priv->prelight_node)
     {
       path = _gtk_tree_view_find_path (tree_view,
@@ -2998,8 +2996,6 @@ auto_expand_timeout (gpointer data)
 
   tree_view->priv->auto_expand_timeout = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -3105,7 +3101,7 @@ do_prelight (GtkTreeView *tree_view,
   if (tree_view->priv->hover_expand)
     {
       tree_view->priv->auto_expand_timeout = 
-       g_timeout_add (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
+       gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
     }
 }
 
@@ -3920,7 +3916,7 @@ gtk_tree_view_motion_bin_window (GtkWidget      *widget,
 
       if (tree_view->priv->scroll_timeout == 0)
         {
-         tree_view->priv->scroll_timeout = g_timeout_add (150, scroll_row_timeout, tree_view);
+         tree_view->priv->scroll_timeout = gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
        }
     }
 
@@ -6190,8 +6186,6 @@ validate_rows_handler (GtkTreeView *tree_view)
 {
   gboolean retval;
 
-  GDK_THREADS_ENTER ();
-
   retval = do_validate_rows (tree_view, TRUE);
   if (! retval && tree_view->priv->validate_rows_timer)
     {
@@ -6199,8 +6193,6 @@ validate_rows_handler (GtkTreeView *tree_view)
       tree_view->priv->validate_rows_timer = 0;
     }
 
-  GDK_THREADS_LEAVE ();
-
   return retval;
 }
 
@@ -6235,12 +6227,8 @@ do_presize_handler (GtkTreeView *tree_view)
 static gboolean
 presize_handler_callback (gpointer data)
 {
-  GDK_THREADS_ENTER ();
-
   do_presize_handler (GTK_TREE_VIEW (data));
                   
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -6253,21 +6241,18 @@ install_presize_handler (GtkTreeView *tree_view)
   if (! tree_view->priv->presize_handler_timer)
     {
       tree_view->priv->presize_handler_timer =
-       g_idle_add_full (GTK_PRIORITY_RESIZE - 2, presize_handler_callback, tree_view, NULL);
+       gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 2, presize_handler_callback, tree_view, NULL);
     }
   if (! tree_view->priv->validate_rows_timer)
     {
       tree_view->priv->validate_rows_timer =
-       g_idle_add_full (GTK_TREE_VIEW_PRIORITY_VALIDATE, (GSourceFunc) validate_rows_handler, tree_view, NULL);
+       gdk_threads_add_idle_full (GTK_TREE_VIEW_PRIORITY_VALIDATE, (GSourceFunc) validate_rows_handler, tree_view, NULL);
     }
 }
 
 static gboolean
 scroll_sync_handler (GtkTreeView *tree_view)
 {
-
-  GDK_THREADS_ENTER ();
-
   if (tree_view->priv->height <= tree_view->priv->vadjustment->page_size)
     gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0);
   else if (gtk_tree_row_reference_valid (tree_view->priv->top_row))
@@ -6277,8 +6262,6 @@ scroll_sync_handler (GtkTreeView *tree_view)
 
   tree_view->priv->scroll_sync_timer = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -6291,7 +6274,7 @@ install_scroll_sync_handler (GtkTreeView *tree_view)
   if (!tree_view->priv->scroll_sync_timer)
     {
       tree_view->priv->scroll_sync_timer =
-       g_idle_add_full (GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC, (GSourceFunc) scroll_sync_handler, tree_view, NULL);
+       gdk_threads_add_idle_full (GTK_TREE_VIEW_PRIORITY_SCROLL_SYNC, (GSourceFunc) scroll_sync_handler, tree_view, NULL);
     }
 }
 
@@ -6689,8 +6672,6 @@ open_row_timeout (gpointer data)
   GtkTreeViewDropPosition pos;
   gboolean result = FALSE;
 
-  GDK_THREADS_ENTER ();
-
   gtk_tree_view_get_drag_dest_row (tree_view,
                                    &dest_path,
                                    &pos);
@@ -6712,25 +6693,19 @@ open_row_timeout (gpointer data)
       result = TRUE;
     }
 
-  GDK_THREADS_LEAVE ();
-
   return result;
 }
 
-static gint
+static gboolean
 scroll_row_timeout (gpointer data)
 {
   GtkTreeView *tree_view = data;
 
-  GDK_THREADS_ENTER ();
-
   gtk_tree_view_vertical_autoscroll (tree_view);
 
   if (tree_view->priv->rubber_band_status == RUBBER_BAND_ACTIVE)
     gtk_tree_view_update_rubber_band (tree_view);
 
-  GDK_THREADS_LEAVE ();
-
   return TRUE;
 }
 
@@ -7180,12 +7155,12 @@ gtk_tree_view_drag_motion (GtkWidget        *widget,
            pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE))
         {
           tree_view->priv->open_dest_timeout =
-            g_timeout_add (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
+            gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
         }
       else if (tree_view->priv->scroll_timeout == 0)
         {
          tree_view->priv->scroll_timeout =
-           g_timeout_add (150, scroll_row_timeout, tree_view);
+           gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
        }
 
       if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
@@ -10053,13 +10028,9 @@ gtk_tree_view_real_select_cursor_parent (GtkTreeView *tree_view)
 static gboolean
 gtk_tree_view_search_entry_flush_timeout (GtkTreeView *tree_view)
 {
-  GDK_THREADS_ENTER ();
-
   gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, tree_view);
   tree_view->priv->typeselect_flush_timeout = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -10225,7 +10196,7 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view,
     }
 
   tree_view->priv->typeselect_flush_timeout =
-    g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+    gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
                   (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                   tree_view);
 
@@ -11602,15 +11573,7 @@ gtk_tree_view_expand_all (GtkTreeView *tree_view)
 static gboolean
 expand_collapse_timeout (gpointer data)
 {
-  gboolean retval;
-
-  GDK_THREADS_ENTER ();
-
-  retval = do_expand_collapse (data);
-
-  GDK_THREADS_LEAVE ();
-
-  return retval;
+  return do_expand_collapse (data);
 }
 
 static gboolean
@@ -11851,7 +11814,7 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view,
 
   if (animate)
     {
-      tree_view->priv->expand_collapse_timeout = g_timeout_add (50, expand_collapse_timeout, tree_view);
+      tree_view->priv->expand_collapse_timeout = gdk_threads_add_timeout (50, expand_collapse_timeout, tree_view);
       tree_view->priv->expanded_collapsed_node = node;
       tree_view->priv->expanded_collapsed_tree = tree;
 
@@ -12055,7 +12018,7 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view,
   
   if (animate)
     {
-      tree_view->priv->expand_collapse_timeout = g_timeout_add (50, expand_collapse_timeout, tree_view);
+      tree_view->priv->expand_collapse_timeout = gdk_threads_add_timeout (50, expand_collapse_timeout, tree_view);
       tree_view->priv->expanded_collapsed_node = node;
       tree_view->priv->expanded_collapsed_tree = tree;
 
@@ -13827,7 +13790,7 @@ gtk_tree_view_search_preedit_changed (GtkIMContext *im_context,
     {
       g_source_remove (tree_view->priv->typeselect_flush_timeout);
       tree_view->priv->typeselect_flush_timeout =
-       g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+       gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
                       (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                       tree_view);
     }
@@ -13865,12 +13828,8 @@ gtk_tree_view_real_search_enable_popdown (gpointer data)
 {
   GtkTreeView *tree_view = (GtkTreeView *)data;
 
-  GDK_THREADS_ENTER ();
-
   tree_view->priv->disable_popdown = 0;
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -13878,7 +13837,7 @@ static void
 gtk_tree_view_search_enable_popdown (GtkWidget *widget,
                                     gpointer   data)
 {
-  g_timeout_add (200, gtk_tree_view_real_search_enable_popdown, data);
+  gdk_threads_add_timeout_full (G_PRIORITY_HIGH, 200, gtk_tree_view_real_search_enable_popdown, g_object_ref (data), g_object_unref);
 }
 
 static gboolean
@@ -13932,7 +13891,7 @@ gtk_tree_view_search_scroll_event (GtkWidget *widget,
     {
       g_source_remove (tree_view->priv->typeselect_flush_timeout);
       tree_view->priv->typeselect_flush_timeout =
-       g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+       gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
                       (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                       tree_view);
     }
@@ -14003,7 +13962,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 =
-       g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+       gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
                       (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                       tree_view);
     }
@@ -14261,7 +14220,7 @@ gtk_tree_view_search_init (GtkWidget   *entry,
     {
       g_source_remove (tree_view->priv->typeselect_flush_timeout);
       tree_view->priv->typeselect_flush_timeout =
-       g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+       gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
                       (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                       tree_view);
     }
index 8a3685f76ea06f39460168dec2f5cf5d0a000519..9e241c946a8fc777778fd45ddd7386c8d70d2105 100644 (file)
@@ -2620,9 +2620,7 @@ do_updates (GtkUIManager *self)
 static gboolean
 do_updates_idle (GtkUIManager *self)
 {
-  GDK_THREADS_ENTER ();
   do_updates (self);
-  GDK_THREADS_LEAVE ();
 
   return FALSE;
 }
@@ -2633,7 +2631,8 @@ queue_update (GtkUIManager *self)
   if (self->private_data->update_tag != 0)
     return;
 
-  self->private_data->update_tag = g_idle_add ((GSourceFunc)do_updates_idle, 
+  self->private_data->update_tag = gdk_threads_add_idle (
+                                              (GSourceFunc)do_updates_idle, 
                                               self);
 }
 
index 1da30202ee0d855408457de6f20434f04abad5ee..c12dc6a1519c8c418275743f6d67a7530cf5cbe6 100644 (file)
@@ -1360,7 +1360,6 @@ handle_keys_changed (gpointer data)
 {
   GtkWindow *window;
 
-  GDK_THREADS_ENTER ();
   window = GTK_WINDOW (data);
 
   if (window->keys_changed_handler)
@@ -1370,7 +1369,6 @@ handle_keys_changed (gpointer data)
     }
 
   g_signal_emit (window, window_signals[KEYS_CHANGED], 0);
-  GDK_THREADS_LEAVE ();
   
   return FALSE;
 }
@@ -1379,7 +1377,7 @@ static void
 gtk_window_notify_keys_changed (GtkWindow *window)
 {
   if (!window->keys_changed_handler)
-    window->keys_changed_handler = g_idle_add (handle_keys_changed, window);
+    window->keys_changed_handler = gdk_threads_add_idle (handle_keys_changed, window);
 }
 
 /**
index 12288710d2dd02c89f3a6f42ac943ce7755e4f51..5aab327f47f02c4ce39b76e7e938d5db39c22d58 100644 (file)
@@ -1158,6 +1158,9 @@ cups_request_printer_list (GtkPrintBackendCups *cups_backend)
       !cups_backend->got_default_printer)
     return TRUE;
 
+  g_object_ref (cups_backend);
+  GDK_THREADS_LEAVE ();
+
   cups_backend->list_printers_pending = TRUE;
 
   request = gtk_cups_request_new (NULL,
@@ -1176,6 +1179,8 @@ cups_request_printer_list (GtkPrintBackendCups *cups_backend)
                         (GtkPrintCupsResponseCallbackFunc) cups_request_printer_list_cb,
                        request,
                        NULL);
+  GDK_THREADS_ENTER ();
+  g_object_unref (cups_backend);
 
   return TRUE;
 }
@@ -1189,7 +1194,7 @@ cups_get_printer_list (GtkPrintBackend *backend)
   if (cups_backend->list_printers_poll == 0)
     {
       cups_request_printer_list (cups_backend);
-      cups_backend->list_printers_poll = g_timeout_add (3000,
+      cups_backend->list_printers_poll = gdk_threads_add_timeout (3000,
                                                         (GSourceFunc) cups_request_printer_list,
                                                         backend);
     }
index 3fd9f858df0769b6fb6f67d3e2945560e2784c3a..17be09cd3c45cc02539e987b36342b49754dabb9 100644 (file)
@@ -223,7 +223,7 @@ toplevel_expose_event_cb (GtkWidget *widget, GdkEventExpose *event, gpointer dat
 
   profiler = GTK_WIDGET_PROFILER (data);
 
-  g_idle_add_full (G_PRIORITY_HIGH, toplevel_idle_after_expose_cb, profiler, NULL);
+  gdk_threads_add_idle_full (G_PRIORITY_HIGH, toplevel_idle_after_expose_cb, profiler, NULL);
   return FALSE;
 }
 
index e7aa8de685097c54f10e416925ebfe93235e96d8..2706d9d5228634cf45f26bac2abf02c7c413c0e9 100644 (file)
@@ -122,7 +122,7 @@ test_set_filename (GtkFileChooserAction action,
 
   (* set_filename_fn) (GTK_FILE_CHOOSER (chooser), data);
 
-  g_timeout_add (2000, set_filename_timeout_cb, &closure);
+  gdk_threads_add_timeout (2000, set_filename_timeout_cb, &closure);
   gtk_dialog_run (GTK_DIALOG (chooser));
 
   retval = (* compare_filename_fn) (GTK_FILE_CHOOSER (chooser), data);
@@ -332,7 +332,7 @@ test_confirm_overwrite_for_path (const char *path)
 
   gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (closure.chooser), path);
 
-  g_timeout_add (2000, confirm_overwrite_timeout_cb, &closure);
+  gdk_threads_add_timeout (2000, confirm_overwrite_timeout_cb, &closure);
   gtk_dialog_run (GTK_DIALOG (closure.chooser));
 
   filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (closure.chooser));
@@ -899,7 +899,7 @@ sleep_timeout_cb (gpointer data)
 static void
 sleep_in_main_loop (int milliseconds)
 {
-  g_timeout_add (milliseconds, sleep_timeout_cb, NULL);
+  gdk_threads_add_timeout (milliseconds, sleep_timeout_cb, NULL);
   gtk_main ();
 }
 
index 33bd6ba4b00f20a1c29c4c9ed00642ad3abf8677..9738fc63a78e565e3e850f865bab4407a307eaf6 100644 (file)
@@ -105,7 +105,7 @@ timeout_cb (gpointer data)
 static void
 wait_for_callback (TestCallbackClosure *closure)
 {
-  g_timeout_add (CALLBACK_TIMEOUT_MS, timeout_cb, closure);
+  gdk_threads_add_timeout (CALLBACK_TIMEOUT_MS, timeout_cb, closure);
   gtk_main ();
 }
 
index 74fbcbf470a4aa5203a862fe314ed7601fc2f1dd..17a59f246496337993a5a233c69c27200c2c26ab 100644 (file)
@@ -137,7 +137,7 @@ main (gint argc, gchar **argv)
 
   gtk_widget_show (GTK_WIDGET (info.window));
   
-  g_idle_add (stress_test_old_api, &info);
+  gdk_threads_add_idle (stress_test_old_api, &info);
 
   gtk_widget_show_all (GTK_WIDGET (info.window));
   
index 826bb85028ee232dd17d805ef7c0e1f91c81cf94..3eff2cdf5d0af2d1635b46b010c5c06198c739dc 100644 (file)
@@ -143,7 +143,7 @@ prepare_callback (GtkWidget *widget, GtkWidget *page)
       progress = GTK_BIN (page)->child;
       gtk_assistant_set_page_complete (GTK_ASSISTANT (widget), page, FALSE);
       gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress), 0.0);
-      g_timeout_add (300, (GSourceFunc) progress_timeout, widget);
+      gdk_threads_add_timeout (300, (GSourceFunc) progress_timeout, widget);
     }
   else
     g_print ("prepare: %d\n", gtk_assistant_get_current_page (GTK_ASSISTANT (widget)));
index 12d8de34475e14cb418db55c8d007b2eab7dd9d9..c27cc005fb532c4a131afef789eaa832037012ca 100644 (file)
@@ -1332,7 +1332,7 @@ main (int argc, char **argv)
         gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combobox), &iter);
 
 #if 1
-       g_timeout_add (1000, (GSourceFunc) capital_animation, model);
+       gdk_threads_add_timeout (1000, (GSourceFunc) capital_animation, model);
 #endif
 
         gtk_widget_show_all (window);
index b67b0f50feb54a4670c1d620f222fadd4b22827e..7e42cbca1423bf8f6cb3cb2c0b19f79fe2acb56c 100644 (file)
@@ -228,7 +228,7 @@ on_animate (void)
 {
   n_animations += 20;
  
-  timer = g_timeout_add (1000, (GSourceFunc) animation_timer, NULL);
+  timer = gdk_threads_add_timeout (1000, (GSourceFunc) animation_timer, NULL);
 }
 
 int
index d2e9a5c488249a6c8e530b4485b60b6ee7f686e5..608cfc869321f812f5023c6873ca47cab51552aa 100644 (file)
@@ -485,12 +485,12 @@ popup_leave          (GtkWidget          *widget,
       if (!popdown_timer)
        {
          g_print ("added popdown\n");
-         popdown_timer = g_timeout_add (500, popdown_cb, NULL);
+         popdown_timer = gdk_threads_add_timeout (500, popdown_cb, NULL);
        }
     }
 }
 
-gint
+gboolean
 popup_cb (gpointer data)
 {
   if (!popped_up)
@@ -534,7 +534,7 @@ popup_cb (gpointer data)
       popped_up = TRUE;
     }
 
-  popdown_timer = g_timeout_add (500, popdown_cb, NULL);
+  popdown_timer = gdk_threads_add_timeout (500, popdown_cb, NULL);
   g_print ("added popdown\n");
 
   popup_timer = FALSE;
@@ -550,7 +550,7 @@ popsite_motion         (GtkWidget          *widget,
                    guint               time)
 {
   if (!popup_timer)
-    popup_timer = g_timeout_add (500, popup_cb, NULL);
+    popup_timer = gdk_threads_add_timeout (500, popup_cb, NULL);
 
   return TRUE;
 }
index a0cf7d77525aa2a0ddc9c549c04acd61b7f9eece..483010b1f966ba3292797d14c87b9ab138c5efeb 100644 (file)
@@ -417,7 +417,7 @@ main (int argc, char *argv[])
   gtk_entry_completion_set_text_column (completion, 0);
 
   /* Fill the completion dynamically */
-  g_timeout_add (1000, (GSourceFunc) animation_timer, completion);
+  gdk_threads_add_timeout (1000, (GSourceFunc) animation_timer, completion);
 
   /* Fourth entry */
   gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Model-less entry completion"), FALSE, FALSE, 0);
index 81c1964203dbb315c0ec897bbc3a143effc5cbcc..86eda4bc4603a61d0f33097c14b937f978d96a9d 100644 (file)
@@ -151,7 +151,7 @@ main (int argc, char **argv)
       gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
       gtk_widget_show (menuitem);
       
-      g_timeout_add (250, change_item, submenu);
+      gdk_threads_add_timeout (250, change_item, submenu);
 
       menuitem = gtk_menu_item_new_with_label ("bar");
       gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (4, TRUE));
index 6832f759d63fd8c972dab4dee83037d0aa56d5ea..8aa5002d5efcdfcedb511995ab069032b08d6eb6 100644 (file)
@@ -140,7 +140,7 @@ static void
 toggle_dynamic (GtkWidget    *button, 
                GtkUIManager *merge)
 {
-  g_timeout_add (2000, (GSourceFunc)delayed_toggle_dynamic, merge);
+  gdk_threads_add_timeout (2000, (GSourceFunc)delayed_toggle_dynamic, merge);
 }
 
 static void
index a4760893da8c3ab6a988a4eb55799b948f5d868d..0879865c8da71365011ee2a6d5b16f03c00162b4 100644 (file)
@@ -97,7 +97,7 @@ blink (GtkWidget *widget,
   
   if (!blink_timeout)
     {
-      blink_timeout = g_timeout_add (1000, blink_cb, window);
+      blink_timeout = gdk_threads_add_timeout (1000, blink_cb, window);
       gtk_widget_hide (window);
 
       g_object_set_data (G_OBJECT (window), "blink", GUINT_TO_POINTER (blink_timeout));
index 9a27492519f0f109ce3ab78fe2890a10634d4354..1256152e97e14f4e1e6df9258f711e56cc0127a5 100755 (executable)
@@ -126,7 +126,7 @@ timeout_toggle_toggled (GtkToggleButton *toggle)
     }
   else
     {
-      timeout = g_timeout_add (2000, timeout_handler, NULL);
+      timeout = gdk_threads_add_timeout (2000, timeout_handler, NULL);
     }
 }
 
@@ -301,7 +301,7 @@ main (int argc, char **argv)
 
       icons = g_slist_append (icons, icon);
  
-      timeout = g_timeout_add (2000, timeout_handler, icon);
+      timeout = gdk_threads_add_timeout (2000, timeout_handler, icon);
     }
 
   gtk_main ();
index 5ad9304bcac6f79acfc6274432b28394a595d168..b1f6f532a037f47d616b972c5b6639329b6f740b 100644 (file)
@@ -2460,7 +2460,7 @@ buffer_set_colors (Buffer  *buffer,
   gdouble hue = 0.0;
 
   if (enabled && buffer->color_cycle_timeout == 0)
-    buffer->color_cycle_timeout = g_timeout_add (200, color_cycle_timeout, buffer);
+    buffer->color_cycle_timeout = gdk_threads_add_timeout (200, color_cycle_timeout, buffer);
   else if (!enabled && buffer->color_cycle_timeout != 0)
     {
       g_source_remove (buffer->color_cycle_timeout);
index 0818c5dcead9723727d5c2b9b3898457c96a02ba..1e4985f8f6c21afd72563637bd4b4adb07bb40e6 100644 (file)
@@ -608,7 +608,7 @@ main (gint argc, gchar **argv)
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (item), NULL);
   add_item_to_list (store, item, "New");
   gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
-  g_timeout_add (3000, (GSourceFunc) timeout_cb, item);
+  gdk_threads_add_timeout (3000, (GSourceFunc) timeout_cb, item);
   gtk_tool_item_set_expand (item, TRUE);
 
   menu = gtk_menu_new ();
@@ -626,7 +626,7 @@ main (gint argc, gchar **argv)
   gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (item), menu);
   add_item_to_list (store, item, "Open");
   gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
-  g_timeout_add (3000, (GSourceFunc) timeout_cb1, item);
+  gdk_threads_add_timeout (3000, (GSourceFunc) timeout_cb1, item);
  
   menu = gtk_menu_new ();
   for (i = 0; i < 20; i++)
index 1af0b6e72c2b8d8ba997094fe9769231f458139a..e5ebacd8994e1b1a5f71a4fae4808b2fc8435fee 100644 (file)
@@ -168,7 +168,7 @@ main (int argc, char *argv[])
   g_signal_connect (button, "realize", G_CALLBACK (gtk_widget_grab_focus), NULL);
   gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
   gtk_widget_show_all (window);
-  g_timeout_add (1000, (GSourceFunc) futz, NULL);
+  gdk_threads_add_timeout (1000, (GSourceFunc) futz, NULL);
   gtk_main ();
   return 0;
 }