[gnome-settings-daemon] power: Don't react to light changes if not at console
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Don't react to light changes if not at console
- Date: Fri, 12 Jan 2018 15:06:09 +0000 (UTC)
commit bc732cd6c7c7e22b0f8df7c6a4046b5303eff5eb
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jan 10 17:57:47 2018 +0100
power: Don't react to light changes if not at console
As iio-sensor-proxy isn't yet clever enough to only send property
changes signals to clients that have claimed a sensor, disconnect
the properties-changed signal so we don't attempt to make brightness
changes when we're not on the active seat.
See https://github.com/hadess/iio-sensor-proxy/issues/210
See https://bugzilla.gnome.org/show_bug.cgi?id=756539
See https://bugzilla.gnome.org/show_bug.cgi?id=773685
See https://bugzilla.gnome.org/show_bug.cgi?id=764896
See https://bugzilla.redhat.com/show_bug.cgi?id=1322588
https://bugzilla.gnome.org/show_bug.cgi?id=792409
plugins/power/gsd-power-manager.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index e411e12..19fa321 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -219,6 +219,7 @@ static gboolean idle_is_session_inhibited (GsdPowerManager *manager, guint mask
static void idle_triggered_idle_cb (GnomeIdleMonitor *monitor, guint watch_id, gpointer user_data);
static void idle_became_active_cb (GnomeIdleMonitor *monitor, guint watch_id, gpointer user_data);
static void iio_proxy_changed (GsdPowerManager *manager);
+static void iio_proxy_changed_cb (GDBusProxy *proxy, GVariant *changed_properties, GStrv
invalidated_properties, gpointer user_data);
G_DEFINE_TYPE (GsdPowerManager, gsd_power_manager, G_TYPE_OBJECT)
@@ -996,6 +997,18 @@ iio_proxy_claim_light (GsdPowerManager *manager, gboolean active)
if (active && !manager->priv->session_is_active)
return;
+ /* FIXME:
+ * Remove when iio-sensor-proxy sends events only to clients instead
+ * of all listeners:
+ * https://github.com/hadess/iio-sensor-proxy/issues/210 */
+ if (active)
+ g_signal_connect (manager->priv->iio_proxy, "g-properties-changed",
+ G_CALLBACK (iio_proxy_changed_cb), manager);
+ else
+ g_signal_handlers_disconnect_by_func (manager->priv->iio_proxy,
+ G_CALLBACK (iio_proxy_changed_cb),
+ manager);
+
if (!g_dbus_proxy_call_sync (manager->priv->iio_proxy,
active ? "ClaimLight" : "ReleaseLight",
NULL,
@@ -2613,8 +2626,6 @@ iio_proxy_appeared_cb (GDBusConnection *connection,
"net.hadess.SensorProxy",
NULL,
NULL);
- g_signal_connect (manager->priv->iio_proxy, "g-properties-changed",
- G_CALLBACK (iio_proxy_changed_cb), manager);
iio_proxy_claim_light (manager, TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]