forked from enlightenment/enlightenment
try and handle peoples thinkpads where acpid reports different event
formasts. e.g.: button/lid LID close as opposed to button/lid LID0 00000080 00000001 i hope normal acpi isn't broken. please test. SVN revision: 71268
This commit is contained in:
parent
fba085fcb9
commit
496577bbf8
|
@ -209,8 +209,14 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
sdata[p - str] = 0;
|
sdata[p - str] = 0;
|
||||||
/* parse out this acpi string into separate pieces */
|
/* parse out this acpi string into separate pieces */
|
||||||
if (sscanf(sdata, "%1023s %1023s %x %x",
|
if (sscanf(sdata, "%1023s %1023s %x %x",
|
||||||
device, bus, &sig, &status) == 4)
|
device, bus, &sig, &status) != 4)
|
||||||
{
|
{
|
||||||
|
sig = -1;
|
||||||
|
status = -1;
|
||||||
|
if (sscanf(sdata, "%1023s %1023s", device, bus) != 2)
|
||||||
|
goto done_event;
|
||||||
|
}
|
||||||
|
|
||||||
/* create new event structure to raise */
|
/* create new event structure to raise */
|
||||||
acpi_event = E_NEW(E_Event_Acpi, 1);
|
acpi_event = E_NEW(E_Event_Acpi, 1);
|
||||||
acpi_event->bus_id = eina_stringshare_add(bus);
|
acpi_event->bus_id = eina_stringshare_add(bus);
|
||||||
|
@ -218,7 +224,7 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
acpi_event->status = status;
|
acpi_event->status = status;
|
||||||
|
|
||||||
/* FIXME: add in a key faking layer */
|
/* FIXME: add in a key faking layer */
|
||||||
if (!done)
|
if ((!done) && (sig >= 0) && (status >= 0))
|
||||||
{
|
{
|
||||||
for (i = 0; _devices_multiplexed[i].name; i++)
|
for (i = 0; _devices_multiplexed[i].name; i++)
|
||||||
{
|
{
|
||||||
|
@ -270,7 +276,7 @@ _e_acpi_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
||||||
ecore_event_add(E_EVENT_ACPI, acpi_event,
|
ecore_event_add(E_EVENT_ACPI, acpi_event,
|
||||||
_e_acpi_cb_event_free, NULL);
|
_e_acpi_cb_event_free, NULL);
|
||||||
}
|
}
|
||||||
}
|
done_event:
|
||||||
str = p + 1;
|
str = p + 1;
|
||||||
p = strchr(str, '\n');
|
p = strchr(str, '\n');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue