[Xfce4-commits] <xfwm4:libxfce4ui> Don't save the settings dialogs when saving the session.

Jérôme Guelfucci noreply at xfce.org
Sun Feb 28 12:48:10 CET 2010


Updating branch refs/heads/libxfce4ui
         to e3e23be8366d4dabd64a53e46f0d673acb0c479f (commit)
       from 2ffcbf4223c653f62fef73208c2683485de24e53 (commit)

commit e3e23be8366d4dabd64a53e46f0d673acb0c479f
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Sun Feb 28 12:21:20 2010 +0100

    Don't save the settings dialogs when saving the session.

 settings-dialogs/tweaks-settings.c    |   12 +++++++++++-
 settings-dialogs/workspace-settings.c |   12 +++++++++---
 settings-dialogs/xfwm4-settings.c     |   12 +++++++++++-
 3 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/settings-dialogs/tweaks-settings.c b/settings-dialogs/tweaks-settings.c
index 9e64e50..5e501fe 100644
--- a/settings-dialogs/tweaks-settings.c
+++ b/settings-dialogs/tweaks-settings.c
@@ -473,7 +473,14 @@ main (int argc, gchar **argv)
         if (opt_socket_id == 0)
         {
             dialog = GTK_WIDGET (gtk_builder_get_object (builder, "main-dialog"));
-            gtk_dialog_run (GTK_DIALOG (dialog));
+            gtk_widget_show (dialog);
+            g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), NULL);
+
+            /* To prevent the settings dialog to be saved in the session */
+            gdk_set_sm_client_id ("FAKE ID");
+
+            gtk_main ();
+
             gtk_widget_destroy (dialog);
         }
         else
@@ -488,6 +495,9 @@ main (int argc, gchar **argv)
             gtk_widget_reparent (plug_child, plug);
             gtk_widget_show (plug_child);
 
+            /* To prevent the settings dialog to be saved in the session */
+            gdk_set_sm_client_id ("FAKE ID");
+
             /* Stop startup notification */
             gdk_notify_startup_complete ();
 
diff --git a/settings-dialogs/workspace-settings.c b/settings-dialogs/workspace-settings.c
index a7f17c5..5e0c5be 100644
--- a/settings-dialogs/workspace-settings.c
+++ b/settings-dialogs/workspace-settings.c
@@ -407,10 +407,13 @@ main(int argc, gchar **argv)
 
         if(opt_socket_id == 0) {
             dialog = GTK_WIDGET (gtk_builder_get_object (builder, "main-dialog"));
+            gtk_widget_show (dialog);
+            g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), NULL);
 
-            while(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_HELP) {
-                /* FIXME: launch help */
-            }
+            /* To prevent the settings dialog to be saved in the session */
+            gdk_set_sm_client_id ("FAKE ID");
+
+            gtk_main ();
 
             gtk_widget_destroy(dialog);
         } else {
@@ -424,6 +427,9 @@ main(int argc, gchar **argv)
             gtk_widget_reparent (plug_child, plug);
             gtk_widget_show (plug_child);
 
+            /* To prevent the settings dialog to be saved in the session */
+            gdk_set_sm_client_id ("FAKE ID");
+
             /* Stop startup notification */
             gdk_notify_startup_complete ();
 
diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c
index 0468b6c..a64f9e6 100644
--- a/settings-dialogs/xfwm4-settings.c
+++ b/settings-dialogs/xfwm4-settings.c
@@ -988,7 +988,14 @@ main (int    argc,
   if (G_UNLIKELY (opt_socket_id == 0))
     {
       dialog = xfwm_settings_create_dialog (settings);
-      gtk_dialog_run (GTK_DIALOG (dialog));
+      gtk_widget_show (dialog);
+      g_signal_connect (dialog, "response", G_CALLBACK (gtk_main_quit), NULL);
+
+      /* To prevent the settings dialog to be saved in the session */
+      gdk_set_sm_client_id ("FAKE ID");
+
+      gtk_main ();
+
       gtk_widget_destroy (dialog);
     }
   else
@@ -996,6 +1003,9 @@ main (int    argc,
       plug = xfwm_settings_create_plug (settings, opt_socket_id);
       g_signal_connect (plug, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
 
+      /* To prevent the settings dialog to be saved in the session */
+      gdk_set_sm_client_id ("FAKE ID");
+
       /* Stop startup notification */
       gdk_notify_startup_complete ();
 



More information about the Xfce4-commits mailing list