[Goodies-commits] r4093 - in xfce4-dict/trunk: . panel-plugin

Enrico Troeger enrico at xfce.org
Sat Mar 22 14:54:31 CET 2008


Author: enrico
Date: 2008-03-22 13:54:31 +0000 (Sat, 22 Mar 2008)
New Revision: 4093

Modified:
   xfce4-dict/trunk/ChangeLog
   xfce4-dict/trunk/panel-plugin/dict.c
Log:
Use GTK's predefined text targets for Drag'n'Drop. This fixes a strange bug when dragging non-Ascii text from Poedit.
Also allow move as DnD action.


Modified: xfce4-dict/trunk/ChangeLog
===================================================================
--- xfce4-dict/trunk/ChangeLog	2008-03-22 12:08:59 UTC (rev 4092)
+++ xfce4-dict/trunk/ChangeLog	2008-03-22 13:54:31 UTC (rev 4093)
@@ -1,3 +1,10 @@
+2008-03-22  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+	* Use GTK's predefined text targets for Drag'n'Drop. This fixes a strange
+	  bug when dragging non-Ascii text from Poedit.
+	  Also allow move as DnD action.
+
+
 2008-03-08  Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
 
 	* Don't use C++-style comments and fix some compiler warnings.

Modified: xfce4-dict/trunk/panel-plugin/dict.c
===================================================================
--- xfce4-dict/trunk/panel-plugin/dict.c	2008-03-22 12:08:59 UTC (rev 4092)
+++ xfce4-dict/trunk/panel-plugin/dict.c	2008-03-22 13:54:31 UTC (rev 4093)
@@ -1592,11 +1592,6 @@
 {
 	DictData *dd = g_new0(DictData, 1);
 	GtkWidget *hbox;
-	GtkTargetEntry copy_dest_types[] = {
-		{ "STRING", 0, 0 },
-		{ "UTF8_STRING", 0, 0 },
-		{ "text/plain", 0, 0 }
-	};
 
     xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
 
@@ -1653,9 +1648,10 @@
     xfce_panel_plugin_add_action_widget(plugin, dd->panel_button);
     dict_set_selection(dd);
 
-    /* DnD stuff */
-    gtk_drag_dest_set(GTK_WIDGET(dd->panel_button), GTK_DEST_DEFAULT_ALL,
-		copy_dest_types, G_N_ELEMENTS(copy_dest_types), GDK_ACTION_COPY);
+	/* DnD stuff */
+	gtk_drag_dest_set(GTK_WIDGET(dd->panel_button), GTK_DEST_DEFAULT_ALL,
+		NULL, 0, GDK_ACTION_COPY | GDK_ACTION_MOVE);
+	gtk_drag_dest_add_text_targets(GTK_WIDGET(dd->panel_button));
     g_signal_connect(dd->panel_button, "drag-data-received", G_CALLBACK(dict_drag_data_received), dd);
     g_signal_connect(dd->main_entry, "drag-data-received", G_CALLBACK(dict_drag_data_received), dd);
     g_signal_connect(dd->panel_entry, "drag-data-received", G_CALLBACK(dict_drag_data_received), dd);




More information about the Goodies-commits mailing list