You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* * Some laptops (and mostly newer ones with intel graphics) can turn off the * backlight completely. If the user is not careful and sets the brightness * very low using the slider, he might not be able to see the screen contents * anymore. Brightness keys do not work on every laptop, so it's better to use * a safe default minimum level that the user can change via the settings * editor if desired. */voidxfpm_brightness_set_min_level (XfpmBrightness*brightness,
gint32level)
{
XfpmBrightnessPrivate*priv=get_instance_private (brightness);
gint32max_min;
g_return_if_fail (XFPM_BRIGHTNESS (brightness));
/* MIN_BRIGHTNESS_SLIDER_MIN_LEVEL = auto, we set the minimum as 10% of delta */if (level==MIN_BRIGHTNESS_SLIDER_MIN_LEVEL)
{
priv->min_level=priv->hw_min_level+MAX (priv->step, (priv->max_level-priv->hw_min_level) / 10);
XFPM_DEBUG ("Setting default min brightness (%d) above hardware min (%d)", priv->min_level, priv->hw_min_level);
return;
}
max_min=priv->max_level-priv->step;
if (level<priv->hw_min_level||level>max_min)
{
XFPM_DEBUG ("Set min brightness (%d) clamped to admissible values [%d, %d]", level, priv->hw_min_level, max_min);
priv->min_level=CLAMP (level, priv->hw_min_level, max_min);
return;
}
XFPM_DEBUG ("Setting min brightness at %d", level);
priv->min_level=level;
}
The text was updated successfully, but these errors were encountered:
Cosmic-applets version:
Specific applet that this is regarding (if applicable):
Issue/Bug description:
Steps to reproduce:
set 0 to display brightness
Expected behavior:
Clamp the value to a "safe" min value
Other notes:
Other desktop environments seem to have fix this issue and do a bit of processing, as an example i found what the xfce desktop does here:
https://github.com/xfce-mirror/xfce4-power-manager/blob/3707578fbed608a1d275d7bf32eb6b299f657a01/common/xfpm-brightness.c#L123-L158
The text was updated successfully, but these errors were encountered: