Commit cdb2d8d4 authored by Jérôme Guelfucci's avatar Jérôme Guelfucci

Don't save settings dialogs when saving session (Bug #5113).

For this, we set a fake SM id for each dialog. This needs to be added in
every settings dialog (Thunar, xfdesktop, xfce4-panel, xfwm4,
xfce4-notifyd, exo-preferred-applications...).
parent 2dc0f0b0
......@@ -196,10 +196,14 @@ main (gint argc, gchar **argv)
/* Get the dialog widget */
dialog = gtk_builder_get_object (builder, "dialog");
/* run the dialog */
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_show (GTK_WIDGET (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 ();
/* destroy the dialog */
gtk_widget_destroy (GTK_WIDGET (dialog));
}
else
......@@ -217,6 +221,9 @@ main (gint argc, gchar **argv)
gtk_widget_reparent (GTK_WIDGET (plug_child), plug);
gtk_widget_show (GTK_WIDGET (plug_child));
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
/* Enter main loop */
gtk_main ();
}
......
......@@ -830,8 +830,15 @@ main(gint argc, gchar **argv)
/* build the dialog */
dialog = gtk_builder_get_object (builder, "dialog");
/* run the dialog */
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_show (GTK_WIDGET (dialog));
g_signal_connect (dialog, "response", gtk_widget_destroy (GTK_WIDGET (dialog)));
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
gtk_main ();
gtk_widget_destroy (GTK_WIDGET (dialog));
}
else
{
......@@ -848,6 +855,9 @@ main(gint argc, gchar **argv)
gtk_widget_reparent (GTK_WIDGET (plug_child), plug);
gtk_widget_show (GTK_WIDGET (plug_child));
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
/* Enter main loop */
gtk_main ();
}
......
......@@ -678,6 +678,7 @@ main (gint argc, gchar **argv)
_("The Resize and Rotate extension (RandR) is not enabled on "
"this display. Try to enable it and run the dialog again."));
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_QUIT, GTK_RESPONSE_CLOSE);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
......@@ -752,6 +753,9 @@ main (gint argc, gchar **argv)
/* show the dialog */
gtk_widget_show (dialog);
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
/* enter the main loop */
gtk_main ();
}
......
......@@ -109,8 +109,16 @@ main (int argc,
{
/* Create and run the settings dialog */
dialog = xfce_keyboard_settings_create_dialog (settings);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
gtk_widget_show (GTK_WIDGET (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 (GTK_WIDGET (dialog));
}
else
{
......@@ -121,6 +129,9 @@ main (int argc,
/* Stop startup notification */
gdk_notify_startup_complete ();
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
/* Enter the main loop */
gtk_main ();
}
......
......@@ -1315,8 +1315,15 @@ main (gint argc, gchar **argv)
/* unlock */
locked--;
/* show the dialog */
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_show (GTK_WIDGET (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 (GTK_WIDGET (dialog));
}
else
{
......@@ -1336,6 +1343,9 @@ main (gint argc, gchar **argv)
/* Unlock */
locked--;
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
/* Enter main loop */
gtk_main ();
}
......
......@@ -95,6 +95,9 @@ main(int argc,
opt_dialog);
}
/* To prevent the settings dialog to be saved in the session */
gdk_set_sm_client_id ("FAKE ID");
gtk_main();
if(GTK_IS_WIDGET(dialog))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment