diff mbox

asus-wireless: send an EV_SYN/SYN_REPORT between state changes

Message ID 20171204002617.GA11430@jelly (mailing list archive)
State Accepted, archived
Delegated to: Darren Hart
Headers show

Commit Message

Peter Hutterer Dec. 4, 2017, 12:26 a.m. UTC
Sending the switch state change twice within the same frame is invalid evdev
protocol and only works if the client handles keys immediately as well.
Processing events immediately is incorrect, it forces a fake order of events
that does not exist on the device.

Recent versions of libinput changed to only process the device state and
SYN_REPORT time, so now the key event is lost.

https://bugs.freedesktop.org/show_bug.cgi?id=104041

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 drivers/platform/x86/asus-wireless.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Darren Hart Dec. 9, 2017, 12:10 a.m. UTC | #1
On Mon, Dec 04, 2017 at 10:26:17AM +1000, Peter Hutterer wrote:
> Sending the switch state change twice within the same frame is invalid evdev
> protocol and only works if the client handles keys immediately as well.
> Processing events immediately is incorrect, it forces a fake order of events
> that does not exist on the device.
> 
> Recent versions of libinput changed to only process the device state and
> SYN_REPORT time, so now the key event is lost.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=104041
> 
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Thanks Peter, queued.
diff mbox

Patch

diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c
index f3796164329e..d4aeac3477f5 100644
--- a/drivers/platform/x86/asus-wireless.c
+++ b/drivers/platform/x86/asus-wireless.c
@@ -118,6 +118,7 @@  static void asus_wireless_notify(struct acpi_device *adev, u32 event)
 		return;
 	}
 	input_report_key(data->idev, KEY_RFKILL, 1);
+	input_sync(data->idev);
 	input_report_key(data->idev, KEY_RFKILL, 0);
 	input_sync(data->idev);
 }