Re: [PATCH 3/4] queue-test: Add another assertion

2014-09-28 Thread Karsten Otto
Indeed, I just followed the lead of the other tests, which use assert exactly like this. I think what makes it OK are these lines in test-runner.h: #ifdef NDEBUG #error "Tests must not be built with NDEBUG defined, they rely on assert()." #endif Cheers, Karsten Am 29.09.2014 um 05:48 schrieb Di

Re: [PATCH 4/4] wayland-server: Abort if a read from a client gives 0 length

2014-09-28 Thread Jason Ekstrand
On Sep 28, 2014 11:49 AM, "Karsten Otto" wrote: > > From: Philip Withnall > > This happens if the socket has been gracefully closed. > > [KAO: It prevents a potential infinite loop when using a different > event handling mechanism than epoll, if said mechanism cannot > distinguish EOF from regula

Re: [PATCH 1/4] connection: Fix sendmsg() on BSD systems

2014-09-28 Thread Jason Ekstrand
On Sep 28, 2014 6:54 PM, "Bill Spitzak" wrote: > > On 09/28/2014 11:49 AM, Karsten Otto wrote: > >> + msg.msg_control = NULL; >> + msg.msg_controllen = 0; >> msg.msg_flags = 0; >> >> + /* Only set msg_control when sending ancillary data */

Re: [PATCH 3/4] queue-test: Add another assertion

2014-09-28 Thread Dima Ryazanov
I've brought this up once, but looks like it's acceptable in the test suite since it already relies on asserts: http://lists.freedesktop.org/archives/wayland-devel/2013-February/007454.html On Sep 28, 2014 6:57 PM, "Bill Spitzak" wrote: > On 09/28/2014 11:49 AM, Karsten Otto wrote: > > - w

Re: [PATCH 3/4] queue-test: Add another assertion

2014-09-28 Thread Bill Spitzak
On 09/28/2014 11:49 AM, Karsten Otto wrote: - wl_display_roundtrip(display); + assert(wl_display_roundtrip(display) != -1); You can't put code that you require to run in an assert. ___ wayland-devel mailing list wayland-devel@lists.freed

Re: [PATCH 1/4] connection: Fix sendmsg() on BSD systems

2014-09-28 Thread Bill Spitzak
On 09/28/2014 11:49 AM, Karsten Otto wrote: + msg.msg_control = NULL; + msg.msg_controllen = 0; msg.msg_flags = 0; + /* Only set msg_control when sending ancillary data */ + if (clen > 0) { + msg.msg_c

[PATCH 3/4] queue-test: Add another assertion

2014-09-28 Thread Karsten Otto
From: Philip Withnall Ensure that the round trip succeeds. [KAO: adjusted to current test framework] Signed-off-by: Philip Withnall --- tests/queue-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/queue-test.c b/tests/queue-test.c index 96f2100..6e2e932 100644

[PATCH 1/4] connection: Fix sendmsg() on BSD systems

2014-09-28 Thread Karsten Otto
From: Philip Withnall BSD systems expect all unused fields in the msghdr struct to be initialized to 0 and NULL respectively, and returns EINVAL otherwise. It can't hurt to be tidy about things on other platforms either though. [KAO: Make comments refer to all BSD-like systems] --- src/connecti

[PATCH 4/4] wayland-server: Abort if a read from a client gives 0 length

2014-09-28 Thread Karsten Otto
From: Philip Withnall This happens if the socket has been gracefully closed. [KAO: It prevents a potential infinite loop when using a different event handling mechanism than epoll, if said mechanism cannot distinguish EOF from regular read (e.g. select).] --- src/wayland-server.c | 2 +- 1 file

[PATCH 2/4] event-loop.c: Use correct OS abstraction function for dupfd()

2014-09-28 Thread Karsten Otto
From: Philip Withnall Signed-off-by: Philip Withnall --- src/event-loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/event-loop.c b/src/event-loop.c index a149db9..1f571ba 100644 --- a/src/event-loop.c +++ b/src/event-loop.c @@ -134,7 +134,7 @@ wl_event_loop_add_fd(

[PATCH libinput 7/7] touchpad: Make tap code follow state machine diagram part 3

2014-09-28 Thread Hans de Goede
We should only mark touches dead on a button click if we're dealing with a clickpad. Signed-off-by: Hans de Goede --- src/evdev-mt-touchpad-tap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c index e9dc147..ce88ff4

[PATCH libinput 6/7] touchpad: Make tap code follow state machine diagram part 2

2014-09-28 Thread Hans de Goede
Mark touches as idle, rather then dead, on release. This causes no functional changes since we only evert check for tap-touch-state == touch, and neither being idle or dead == touch. Signed-off-by: Hans de Goede --- src/evdev-mt-touchpad-tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[PATCH libinput 2/7] touchpad: Make motion during tap-n-drag test take some time

2014-09-28 Thread Hans de Goede
The tap code will move individual touches to a state of TAP_TOUCH_STATE_DEAD after a timeout. In case of tap-n-drag this should not have any influence, make the litest_touch_move_to take long enough to trigger the timeout to verify that this does not has any influence. Signed-off-by: Hans de Goede

[PATCH libinput 1/7] litest: Add a sleep_ms parameter to litest_touch_move_to

2014-09-28 Thread Hans de Goede
In reality moving a touch from point to another takes time. In some cases (when a timeout may trigger during the move, e.g. tap-n-drag on a touchpad), this is important. Add a sleep_ms parameter, which will cause litest_touch_move_to to sleep the specified amount of ms every step. Signed-off-by: H

[PATCH libinput 5/7] touchpad: Make tap code follow state machine diagram part 1

2014-09-28 Thread Hans de Goede
According to the diagram, we should only check the tap-touch-state before sending a button press / release when in state touch_2 or touch_3. tp_tap_notify always checks the tap-touch-state. This is problematic when in state tapped, or one of the follow up states, since this could cause the button

[PATCH libinput 4/7] touchpad: Add a test for 2fg tap-n-drag release on a 3th finger down

2014-09-28 Thread Hans de Goede
Signed-off-by: Hans de Goede --- test/touchpad.c | 49 + 1 file changed, 49 insertions(+) diff --git a/test/touchpad.c b/test/touchpad.c index fba1d58..f9031dd 100644 --- a/test/touchpad.c +++ b/test/touchpad.c @@ -239,6 +239,54 @@ START_TEST(touch

[PATCH libinput 3/7] touchpad: Don't send scroll events during 2 finger tap-n-drag

2014-09-28 Thread Hans de Goede
The touchpad tap code explicitly supports 2 finger tap-n-drag, this commit adds a test-case for this, which fails due to the 2 finger scrolling code sending scroll events during a 2 finger tap-n-drag. And this commit fixes the test-case, by not sending scroll events while a tap-n-drag is active.

[PATCH libinput v2 4/9] core: Move libinput_event definition to libinput-private.h

2014-09-28 Thread Hans de Goede
Signed-off-by: Hans de Goede Reviewed-by: Peter Hutterer --- src/libinput-private.h | 5 + src/libinput.c | 5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libinput-private.h b/src/libinput-private.h index c8b65d9..92bd96b 100644 --- a/src/libinput-private

[PATCH libinput v2 8/9] touchpad: Rename consumed to filter_motion

2014-09-28 Thread Hans de Goede
This is what the return value in tp_tap_handle_state is called, and it better reflects what the flag does. Signed-off-by: Hans de Goede --- src/evdev-mt-touchpad.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index

[PATCH libinput v2 9/9] touchpad: Disable touchpads on trackpoint activity

2014-09-28 Thread Hans de Goede
Some laptops with both a clickpad and a trackpoint have such a large touchpad, that parts of the users hands will touch the pad when using the trackpoint. Examples of this are the Lenovo T440s and the Toshiba Tecra Z40-A. This commit makes libinput automatically disable the touchpad while using th

[PATCH libinput v2 6/9] touchpad: Add tap suspend / resume

2014-09-28 Thread Hans de Goede
While e.g. disabling the touchpad while the trackpoint is used, we want to stop sending tap (or scroll or motion) events. We cannot use tp_clear_state at this time as that will also release any touchpad buttons pressed, breaking dragging with the trackpoint using the touchpad or clickpad buttons.

[PATCH libinput v2 5/9] touchpad: Rewrite / fix tp_release_all_taps

2014-09-28 Thread Hans de Goede
Before this commit tp_release_all_taps would call tp_tap_handle_timeout, which is a nop when in state DRAGGING. tp_clear_state then releases all touches and calls touchpad_handle_state which moves the state to DRAGGING_WAIT, and the button 1 release will only be done after the tap-timeout, rather t

[PATCH libinput v2 2/9] core: Add timestamp parameter to post_device_event

2014-09-28 Thread Hans de Goede
This is a preparation patch for adding internal event listeners, so that the callbacks for these can get the full 64 bit timestamps. Signed-off-by: Hans de Goede --- src/libinput.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/libinput.c b/src/libin

[PATCH libinput v2 7/9] touchpad: Fix log_bug_libinput calls on tap enable with fingers down

2014-09-28 Thread Hans de Goede
Before this commit the tap code deals with enabled being set to false, by waiting for tap.state to become IDLE, and then ignoring any events from that point on. This causes a problem when enabled gets set to true again while fingers are down, because when in IDLE no release events are expected, so

[PATCH libinput v2 1/9] core: Make time argument to internal foo_notify_bar functions 64 bit

2014-09-28 Thread Hans de Goede
The libinput evdev code uses 64 bit timestamps internally, to avoid having to deal with timestamp wraps. The internal foo_notify_bar functions time argument however is only 32 bits, bump this to 64 bits to avoid truncating the timestamps when calling these functions. This is a preparation patch fo

[PATCH libinput v2 3/9] core: Add internal event notification mechanism

2014-09-28 Thread Hans de Goede
For features like e.g. disable-touchpad-while-typing, it is necessary for one device to be able to listen into another device's events. It is tempting to use the existing device_added / device_removed mechanism to give e.g. the keyboard a link to the touchpad, and make the keyboard code disable /

Re: [PATCH libinput 3/3] touchpad: Disable touchpads on trackpoint activity

2014-09-28 Thread Hans de Goede
Hi, On 09/22/2014 07:18 AM, Peter Hutterer wrote: > On Thu, Sep 18, 2014 at 01:11:05PM +0200, Hans de Goede wrote: >> Some laptops with both a clickpad and a trackpoint have such a large >> touchpad, >> that parts of the users hands will touch the pad when using the trackpoint. >> Examples of thi