Re: how to end a session
- From: Maarten Ditzel <ditzel cas et tudelft nl>
- To: gnome-devel-list gnome org
- Subject: Re: how to end a session
- Date: Tue, 04 Dec 2001 11:04:51 +0100
> You don't want the signal_emit_by_name(), that's just in your own
> process, not useful.
>
> gnome_master_client() is right. But maybe you aren't connected to the
> session manager - try the same code in a standalone GNOME app instead
> of an applet? Try gnome_client_is_connected() or whatever that
> function is called?
>
> Havoc
Ok, I wrote gnexit.c:
#include <gnome.h>
int main (int argc, char *argv[]) {
/* Initialize GNOME */
gnome_init("gnexit", "0.1", argc, argv);
/* check connection to session manager */
if (GNOME_CLIENT_CONNECTED(gnome_master_client()))
printf("Client is connected\n");
/* try to exit gnome */
printf("Exiting gnome... maybe\n");
gnome_client_request_save (gnome_master_client(), GNOME_SAVE_BOTH,
TRUE,
GNOME_INTERACT_ANY, 0, 1);
return 0;
}
Does not work. Digging a bit deeper in the library documentation
(especially GnomeClient docs
http://developer.gnome.org/doc/API/libgnomeui/gnomeclient.html) gives me
the idea that gnome_master_client does not point to a "global gnome
client", but to the current application itself. But I still don't get
why in gnome-core/gsm/save.c gnome_client_request_save(...) works.
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]