output-xrandr: Consistently return -1 on error

Returning FALSE does not indicate an error, but a valid backlight
value of 0. Consumers expect a negative value to indicate no
backlight support, so return -1 in case of error, just like we
already do for invalid values.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2947>
This commit is contained in:
Florian Müllner 2023-04-03 20:17:29 +02:00 committed by Marge Bot
parent 1e459c8302
commit aa1eaa8120

View File

@ -526,7 +526,7 @@ output_get_backlight_xrandr (MetaOutput *output)
&nitems, &bytes_after, &buffer);
if (actual_type != XA_INTEGER || actual_format != 32 || nitems < 1)
return FALSE;
return -1;
value = ((int*)buffer)[0];
if (value > 0)