summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@gnome.org>2018-07-11 14:44:29 +0300
committerAntónio Fernandes <antoniof@gnome.org>2021-08-15 21:14:27 +0100
commitfee3e22d66d40c35f22e30f3aaf7a2811161c39f (patch)
treec62944ce27a3b02ee27cf59e5ed576d7b7f1d699
parent7d188272c80dfa179cf2284aba756c25211d182e (diff)
downloadnautilus-fee3e22d66d40c35f22e30f3aaf7a2811161c39f.tar.gz
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>
-rw-r--r--src/nautilus-canvas-dnd.c5
-rw-r--r--src/nautilus-dnd.h2
-rw-r--r--src/nautilus-tree-view-drag-dest.c5
-rw-r--r--src/nautilus-window-slot-dnd.c8
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