Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nachanon/da35ebff56868602020c to your computer and use it in GitHub Desktop.
Save nachanon/da35ebff56868602020c to your computer and use it in GitHub Desktop.
Patch for MATE Power Manager 1.8.0 idle handler, to always calculate backlight from configured value
From: Nutchanon Wetchasit <nachanon@users.noreply.github.com>
Subject: Make idle event handler always calculate backlight from configured settings
Bug: https://github.com/mate-desktop/mate-power-manager/issues/150
--- a/src/gpm-backlight.c
+++ b/src/gpm-backlight.c
@@ -578,7 +578,7 @@
if (mode == GPM_IDLE_MODE_NORMAL) {
/* sync lcd brightness */
gpm_backlight_notify_system_idle_changed (backlight, FALSE);
- gpm_backlight_brightness_evaluate_and_set (backlight, FALSE, FALSE);
+ gpm_backlight_brightness_evaluate_and_set (backlight, FALSE, TRUE);
/* ensure backlight is on */
ret = gpm_dpms_set_mode (backlight->priv->dpms, GPM_DPMS_MODE_ON, &error);
@@ -591,7 +591,7 @@
/* sync lcd brightness */
gpm_backlight_notify_system_idle_changed (backlight, TRUE);
- gpm_backlight_brightness_evaluate_and_set (backlight, FALSE, FALSE);
+ gpm_backlight_brightness_evaluate_and_set (backlight, FALSE, TRUE);
/* ensure backlight is on */
ret = gpm_dpms_set_mode (backlight->priv->dpms, GPM_DPMS_MODE_ON, &error);
@@ -604,7 +604,7 @@
/* sync lcd brightness */
gpm_backlight_notify_system_idle_changed (backlight, TRUE);
- gpm_backlight_brightness_evaluate_and_set (backlight, FALSE, FALSE);
+ gpm_backlight_brightness_evaluate_and_set (backlight, FALSE, TRUE);
/* get the DPMS state we're supposed to use on the power state */
g_object_get (backlight->priv->client,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment