[Xfce4-commits] <libxfce4ui:new-sm-client> don't automatically set command properties to NULL on construct

Brian J. Tarricone brian at tarricone.org
Thu Sep 17 14:20:01 CEST 2009


Updating branch refs/heads/kelnos/new-sm-client
         to 77c8ec46e67c326b423c4d7a956f802d142399aa (commit)
       from d883beffbb1108d5406960f060e7eec04bdd753f (commit)

commit 77c8ec46e67c326b423c4d7a956f802d142399aa
Author: Brian J. Tarricone <brian at tarricone.org>
Date:   Thu Sep 17 05:16:08 2009 -0700

    don't automatically set command properties to NULL on construct
    
    since restart and clone are figured out from argv during construction,
    if we auto-set them as well, they'll get overwritten

 libxfce4ui/xfce-sm-client.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/libxfce4ui/xfce-sm-client.c b/libxfce4ui/xfce-sm-client.c
index d0b2fd4..f1870aa 100644
--- a/libxfce4ui/xfce-sm-client.c
+++ b/libxfce4ui/xfce-sm-client.c
@@ -392,7 +392,7 @@ xfce_sm_client_class_init(XfceSMClientClass *klass)
                                                         "Current working directory",
                                                         "The directory that should be used as the working directory the next time this client is restarted",
                                                         NULL,
-                                                        G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
+                                                        G_PARAM_READWRITE));
     g_object_class_install_property(gobject_class, PROP_PROGRAM,
                                     g_param_spec_string("program",
                                                         "Program name",
@@ -404,19 +404,19 @@ xfce_sm_client_class_init(XfceSMClientClass *klass)
                                                        "Clone command",
                                                        "A command used to launch a fresh instance of the application",
                                                        G_TYPE_STRV,
-                                                       G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
+                                                       G_PARAM_READWRITE));
     g_object_class_install_property(gobject_class, PROP_RESTART_COMMAND,
                                     g_param_spec_boxed("restart-command",
                                                        "Restart command",
                                                        "A command used to restart this application, preserving the current state",
                                                        G_TYPE_STRV,
-                                                       G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
+                                                       G_PARAM_READWRITE));
     g_object_class_install_property(gobject_class, PROP_DISCARD_COMMAND,
                                     g_param_spec_boxed("discard-command",
                                                        "Discard command",
                                                        "A command used to discard any information about the current saved state",
                                                        G_TYPE_STRV,
-                                                       G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
+                                                       G_PARAM_READWRITE));
     g_object_class_install_property(gobject_class, PROP_DESKTOP_FILE,
                                     g_param_spec_string("desktop-file",
                                                         "Desktop file",
@@ -719,6 +719,9 @@ xfce_sm_client_parse_argv(XfceSMClient *sm_client)
     } else
         restart_command = argv;
 
+    DBG("setting restart and clone commands (%s, %s)",
+        restart_command && restart_command[0] ? restart_command[0] : "(null)",
+        clone_command && clone_command[0] ? clone_command[0] : "(null)");
     xfce_sm_client_set_restart_command(sm_client, restart_command);
     xfce_sm_client_set_clone_command(sm_client, clone_command);
 
@@ -1240,6 +1243,9 @@ xfce_sm_client_set_property_from_command(XfceSMClient *sm_client,
     gint i, argc;
     SmPropValue *vals;
 
+    TRACE("entering (%s, %p, %s)", property_name, command,
+          alter_sm_id == SM_ARG_APPEND ? "APPEND" : alter_sm_id == SM_ARG_REMOVE ? "REMOVE" : "FALSE");
+
     if(!command || !sm_client->session_connection)
         return;
 
@@ -1313,6 +1319,7 @@ xfce_sm_client_set_property_from_command(XfceSMClient *sm_client,
     prop.num_vals = i;
 
     props[0] = ∝
+    DBG("setting %s", property_name);
     SmcSetProperties(sm_client->session_connection, 1, props);
     g_free(vals);
 }
@@ -1320,6 +1327,8 @@ xfce_sm_client_set_property_from_command(XfceSMClient *sm_client,
 static void
 xfce_sm_client_set_clone_restart_commands(XfceSMClient *sm_client)
 {
+    TRACE("entering");
+
     /* Restart */
     xfce_sm_client_set_property_from_command(sm_client, SmRestartCommand,
                                              sm_client->restart_command,



More information about the Xfce4-commits mailing list