diff options
author | jmmv <jmmv> | 2004-11-19 19:59:14 +0000 |
---|---|---|
committer | jmmv <jmmv> | 2004-11-19 19:59:14 +0000 |
commit | d4d56323f2eec905a58310e5bcb74a49d23faede (patch) | |
tree | 520daf9768bfe6ef6812f3b9887a143c2fa9513f /x11/gnome-session/patches | |
parent | ccf0f78b04a0b8aceb09866890279c74b8eaddeb (diff) | |
download | pkgsrc-d4d56323f2eec905a58310e5bcb74a49d23faede.tar.gz |
Let the reboot and halt options appear in GNOME's "Log Out" dialog and
make they use /sbin/shutdown under *BSD, instead of the poweroff and
reboot commands.
The patch is a hack (not to be submitted back to the upstream developers
without modification), but is the simplest thing we can do to avoid ugly
and hard to maintain patches. I'll submit a better, but more complex
one, to GNOME's Bugzilla when I have more time.
Bump PKGREVISION to 1.
Diffstat (limited to 'x11/gnome-session/patches')
-rw-r--r-- | x11/gnome-session/patches/patch-ac | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/x11/gnome-session/patches/patch-ac b/x11/gnome-session/patches/patch-ac new file mode 100644 index 00000000000..df58aaf515d --- /dev/null +++ b/x11/gnome-session/patches/patch-ac @@ -0,0 +1,55 @@ +$NetBSD: patch-ac,v 1.4 2004/11/19 19:59:14 jmmv Exp $ + +--- gnome-session/logout.c.orig 2004-07-19 20:11:14.000000000 +0200 ++++ gnome-session/logout.c +@@ -37,12 +37,20 @@ + + static gchar *halt_command[] = + { ++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) ++ "/sbin/shutdown", "-p", "now", NULL ++#else + HALT_COMMAND, NULL ++#endif + }; + + static gchar *reboot_command[] = + { ++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) ++ "/sbin/shutdown", "-r", "now", NULL ++#else + REBOOT_COMMAND, NULL ++#endif + }; + + /* What action to take upon shutdown */ +@@ -298,6 +306,7 @@ display_gui (void) + GtkWidget *reboot = NULL; + GtkWidget *invisible; + gboolean retval = FALSE; ++ gboolean can_shutdown = FALSE; + gboolean save_active = FALSE; + gboolean halt_active = FALSE; + gboolean reboot_active = FALSE; +@@ -392,6 +401,7 @@ display_gui (void) + FALSE, TRUE, 0); + } + ++#if defined(__linux__) + /* Red Hat specific code to check if the user has a + * good chance of being able to shutdown the system, + * and if so, give them that option +@@ -400,6 +410,13 @@ display_gui (void) + t = g_strconcat ("/var/run/console/", g_get_user_name (), NULL); + if (((geteuid () == 0) || g_file_exists (t) || g_file_exists(s)) && + access (halt_command[0], X_OK) == 0) ++ can_shutdown = TRUE; ++#else ++ if (access (halt_command[0], X_OK) == 0) ++ can_shutdown = TRUE; ++#endif ++ ++ if (can_shutdown) + { + GtkWidget *title, *spacer; + GtkWidget *action_vbox, *hbox; |