Commit Graph

76 Commits

Author SHA1 Message Date
Chris Michael d0a6263519 elput: Fix resource leak
Coverty reports that we leak 'reply' here if we fall into the error
condition.

CID1367506

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-19 09:49:36 -05:00
Chris Michael fe27a8d440 elput: Fix resource leak
Coverity reports that 'reply' is leaked here if we fall into the error
condition.

CID1367507

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-19 09:48:30 -05:00
Chris Michael 6ff374256c elput: Properly check return values from libinput config functions
As libinput_config_status may contain 3 possible return values, we
need to santize the return values there into Eina_Bool for use in our
own functions.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-14 09:18:14 -05:00
Chris Michael b27ebc6294 elput: Add API functions to get/set if tap-to-click is enabled
This patch adds API functions to get or set if tap-to-click is enabled
on a touchpad device

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-14 09:18:14 -05:00
Chris Michael 73a074498a elput: Add API functions to get/set touchpad click method
This patch adds API functions to get or set the click method used on
touch devices. The click method defines when to generate software
emulated buttons

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-14 09:18:14 -05:00
Chris Michael 0f81e32433 elput: Add API functions to get/set the scroll method for a touchpad
device

This patch adds API functions which can be used to get or set the
scroll method used for a given device. Scroll method defines when to
generate scroll axis events

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-14 09:18:14 -05:00
Chris Michael 68e1c9e0a0 elput: Add API functions to enable/disable dwt support on touchpads
This patch adds API functions to get/set if dwt (disable-while-typing) is
enabled on a touchpad.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-14 09:18:14 -05:00
Chris Michael 6eb34e2199 elput: Add API functions to enable/disable drag-lock on touch devices
This patch adds API functions to get or set if drag-lock is enabled on
touch devices.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-14 09:18:14 -05:00
Chris Michael 0b2a32212a elput: Add API functions to enable/disable tap-and-drag
This patch adds new API functions for Elput touch devices to get or set if
tap-and-drag is enabled on a touchpad device

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-14 09:18:14 -05:00
Chris Michael 8ebf4cd972 elput: Improve checks for keyboard & pointer devices
Some devices reported by libinput show up as both keyboard and mouse,
even tho they are physically only just a keyboard or just a mouse.
When a device gets added, we can verify if it is actually a mouse by
checking if the device has BTN_LEFT (and for keyboards, check
KEY_ENTER). This stops us from getting multiple mouse pointers
reported when we really only have one.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-08 14:32:22 -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
Bruno Dilly a3fba57b26 ecore_con,elput: fix warnings
Summary:
elput: fix warning for unused write result
         ecore_con: fix warning for unused asprintf result

Reviewers: iscaro, devilhorns, cedric

Reviewed By: cedric

Subscribers: cedric, seoz, jpeg

Differential Revision: https://phab.enlightenment.org/D4308

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-09-20 16:13:28 -07:00
Jihoon Kim 4675edfcf9 elput: Fix typo in doxygen
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
2016-08-23 14:55:50 +09:00
Derek Foreman 3d5dbbfcd0 elput: Use correct filename in unlink
We switched from mkstemp to eina_file_mkstemp() but ended up unlinking
the template filename, which didn't exist on the filesystem.
2016-07-26 12:38:24 -05:00
Chris Michael 32af25ebb9 elput: Fix issue of losing mouse input when removing a device
When we are adding new input devices, if we already have an existing
one (keyboard, pointer, touch, etc) then we should just be
incrementing the device count and returning from the init function.
Previous code here would increment the device count, then continue on
and create a new internal representation of the device. This was
causing issues when a device gets removed.

Fixes T4192

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-25 10:55:57 -04:00
Chris Michael 4309050fec elput: Use proper variable type
The 'getenv' function returns char * ... not a const char *, so adjust
variable type to match

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-21 13:18:57 -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
Marcel Hollerbach 38554b652a elput: check for a special return value
sd_pid_get_session returns ENODATA or ENXIO if it was unable to fetch
the session data for the given pid, reason for that is mostly that the
pid is not running is a session. Adding this as the error value can help
the user debugging the problem without the need of gdb´ing into the
function and checking the return value.
2016-07-11 11:02:52 +02:00
Carsten Haitzler 9c80c2b070 elput - simplify and fix handling of string overflow with xdg runtimedir
this addresses an issue pointed to by CID 1357168
2016-07-09 12:01:51 +09:00
Carsten Haitzler 870c81fd72 elput - remove pointless code in handling touch event
i commented the pointless code out. this fixes CID 1357145
2016-07-09 11:57:30 +09: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 ee72059219 elput: Fix insecure temporary file
Fix using mkstemp directly without securely setting umask first by
making use of eina_file_mkstemp which does set unmask.

Fixes Coverity CID1357165

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-08 08:51:54 -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
Chris Michael 28f79d4585 elput: Fix issue of VT-Switching not working
This patch fixes an issue where you could not VT-switch away from a
running Enlightenment session by simplifying the vt switch code and
passing the proper arguments to the dbus message.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-13 16:19:46 -04:00
Chris Michael 09fc4e7b68 Revert "elput: Missing pointer initialization."
Reverting this as the initialization of char *s was already set to
NULL in a previous patch, so the 'if (s)' check here is pointless
really as 'man 3 free' says passing NULL to free() is ok.

This reverts commit ad2e21b023.
2016-06-07 12:09:20 -04:00
Benjamin Jacobs ad2e21b023 elput: Missing pointer initialization.
Summary:
Calling free() on an uninitialized pointer leads to crash, that can occurs
when sd_session_get_seat fails.
Fixes T3785.

Reviewers: devilhorns

Subscribers: cedric, jpeg

Maniphest Tasks: T3785

Differential Revision: https://phab.enlightenment.org/D4015

@fix
2016-06-07 09:43:01 -04:00
Chris Michael 180e64653d elput: Fix crash whem sd_session_get_seat fails
If systemd fails to give us a valid session id, then any further calls
to get a seat from that session are going to fail. As such, check for
a valid seat return from systemd before calling any systemd functions
which require session id.

Fixes T3785

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-06 14:53:35 -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 ad58478b76 elput: Remove badly named API
This patch removes an API function that basically "tried to do too
much". This was supposed to be used for centering mouse pointer and
calibrating an input device based on output size. Remove this
silliness. It would be better to have one API for calibrating, and a
separate API for pointer centering. These new APIs will come shortly
in pending patches.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-26 11:37:18 -04:00
Chris Michael bf7978d9e3 elput: Fix issue where double/triple click was not working
As we use the mouse threshold for determining double/triple clicking,
it would probably be a good idea if that threshold had a value

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-26 11:35:42 -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
Chris Michael 03c42fd2cb elput: Fix formatting
NB: No functional changes, just making this readable

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-25 15:03:15 -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
Mike Blumenkrantz 33a5d44dcf elput: remove 'sync' param from device management
unnecessarily complicates code
2016-05-25 12:57:26 -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 9ecc3ba38d elput: Check return of calibration_get_default_matrix function
We should be checking the return value when we try to get the default
matrix calibration for an input device so we can fail properly

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-20 11:30:33 -04:00
Chris Michael 6cd9605029 elput: Don't calculate pointer constraints twice
As constraints for pointer movement are already handled in the
function which sends the pointer motion event, there is no need to
handle them inside the function which gets pointer position.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-20 11:18:21 -04:00
Chris Michael 63787ee459 elput: Don't multiply pointer axis value
Reporting of mouse axis values should not be multiplied by 10. This
will cause serious jumps in wheel events. Loosely based on
1a339c9e59

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-14 03:35:09 -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