Verified Commit 6ac205d3 authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak
Browse files

d/patches: Don't claim ambient light sensor when disabled

Forwarded upstream: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/274
parent 9ce1a833
From: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Date: Sat, 13 Nov 2021 16:35:09 +0100
Subject: gsd-power-manager: Don't claim ambient light sensor when disabled
---
plugins/power/gsd-power-manager.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index c93c620..43fcc51 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -1112,8 +1112,10 @@ iio_proxy_claim_light (GsdPowerManager *manager, gboolean active)
return;
if (!manager->backlight)
return;
- if (active && !manager->session_is_active)
- return;
+ if (active && !manager->session_is_active)
+ return;
+ if (active && !g_settings_get_boolean (manager->settings, "ambient-enabled"))
+ return;
/* FIXME:
* Remove when iio-sensor-proxy sends events only to clients instead
@@ -2289,6 +2291,13 @@ engine_settings_key_changed_cb (GSettings *settings,
idle_configure (manager);
return;
}
+ if (g_str_equal (key, "ambient-enabled")) {
+ if (manager->current_idle_mode == GSD_POWER_IDLE_MODE_NORMAL ||
+ manager->current_idle_mode == GSD_POWER_IDLE_MODE_DIM)
+ iio_proxy_claim_light (manager,
+ g_settings_get_boolean (settings, key));
+ return;
+ }
}
static void
debian/01_debianize_xrdb.patch
debian/meson.build-Lower-polkit-requirement.patch
media-keys-Suppress-OSD-title-on-phones-as-well.patch
gsd-power-manager-Don-t-claim-ambient-light-sensor-when-d.patch
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment