Fix #314: Remote commands for thumbnail maintenance
[geeqie.git] / src / ui_bookmark.c
index 18f7311..ae9a0fc 100644 (file)
@@ -1,13 +1,22 @@
 /*
- * (SLIK) SimpLIstic sKin functions
- * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
  * Author: John Ellis
  *
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -473,6 +482,7 @@ static void bookmark_drag_set_data(GtkWidget *button,
        GList *list = NULL;
 
 #if GTK_CHECK_VERSION(3,0,0)
+       return;
        if (gdk_drag_context_get_dest_window(context) == gtk_widget_get_window(bm->widget)) return;
 #else
        if (context->dest_window == bm->widget->window) return;
@@ -483,7 +493,7 @@ static void bookmark_drag_set_data(GtkWidget *button,
 
        list = g_list_append(list, b->path);
 
-       gchar **uris = uris_from_filelist(list);
+       gchar **uris = uris_from_pathlist(list);
        gboolean ret = gtk_selection_data_set_uris(selection_data, uris);
        if (!ret)
                {
@@ -502,6 +512,10 @@ static void bookmark_drag_begin(GtkWidget *button, GdkDragContext *context, gpoi
        GdkModifierType mask;
        gint x, y;
        GtkAllocation allocation;
+#if GTK_CHECK_VERSION(3,0,0)
+       GdkDeviceManager *device_manager;
+       GdkDevice *device;
+#endif
 
        gtk_widget_get_allocation(button, &allocation);
 
@@ -509,14 +523,17 @@ static void bookmark_drag_begin(GtkWidget *button, GdkDragContext *context, gpoi
        pixbuf = gdk_pixbuf_get_from_window(gtk_widget_get_window(button),
                                            allocation.x, allocation.y,
                                            allocation.width, allocation.height);
+       device_manager = gdk_display_get_device_manager(gdk_window_get_display(gtk_widget_get_window(button)));
+       device = gdk_device_manager_get_client_pointer(device_manager);
+       gdk_window_get_device_position(gtk_widget_get_window(button), device, &x, &y, &mask);
 #else
        pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8,
                                allocation.width, allocation.height);
        gdk_pixbuf_get_from_drawable(pixbuf, gtk_widget_get_window(button), NULL,
                                     allocation.x, allocation.y,
                                     0, 0, allocation.width, allocation.height);
-#endif
        gdk_window_get_pointer(gtk_widget_get_window(button), &x, &y, &mask);
+#endif
 
        gtk_drag_set_icon_pixbuf(context, pixbuf,
                                 x - allocation.x, y - allocation.y);
@@ -714,7 +731,7 @@ static void bookmark_dnd_get_data(GtkWidget *widget,
        if (!bm->editable) return;
 
        uris = gtk_selection_data_get_uris(selection_data);
-       list = uri_filelist_from_uris(uris, &errors);
+       list = uri_pathlist_from_uris(uris, &errors);
        if(errors)
                {
                warning_dialog_dnd_uri_error(errors);