[PATCH libinput 12/14] Add a helper function for initializing an event listener

2017-01-25 Thread Peter Hutterer
Not needed right now as everything assumes the listener was added before it was removed. This helper is for the cases where we may call listener_remove before it was ever added. Signed-off-by: Peter Hutterer --- src/libinput-private.h | 3 +++ src/libinput.c | 6 ++ 2 files changed,

[PATCH libinput 11/14] switch: move the lid switch bits into their own file

2017-01-25 Thread Peter Hutterer
Keep this separate from the other code so it's easier to read Signed-off-by: Peter Hutterer --- src/Makefile.am | 1 + src/evdev-lid.c | 174 src/evdev.c | 144 +- src/evdev.h | 13 +++

[PATCH libinput 10/14] switch: only sync the initial state if we know the state is reliable

2017-01-25 Thread Peter Hutterer
This changes the default behavior to "disable the touchpad on the first lid close event", thus filtering any laptops where the switch state is buggy and always in "on" state. Devices where we know the lid switch state is reliable can be marked as such. Signed-off-by: Peter Hutterer --- src/evdev

[PATCH libinput 07/14] Clarify the default 'off' position of a switch

2017-01-25 Thread Peter Hutterer
So we don't need to send an "off" event for every switch on startup. Signed-off-by: Peter Hutterer --- src/libinput.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libinput.h b/src/libinput.h index f8b123a..436923d 100644 --- a/src/libinput.h +++ b/src/libinput.h @

[PATCH libinput 14/14] udev: mark all laptops as lid switch reliable

2017-01-25 Thread Peter Hutterer
If the chassis type is 9 or 10 (Laptop, Notebook) let's assume that our lid switch works. On anything else we leave it at unknown. Signed-off-by: Peter Hutterer --- udev/90-libinput-model-quirks.hwdb | 9 + 1 file changed, 9 insertions(+) diff --git a/udev/90-libinput-model-quirks.hwdb

[PATCH libinput 13/14] switch: hook up to keyboard events to fix the lid switch state

2017-01-25 Thread Peter Hutterer
Extra insurance against broken lid switches. Listen to events from the (internal) keyboard when we are logically closed. If any, assume we're open after all and update accordingly. Signed-off-by: Peter Hutterer --- src/evdev-lid.c | 110 +--- t

[PATCH libinput 09/14] switch: prevent switches to send the same event twice

2017-01-25 Thread Peter Hutterer
Signed-off-by: Peter Hutterer --- src/evdev.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/evdev.c b/src/evdev.c index 2e0402b..50c8abd 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1317,10 +1317,16 @@ lid_switch_process_switch(struct lid_switch_dispatch *dispa

[PATCH libinput 08/14] switch: sync the initial state of the switch on startup

2017-01-25 Thread Peter Hutterer
This is the default behavior, based on the theory of hardware actually doing the right thing. That's not always the case, follow-up patches will change when we do the theoretically ideal thing. Signed-off-by: Peter Hutterer --- src/evdev.c | 23 ++- test/test-lid.c | 42 +

[PATCH libinput 05/14] evdev: move the lid switch process functions together

2017-01-25 Thread Peter Hutterer
Don't sprinkle them across the file Signed-off-by: Peter Hutterer --- src/evdev.c | 96 ++--- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 245d878..216dcc2 100644 --- a/src/evdev.c +++ b/sr

[PATCH libinput 01/14] Add a "switch" interface for parts of the SW_* range

2017-01-25 Thread Peter Hutterer
From: James Ye This will allow switch devices known to libinput to be exposed. Currently, this is SW_LID. libinput also handles switch events internally, e.g. a laptop touchpad will be disabled autmoatically when the lid is closed. This is transparent to the caller, although the caller will also

[PATCH libinput 06/14] touchpad: check for a switch type before handling the event

2017-01-25 Thread Peter Hutterer
Don't call get_switch_event immediately, doing so for non-switch events is documented as a bug. Check the event type instead, if that one is correct then we can assume the rest works. Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 24 1 file changed, 12 inse

[PATCH libinput 04/14] test: add tests for lid switch

2017-01-25 Thread Peter Hutterer
From: James Ye Ship a custom udev rule for the test device until systemd v333 is commonplace. Signed-off-by: James Ye Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- test/Makefile.am| 4 +- test/litest-device-lid-switch.c | 69 +++ test/litest.c

[PATCH libinput 00/14] Lid switch interface

2017-01-25 Thread Peter Hutterer
The first four are James' patches, I think the only change I did to those was force ID_INPUT_SWITCH in the udev rule (until systemd is ready) and a removal of a double empty line. Patches 5 and 11 are cleanup, I should've done those first but... The others make sure that: * lid switch is synchro

[PATCH libinput 02/14] Add evdev_dispatch interface for lid switch

2017-01-25 Thread Peter Hutterer
From: James Ye Create a lid_switch_interface to handle lid switch events, so the touchpad can be disabled when lid is closed. Signed-off-by: James Ye Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- src/evdev.c | 106 ++--

[PATCH libinput 03/14] Pair touchpad and lid_switch for disable

2017-01-25 Thread Peter Hutterer
From: James Ye Add listener for lid switch events, disable touchpad on switch event. Signed-off-by: James Ye Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 49 + src/evdev-mt-touchpad.h | 5 + 2 fil

Re: [PATCH] protocol: Add gaming input protocol

2017-01-25 Thread Mayeul Cantan
Hi Jingqui, >> games usually have a defined set of actions, in different contexts >> (take for example a game where the player can be in a menu, driving a >> boat or flying a plane; those are the contexts or "action sets"). > I agree that if there is a standard (or at least well known) set of act

Re: [PATCH wayland] tests: add a test for mixing up client resources in an event

2017-01-25 Thread Pekka Paalanen
On Mon, 23 Jan 2017 11:49:24 -0600 Derek Foreman wrote: > Tests that the compositor is prevented from sending a resource id > from one client in an event to another client. > > This tests the (rare in practice) subset of the problem where both > clients magically happen to have the same kind of

Re: [PATCH wayland] dtddata: Use standard permission notice

2017-01-25 Thread Daniel Stone
Hi Yong, On 25 January 2017 at 14:41, Yong Bakos wrote: > From: Yong Bakos > > Signed-off-by: Yong Bakos This, and any other patch to wayland, wayland-protocols, or weston, to migrate any code copyright Collabora or the Raspberry Pi Foundation to the standard license text, are: Reviewed-by: Da

[PATCH wayland] dtddata: Use standard permission notice

2017-01-25 Thread Yong Bakos
From: Yong Bakos Signed-off-by: Yong Bakos --- src/dtddata.S | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/dtddata.S b/src/dtddata.S index ce51133..2405066 100644 --- a/src/dtddata.S +++ b/src/dtddata.S @@ -1,23 +1,26 @@ /* * Co

Re: [PATCH wayland] wayland-server: hide wl_priv_signal from doxygen

2017-01-25 Thread Yong Bakos
Hi Pekka, > On Jan 25, 2017, at 4:32 AM, Pekka Paalanen wrote: > > From: Pekka Paalanen > > Fix this set of warnings appearing three times during a build: > > /home/pq/git/wayland/src/wayland-server.c:1868: warning: class > `wl_priv_signal' for related function `wl_priv_signal_init' is not >

Re: [PATCH wayland] wayland-server: hide wl_priv_signal from doxygen

2017-01-25 Thread Yong Bakos
Pekka, > On Jan 25, 2017, at 4:32 AM, Pekka Paalanen wrote: > > From: Pekka Paalanen > > Fix this set of warnings appearing three times during a build: > > /home/pq/git/wayland/src/wayland-server.c:1868: warning: class > `wl_priv_signal' for related function `wl_priv_signal_init' is not > doc

Re: [PATCH v5 wayland 3/3] wayland-server: log an error for events with wrong client objects

2017-01-25 Thread Pekka Paalanen
On Tue, 24 Jan 2017 12:07:21 -0600 Derek Foreman wrote: > Check that all the objects in an event belong to the same client as > the resource posting it. This prevents a compositor from accidentally > mixing client objects and posting an event that causes a client to > abort with a cryptic messag

[PATCH wayland] wayland-server: hide wl_priv_signal from doxygen

2017-01-25 Thread Pekka Paalanen
From: Pekka Paalanen Fix this set of warnings appearing three times during a build: /home/pq/git/wayland/src/wayland-server.c:1868: warning: class `wl_priv_signal' for related function `wl_priv_signal_init' is not documented. /home/pq/git/wayland/src/wayland-server.c:1884: warning: class `wl_pri

Re: [PATCH wayland v3 3/3] server: use the new wl_priv_signal for wl_resource

2017-01-25 Thread Pekka Paalanen
On Tue, 24 Jan 2017 16:34:30 +0200 Giulio Camuffo wrote: > The old wl_signal is kept for backwards compatibility, as that is also > present in the deprecated public wl_resource struct, and that must be > kept working. > --- > src/wayland-server.c | 52 > +

Re: libwayland-server ABI change: [PATCH] wayland-server: Destroy Clients upon wl_display_destroy()

2017-01-25 Thread Pekka Paalanen
On Wed, 25 Jan 2017 11:08:26 +0800 Jonas Ã…dahl wrote: > On Mon, Jan 23, 2017 at 03:40:11PM +0200, Pekka Paalanen wrote: > > On Tue, 20 Dec 2016 18:40:13 +0530 > > viveka wrote: > > > > > From: "Vivek.A" > > > > > > Without this, client socket file descriptors are being kept open > > >

Re: [PATCH 3/3 v8] tests: Add a test for global filter

2017-01-25 Thread Pekka Paalanen
On Tue, 24 Jan 2017 16:54:04 +0100 Olivier Fourdan wrote: > Test if the global filter is effectively filtering out the global when > the filter returns false. > > Signed-off-by: Olivier Fourdan > --- > v3: split out as its own commit > v4: Follow up on Jonas' comments: > assert(hi.has_da