Re: how to end a session



Havoc Pennington wrote:
> 
> Maarten Ditzel <ditzel cobalt et tudelft nl> writes:
> >
> > I just started to write a small gnome-applet which adds a small button
> > to the panel to end your gnome-session. (I find the standard button too
> > big). Now my question is: how can I end a session. I have tried to send
> > a "die" signal to gnome_master_client(), but that doesn't do the job.
> > There must be a better way than just to kill the process.
> >
> 
> You need to send the session manager a SaveYourselfRequest. The code
> is in gnome-core/gsm/save.c:
> 
>   gnome_client_request_save (client, GNOME_SAVE_BOTH, TRUE,
>                              GNOME_INTERACT_ANY, 0, 1);
> 
> Havoc

Actually this is what I tried already:

1st)
    gnome_client_request_save (gnome_master_client(), GNOME_SAVE_BOTH,
TRUE,
                               GNOME_INTERACT_ANY, 0, 1);

2nd)
    gnome_client_request_save (gnome_master_client(), GNOME_SAVE_BOTH,
TRUE,
                               GNOME_INTERACT_ANY, 0, 1);
    gtk_signal_emit_by_name(GTK_OBJECT(gnome_master_client()), "die");

both compile and execute without problemns, however gnome is not ended.
Maybe I send the request to the wrong client. If so, any idea which
client to send it to ?

Regards,
Maarten


-- 

=================================================================
ir. Maarten Ditzel                 Delft University of Technology 
                                           Electrical Engineering 
ditzel cobalt et tudelft nl                  Circuits and Systems
http://cobalt.et.tudelft.nl/~ditzel     Ubiquitous Communications
=================================================================



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]