Commit Graph

43 Commits

Author SHA1 Message Date
Carsten Haitzler 5a1e9a995c e laptop lid fixes to bring back behavior and trim down glitches
so i spent a few days lopening and closing the lids of a few laptops,
plugging and unplugging external screens in, plugging and unplugging
ac power and doing lots of combinations of these. this led to a whole
slew of interrealted issues that were pretty hard to detangle into
just single issues, so this is all one blob.

this fixes:

1. if a lid close gets a monitor unplug from x or e's randr wants to
unplug then this lead to slow unsuspend or lid open times as e was
reconfirguring the screens entireluy on lid open. dont do that. just
keep things as is, unless we have an external display, then reconfigure.

2. we had 2 systems monitoring for a wake. a poller and a systemd
event. this was redundant and lead to interesting things in the debug
output, so clean that up and on systemd systsems use the systemd wake
events

3. some systems dont shut down their screens on lid close, so they
stay open until screensaver timeouts kick in. bad. so also force the
screen to go off on lid close (if the lid screen is the only one we
have).

4. x seems to have a bug where if you force dpms off etc. to turn the
screen on, it still thinks it's of and wont dpms off again after that
until you eother give some input to have the wake event make the dpms
system in x think its now time to go on, or you toggle dpms on and
off, so i found toggling tricks x into thinking the right thing.

this makes some debugging also be consistent with printfs.

all in all i have a pretty well supported laptop doing swimmingly with
e and a not so well designed (acpi dsdt - missing many events like
acpi battery ones, ac power change acpi events, missing logic to power
off a closed screen in firmware or hardware and leaving it to sw...
not this laptop has a tocuh panel and extra fun points awarded since
the touch panel doesnt shut off on lid close... AND it reprots touch
events when it closes  as it touches the keys/case... hooray! that has
another work-around local to my system, as efl has no mechanism to do
this).

@fix
2018-05-18 21:45:20 +09:00
Carsten Haitzler 0fada40917 smart suspend - honor suspend on ac or not flag as it should
so if you closed the lid ANd didn't have external screens ANd had ac
plugged in ... e would suspend even if youdidn't have "suspend on ac"
checked in blanking dialog. respect this and handle it properly.

@fix

side note... i've notced acpid no longer reporting lid events on one
of my systems. this is very sucky. you now have to open
/dev/input/event2 (this may vary from device to device) to get lid
events... it's an input device. this means elput needs to start doing
this as we cant get power button or lid events anymore .... and we may
have to do this for x11 too.
2017-10-18 13:33:47 +09:00
Mike Blumenkrantz b9c4911374 s/EAPI/E_API/ ...again 2015-09-28 15:51:51 -04:00
Yomi 0dc33a5aeb Fix misspellings in E's files.
Summary: Fix misspellings and spaces in E's files.

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2676
2015-06-16 16:10:21 -04:00
Chris Michael 8039ecb9b7 make e_acpi_lid_is_closed function callable from wl_drm module
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 15:44:22 -04:00
Chris Michael 0a94e8ba71 enlightenment: Make E build again with EFL from git
sed -i 's/EAPI/E_API/g'

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 15:13:10 -04:00
Mike Blumenkrantz b4e65519d1 move acpi lid status tracking from e_randr to e_acpi 2015-04-22 16:05:16 -04:00
Mike Blumenkrantz 98068e9b9c add e_acpi_lid_is_closed() for returning cached state of computer lid 2015-04-22 15:50:05 -04:00
Mike Blumenkrantz 471dcb24cb __UNUSED__ -> EINA_UNUSED
this has been bugging me forever. __UNUSED__ is no longer a valid macro here.
2015-03-18 18:09:09 -04:00
Sebastian Dransfeld ed520d31a1 e_acpi: Add function to get lid status
So we can know lid status without waiting for a lid event.
2014-01-15 07:06:13 +01:00
Sebastian Dransfeld d5853ddc2c e: Check for error reading lid status 2013-12-10 20:15:21 +01:00
Carsten Haitzler c7694a9e6a add simple tablet acpi button event. 2013-09-09 11:29:14 +09:00
Carsten Haitzler c65e2cb4c7 add reported acpi events for several button/... events not handled yet 2013-06-16 10:39:20 +09:00
Carsten Haitzler 4d68c30127 add support for acpi events like:
video/tabletmode TBLT on K
video/tabletmode TBLT off K
2013-06-16 10:31:11 +09:00
Carsten Haitzler b5b0756e79 add more acpi button support 2013-05-27 23:25:54 +09:00
Mike Blumenkrantz 9e8e755cdf formatting: all at once
SVN revision: 82625
2013-01-11 10:34:29 +00:00
Maxime Villard 5ebf793f1b From: Maxime Villard <rustyBSD@gmx.fr>
Subject: [E-devel] [e] Patch acpi

A little patch to fix a possible warning - and overflow.

'buf' is PATH_MAX, but PATH_MAX is not necessary 1024. If
PATH_MAX < 1024 -> overflow.

Also, fgets() fills the buffer and nullterminate it, so we
don't need to buff[0] = '\0'.



SVN revision: 81024
2012-12-15 14:42:19 +00:00
Vincent Torri c3b0637802 e17: whitespaces--
SVN revision: 72561
2012-06-21 06:19:43 +00:00
Carsten Haitzler 35dda3c894 oops ppurka - %i on wrong part of string. fix. this is what happens
when u cant test :)



SVN revision: 71424
2012-05-25 12:17:16 +00:00
Carsten Haitzler 0ed1c99f2c work around ppurka's demented laptop.
SVN revision: 71414
2012-05-25 00:09:15 +00:00
Carsten Haitzler 496577bbf8 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
2012-05-21 07:40:04 +00:00
Carsten Haitzler 0add92b38a remove acpi debugging and label lid state properly in the ui!
SVN revision: 68223
2012-02-21 14:35:00 +00:00
Carsten Haitzler 8f465dbb54 debugging stuff in e_acpi for later.
SVN revision: 68189
2012-02-21 03:01:40 +00:00
Carsten Haitzler 16022b1d80 properly get lid status! my god this has been broken for a while!
SVN revision: 67602
2012-01-30 12:58:40 +00:00
Sebastian Dransfeld 67da66aacf Fix raster fix
Use eina_strbuf_append_length, not eina_strbuf_append_n to add a string
with known length.

SVN revision: 57211
2011-02-21 11:02:10 +00:00
Carsten Haitzler 09d6cde244 work around weird eina-ism fo strlening a strign it already knows the
length of.



SVN revision: 57202
2011-02-21 06:20:28 +00:00
Carsten Haitzler 79742c3762 and extend acpi support some more - allow bus matching too. start
listing specific device models tested etc. and their  specific tables



SVN revision: 56829
2011-02-09 01:17:14 +00:00
Carsten Haitzler f8da083328 a bit of a refactor of e_acpi -> can buffer and handle more than 1
acpi message at once (will happen IF e is paused/hung/suspended and
multiple acpi events happen during that time).

also no need for multiple acpi event id's - the type is already in the
struct itself. it's dup;icating the work. simplify.

also... vaio "hotkey" style support. new mapping ethod needed for
that. who knows what other bizarre acpi hardware is out there. may
need more. also make a note that we may want a mapping system some
time that maps acpi event to faking an x key event.

also... allow acpi bindings to bind to anything in gui.



SVN revision: 56790
2011-02-07 22:57:50 +00:00
Gustavo Sverzut Barbieri 6f2213cb25 convert init/shutdown to EINTERN, move some to _update().
Do not abuse the concept of e_*_init(), make them call-once and those
that needed multiple call are renamed to e_*_update(). To make sure
convert them to EINTERN so the symbols are not exported.

Actually I guess too much is exported as EAPI while they should be
EINTERN, but that would require manual investigation, while this patch
was basically created with sed + grep.



SVN revision: 54795
2010-11-22 15:21:32 +00:00
Carsten Haitzler a75fbc97b1 bad horns!
SVN revision: 52682
2010-09-24 13:39:19 +00:00
Christopher Michael 691061d7bf Add UNUSED.
Remove unused variable(s).



SVN revision: 51367
2010-08-18 22:05:27 +00:00
Cedric BAIL c6a118d738 * e: remove warning due to Ecore API change.
SVN revision: 49833
2010-06-24 16:19:12 +00:00
Christopher Michael 6f33f9d823 Cleanup todo.
SVN revision: 49419
2010-06-03 19:27:44 +00:00
Christopher Michael 7ef8b28341 Make sure we don't go below zero (for the case where _thaw gets called
an odd number of times).



SVN revision: 49418
2010-06-03 17:35:41 +00:00
Christopher Michael 97d4239b35 Add a way to freeze incoming acpi events.
NB: To be used in the acpi bindings config dialog. This allows us to freeze 
all existing events so that if the user presses the power button 
(or something else) when adding a new binding, their machine does not
power off.



SVN revision: 49416
2010-06-03 16:57:09 +00:00
Christopher Michael d2d1e49bf5 Add bindings for ACPI.
Add acpi bindings to config.
Add handlers in e_acpi for common/default acpi events.
Add actions for some missing ACPI events.
 - NB: Dim/Undim screen do nothing currently except a printf.



SVN revision: 49309
2010-05-29 19:57:13 +00:00
Christopher Michael a9f6e4186e Bus id can be longer than 4 chars, so fix scanf.
SVN revision: 49201
2010-05-26 02:29:48 +00:00
Christopher Michael 24188afa26 Add enums for acpi signals, and enums for lid status.
Add function to return current lid status.



SVN revision: 48948
2010-05-17 22:46:28 +00:00
Christopher Michael 078fe68f2d Make sscanf a bit more sane wrt the if statement.
SVN revision: 48931
2010-05-17 00:18:21 +00:00
Christopher Michael 08fde98a06 For unknown devices, set the event's device name to the name of the
device returned in the ACPI message rather than a hard-coded 'unknown'.



SVN revision: 48930
2010-05-17 00:11:55 +00:00
Christopher Michael d823aba015 Add a TODO list.
Create a device hash to match standard device names to types.
Cleanup E_EVENT_ACPI (add missing ones, remove not needed ones).
Actually parse out the ACPI data which we receive.

You can now actually use this ACPI code for event listening, but the
Status field of the event structure needs sanatizing yet (turn into
something meaningful).



SVN revision: 48928
2010-05-17 00:03:55 +00:00
Christopher Michael e828519e97 Change acpi event structure to be able to pass more info.
SVN revision: 48912
2010-05-16 06:21:48 +00:00
Christopher Michael 903caca63b Add start of ACPI code. Does not actually parse yet tho.
Add e_acpi_init to startup (it safely returns if acpid is not running).
Fix some formatting in e_main.



SVN revision: 48910
2010-05-16 05:26:29 +00:00