gnome-settings-daemon r644 - in branches/gnome-2-24: . plugins/media-keys



Author: jensg
Date: Sun Dec 28 14:56:04 2008
New Revision: 644
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=644&view=rev

Log:
2008-12-28  Jens Granseuer  <jensgr gmx net>

	Merged from trunk.

	Based on patch by: Jasper Lievisse Adriaanse <jasper humppa nl>

	* plugins/media-keys/gsd-media-keys-manager.c: (do_eject_action),
	(do_action): better support for Eject and Sleep actions on OpenBSD
	and FreeBSD (bug #565472)


Modified:
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/plugins/media-keys/gsd-media-keys-manager.c

Modified: branches/gnome-2-24/plugins/media-keys/gsd-media-keys-manager.c
==============================================================================
--- branches/gnome-2-24/plugins/media-keys/gsd-media-keys-manager.c	(original)
+++ branches/gnome-2-24/plugins/media-keys/gsd-media-keys-manager.c	Sun Dec 28 14:56:04 2008
@@ -58,6 +58,18 @@
 
 #define VOLUME_STEP 6           /* percents for one volume button press */
 
+#if defined(__OpenBSD__)
+# define EJECT_COMMAND "eject -t /dev/cd0"
+#else
+# define EJECT_COMMAND "eject -T"
+#endif
+
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
+# define SLEEP_COMMAND "zzz"
+#else
+# define SLEEP_COMMAND "apm"
+#endif
+
 #define GSD_MEDIA_KEYS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MEDIA_KEYS_MANAGER, GsdMediaKeysManagerPrivate))
 
 typedef struct {
@@ -575,7 +587,7 @@
         if ((command != NULL) && (strcmp (command, "") != 0)) {
                 execute (manager, command, FALSE, FALSE);
         } else {
-                execute (manager, "eject -T", FALSE, FALSE);
+                execute (manager, EJECT_COMMAND, FALSE, FALSE);
         }
 
         g_free (command);
@@ -785,7 +797,7 @@
                 do_mail_action (manager);
                 break;
         case SLEEP_KEY:
-                do_sleep_action ("apm", "xset dpms force off");
+                do_sleep_action (SLEEP_COMMAND, "xset dpms force off");
                 break;
         case SCREENSAVER_KEY:
                 if ((cmd = g_find_program_in_path ("gnome-screensaver-command"))) {



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