add eeze watch for backlight events

when using "system" backlight mode, ensure that events are processed
as they occur so that the available backlight level is in sync with
the actual backlight level

fix T2255
This commit is contained in:
Mike Blumenkrantz 2015-09-21 17:19:53 -04:00
parent a108d8ec6a
commit b6d243ce1a
1 changed files with 13 additions and 0 deletions

View File

@ -253,6 +253,7 @@ _e_backlight_update(E_Zone *zone)
if (bl_sysval)
{
sysmode = MODE_SYS;
xbl_avail = EINA_FALSE;
_bl_sys_level_get();
return;
}
@ -338,6 +339,17 @@ _bl_anim(void *data, double pos)
}
#ifdef HAVE_EEZE
static void
_bl_sys_change(const char *device, Eeze_Udev_Event event EINA_UNUSED, void *data EINA_UNUSED, Eeze_Udev_Watch *watch EINA_UNUSED)
{
if (device == bl_sysval)
{
_bl_sys_level_get();
ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL);
}
eina_stringshare_del(device);
}
static void
_bl_sys_find(void)
{
@ -422,6 +434,7 @@ _bl_sys_find(void)
}
/* clear out preferred devs list */
E_FREE_LIST(pdevs, eina_stringshare_del);
eeze_udev_watch_add(EEZE_UDEV_TYPE_BACKLIGHT, EEZE_UDEV_EVENT_CHANGE, _bl_sys_change, NULL);
}
static void