[totem] Use gtk_drag_get_source_widget instead of storing window



commit 14e7f8e172446cf90d1d7f5f228ba20d16f073de
Author: Robin Stocker <robin nibor org>
Date:   Tue Dec 8 00:44:45 2009 +0100

    Use gtk_drag_get_source_widget instead of storing window

 src/totem-object.c  |    7 ++++---
 src/totem-private.h |    4 ----
 2 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 2e4bd62..20fc37f 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -2284,10 +2284,13 @@ drop_video_cb (GtkWidget     *widget,
 	 guint               _time,
 	 Totem              *totem)
 {
+	GtkWidget *source_widget;
 	gboolean empty_pl;
 
+	source_widget = gtk_drag_get_source_widget (context);
+
 	/* Drop of video on itself */
-	if (context->source_window == totem->video_drag_source_window &&
+	if (source_widget && widget == source_widget &&
 	    context->action == GDK_ACTION_MOVE) {
 		gtk_drag_finish (context, FALSE, FALSE, _time);
 		return;
@@ -2401,8 +2404,6 @@ drag_video_cb (GtkWidget *widget,
 	gtk_selection_data_set (selection_data, selection_data->target,
 				8, (guchar *) text, len);
 
-	totem->video_drag_source_window = context->source_window;
-
 	g_free (text);
 }
 
diff --git a/src/totem-private.h b/src/totem-private.h
index 43abc26..9b849a8 100644
--- a/src/totem-private.h
+++ b/src/totem-private.h
@@ -163,10 +163,6 @@ struct TotemObject {
 	TotemOpenLocation *open_location;
 	gboolean remember_position;
 	gboolean disable_kbd_shortcuts;
-
-	/* Stored source_window of GdkDragContext from a video drag,
-	 * used to detect when the video is dropped on itself. */
-	GdkWindow *video_drag_source_window;
 };
 
 GtkWidget *totem_volume_create (void);



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