diff options
author | Stefano Karapetsas <[email protected]> | 2012-11-14 07:41:30 -0800 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-11-14 07:41:30 -0800 |
commit | abf46d226f006c5b6843ccac2010469ae838d68b (patch) | |
tree | 88bdba96755c2af731cbddbf8c5cd8825f39c270 /src/gpm-manager.c | |
parent | fbf40ff748a675bdba451168c30aab7abeb5afa2 (diff) | |
parent | 1ea3233503f84366afd4e0a76e47afa258d17d04 (diff) | |
download | mate-power-manager-abf46d226f006c5b6843ccac2010469ae838d68b.tar.bz2 mate-power-manager-abf46d226f006c5b6843ccac2010469ae838d68b.tar.xz |
Merge pull request #25 from Firstyear/master
keyboard backlight, with basic controls.
Diffstat (limited to 'src/gpm-manager.c')
-rw-r--r-- | src/gpm-manager.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gpm-manager.c b/src/gpm-manager.c index 68ff788..9ee8781 100644 --- a/src/gpm-manager.c +++ b/src/gpm-manager.c @@ -53,6 +53,7 @@ #include "gpm-manager.h" #include "gpm-screensaver.h" #include "gpm-backlight.h" +#include "gpm-kbd-backlight.h" #include "gpm-session.h" #include "gpm-stock-icons.h" #include "gpm-tray-icon.h" @@ -84,6 +85,7 @@ struct GpmManagerPrivate GpmTrayIcon *tray_icon; GpmEngine *engine; GpmBacklight *backlight; + GpmKbdBacklight *kbd_backlight; EggConsoleKit *console; guint32 screensaver_ac_throttle_id; guint32 screensaver_dpms_throttle_id; @@ -1848,10 +1850,12 @@ gpm_manager_init (GpmManager *manager) gboolean check_type_cpu; gint timeout; DBusGConnection *connection; + GDBusConnection *g_connection; GError *error = NULL; manager->priv = GPM_MANAGER_GET_PRIVATE (manager); connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); + g_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); /* init to unthrottled */ manager->priv->screensaver_ac_throttle_id = 0; @@ -1904,6 +1908,13 @@ gpm_manager_init (GpmManager *manager) G_OBJECT (manager->priv->backlight)); } + manager->priv->kbd_backlight = gpm_kbd_backlight_new (); + if (manager->priv->kbd_backlight != NULL) { + gpm_kbd_backlight_register_dbus (manager->priv->kbd_backlight, + g_connection, + NULL); + } + manager->priv->idle = gpm_idle_new (); g_signal_connect (manager->priv->idle, "idle-changed", G_CALLBACK (gpm_manager_idle_changed_cb), manager); @@ -1998,6 +2009,7 @@ gpm_manager_finalize (GObject *object) g_object_unref (manager->priv->control); g_object_unref (manager->priv->button); g_object_unref (manager->priv->backlight); + g_object_unref (manager->priv->kbd_backlight); g_object_unref (manager->priv->console); g_object_unref (manager->priv->client); g_object_unref (manager->priv->status_icon); |