forked from enlightenment/enlightenment
backlight update loop cleanups
* do null check before adding to device list * use name length from ecore_x_randr_output_name_get()
This commit is contained in:
parent
3addb45e79
commit
bec5d1fe51
|
@ -298,22 +298,23 @@ _e_backlight_update(E_Zone *zone)
|
||||||
if ((out) && (num > 0))
|
if ((out) && (num > 0))
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
const char *s;
|
|
||||||
Eina_Bool gotten = EINA_FALSE;
|
Eina_Bool gotten = EINA_FALSE;
|
||||||
|
|
||||||
EINA_LIST_FREE(bl_devs, s)
|
E_FREE_LIST(bl_devs, eina_stringshare_del);
|
||||||
eina_stringshare_del(s);
|
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
|
Eina_Stringshare *n;
|
||||||
|
|
||||||
name = ecore_x_randr_output_name_get(root, out[i], NULL);
|
name = ecore_x_randr_output_name_get(root, out[i], NULL);
|
||||||
bl_devs = eina_list_append(bl_devs, eina_stringshare_add(name));
|
if (!name) continue;
|
||||||
if ((name) && (e_config->backlight.sysdev) &&
|
n = eina_stringshare_add(name);
|
||||||
(!strcmp(name, e_config->backlight.sysdev)))
|
free(name);
|
||||||
|
bl_devs = eina_list_append(bl_devs, n);
|
||||||
|
if (!e_util_strcmp(n, e_config->backlight.sysdev))
|
||||||
{
|
{
|
||||||
x_bl = ecore_x_randr_output_backlight_level_get(root, out[i]);
|
x_bl = ecore_x_randr_output_backlight_level_get(root, out[i]);
|
||||||
gotten = EINA_TRUE;
|
gotten = EINA_TRUE;
|
||||||
}
|
}
|
||||||
free(name);
|
|
||||||
}
|
}
|
||||||
if (!gotten)
|
if (!gotten)
|
||||||
x_bl = ecore_x_randr_output_backlight_level_get(root, out[0]);
|
x_bl = ecore_x_randr_output_backlight_level_get(root, out[0]);
|
||||||
|
|
Loading…
Reference in New Issue