aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--src/compose.c21
3 files changed, 31 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d58c4dca..25d654a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2005-07-19
+ * src/compose.c: compose_insert_drag_received_cb(): added a hack to
+ prevent duplicated insertion.
+
+2005-07-19
+
* src/compose.c: compose_get_line_break_pos(): don't break line after
'/' (to protect file path etc.).
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 7f1c86b5..2f596677 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,10 @@
2005-07-19
+ * src/compose.c: compose_insert_drag_received_cb(): 重複して挿入して
+ しまうのを防ぐための hack を追加。
+
+2005-07-19
+
* src/compose.c: compose_get_line_break_pos(): '/' の後で改行しない
ようにした(ファイルパス等を保護するため)。
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);