mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 04:40:25 +01:00
test: enable 2fg scrolling on most palm tests
edge scrolling disables some palm detection, so we can't run those tests when active. That fell through the cracks so far, all devices with edge scroll by default were too small to enable palm detection. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
2447f3862c
commit
3948cb9048
1 changed files with 42 additions and 5 deletions
|
|
@ -32,6 +32,28 @@
|
|||
#include "libinput-util.h"
|
||||
#include "litest.h"
|
||||
|
||||
static bool
|
||||
has_2fg_scroll(struct litest_device *dev)
|
||||
{
|
||||
struct libinput_device *device = dev->libinput_device;
|
||||
|
||||
return !!(libinput_device_config_scroll_get_methods(device) &
|
||||
LIBINPUT_CONFIG_SCROLL_2FG);
|
||||
}
|
||||
|
||||
static void
|
||||
enable_2fg_scroll(struct litest_device *dev)
|
||||
{
|
||||
enum libinput_config_status status, expected;
|
||||
struct libinput_device *device = dev->libinput_device;
|
||||
|
||||
status = libinput_device_config_scroll_set_method(device,
|
||||
LIBINPUT_CONFIG_SCROLL_2FG);
|
||||
|
||||
expected = LIBINPUT_CONFIG_STATUS_SUCCESS;
|
||||
litest_assert_int_eq(status, expected);
|
||||
}
|
||||
|
||||
static void
|
||||
enable_edge_scroll(struct litest_device *dev)
|
||||
{
|
||||
|
|
@ -2099,9 +2121,12 @@ START_TEST(touchpad_palm_detect_at_edge)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (!touchpad_has_palm_detect_size(dev))
|
||||
if (!touchpad_has_palm_detect_size(dev) ||
|
||||
!has_2fg_scroll(dev))
|
||||
return;
|
||||
|
||||
enable_2fg_scroll(dev);
|
||||
|
||||
litest_disable_tap(dev->libinput_device);
|
||||
|
||||
litest_drain_events(li);
|
||||
|
|
@ -2143,9 +2168,12 @@ START_TEST(touchpad_palm_detect_at_bottom_corners)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (!touchpad_has_palm_detect_size(dev))
|
||||
if (!touchpad_has_palm_detect_size(dev) ||
|
||||
!has_2fg_scroll(dev))
|
||||
return;
|
||||
|
||||
enable_2fg_scroll(dev);
|
||||
|
||||
litest_disable_tap(dev->libinput_device);
|
||||
|
||||
/* Run for non-clickpads only: make sure the bottom corners trigger
|
||||
|
|
@ -2169,9 +2197,12 @@ START_TEST(touchpad_palm_detect_at_top_corners)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (!touchpad_has_palm_detect_size(dev))
|
||||
if (!touchpad_has_palm_detect_size(dev) ||
|
||||
!has_2fg_scroll(dev))
|
||||
return;
|
||||
|
||||
enable_2fg_scroll(dev);
|
||||
|
||||
litest_disable_tap(dev->libinput_device);
|
||||
|
||||
/* Run for non-clickpads only: make sure the bottom corners trigger
|
||||
|
|
@ -2195,9 +2226,12 @@ START_TEST(touchpad_palm_detect_palm_stays_palm)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (!touchpad_has_palm_detect_size(dev))
|
||||
if (!touchpad_has_palm_detect_size(dev) ||
|
||||
!has_2fg_scroll(dev))
|
||||
return;
|
||||
|
||||
enable_2fg_scroll(dev);
|
||||
|
||||
litest_disable_tap(dev->libinput_device);
|
||||
|
||||
litest_drain_events(li);
|
||||
|
|
@ -2214,9 +2248,12 @@ START_TEST(touchpad_palm_detect_palm_becomes_pointer)
|
|||
struct litest_device *dev = litest_current_device();
|
||||
struct libinput *li = dev->libinput;
|
||||
|
||||
if (!touchpad_has_palm_detect_size(dev))
|
||||
if (!touchpad_has_palm_detect_size(dev) ||
|
||||
!has_2fg_scroll(dev))
|
||||
return;
|
||||
|
||||
enable_2fg_scroll(dev);
|
||||
|
||||
litest_disable_tap(dev->libinput_device);
|
||||
|
||||
litest_drain_events(li);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue