Commit Graph

77 Commits

Author SHA1 Message Date
Vincent Torri 3c619b96fc remove arguments of LOGFN in ecre_x and ecore_wayland as the are always the same
Reviewers: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11769
2020-05-04 15:15:07 +01:00
Bowon Ryu 72c263d5f2 ecore_wayland: remove logically dead code.
Summary:
remove logically dead code.
execution cannot reach this statement.

Reviewers: cedric

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

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-06 10:10:44 -07:00
JengHyun Kang 71fab49325 ecore-wayland: Prevent duplicated mouse up events.
Summary:
Prevent duplicated mouse up events generated from input_ungrab.
         If you touch downs and ups about all of fingers,
         that is sufficient condition to call ecore_wl_input_ungrab().
         And then one mouse up event is generated from that function.
         So if you set a callback about ECORE_EVENT_MOUSE_BUTTON_UP,
         you can watch two mouse up events are occurred.

Test Plan: Touch and release. And watch mouse up events.

Reviewers: raster, zmike, devilhorns

Reviewed By: devilhorns

Subscribers: ohduna, input.hacker, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4112
2016-06-28 09:01:09 -04:00
Duna Oh fbe4e4b6ad Ecore: Use calloc() to initialize Ecore_Event_Mouse_XXXX
Summary:
To ensure initialize all fields of Ecore_Event_Mouse_XXX,
use calloc() instead of malloc().

Test Plan: N/A

Reviewers: gwanglim, cedric, raster, devilhorns, ManMower, zmike

Subscribers: jpeg, input.hacker, JHyun

Differential Revision: https://phab.enlightenment.org/D3906
2016-04-20 08:33:20 -04:00
JengHyun Kang 1a27f1274e ecore_wayland: Add a new API to get keymap - ecore_wl_input_keymap_get()
Summary:
Each Ecore_Wl_Input structure has there own keymap.
         This keymap is struct xkb_keymap used in libxkbcommon lib and
         the client can get this keymap from server in wayland system.
         So if the client want to get keymap and use some libxkbcommon APIs,
         use this API to get keymap.

Test Plan: Use this api after initialize wayland system.

Reviewers: raster, zmike, ManMower, devilhorns

Reviewed By: devilhorns

Subscribers: input.hacker, ohduna, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3819
2016-03-24 08:53:15 -04:00
Duna Oh 01dc2540db ecore_wayland: move check for pointer capability
Summary:
We don't need to work for cursor if system doesn't have pointer devices.
Since this function is called by elementary(e.g. entry) also, we move a check condition into the function.

@fix

Reviewers: raster, zmike, devilhorns, ManMower, gwanglim

Subscribers: cedric, JHyun, input.hacker, jpeg

Differential Revision: https://phab.enlightenment.org/D3566
2016-01-14 11:19:24 -05:00
Duna Oh 49ef37457a ecore_wayland: send mouse_move when sets touch_focus window in cb_touch_down
Summary:
When user touches the screen, ecore_drm generates MOUSE_MOVE event before MOUSE_BUTTON_DOWN.
But when ecore_wayland gets touch_motion before touch_down, touch_focus window is NULL and sending MOUSE_MOVE event fails.
Also in terms of 'touch' input, touch_focus needs be set in cb_touch_down, not in cb_pointer_enter.
So this commit makes sure that ecore_wayland generates MOUSE_MOVE when touch_focus is set.

@fix

Test Plan:
when the application is launched for first time, user clicks on any area of the screen.
We can see the posion of touch event wrong.

Reviewers: raster, zmike, devilhorns, gwanglim, ManMower

Reviewed By: ManMower

Subscribers: jpeg, JHyun, cedric, input.hacker

Differential Revision: https://phab.enlightenment.org/D3555
2016-01-13 10:10:35 -05:00
Duna Oh 999dd527d8 ecore_wayland: set touch_focus window when gets pointer_enter
Summary:
When user touches the screen, ecore_wayland gets touch_motion event before touch_down event.
But touch_focus would be NULL in cb_touch_motion, so doesn't send ECORE_EVENT_MOUSE_MOVE event to client.
This fix set touch_focus when gets pointer_enter same as pointer_focus.

Test Plan:
when the application is launched for first time, user clicks on any area of the screen.
We can see the posion of touch event wrong.

@fix

Reviewers: devilhorns, raster, ManMower, zmike

Subscribers: input.hacker, cedric, jpeg, JHyun

Differential Revision: https://phab.enlightenment.org/D3545
2016-01-07 08:49:46 -05:00
Mike Blumenkrantz fe10889ec7 ecore-wayland: plug some trivial leaks 2015-10-20 17:51:44 -04:00
Chris Michael 667d7b15c9 ecore-wl: Support wl_keyboard_send_repeat_info for adjusting keyboard repeat rate and delay
Summary: This adds support for allowing a client/compositor to adjust
the keyboard repeat rate and delay via a call to
wl_keyboard_send_repeat_info.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-08-04 09:28:01 -04:00
Chris Michael a1bac6be1b ecore-wl: Reset input keyboard repeat values when we cancel the timer
Summary: If we end up cancelling the keyboard repeat timer due to no
focused surface, we should also reset the input repeat values.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 14:33:41 -04:00
Chris Michael d8d671548a ecore-wl: Don't renew keyboard-repeat timer if we have no focused surface
Summary: During the keyboard repeat function, if we have no keyboard
focused window to send the key to, then we should cancel the repeat
timer.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 14:31:15 -04:00
Chris Michael 1fb5698f35 ecore-wl: Reset ecore_wl_input repeat values on keyboard leave
Summary: As we delete any keyboard repeat timers when we get a
keyboard leave event, we should also reset any stored values there
(key, sym, time, etc).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 14:28:14 -04:00
Chris Michael dca6f0756d ecore-wl: Reset input's pointer & keyboard focus on events
Summary: If we get pointer or keyboard leave events, then reset the
Ecore_Wl_Input's idea of focus (eg: set input->pointer_focus and
input->keyboard_focus fields to NULL) just in case we cannot find a
window for this surface.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-14 14:24:07 -04:00
Mike Blumenkrantz 121e7be4b6 Revert "ecore-input: add keysym to Ecore_Event_Key struct"
This reverts commit c3f3c4eba8.

this was audited and found to be impractical due to portability concerns
2015-06-29 13:18:01 -04:00
Chris Michael 8651f51add ecore-wl: Remove +x from ecore_wl_input.c
Summary: Unsure how this file mode got changed, but it should not be +x.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-21 09:24:36 -04:00
Mike Blumenkrantz c3f3c4eba8 ecore-input: add keysym to Ecore_Event_Key struct
currently only functional for x11, wl, drm

@feature
2015-05-20 14:50:46 -04:00
Chris Michael ae6ec06991 ecore-wl: Set keycode in event structure for key down/up
Summary: When we generate an Ecore key down/up event, we should also
be setting the keycode in the event structure

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-20 14:43:06 -04:00
Chris Michael d278cd5f49 ecore-wayland: Input grab_count is unsigned int, no need for comparison < 0
Summary: As input->grab_count is an unsigned int there is no need for
the < 0 comparison as that will always return false

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-12 09:14:26 -04:00
jhyuni.kang aee186b4f3 ecore-wayland: Add a grab_count variable for synchronization wl_input_grab/ungrab with pointer and touch event
Summary:
The touch screen device generates touch events.
         But in some special enviroments, a first finger will be matched to a pointer event(not touch event).
         And other fingers (second, third, ...) will be matched touch events.
         In that case ecore_wl_input_ungrab() is called abnormally.
         A first finger pressed, _ecore_wl_input_cb_pointer_button() call ecore_wl_input_grab().
         A second finger pressed, _ecore_wl_input_cb_touch_down() is called but not grab.
         But when a second finger is released, _ecore_wl_input_cb_touch_up() call ecore_wl_input_ungrab()
         So ungrab function generate two mouse up events and a first finger is released.
         In other case, first finger pressed -> second finger pressed -> first finger release.
         That case when a first finger released a second finger release event is generated.
         So after that application doesn't get a release event about a second finger
         when a second finger is really released.

         I think in a multitouch case, ungrab function will be called when a all finger are released.
         So I add a grab_count variable for count currently touched fingers.
         And only called a ungrab funtion all fingers are released.

Test Plan:
In a touch screen supported multitouch, press two or more fingers and release.
           And watch events generation.

Reviewers: raster, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2481
2015-05-12 08:57:47 -04:00
jhyuni.kang 5c5f4580d2 Check a key repeat using xkb ruled keycode
Summary:
ecore_wayland get a key information using libxkbcommon's functions.
         Also generate key repeat check xkb keymap's information using xkb_keymap_key_repeats().
         But xkb rules reflect X broken keycodes, so offset by 8.
         In ecore_wayland backend, other xkb funtions using offset keycode
         but only use default keycode to check key repeat.
         So I fix it to use xkb ruled keycode.

Test Plan: Long press a key and watch repeated key events generate well

Reviewers: devilhorns, raster

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2475
2015-05-07 09:24:54 -04:00
Mike Blumenkrantz 1361775ddf ecore-wl: reject key events which do not correlate to a valid keysym 2015-04-27 12:57:35 -04:00
Jean-Philippe ANDRE 0ef41604e8 Ecore: Use calloc() to initialize Ecore_Event_Key fully
Some fields (eg. data) may not be properly initialized.
Use calloc() instead of malloc() will ensure proper initialization
even if we add more fields.

These fields (data) would even be passed down to Evas as
Evas_Event_Key_Down for instance.
2015-03-25 15:34:23 -07:00
Bryce Harrington 931db7f12e ecore_wayland: Check for null inputs
Summary:
The other functions in this module check inputs; this one should as
well.

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2210
2015-03-20 22:07:21 -04:00
Bryce Harrington 69e827ef0c ecore_wayland: Add some comments
Summary: Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2209
2015-03-20 21:18:52 -04:00
Bryce Harrington db91d16f78 ecore-wayland: Whitespace cleanup
Summary: Remove trailing whitespace, convert tabs to spaces as per style guide.

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2157
2015-03-13 21:43:08 -04:00
Mike Blumenkrantz 0497094051 ecore-wl now allocates cursor_theme_name struct member of Ecore_Wl_Input
previous behavior would result in invalid memory access if the externally-passed
string were ever deallocated

@fix
2015-03-12 15:57:21 -04:00
Mike Blumenkrantz 877d35e361 ecore-wl use calloc for Ecore_Wl_Input allocation instead of malloc+memset 2015-03-12 15:56:46 -04:00
Mike Blumenkrantz 37c2451b5f ecore-wl cursor setup no longer triggers errors on startup
@fix T2202
2015-03-12 15:56:34 -04:00
Chris Michael eedd6c3159 ecore-wayland: Don't send key repeat events for keys which should not
get them

Summary: Some keys in certain keyboard layouts should not be repeated
so add a test which uses xkb to inform us if this key supports
repeating.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-03 15:31:17 -05:00
Chris Michael c6e70107dc ecore-wayland: Don't send a mouse_up on grab release unless we
actually have a grabbed button

Summary: If we don't have an actual grabbed mouse button, then don't
send a mouse up event. Caught this while adding e_grabinput support to
Enlightenment.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-23 16:01:08 -05:00
Chris Michael 6b1e62afa4 ecore-wayland: Fix issue with Elementary DnD test not releasing mouse
Summary: When we do an input_ungrab, we should be sending a mouse up
event so that apps/elm/etc know that the mouse has been released. This
fixes an issue in the Elm Features DnD test report by Daniel Zaoui

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-13 11:37:02 -05:00
vivek 9be84a1ce7 ecore-wayland: Check if system has mouse in ecore_wl_input
Summary:
Added a condition to check if system has mouse before setting
the cursor on surface.

@fix

Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1707
2014-12-01 10:00:26 -05:00
Chris Michael 026b1e9dc5 ecore-wayland: Don't crash if we have no shm interface yet when
setting cursor theme

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-18 11:57:24 -04:00
Chris Michael eefabe1abe ecore-wayland: Allow setting input->cursor_size even if we don't have
the shm interface yet

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-18 11:56:41 -04:00
Mike Blumenkrantz 9a218f4f20 ecore-wayland should not cause crashes when setting cursor size if display shm is not yet acquired
crash added in c01c8456fe
2014-09-18 11:49:36 -04:00
Srivardhan Hebbar 50a0195f7e ecore_wayland: Added cursor_theme_name in Ecore_Wl_input.
Summary:
1. Added cursor_theme_name to Ecore_Wl_Input struct.
2. Made it configurable through environment variable ECORE_WL_INPUT_CURSOR_THEME_NAME.
3. Added a API ecore_wl_cursor_theme_name_set for user to set manually.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1458
2014-09-18 10:52:29 -04:00
Chris Michael d645ea28c6 ecore-wayland: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-17 09:14:39 -04:00
Srivardhan Hebbar c01c8456fe ecore_wayland: Added cursor_size in Ecore_Wl_Input.
Summary:
1. Added cursor_size to Ecore_Wl_Input struct.
2. Made it configurable through environment variable ECORE_WL_INPUT_CURSOR_SIZE.
3. Added a API ecore_wl_input_cursor_size_set for user to set manually.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

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

Conflicts:
	src/lib/ecore_wayland/ecore_wl_private.h
2014-09-17 09:12:58 -04:00
Chris Michael 44b3cd1564 ecore-wl: Check for existance of data device manager
@fix: Don't segfault if the running compositor never creates a data
device manager.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-04-15 10:41:54 +01:00
Chris Michael 6699d427c1 ecore-wl: Don't create an input cursor surface unless the input has pointer capability.
@fix: There is no use for an input cursor surface if the seat does not
have the pointer ability (for kiosk cases, or touch-only cases where
a pointer is not created).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-04-15 10:41:54 +01:00
Chris Michael c5c378f5f9 ecore-wayland: No need to check button state twice
Since we already check the button pressed state in the 'if' above
this, there is no need to check it again.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-04-01 07:09:49 +01:00
Rafael Antognolli cc4aedaaee ecore/wayland: Use touch_focus for touch_based events.
Also call the mouse related events with BTN_LEFT instead of 0, otherwise
the correct button won't be assigned to the event (button 1).
2013-11-29 18:05:42 -02:00
Rafael Antognolli a14ee372e0 ecore/wayland: Send a mouse up event when the implicit grab starts.
The previous workaround used to send a mouse up event to the
application, using the pointer enter callback to determine when an
implicit grab has finished. This was "simulating" a mouse up event when
the surface move or resize finished.

However, this doesn't work for touch-based move. The pointer enter isn't
emitted, because the wl_touch interface doesn't have the concept of a
pointer.

Changing this code to make it more similar to what Weston's toytoolkit
does, the mouse up event is sent as soon as the move or resize grab
starts. After that, the compositor takes care of the move/resize almost
entirely.

Should fix T468.
2013-11-29 18:05:19 -02:00
Rafael Antognolli 2c95c5ee1d ecore/wayland: Get the touch up event position from the down_info.
down_info is a struct that stores some information about the current
pressed touch events. It should be used for that specific touch point,
instead of the generic input info, when sending a mouse_up event.
2013-11-29 18:05:06 -02:00
Rafael Antognolli b92fc57c5a ecore/wayland: Remove list of touch points from input structure.
We already have the "Ecore_Wl_Mouse_Down_Info" list, that contains this
information.
2013-11-29 18:05:06 -02:00
Chris Michael 445f2eb206 Fix keyrepeat going crazy ;)
Previously, if you were hold down shift for 1-2 seconds and then press
a key, you would get superfluous key repeats (even tho you released
the printable key). This was because the "key repeat" code was not
checking for the same key before (re)starting the repeat timer.

This fixes the repeating key issue by checking if the key pressed is
different than the one already pressed. If so, it will (re)start the
timer. If it is not different, then the timer is already running and
we don't need to do anything.

Fixes T552

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-25 07:47:52 +00:00
Chris Michael 55c0dbb3c8 Fix ecore wayland key events to fill in Ecore_Event_Key with X11-like
values.

Previously, the keyname and key fields of the Ecore_Event_Key
structure were being filled in with the capitalized version of the
key. This is due to xkb_keysym_get_name always returning keys with the
modifier applied. There is no actual function in xkbcommon to Not do
this :/ so we have to manually check if Shift is pressed, and if so
then we need to convert the key to lowercase.

Fixes T550

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-25 07:38:00 +00:00
Chris Michael 0a32212a79 Add support for storing mulitple touch points.
Send events to properly focused surface.
Fill in missing parts of the event structures (ev->root, ev->multi).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-19 10:38:23 +00:00
Chris Michael d96339e9bb Don't send pointer_enter events on touch_down.
Fix touch_down and touch_up to send proper button ID (ecore_x sends 0).

Fixes Phab Ticket T468

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-18 12:58:54 +00:00