diff options
author | Matthew Pottage <[email protected]> | 2015-07-02 15:33:10 +0100 |
---|---|---|
committer | monsta <[email protected]> | 2017-01-24 12:25:12 +0300 |
commit | 5c7cc17b0ec5626256cd867c5e2ec3395e2ea941 (patch) | |
tree | 4d8be52ba8985f2bb4e08fa4d94a444bc1f4444d | |
parent | b850b99bcdb120b89b354280f2816587ea6b7611 (diff) | |
download | mate-power-manager-5c7cc17b0ec5626256cd867c5e2ec3395e2ea941.tar.bz2 mate-power-manager-5c7cc17b0ec5626256cd867c5e2ec3395e2ea941.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.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gpm-brightness.c b/src/gpm-brightness.c index 686f676..944fb41 100644 --- a/src/gpm-brightness.c +++ b/src/gpm-brightness.c @@ -270,11 +270,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; } |