[Xfce4-commits] <xfce4-panel:devel> Enable drop support in the launcher.

Nick Schermer nick at xfce.org
Tue Aug 11 20:28:40 CEST 2009


Updating branch refs/heads/devel
         to d181bbdac59dff3aaae8e45cb8aec4eae89ac9e2 (commit)
       from 362a0a23a1ff77e351a05d6f3ca43a48b3df96af (commit)

commit d181bbdac59dff3aaae8e45cb8aec4eae89ac9e2
Author: Nick Schermer <nick at xfce.org>
Date:   Thu Mar 5 22:33:21 2009 +0100

    Enable drop support in the launcher.

 plugins/launcher/launcher.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index 5d2d300..7aa29fd 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -128,6 +128,17 @@ GQuark launcher_plugin_quark = 0;
 
 
 
+/* target types for dropping in the launcher plugin */
+static const GtkTargetEntry drop_targets[] =
+{
+    { (gchar *) "text/uri-list", 0, 0, },
+    { (gchar *) "STRING", 0, 0 },
+    { (gchar *) "UTF8_STRING", 0, 0 },
+    { (gchar *) "text/plain", 0, 0 },
+};
+
+
+
 static void
 launcher_plugin_class_init (XfceLauncherPluginClass *klass)
 {
@@ -194,6 +205,9 @@ launcher_plugin_init (XfceLauncherPlugin *plugin)
   xfce_panel_plugin_add_action_widget (XFCE_PANEL_PLUGIN (plugin), plugin->button);
   gtk_widget_set_has_tooltip (plugin->button, TRUE);
   gtk_widget_show (plugin->button);
+  gtk_drag_dest_set (plugin->button, GTK_DEST_DEFAULT_ALL,
+                     drop_targets, G_N_ELEMENTS (drop_targets),
+                     GDK_ACTION_COPY);
   g_signal_connect (G_OBJECT (plugin->button), "button-press-event",
                     G_CALLBACK (launcher_plugin_button_press_event), plugin);
   g_signal_connect (G_OBJECT (plugin->button), "button-release-event",
@@ -213,6 +227,9 @@ launcher_plugin_init (XfceLauncherPlugin *plugin)
   gtk_box_pack_start (GTK_BOX (plugin->box), plugin->arrow, FALSE, FALSE, 0);
   xfce_panel_plugin_add_action_widget (XFCE_PANEL_PLUGIN (plugin), plugin->arrow);
   gtk_button_set_relief (GTK_BUTTON (plugin->arrow), GTK_RELIEF_NONE);
+  gtk_drag_dest_set (plugin->arrow, GTK_DEST_DEFAULT_ALL,
+                     drop_targets, G_N_ELEMENTS (drop_targets),
+                     GDK_ACTION_COPY);
   g_signal_connect (G_OBJECT (plugin->arrow), "button-press-event",
                     G_CALLBACK (launcher_plugin_arrow_press_event), plugin);
 



More information about the Xfce4-commits mailing list