summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-07-25 16:47:04 +0200
committerinfirit <[email protected]>2014-07-25 16:47:04 +0200
commitfe245c3ae28bd9638bcbbb0f1982a356635e8f2c (patch)
tree2a5cfd16b0f785e2b451e26139986a7978924a97
parent28536f23be5be6807e492b3b0ca677b14ff4257c (diff)
downloadeom-fe245c3ae28bd9638bcbbb0f1982a356635e8f2c.tar.bz2
eom-fe245c3ae28bd9638bcbbb0f1982a356635e8f2c.tar.xz
Ignore drag&drop requests from a window onto itself
Avoids accidential DnD of an image into the same window (e.g. while trying to scroll) and the resulting reload. Eog bug http://bugzilla.gnome.org/show_bug.cgi?id=585069 Based on eog commit 6a406bf93969a73159b67eefe125f700a1f82126 From Felix Riemann <[email protected]>
-rw-r--r--src/eom-window.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/eom-window.c b/src/eom-window.c
index 0d9f636..2cb28e7 100644
--- a/src/eom-window.c
+++ b/src/eom-window.c
@@ -4189,12 +4189,25 @@ eom_window_drag_data_received (GtkWidget *widget,
GSList *file_list;
EomWindow *window;
GdkAtom target;
+ GtkWidget *src;
target = gtk_selection_data_get_target (selection_data);
if (!gtk_targets_include_uri (&target, 1))
return;
+ /* if the request is from another process this will return NULL */
+ src = gtk_drag_get_source_widget (context);
+
+ /* if the drag request originates from the current eog instance, ignore
+ the request if the source window is the same as the dest window */
+ if (src &&
+ gtk_widget_get_toplevel (src) == gtk_widget_get_toplevel (widget))
+ {
+ gdk_drag_status (context, 0, time);
+ return;
+ }
+
if (gdk_drag_context_get_suggested_action (context) == GDK_ACTION_COPY) {
window = EOM_WINDOW (widget);