session management tweaking
edscott wilson garcia
edscott at xfce.org
Mon Oct 11 19:35:47 CEST 2004
Hey Benny,
El lun, 11-10-2004 a las 09:21, Benedikt Meurer escribió:
>
> Have a look at libxfcegui4/session.c, it includes a simple
> implementation of X11R6 client-side session management.
>
I looked into it and am now setting the sm property but it is not
working. This is what I did:
session_client = client_session_new (argc,argv,
NULL,SESSION_RESTART_IMMEDIATELY,10);
session_init(session_client);
followed by a call to the routine:
void set_restart_command (int argc, char **argv){
#ifdef HAVE_LIBSM
int i=0;
SmProp prop1,*props[1];
SmPropValue *vals = g_new (SmPropValue, argc);
props[0] = &prop1;
prop1.name = SmRestartCommand;
prop1.type = SmLISTofARRAY8;
prop1.vals = vals;
for (i=0;i<argc;i++){
if (!argv[i]) {
argc=i;
break;
}
vals[i].value = argv[i];
vals[i].length = strlen(argv[i]);
}
prop1.num_vals = argc;
SmcSetProperties ((SmcConn) session_client->session_connection, 1,
props);
g_free(vals);
#endif
}
Can you see anything wrong with the above?
regards,
Edscott
More information about the Xfce4-dev
mailing list