Commit Graph

56 Commits

Author SHA1 Message Date
Marcel Hollerbach 202bae05ec WIP: elput: introduce gesture passing
In order to have that working on Xorg, this requires the libinput group
hack if you are not session leader.
for now only swipe bindings.
2021-03-24 20:58:13 +01:00
Michaël Bouchaud (yoz) ebc84e82ac elput: Add API to allow settings tap-to-click on pointer device
Summary:
Add a way to configure pointer device with tap-to-click features.

@feature

Reviewers: ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7843
2019-01-31 08:39:41 -05:00
Christopher Michael 7fcb3f5db1 elput: Verify pointer device is accel capable before setting speed
As we cannot set mouse accel speed unless an input device is capable,
we add a small test here to check that it supports acceleration.
2019-01-02 14:55:13 -05:00
Carsten Haitzler db6e4622af elput - don't segv on shutdown when libinput dispatch happens to free lib 2018-02-26 00:36:17 +09:00
Carsten Haitzler b461830e64 elput - fix crash on shutdown where input.lib was NULL
this was null checked everywhere except in 1 place. fix. now more
crash on shutdown now
2018-01-17 18:14:51 +09:00
Chris Michael fa2faff41b elput: Fix issue of pointer rotation not being set on startup
elput_input_pointer_rotation_set may be getting called before input
devices are actually added, so we need to be able to set pointer
rotation when a device actually gets added.

To fix this, we will store the requested input rotation value, and
apply it at the time of input device creation.

NB: The current case is that the wl_drm module will apply existing
output rotation before Input has completely initialized, thus any
calls to set the pointer rotation there will not succeed as input
devices have not been created yet.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-10-03 14:14:04 -04:00
Chris Michael d798eca247 elput: Add API to set pointer acceleration speed
Small patch to add an API which can be called to set pointer
acceleration speed under Wayland.

ref T4736

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-08-24 11:28:31 -04:00
Mike Blumenkrantz d529d6def6 elput: fix seat cleanup
ensure seat deletion does not conflict with elput shutdown

@fix
2017-07-28 15:40:47 -04:00
Mike Blumenkrantz ea4ae11023 elput: unref devices in post event cb
@fix
2017-07-28 15:40:47 -04:00
Chris Michael 4052923ed0 elput: Minor formatting fix
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-07-10 13:13:59 -04:00
Chris Michael 26af19b543 elput: Add API function to swap dx & dy axis from pointer motion event
Small patch which adds an API function that can be called to swap x
and y axis and invert them according to rotation angle.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-08 10:03:36 -04:00
Mike Blumenkrantz bc346d367f elput: send extra pointer motion event on first button press after resume
ensure state is reapplied by other components
2017-06-02 18:23:43 -04:00
Mike Blumenkrantz f220f086b9 elput: move pointer coords into seat struct
@fix
2017-06-02 18:23:43 -04:00
Mike Blumenkrantz 4c7c613e76 elput: add refcounting for seats/devices
ensure lifetimes persist through events

@fix
2017-06-02 18:23:42 -04:00
Mike Blumenkrantz d4ce9b1ac3 elput: store output w/h and apply to devices on creation
fix async device initialization for devices which need this (e.g., touchpads)

@fix
2017-05-26 16:27:43 -04:00
Mike Blumenkrantz cf6fc05610 elput: add more elput_seat accessor apis 2017-05-26 16:27:43 -04:00
Mike Blumenkrantz b09c6f1f3e elput: start elput_device_ and elput_seat_ namespaces, rename some functions 2017-05-26 16:27:43 -04:00
Mike Blumenkrantz e34088d74e elput: rename and make public Elput_Device_Caps enum 2017-05-26 16:27:43 -04:00
Mike Blumenkrantz e8fe0bcc47 elput/drm: redo xkb context/keymap setting
context and keymap need to be set at the same time in order to effectively
update keyboard state, and active group should be accessible through api
as well

preserve old function ABI to ensure old binaries don't crash
2017-05-26 16:27:42 -04:00
Mike Blumenkrantz 9f217eb0f6 elput: add copyright from weston 2017-05-26 16:27:42 -04:00
Derek Foreman b04fa2ddba elput: Fix async input shutdown during init
By only checking if the thread was cancelled *after* sending feedback
to the main thread we ended up claiming all the devices libinput
asked for in a way that never allowed them to be released

(how the hell can a cancelled thread send feedback?)
2017-02-07 16:53:09 -06:00
Chris Michael 661c19a514 elput: Set device output name when device is created
Small patch to set the output name of an Elput_Device when the device
gets created. Note, this was already being done inside elput_input,
but this patch moves it to when the device gets created.

NB: Really no functional changes here, just moving a function call.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-07 11:33:25 -05:00
Chris Michael e483e35f3d elput: Improve debug output for added devices
Small patch which does not print out debug info for devices we do not
handle, and adds the 'type' of device to the debug output (pointer,
keyboard, etc).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-31 10:55:55 -05:00
Chris Michael d90be60e47 Revert "elput: Change return of device_add/remove functions"
Reverting this in favor of a better way to improve debug output

This reverts commit cee7ee3993.
2017-01-31 10:53:30 -05:00
Chris Michael cee7ee3993 elput: Change return of device_add/remove functions
Minor change on the return value of the device_add and device_remove
functions so that we can avoid debug output for devices which we do
not deal with.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-31 10:34:22 -05:00
Chris Michael ea3c1d17da elput: Add more robust debugging output for input devices
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-31 10:29:25 -05:00
Chris Michael 2af4858e2a elput: Return touch coordinates when we have no pointer
If a user calls elput_input_pointer_xy_get (as is done via
ecore_evas_drm) and a pointer does not exist, we never return any
coordinates for this function.

Enlightenment is using ecore_evas_pointer_xy_get (which when using the
drm ee, ends up calling elput_input_pointer_xy_get). If we have no
pointer device, then no coordinates are ever returned and touch
clicking does not function properly.

To fix that we will check if a touch device exists and supply the
coordinates from that (in the case where there is no pointer device).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-17 11:36:50 -05:00
Chris Michael 93f7639c0d elput: Add API to allow setting pointer acceleration profile
This patch adds an API that can be used to set a pointer acceleration
profile. This API should be used when addressing T4736

ref T4736

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-02 09:58:43 -04:00
Chris Michael 2437d53278 elput: Cleanup erroneous errors when trying to get output name
When we make calls to get an Input device's output name, if the device
does not have an output name it's not actually an error so just return
NULL with less noise

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-13 11:41:09 -04:00
Chris Michael cb2ab38421 elput: Fix horrid typo
Not sure how this happened, but use a ; not a : ;)

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-08 08:54:45 -04:00
Chris Michael e0cde40475 elput: Add API function to return output name associated with input
device

This patch adds a new API function which we can call from Ecore_Drm2
which will return the name of an output which is associated with a
given input device. This output name can then be used to find a
matching output, and perform any device calibration that is needed.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-08 08:05:14 -04:00
Chris Michael 0f965446a8 elput: Check return of read function call
If we fail to read any bytes from the fd, then we should be returning
a failure here.

Fixes Coverity CID1357143

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 10:54:22 -04:00
Chris Michael b2a4f45790 elput: Support suspending and resuming inputs on vt switch
This patch fixes an issue where input would stop working when you
vt-switch away and back again in a running Enlightenment Wayland
session. Basically, when we vt-switch away, we need to tell libinput
to suspend input event processing, and when we return to re-enable it.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-21 12:46:29 -04:00
Chris Michael 3adf6fdbae elput: Trap for null physical seat name
It could be possible that libinput_seat_get_physical_name does not
return a valid name, in which case searching for seats will fail. This
small patch just checks for a valid name being passed in and if not,
searches for a default seat name

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-16 13:01:33 -04:00
Mike Blumenkrantz 596b132226 Revert "elput: Use Eeze function to get the udev to create context with"
This reverts commit 7b3d20371e.

using a separate context was intentional here since libudev is not threadsafe
and this will crash
2016-06-02 11:12:06 -04:00
Chris Michael 7b3d20371e elput: Use Eeze function to get the udev to create context with
As we already link to Eeze and use it throughout this code, there is
no point in adding an extra dependency on libudev itself when we can
just use Eeze functions to get what we need. This is a better fix for
T3712

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-02 10:24:42 -04:00
Chris Michael 20f418b8d7 elput: Add API function to support caching of existing keymap
@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 09:17:46 -04:00
Chris Michael 65cfdaa3dd elput: Add API function to support caching of an xkb_context
@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 09:12:53 -04:00
Chris Michael 2c043ca205 elput: Add APIs to support keyboard key remapping
This patch adds 2 new API functions which can enable keyboard key
remapping, and set which keys are to be remapped.

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-26 12:49:24 -04:00
Chris Michael 054a9c8182 elput: Add API function to calibrate input devices
This adds an API function that can be called to calibrate input
devices based on a given output size

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-26 11:43:22 -04:00
Chris Michael 3c6cb6a02b elput: Minor formatting fixes
NB: No functional changes, just cleanup of formatting

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-26 08:42:38 -04:00
Mike Blumenkrantz b9ecdcef6a elput: use physical name of seat when finding existing seats
"seat0" is used as the default internal name, and this is a physical name.
using the logical name causes mismatches and allows devices to function
in unintended ways
2016-05-25 12:57:27 -04:00
Mike Blumenkrantz 8c3f0ff640 elput: further simplify device internals
'window' and pointer max w/h attributes are set for a manager object,
so let the attributes stay there. this also resolves issues where devices
created at a later point would fail to be initialized with these attributes
2016-05-25 12:57:27 -04:00
Mike Blumenkrantz 7fdcf841f5 elput: change some functions and internal flags to enable async input setup
this sets attributes on the Elput_Manager struct so that devices created at
a later point can then have relevant attributes applied to them
2016-05-25 12:57:27 -04:00
Mike Blumenkrantz 5f088b026d elput: define and implement an async device opening interface for libinput
this adds an overly-complex method of removing blocking dbus calls from libinput's
synchronous device initialization architecture. libinput was clearly never meant
to be used in this way, but we're doing it anyway because we're efl.

 #SamsungFeatures
2016-05-25 12:57:27 -04:00
Chris Michael eec50ed7bd elput: Add API function to set left-handed device
This commit adds an API function which Enlightenment can call in order
to set an input device to be "left-handed". Mainly used for a mouse
pointer, but not specific to pointers.

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-24 09:19:04 -04:00
Chris Michael fa5abb2967 elput: Add API function to set max allowed pointer position
This patch adds an API function that can be used to restrict mouse
movement from going outside a screen

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-10 15:12:53 -04:00
Chris Michael 3954aa5518 elput: Fix issue of NULL seat named being passed during input init
When calling elput_input_init we need to check for a valid seat name
being passed in. If no seat name is provided, we will use the default
seat name.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-10 14:36:35 -04:00
Chris Michael be763a011c elput: Add API function to return a list of Elput_Devices on a given
seat

This patch adds a new API function which can be called to retrieve a
list of existing Elput_Devices on a given Elput_Seat.

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-10 13:49:38 -04:00
Chris Michael a96266c422 elput: Remove erroneous debug print out
NB: No functional changes, just cleanup of extra debug message and
commented out codeblock

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-09 11:05:21 -04:00