summaryrefslogtreecommitdiff
path: root/settings-dialogs
diff options
context:
space:
mode:
authorStefan Berzl <stefan@localhost.localdomain>2017-09-16 02:00:17 +0200
committerOlivier Fourdan <fourdan@xfce.org>2020-04-05 16:52:46 +0200
commit1e3dd9c8a5510144676ac1df4c4a21ca88a69bf5 (patch)
treeb80f188d98face18b0c0cb3c5c5787eabdf7e577 /settings-dialogs
parent8dd22120b4c4d97259bf5f35cd0eb08d6226a3a3 (diff)
downloadxfwm4-1e3dd9c8a5510144676ac1df4c4a21ca88a69bf5.tar.gz
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.
Diffstat (limited to 'settings-dialogs')
-rw-r--r--settings-dialogs/xfwm4-settings.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c
index 8d789722c..939d71a04 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));
}