mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-06 09:10:27 +01:00
switch: prevent switches to send the same event twice
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
2a1ed92c51
commit
3f5e9cb636
1 changed files with 7 additions and 1 deletions
|
|
@ -1317,10 +1317,16 @@ lid_switch_process_switch(struct lid_switch_dispatch *dispatch,
|
|||
struct input_event *e,
|
||||
uint64_t time)
|
||||
{
|
||||
bool is_closed;
|
||||
|
||||
switch (e->code) {
|
||||
case SW_LID:
|
||||
dispatch->lid_is_closed = !!e->value;
|
||||
is_closed = !!e->value;
|
||||
|
||||
if (dispatch->lid_is_closed == is_closed)
|
||||
return;
|
||||
|
||||
dispatch->lid_is_closed = is_closed;
|
||||
switch_notify_toggle(&device->base,
|
||||
time,
|
||||
LIBINPUT_SWITCH_LID,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue