Commit Graph

43 Commits

Author SHA1 Message Date
Chris Michael 0e6cd3fbf5 elput: Remove unused variable
Gcc reports 'flags' as unused here, so remove it

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-19 13:15:02 -04:00
Cedric BAIL b12311804f elput: use new API eina_file_close_on_exec. 2017-04-18 16:56:56 -07:00
Carsten Haitzler 0356b1eb5e vpath usage - simplify to bare minimum to make gustavo happy
since these are only local path resolves, the do and wait are
technically not needed. also remove any other tmp strings
and use the vpath string resolving feature to avoid
printfs/strjoins/cats etc. etc. as well.

also remember to remove old name string from evas shm code - it worked
for me. i guess i was lucky and it happened to be NULL thus free was
fine.
2017-02-10 19:27:15 +09:00
Derek Foreman 2800038ee2 Revert "vpath usage - simplify to bare minimum to make gustavo happy"
This reverts commit 2037474dc0.

This causes the wayland_shm engine to seg fault immediately at
startup when attempting to create shm buffers.

Please make sure when committing changes to the wayland_shm engine to
test on intel, exynos, and at least one platform without dmabuf
capabilities - or using the EVAS_WAYLAND_SHM_DISABLE_DMABUF env var
to disable dmabuf on intel or exynos.

Anyone without the time or hardware to fully test changes to wayland_shm
can submit a patch to phabricator and assign it to me so I can fully
test it before landing.
2017-02-09 09:17:38 -06:00
Carsten Haitzler 2037474dc0 vpath usage - simplify to bare minimum to make gustavo happy
since these are only local path resolves, the do and wait are
technically not needed. also remove any other tmp strings and use the
vpath string resolving feature to avoid printfs/strjoins/cats etc.
etc. as well.
2017-02-09 22:06:16 +09:00
Carsten Haitzler 8e959890e7 elput - use vpath to get xdg runtime to also be setuid safe
this time around... use a / at the end of the (:run:) virtual dir
path to make it work.
2017-02-09 09:28:47 +09:00
Derek Foreman 62a22fd401 Revert "elput - use vpath to get xdg runtime to also be setuid safe"
This reverts commit 24e34e19a1.

This broke keyboard input for the enlightenment wayland compositor,
please test elput changes on at least one of the drm backends,
preferably with enlightenment.

The wayland compositor is hard enough to keep stable due to breakage
from core changes only tested on X - but elput's main user is our
wayland compositor, was this tested anywhere?
2017-02-08 09:47:33 -06:00
Derek Foreman 53cc1eab04 Revert "elput: Minor formatting fix"
This reverts commit 95d93cb720.

Formatting change on top of a totally untested coverity fix that
breaks input for enlightenment's wayland compositor.

 #TeamworkIsDeprecated
2017-02-08 09:47:32 -06:00
Chris Michael 95d93cb720 elput: Minor formatting fix
NB: No functional changes, just some minor formatting adjustments

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-08 08:29:24 -05:00
Carsten Haitzler 24e34e19a1 elput - use vpath to get xdg runtime to also be setuid safe
this fixes CID 1357168 in the case of setuid binaries as vpath handles
setuid cases.
2017-02-08 21:19:39 +09:00
Chris Michael 60859b4789 elput: Delete output_name stringshare on error case
This actually should have been part of the previous patch which moved
setting output_name to evdev, but it got missed so add it now. This
ensures we cleanup the output_name stringshare on error.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-07 12:00:15 -05:00
Chris Michael 6bd8313f02 elput: Remove dead FIXME note
As device calibration has already been handled via external facing
API, this FIXME note is no longer needed.

NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-02-07 11:34:57 -05: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
Mike Blumenkrantz 9a8931c3de elput: add event for relative motion
@feature
2017-02-03 15:13:57 -05:00
Chris Michael df1a1e05a9 elput: Don't add devices which we are not going to use
If an input device is not a pointer, keyboard, or touch device then we
are not going to be handling events for it, so do not create a new
Elput device for it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-31 10:54:09 -05:00
Chris Michael 251f52006f elput: Send touch motion before sending touch button events
This patch sends a touch motion event before sending of touch up/down
events. This allows some compositors (enlightenment) to update their
internal representation of where the mouse pointer is before handling
button events (as touch down/up is treated as a mouse button down/up).

Fixes T5094 for the old man ;)

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-12 11:11:50 -05:00
Chris Michael 343a272328 elput: Store touch timestamp and slot
This patch adds a timestamp field to the touch structure so that we
can store it and do not have to refetch the timestamp when sending
touch events.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-12 11:11:50 -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
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
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 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 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
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
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 54cce990d3 elput: Add API function to set pointer position on a given seat
Small patch to add an API function that can be used to set the current
pointer position on a given seat name. This function (typically) will
be used inside an Ecore_Evas to "pointer warp".

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-04 10:43:36 -04:00
Chris Michael 219a18efa4 elput: Remove dead comment and fix error message
NB: Minor cosmetic changes such as removing a commented out line of
code and fixing an error message

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-27 12:56:11 -04:00
Chris Michael 43360ca98a elput: Add API function to set output size on an input device
This function is used to adjust device calibration based on size of
output

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-13 14:16:17 -04:00
Chris Michael 404b3049f3 elput: Add API function to set input window
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-13 14:16:17 -04:00
Chris Michael 6a7589bf78 elput: Handle various events from libinput and pass to ecore_event
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-13 14:16:17 -04:00
Chris Michael 5db91e3802 elput: Create and send seat frame events when we need to
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-13 14:16:17 -04:00
Chris Michael b764978f29 elput: Create and raise event when seat capabilities change
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-13 14:16:17 -04:00
Chris Michael 3070c4cf08 elput: Add support for creating and removing devices
This patch adds start of code to create or remove input devices such
as keyboards, pointers, or touch devices.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-13 14:16:17 -04:00