summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pottage <[email protected]>2015-07-02 15:33:10 +0100
committerMatthew Pottage <[email protected]>2017-01-18 08:59:45 +0000
commit8305f32f2a1be9f787a9610aa9272d7b9cbe9d65 (patch)
treeda7c9f24091057c2678170757b29bd7d2e02dfc5
parent55c56c6dc2e67ad244f2afde77343b0ee83aeea3 (diff)
downloadmate-power-manager-8305f32f2a1be9f787a9610aa9272d7b9cbe9d65.tar.bz2
mate-power-manager-8305f32f2a1be9f787a9610aa9272d7b9cbe9d65.tar.xz
Check both the "Backlight" and "BACKLIGHT" xrandr properties for a backlight.
Added checking the "Backlight" property. "BACKLIGHT" appears to be the legacy property. This resolves an issue where xbacklight can change the backlight, but mate-power-manager can't.
-rw-r--r--src/gpm-brightness.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c
index acfffc2..fcf2eb6 100644
--- a/src/gpm-brightness.c
+++ b/src/gpm-brightness.c
@@ -273,11 +273,15 @@ gpm_brightness_setup_display (GpmBrightness *brightness)
egg_debug ("RandR version %d.%d too old", major, minor);
return FALSE;
}
- /* can we support BACKLIGHT */
- brightness->priv->backlight = XInternAtom (brightness->priv->dpy, "BACKLIGHT", True);
+ /* Can we support "Backlight" */
+ brightness->priv->backlight = XInternAtom (brightness->priv->dpy, "Backlight", True);
if (brightness->priv->backlight == None) {
- egg_debug ("No outputs have backlight property");
- return FALSE;
+ /* Do we support "BACKLIGHT" (legacy) */
+ brightness->priv->backlight = XInternAtom (brightness->priv->dpy, "BACKLIGHT", True);
+ if (brightness->priv->backlight == None) {
+ egg_debug ("No outputs have backlight property");
+ return FALSE;
+ }
}
return TRUE;
}