void-packages/srcpkgs/cinnamon-settings-daemon/patches/power-manager-upower-0.99-support.patch

60 lines
2.5 KiB
Diff
Raw Normal View History

Index: cinnamon-settings-daemon/plugins/power/csd-power-manager.c
===================================================================
--- cinnamon-settings-daemon.orig/plugins/power/csd-power-manager.c 2014-07-26 21:44:58.490885083 +0200
+++ cinnamon-settings-daemon/plugins/power/csd-power-manager.c 2014-07-26 22:11:41.186589948 +0200
@@ -236,6 +236,10 @@
static void lock_screensaver (CsdPowerManager *manager);
static void kill_lid_close_safety_timer (CsdPowerManager *manager);
+#if UP_CHECK_VERSION(0,99,0)
+static void device_properties_changed_cb (UpDevice *device, GParamSpec *pspec, CsdPowerManager *manager);
+#endif
+
G_DEFINE_TYPE (CsdPowerManager, csd_power_manager, G_TYPE_OBJECT)
static gpointer manager_object = NULL;
@@ -990,6 +994,16 @@
"engine-state-old",
GUINT_TO_POINTER(state));
}
+
+#if UP_CHECK_VERSION(0,99,0)
+ g_ptr_array_add (manager->priv->devices_array, g_object_ref(device));
+
+ g_signal_connect (device, "notify::state",
+ G_CALLBACK (device_properties_changed_cb), manager);
+ g_signal_connect (device, "notify::warning-level",
+ G_CALLBACK (device_properties_changed_cb), manager);
+#endif
+
}
static gboolean
@@ -1714,7 +1728,11 @@
}
static void
+#if UP_CHECK_VERSION(0,99,0)
+device_properties_changed_cb (UpDevice *device, GParamSpec *pspec, CsdPowerManager *manager)
+#else
engine_device_changed_cb (UpClient *client, UpDevice *device, CsdPowerManager *manager)
+#endif
{
UpDeviceKind kind;
UpDeviceState state;
@@ -3986,12 +4004,12 @@
G_CALLBACK (engine_device_added_cb), manager);
g_signal_connect (manager->priv->up_client, "device-removed",
G_CALLBACK (engine_device_removed_cb), manager);
- g_signal_connect (manager->priv->up_client, "device-changed",
- G_CALLBACK (engine_device_changed_cb), manager);
#if UP_CHECK_VERSION(0,99,0)
g_signal_connect_after (manager->priv->up_client, "notify::lid-is-closed",
G_CALLBACK (lid_state_changed_cb), manager);
#else
+ g_signal_connect (manager->priv->up_client, "device-changed",
+ G_CALLBACK (engine_device_changed_cb), manager);
g_signal_connect_after (manager->priv->up_client, "changed",
G_CALLBACK (up_client_changed_cb), manager);
#endif