aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-07-19 10:44:48 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-07-19 10:44:48 +0000
commitca8ebeb05ab140f3114d82edc0a85b69e5dc6aa8 (patch)
tree3cca8720cb9b03b6b012618e7e1dcbe2495defa9 /src
parentdd1685e947866decb2505133bc33e2534d11dc80 (diff)
added a hack to prevent duplicated insertion to compose.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@437 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/compose.c b/src/compose.c
index c7d59dd6..2aa31081 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -6269,10 +6269,31 @@ static void compose_insert_drag_received_cb (GtkWidget *widget,
{
Compose *compose = (Compose *)user_data;
GList *list, *cur;
+ static GdkDragContext *context_ = NULL;
+ static gint x_ = -1, y_ = -1;
+ static guint info_ = N_DRAG_TYPES;
+ static guint time_ = G_MAXUINT;
debug_print("compose_insert_drag_received_cb(): received %s\n",
(const gchar *)data->data);
+ /* FIXME: somehow drag-data-received signal is emitted twice.
+ * This hack prevents duplicated insertion. */
+ if (context_ == drag_context && x_ == x && y_ == y && info_ == info &&
+ time_ == time) {
+ debug_print("dup event\n");
+ context_ = NULL;
+ x_ = y_ = -1;
+ info_ = N_DRAG_TYPES;
+ time_ = G_MAXUINT;
+ return;
+ }
+ context_ = drag_context;
+ x_ = x;
+ y_ = y;
+ info_ = info;
+ time_ = time;
+
list = uri_list_extract_filenames((const gchar *)data->data);
for (cur = list; cur != NULL; cur = cur->next)
compose_insert_file(compose, (const gchar *)cur->data, TRUE);