~james-w/netbook-remix/maximus.handle-null-crash

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: Neil J. Patel
  • Date: 2008-09-10 12:51:32 UTC
  • Revision ID: njpatel@gmail.com-20080910125132-yv60errit0yifo5w
maximus (0.3ubuntu13) hardy; urgency=low

  * "Quit" function on launcher does not work within 120-180 .. (LP: #268433)
    - Connect to the master gnome session client
    - Reply to the the "save-yourself" signal

 -- Neil J. Patel <neil.patel@canonical.com>  Wed, 10 Sep 2008 13:50:31 +0100

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
#include "maximus-app.h"
32
32
 
 
33
static gboolean on_sess_save (GnomeClient        *client,
 
34
                              gint                arg1, 
 
35
                              GnomeSaveStyle      arg2,
 
36
                              gboolean            arg3,
 
37
                              GnomeInteractStyle  arg4,
 
38
                              gboolean            arg5);
 
39
 
33
40
gint
34
41
main (gint argc, gchar *argv[])
35
42
{
39
46
 
40
47
  g_thread_init (NULL);
41
48
  g_set_application_name ("Maximus");
42
 
 
 
49
  
43
50
  gtk_init (&argc, &argv);
44
51
 
45
 
  client = gnome_client_new ();
 
52
  gnome_program_init ("maximus", "0.3", LIBGNOMEUI_MODULE, argc, argv,
 
53
                      GNOME_PARAM_NONE);
 
54
 
 
55
  client = gnome_master_client ();
46
56
  gnome_client_set_restart_command (client, 1, exec);
47
57
  gnome_client_set_restart_style (client, GNOME_RESTART_IMMEDIATELY);
48
58
 
 
59
  g_signal_connect (client, "save-yourself", G_CALLBACK (on_sess_save), NULL);
 
60
 
49
61
  app = maximus_app_get_default ();
50
62
 
51
63
  gtk_main ();
52
64
 
53
65
  return EXIT_SUCCESS;
54
66
}
 
67
 
 
68
static gboolean on_sess_save (GnomeClient        *client,
 
69
                              gint                arg1, 
 
70
                              GnomeSaveStyle      arg2,
 
71
                              gboolean            arg3,
 
72
                              GnomeInteractStyle  arg4,
 
73
                              gboolean            arg5)
 
74
{
 
75
  return TRUE;
 
76
}