[Xfce4-commits] [xfce/xfce4-settings] 01/01: Remove existing socket from socket viewport (Bug #13847)
noreply at xfce.org
noreply at xfce.org
Tue Dec 19 11:02:03 CET 2017
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e 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-settings.
commit 9161d49d3d010746ef44b14a11b4ded6117a826e
Author: Viktor Odintsev <ninetls at xfce.org>
Date: Wed Sep 13 02:16:02 2017 +0300
Remove existing socket from socket viewport (Bug #13847)
Signed-off-by: Sean Davis <smd.seandavis at gmail.com>
---
.../xfce-settings-manager-dialog.c | 30 ++++++++++++++--------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/xfce4-settings-manager/xfce-settings-manager-dialog.c b/xfce4-settings-manager/xfce-settings-manager-dialog.c
index e6411a6..f74f818 100644
--- a/xfce4-settings-manager/xfce-settings-manager-dialog.c
+++ b/xfce4-settings-manager/xfce-settings-manager-dialog.c
@@ -593,10 +593,26 @@ xfce_settings_manager_dialog_iconview_focus (GtkWidget *iconview
static void
-xfce_settings_manager_dialog_go_back (XfceSettingsManagerDialog *dialog)
+xfce_settings_manager_dialog_remove_socket (XfceSettingsManagerDialog *dialog)
{
GtkWidget *socket;
+ socket = gtk_bin_get_child (GTK_BIN (dialog->socket_viewport));
+ if (G_UNLIKELY (socket != NULL))
+ gtk_container_remove (GTK_CONTAINER (dialog->socket_viewport), socket);
+
+ if (dialog->socket_item != NULL)
+ {
+ g_object_unref (G_OBJECT (dialog->socket_item));
+ dialog->socket_item = NULL;
+ }
+}
+
+
+
+static void
+xfce_settings_manager_dialog_go_back (XfceSettingsManagerDialog *dialog)
+{
/* make sure no cursor is shown */
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET(dialog)), NULL);
@@ -620,15 +636,7 @@ xfce_settings_manager_dialog_go_back (XfceSettingsManagerDialog *dialog)
gtk_entry_set_text (GTK_ENTRY (dialog->filter_entry), "");
gtk_widget_grab_focus (dialog->filter_entry);
- socket = gtk_bin_get_child (GTK_BIN (dialog->socket_viewport));
- if (G_LIKELY (socket != NULL))
- gtk_widget_destroy (socket);
-
- if (dialog->socket_item != NULL)
- {
- g_object_unref (G_OBJECT (dialog->socket_item));
- dialog->socket_item = NULL;
- }
+ xfce_settings_manager_dialog_remove_socket (dialog);
}
@@ -872,6 +880,8 @@ xfce_settings_manager_dialog_spawn (XfceSettingsManagerDialog *dialog,
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET(dialog)), cursor);
g_object_unref (cursor);
+ xfce_settings_manager_dialog_remove_socket (dialog);
+
/* create fresh socket */
socket = gtk_socket_new ();
gtk_container_add (GTK_CONTAINER (dialog->socket_viewport), socket);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list