[nautilus/wip/antoniof/gtk4-preparation-drop-outgoing-api: 2/23] general: Replace uses of GDK thread API




commit fee3e22d66d40c35f22e30f3aaf7a2811161c39f
Author: Ernestas Kulik <ernestask gnome org>
Date:   Wed Jul 11 14:44:29 2018 +0300

    general: Replace uses of GDK thread API
    
    We are doing all GTK stuff from the main thread anyway. If we are not,
    we are in big trouble anyway.
    
    So, drop gdk_threads* API this in preparation for GTK4, where it won't
    exist.
    
    Rebased and ammended by António Fernandes <antoniof gnome org>

 src/nautilus-canvas-dnd.c          | 5 +----
 src/nautilus-dnd.h                 | 2 ++
 src/nautilus-tree-view-drag-dest.c | 5 +----
 src/nautilus-window-slot-dnd.c     | 8 ++++----
 4 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/nautilus-canvas-dnd.c b/src/nautilus-canvas-dnd.c
index 1f86039c2..2adfe7dde 100644
--- a/src/nautilus-canvas-dnd.c
+++ b/src/nautilus-canvas-dnd.c
@@ -1516,10 +1516,7 @@ check_hover_timer (NautilusCanvasContainer *container,
     if (uri != NULL)
     {
         dnd_info->target_uri = g_strdup (uri);
-        dnd_info->hover_id =
-            gdk_threads_add_timeout (timeout,
-                                     hover_timer,
-                                     container);
+        dnd_info->hover_id = g_timeout_add (HOVER_TIMEOUT, hover_timer, container);
     }
 }
 
diff --git a/src/nautilus-dnd.h b/src/nautilus-dnd.h
index 6e101b529..0bb5e732f 100644
--- a/src/nautilus-dnd.h
+++ b/src/nautilus-dnd.h
@@ -27,6 +27,8 @@
 #include <gtk/gtk.h>
 #include "nautilus-file.h"
 
+#define HOVER_TIMEOUT 500
+
 /* Drag & Drop target names. */
 #define NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE "x-special/gnome-icon-list"
 #define NAUTILUS_ICON_DND_URI_LIST_TYPE                "text/uri-list"
diff --git a/src/nautilus-tree-view-drag-dest.c b/src/nautilus-tree-view-drag-dest.c
index 379693ffd..4dd9d794e 100644
--- a/src/nautilus-tree-view-drag-dest.c
+++ b/src/nautilus-tree-view-drag-dest.c
@@ -362,10 +362,7 @@ check_hover_timer (NautilusTreeViewDragDest *dest,
     if (uri != NULL)
     {
         dest->details->target_uri = g_strdup (uri);
-        dest->details->hover_id =
-            gdk_threads_add_timeout (timeout,
-                                     hover_timer,
-                                     dest);
+        dest->details->hover_id = g_timeout_add (HOVER_TIMEOUT, hover_timer, dest);
     }
 }
 
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index 96c5d9cc8..d4398f307 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -133,10 +133,10 @@ slot_proxy_check_switch_location_timer (NautilusDragSlotProxyInfo *drag_info,
     settings = gtk_widget_get_settings (widget);
     g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
 
-    drag_info->switch_location_timer =
-        gdk_threads_add_timeout (timeout,
-                                 slot_proxy_switch_location_timer,
-                                 drag_info);
+
+    drag_info->switch_location_timer = g_timeout_add (HOVER_TIMEOUT,
+                                                      slot_proxy_switch_location_timer,
+                                                      drag_info);
 }
 
 static void


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