[Xfce4-commits] <xfce4-panel:devel> * Add marshal file. * Fix dnd for external plugins (start a drag without gtk event).

Nick Schermer nick at xfce.org
Tue Aug 11 20:24:04 CEST 2009


Updating branch refs/heads/devel
         to c34d781f2257e2435123c0a7373f868be936bcfe (commit)
       from 83ab6d460952e9d2844a511d9ecd9285ee6d2f2a (commit)

commit c34d781f2257e2435123c0a7373f868be936bcfe
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Aug 18 22:55:33 2008 +0200

    * Add marshal file.
    * Fix dnd for external plugins (start a drag without gtk event).

 libxfce4panel/libxfce4panel-marshal.list |    1 +
 panel/panel-application.c                |   31 +++++++++++------------------
 2 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/libxfce4panel/libxfce4panel-marshal.list b/libxfce4panel/libxfce4panel-marshal.list
new file mode 100644
index 0000000..8ff8506
--- /dev/null
+++ b/libxfce4panel/libxfce4panel-marshal.list
@@ -0,0 +1 @@
+BOOLEAN:INT
diff --git a/panel/panel-application.c b/panel/panel-application.c
index 367671a..f6d9b05 100644
--- a/panel/panel-application.c
+++ b/panel/panel-application.c
@@ -538,34 +538,27 @@ static void
 panel_application_plugin_move (GtkWidget        *item,
                                PanelApplication *application)
 {
-  GdkEvent      *event;
   GtkTargetList *target_list;
 
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (item));
   panel_return_if_fail (PANEL_IS_APPLICATION (application));
 
-  /* get a copy of the current event */
-  event = gtk_get_current_event ();
-  if (G_LIKELY (event))
-    {
-      /* make the window insensitive */
-      panel_application_windows_sensitive (application, FALSE);
-
-      /* create a target list */
-      target_list = gtk_target_list_new (drag_targets, G_N_ELEMENTS (drag_targets));
+  /* make the window insensitive */
+  panel_application_windows_sensitive (application, FALSE);
 
-      /* begin a drag */
-      gtk_drag_begin (item, target_list, GDK_ACTION_MOVE, 1, event);
+  /* create a target list */
+  target_list = gtk_target_list_new (drag_targets, G_N_ELEMENTS (drag_targets));
 
-      /* release the drag list */
-      gtk_target_list_unref (target_list);
+  /* begin a drag */
+  gtk_drag_begin (item, target_list, GDK_ACTION_MOVE, 1, NULL);
+  
+  /* TODO set something fancy here. A snapshot of the plugin or the icon name... */
 
-      /* free the event */
-      gdk_event_free (event);
+  /* release the drag list */
+  gtk_target_list_unref (target_list);
 
-      /* signal to make the window sensitive again on a drag end */
-      g_signal_connect (G_OBJECT (item), "drag-end", G_CALLBACK (panel_application_plugin_move_end), application);
-    }
+  /* signal to make the window sensitive again on a drag end */
+  g_signal_connect (G_OBJECT (item), "drag-end", G_CALLBACK (panel_application_plugin_move_end), application);
 }
 
 



More information about the Xfce4-commits mailing list