[Xfce4-commits] [xfce/xfce4-panel] 01/01: tasklist: Keep panel visible on drag and drop (Bug #15703)

noreply at xfce.org noreply at xfce.org
Sat Aug 3 23:02:42 CEST 2019


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit 75a10e232c2ebbd5bd3a04d580f522fbbf3495cd
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Sat Aug 3 23:02:32 2019 +0200

    tasklist: Keep panel visible on drag and drop (Bug #15703)
---
 plugins/tasklist/tasklist-widget.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index b8801ab..74119d1 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -40,6 +40,7 @@
 #include <X11/extensions/shape.h>
 #endif
 
+
 #include "tasklist-widget.h"
 
 
@@ -2195,18 +2196,47 @@ xfce_tasklist_child_drag_leave (XfceTasklistChild *child,
 
 
 
+static void
+xfce_tasklist_child_drag_begin_event (GtkWidget      *widget,
+                                      GdkDragContext *context,
+                                      gpointer        user_data)
+{
+  GtkWidget *plugin = user_data;
+
+  panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
+  xfce_panel_plugin_block_autohide (XFCE_PANEL_PLUGIN (plugin), TRUE);
+}
+
+
+
+static void
+xfce_tasklist_child_drag_end_event (GtkWidget      *widget,
+                                    GdkDragContext *context,
+                                    gpointer        user_data)
+{
+  GtkWidget *plugin = user_data;
+
+  panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
+  xfce_panel_plugin_block_autohide (XFCE_PANEL_PLUGIN (plugin), FALSE);
+}
+
+
+
 static XfceTasklistChild *
 xfce_tasklist_child_new (XfceTasklist *tasklist)
 {
   XfceTasklistChild *child;
   GtkCssProvider    *provider;
   gchar             *css_string;
+  GtkWidget         *plugin;
 
   panel_return_val_if_fail (XFCE_IS_TASKLIST (tasklist), NULL);
 
   child = g_slice_new0 (XfceTasklistChild);
   child->tasklist = tasklist;
 
+  plugin = xfce_tasklist_get_panel_plugin (tasklist);
+
   /* create the window button */
   child->button = xfce_arrow_button_new (GTK_ARROW_NONE);
   gtk_widget_set_parent (child->button, GTK_WIDGET (tasklist));
@@ -2273,9 +2303,13 @@ xfce_tasklist_child_new (XfceTasklist *tasklist)
   gtk_drag_dest_set (GTK_WIDGET (child->button), 0,
                      NULL, 0, GDK_ACTION_DEFAULT);
   g_signal_connect_swapped (G_OBJECT (child->button), "drag-motion",
-     G_CALLBACK (xfce_tasklist_child_drag_motion), child);
+                            G_CALLBACK (xfce_tasklist_child_drag_motion), child);
   g_signal_connect_swapped (G_OBJECT (child->button), "drag-leave",
-     G_CALLBACK (xfce_tasklist_child_drag_leave), child);
+                            G_CALLBACK (xfce_tasklist_child_drag_leave), child);
+  g_signal_connect_after (G_OBJECT (child->button), "drag-begin",
+                          G_CALLBACK (xfce_tasklist_child_drag_begin_event), XFCE_PANEL_PLUGIN (plugin));
+  g_signal_connect_after (G_OBJECT (child->button), "drag-end",
+                          G_CALLBACK (xfce_tasklist_child_drag_end_event), XFCE_PANEL_PLUGIN (plugin));
 
   return child;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list