[Xfce4-commits] [xfce/xfwm4] 03/07: settings-dialog: Fix drag and drop of buttons

noreply at xfce.org noreply at xfce.org
Sun Apr 5 17:53:21 CEST 2020


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

o   l   i   v   i   e   r       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/xfwm4.

commit 1e3dd9c8a5510144676ac1df4c4a21ca88a69bf5
Author: Stefan Berzl <stefan at localhost.localdomain>
Date:   Sat Sep 16 02:00:17 2017 +0200

    settings-dialog: Fix drag and drop of buttons
    
    Bug: 13861
    
    Drag and Drop inside GtkSocket and GtkPlug doesn't work correctly.
    
    The drag_end handler isn't called when a button from "Button layout" is
    dragged.
    
    Fortunately, this only happens when the button is dragged onto the
    specified drag area.
    
    All we need to do is move the gtk_widget_show() function at the end of
    the drag-data-received handler.
---
 settings-dialogs/xfwm4-settings.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c
index 8d78972..939d71a 100644
--- a/settings-dialogs/xfwm4-settings.c
+++ b/settings-dialogs/xfwm4-settings.c
@@ -1103,6 +1103,7 @@ xfwm_settings_active_frame_drag_data (GtkWidget        *widget,
   gtk_box_reorder_child (GTK_BOX (active_box), source, i);
 
   xfwm_settings_save_button_layout (settings, GTK_CONTAINER (active_box));
+  gtk_widget_show (source);
 }
 
 
@@ -1193,15 +1194,17 @@ xfwm_settings_hidden_frame_drag_data (GtkWidget        *widget,
   hidden_box = GTK_WIDGET (gtk_builder_get_object (settings->priv->builder, "hidden-box"));
   active_box = GTK_WIDGET (gtk_builder_get_object (settings->priv->builder, "active-box"));
 
-  if (G_UNLIKELY (parent == hidden_box))
-    return;
+  if (G_LIKELY (parent != hidden_box))
+    {
+      g_object_ref (source);
+      gtk_container_remove (GTK_CONTAINER (parent), source);
+      gtk_box_pack_start (GTK_BOX (hidden_box), source, FALSE, FALSE, 0);
+      g_object_unref (source);
 
-  g_object_ref (source);
-  gtk_container_remove (GTK_CONTAINER (parent), source);
-  gtk_box_pack_start (GTK_BOX (hidden_box), source, FALSE, FALSE, 0);
-  g_object_unref (source);
+      xfwm_settings_save_button_layout (settings, GTK_CONTAINER (active_box));
+    }
 
-  xfwm_settings_save_button_layout (settings, GTK_CONTAINER (active_box));
+  gtk_widget_show (source);
 }
 
 
@@ -1236,7 +1239,6 @@ xfwm_settings_title_button_drag_data (GtkWidget        *widget,
 
   name = gtk_buildable_get_name (GTK_BUILDABLE (widget));
 
-  gtk_widget_hide (widget);
   gtk_selection_data_set (data, gdk_atom_intern ("_xfwm4_button_layout", FALSE), 8,
                           (const guchar *)name, strlen (name));
 }

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


More information about the Xfce4-commits mailing list