Commit Graph

51 Commits

Author SHA1 Message Date
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
Chris Michael 9240c2e91c Add support for additional keyboard modifiers. Fix handling of Shift
key for capitals.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-07 14:31:37 +00:00
Rafael Antognolli b5e6855266 ecore/wayland: Use eina_inlist instead of wl_list for inputs too. 2013-11-04 14:24:59 -02:00
Rafael Antognolli e56428f4ad ecore/wayland: Make Ecore_Wl_Input private.
It's mostly only used inside ecore_wayland library anyway.

The only bit needed outside of the library is the "seat" pointer, but a
new function was added to retrieve such pointer from Ecore_Wl_Input.
2013-10-31 21:35:13 -02:00
Chris Michael d1d0090706 Don't send mouse_up or mouse_down events unless we have a focused
surface

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-10-29 08:05:32 +00:00
Chris Michael 0c88d8e8ce Revert "Reduce additional call to eina_stringshare_replace."
This reverts commit f4f44c777a.
2013-09-13 07:01:06 +01:00
Chris Michael 0d0944c4cc Reduce unnecessary pointer frame callbacks
NB: We only need to do pointer frame callbacks if the pointer is using
an animated image.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-09-12 15:02:34 +01:00
Chris Michael f4f44c777a Reduce additional call to eina_stringshare_replace.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-09-12 15:02:34 +01:00
Chris Michael 164299e689 Rework keyboard repeat to use an ecore_timer (not a timerfd).
NB: This fixes keyboard repeat in terminology (under wayland) to be
sane again :)

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-09-10 15:59:40 +01:00
Chris Michael 3cc3d0878a Convert upper-case characters to lower-case characters on keydown
events.

NB: xkbcommon automatically converts the pressed key to Upper if Shift
is pressed. this is a problem as ecore key down events expect them to
be lower-case (not converted yet).

NB: Fixes Phab Ticket T232.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-08-07 10:45:11 +01:00
Chris Michael f0289a1936 Check for valid input->pointer before calling wl_pointer_set_cursor.
During a pointer_enter event, if the window was assigned a custom
cursor, respect it. By default we will still set left_arrow initially,
but if the window was assigned a custom cursor, use it.

NB: Fixes Phab T230

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-07-23 07:15:20 +01:00
Chris Michael 4d05ee2d3d Check for valid xkb state before trying to update modifiers from it.
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-07-17 16:53:04 +01:00
Chris Michael 3b8d6bf89a Add missing initializer for wl_seat_listener.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-26 12:39:14 +01:00
Chris Michael 2942696111 Don't crash when window is null (for mouse_down comparison)
Signed-off-by: Chris Michael <devilhorns@comcast.net>
2013-06-17 23:22:19 +01:00
Rafael Antognolli 79496745cf ecore/wayland: Translate CTRL + keys on Wayland.
The "compose" component of the ecore input events must be translated to
the correct value when CTRL keys are pressed. This implementation was
copy & pasted from the xcb backend.
2013-06-12 18:50:31 -03:00
Chris Michael 92a649e35b Modify ecore_wl_input keypress code to handle modifiers Not on every
keypress, but rather Only on they actual modifier event.

Add some printf debugging for Non-Printables like Ctrl, etc

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-06-07 15:42:53 +01:00
Chris Michael b7ac7bdfd9 Add ecore_wl_input_get function
Remove global dnd object (not necessary)

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-05-28 11:48:51 +01:00
Chris Michael 8c9353e3ec Use ecore_wl_window_surface_find to get the Ecore_Wl_Window.
NB: This is needed because some compositors like Weston are expecting
the wl_surface user_data to be a buffer, not some arbitrary data.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-05-21 10:49:40 +01:00
Rafael Antognolli 2a20ca4477 ecore_evas/wayland: Do not send additional mouse_in's.
If this Ecore_Evas already has a mouse inside it, there's no need to
send an additional mouse in event.

Additionally, always send a mouse_move event before a mouse_down, so the
Evas pointer position can be updated properly before the mouse down.
2013-05-08 16:56:12 -03:00
Rafael Antognolli d4b7389f3a ecore/wayland: Store the multi position per device/finger.
This will make every touch point have its position updated on
multi_move, and then it can be used to send a correct multi_up event.
2013-05-08 16:50:15 -03:00
Rafael Antognolli c18e76eb2c ecore/wayland: Report correctly the device which emitted the mouse event. 2013-05-08 16:50:15 -03:00
Rafael Antognolli de4173ee0a ecore/wayland: Add support for engine animated cursor. 2013-04-23 18:52:35 -03:00
Igor Murzov 1373f0ba4a Fix incorrect printf format usage 2013-04-16 12:07:36 +04:00
Chris Michael 6380cf1bf1 Fix formatting.
Declare variables in the proper place.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-04-11 06:33:30 +01:00
Rafael Antognolli 2d62ea88e5 ecore/wayland: Add support for double and triple click.
It's implemented exactly the same way as on the X11 backend. It does
handle multiple devices, though may need some adjustments when
multi-touch is added, since there's no support for multi-touch on
EFL-wayland yet.
2013-04-10 14:53:14 -03:00
Rafael Antognolli a158958267 ecore/wayland: Always send the mouse button event.
Don't send only the mouse button stored inside input->button, since more
than one button may be pressed and unset the input->button when
unpressed.

SVN revision: 83647
2013-02-05 18:21:33 +00:00
Gustavo Sverzut Barbieri 05212a3d0e efl/ecore_wayland: move docs to header.
SVN revision: 81832
2012-12-28 19:36:01 +00:00