[gnome-settings-daemon/gnome-3-4] media-keys: Handle "toggle brightness" events
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-4] media-keys: Handle "toggle brightness" events
- Date: Mon, 17 Sep 2012 16:48:36 +0000 (UTC)
commit 09fb6718f201c3bfd3ae74151a7fef8fcc006461
Author: Steve Magoun <steve magoun canonical com>
Date: Thu Aug 23 14:45:14 2012 -0400
media-keys: Handle "toggle brightness" events
Toggle would lower the brightness, as:
KEYBOARD_BRIGHTNESS_TOGGLE_KEY != KEYBOARD_BRIGHTNESS_TOGGLE_KEY
https://bugzilla.gnome.org/show_bug.cgi?id=682564
plugins/media-keys/gsd-media-keys-manager.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index bdef10d..0405720 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -1765,15 +1765,31 @@ static void
do_keyboard_brightness_action (GsdMediaKeysManager *manager,
MediaKeyType type)
{
+ const char *cmd;
+
if (manager->priv->connection == NULL ||
manager->priv->power_keyboard_proxy == NULL) {
g_warning ("No existing D-Bus connection trying to handle power keys");
return;
}
+ switch (type) {
+ case KEYBOARD_BRIGHTNESS_UP_KEY:
+ cmd = "StepUp";
+ break;
+ case KEYBOARD_BRIGHTNESS_DOWN_KEY:
+ cmd = "StepDown";
+ break;
+ case KEYBOARD_BRIGHTNESS_TOGGLE_KEY:
+ cmd = "Toggle";
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
/* call into the power plugin */
g_dbus_proxy_call (manager->priv->power_keyboard_proxy,
- type == KEYBOARD_BRIGHTNESS_UP_KEY ? "StepUp" : "StepDown",
+ cmd,
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]