~ubuntu-branches/ubuntu/utopic/cairo-dock-plug-ins/utopic

« back to all changes in this revision

Viewing changes to gnome-integration/src/applet-utils.c

Tags: upstream-2.4.0~0beta2
ImportĀ upstreamĀ versionĀ 2.4.0~0beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
void env_backend_logout (void)
27
27
{
28
 
        cairo_dock_launch_command ("gnome-session-save --kill --gui");
 
28
        // since Gnome 3, gnome-session-save has been replaced by gnome-session-quit
 
29
        gchar *cResult = cairo_dock_launch_command_sync ("which gnome-session-quit");
 
30
        if (cResult != NULL && *cResult == '/')
 
31
                cairo_dock_launch_command ("gnome-session-quit --logout");
 
32
        else
 
33
                cairo_dock_launch_command ("gnome-session-save --kill --gui");
 
34
        g_free (cResult);
29
35
}
30
36
 
31
37
void env_backend_shutdown (void)
32
38
{
33
 
        cairo_dock_launch_command ("gnome-session-save --shutdown-dialog");
 
39
        // since Gnome 3, gnome-session-save has been replaced by gnome-session-quit
 
40
        gchar *cResult = cairo_dock_launch_command_sync ("which gnome-session-quit");
 
41
        if (cResult != NULL && *cResult == '/')
 
42
                cairo_dock_launch_command ("gnome-session-quit --power-off");
 
43
        else
 
44
                cairo_dock_launch_command ("gnome-session-save --shutdown-dialog");
 
45
        g_free (cResult);
34
46
}
35
47
 
36
48
void env_backend_lock_screen (void)
37
49
{
38
 
        cairo_dock_launch_command ("gnome-screensaver-command --lock");
 
50
        cairo_dock_launch_command (MY_APPLET_SHARE_DATA_DIR"/../xfce-integration/lock-screen.sh");  // should probably be shared somewhere...
39
51
}
40
52
 
41
53
void env_backend_setup_time (void)