path: root/src/lib/ecore_wl2/ecore_wl2_input.c (follow)
AgeCommit message (Collapse)Author
2019-04-30wl2_input: fix a problem that occurs in case of using both pointer/touch ↵Wonki Kim
input devices Summary: if wl2_input logic gets a 'touch down' event from touch device, input->focus.touch has set and it cause the logic handles every input as touch input from that moment at _ecore_wl2_input_mouse_move_send function. that is the reason why the patch(410c1f95879e46a5e52132662d4c43b74e95a251) has written for. however, if there are multiple touch input devices, clearing focus.touch variable without checking any conditions causes another problem. I mean a case such as 'touch 1 down' -> 'touch 2 down' -> 'touch 1 up' -> 'touch 2 up' at the moment 'touch 1 up' event executed, focus.touch would be cleared, and 'touch 2 up' and following touch events will not be executed properly at the moment. this patch counts a number of touch devices which are grabbing to clear focus.touch at proper time. Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-04-22ecore_wl2_input: fix a way it works when it has multiple input devicesWonki Kim
Summary: if there are multiple input devices, especially touch and mouse type devices simultaneous. a logic can't recognize the current input device in _ecore_wl2_input_mouse_move_send function. because focus.touch would not be cleared even touch actions from user has finished. This patch clears input->focus.touch if users release their finger from touch device. Reviewers: raster, eagleeye, devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-02-14ecore wl2 - remove pointless sntrcpys causing warningsCarsten Haitzler (Rasterman)
again pointless: strcpy(dest, x); -> len - strlen(x); strncpy(dest, x, len); code put in causing new warnings. this kind of "get rid of strcpy" is actua;;y dangerous as it's more likely a mistake is made along the way and bugs are added. strcpy's should be reviewed and if ok - left as-is. doing otherwise makes the code worse, not better and raises risk. it now also produces warnings at compile time which creates noise we just shouldnt' have.
2019-02-13ecore_wl2: replace strcpy with strncpyWonki Kim
Summary: this patch replaces a volnerable function with a safer one. Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-01-29ecore_wl2_input: update a timestamp whenever possibleWonki Kim
Summary: gettimeofday function returns a accumulated timestamp since around 1970 by the way, a argument from server looks like a system uptime based timestamp in some distribution such as tizen. so that this patch appends a logic that updates a timestamp inside Ecore_Wl2_Input* whenever possible to prevent gettimeofday function from being called. Reviewers: #reviewers, cedric, devilhorns Reviewed By: #reviewers, devilhorns Subscribers: devilhorns, cedric, #reviewers, #committers Tags: #efl Differential Revision:
2018-11-09ecore wl2 - fix wl touch handler struct to set extra cb fieldsCarsten Haitzler (Rasterman)
sape and orient were not set, set them to NULL with fixme's
2018-07-10ecore_wl2&elput: correctly fill the key structureMarcel Hollerbach
Summary: the key structure has two fields key and keyname, those should be identical to the keystructures from x. the method xkb_keysym_to_utf8 however returns different values for keys like "minus" thus only relying on xkb_keysym_name files this issue. Reviewers: eagleeye, devilhorns Reviewed By: eagleeye Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision:
2018-07-06ecore_wl2: Replace window ids with pointersDerek Foreman
Summary: There's no benefit to generating ids instead of just using the Ecore_Wl2_Window pointer in events. This has the added benefit of working around a really nasty hash collision bug when multiple ecore_evas engines are used at once. ref T7053 ref T6222 @beta_break Depends on D6521 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #committers, zmike Tags: #efl Maniphest Tasks: T7053, T6222 Differential Revision:
2018-05-08ecore_wl2: Fix window drag mouse eventingDerek Foreman
Summary: When a CSD button interaction under wayland leads to a compositor action like move or resize, we essentially "give back" that button press to the compositor, and it never sends us a mouse up for it. We need to internally fire a mouse up event to fix up state so the client doesn't think the mouse is still down. Until now we've been doing this by setting a flag when we start a move/resize and checking it at next pointer enter for the window. This leads to unsolvable races and wacky bookkeeping, and runs afoul of the fact that we're not actually guaranteed a pointer enter immediately after a move completes. There is absolutely no way at all on wayland to know if a move or resize operation has completed. So, let's just fire the mouse up immediately on start of interaction, which is raceless. This fixes a years old bug where dragging a window might leave a stuck mouse up, and allow hilighting text without drag after the window drag completes. (elementary-test -to "text editor" with multiple windows open exhibits this bug) Depends on D6127 Reviewers: zmike, cedric Reviewed By: zmike Tags: #efl Differential Revision:
2018-05-08ecore_wl2: Remove ecore_wl2_input_grab/ungrabDerek Foreman
Summary: These should never be called, so they shouldn't be API. This kind of internal state fiddling should happen implicitly in the API that need it. @beta_break Depends on D6126 Reviewers: zmike, cedric Reviewed By: zmike Tags: #efl Differential Revision:
2018-05-08elm_win: Remove move stop callbackDerek Foreman
Summary: This is only fired to trigger a cursor set under wayland, but that cursor set should be done unconditionally on mouse in. However, mouse in was being discarded because mouse out was being deferred when the window was "grabbed" for moving. If instead we just let the mouse out occur as it should, the cursor is properly updated on mouse in. Depends on D6118 Reviewers: zmike, cedric Reviewed By: zmike Tags: #efl Differential Revision:
2018-03-20ecore_wl2: Send a mouse-up event on reentry after client initiated resizeDerek Foreman
Apparently when we initiate a client side move in ecore_wl2 we flag that and send a mouse-up immediately on the next pointer enter. Do the same for resize. At some point this might need to be revisited, we should probably be sending a "cancel" at the start of client initiated move/resize instead of an up at the end? Fix T6422
2018-03-07ecore_wl2: cleanup input code to string logic to reduce compiler warning and ↵Cedric Bail
useless memory access.
2018-03-07ecore-wl2: Check for valid string before passing to strlen()Chris Michael
As strlen() cannot accept NULL (segfaults), we should check for valid key, keyname, and compose strings here before passing to strlen(). @fix Signed-off-by: Chris Michael <>
2018-03-07ecore-wl2: Reduce calls to strlenChris Michael
Small patch to reduce calls to strlen when sending key events. This patch is loosely based on Phab D5567 @fix Signed-off-by: Chris Michael <>
2018-01-22ecore-wl2: correctly translate spacebar keyname into key eventsMike Blumenkrantz
fix T6620 @fix
2018-01-19wayland: Reduce number of unneccessary display flushesDerek Foreman
b48781aa6c85c72f620c57cebff96580ddd67899 fixed multiple bugs where the display wasn't flushed correctly, however it was a little overzealous. Some of the flushes were added after calls that only updated internal state, some in internal functions in which the caller was already going to flush, and some were after wayland protocol calls that are double buffered anyway and won't do anything until a following commit. Also, I've removes at least one long standing flush where the recently added flush is in a better location than the original.
2018-01-17wayland: always flush client display when protocol sends are pendingMike Blumenkrantz
in the case where a connection was not actively rendering, there was nothing which would trigger a display flush, leading to applications potentially deadlocking @fix
2017-08-25ecore-wl2: normalize axis event valuesMike Blumenkrantz
this is value * 10 from the compositor, so /= 10 to get real value fix T5427 @fix
2017-08-18wayland: fix num/caps lock handling in eventsMike Blumenkrantz
locks are not the same as modifiers, and the corresponding event flag must be set based on whichever value(s) are set instead of yolo mixing and matching @fix ref T5737
2017-07-24ecore-wl2: handle null offer drags more effectivelyMike Blumenkrantz
this is valid and refers to an offer with no types; a leave event with no enter is a protocol error, however fix T5770 @fix
2017-07-10ecore-wl2: Formatting fixesChris Michael
NB: No functional changes Signed-off-by: Chris Michael <>
2017-07-10ecore-wl2: Add event handlers even if no data device manager existsChris Michael
If we have no data device manager present, we would still like to receive events when input devices get added or removed so these handlers should be setup before we return from this function. @fix Signed-off-by: Chris Michael <>
2017-07-10ecore-wl2: Rename internal functionChris Michael
As we are in the Ecore_Wl2 library, lets use a function name that reflects this. NB: No functional changes Signed-off-by: Chris Michael <>
2017-06-20ecore-wl2: Fix issue(s) of setting wrong event deviceChris Michael
As we may have both a pointer and touch device on a given system, we need to accurately set event->device when sending mouse move, wheel, down, and up events. Previous code here would always try to find a mouse device first which could potentially end up setting the wrong event->device (if a touch device also existed). This patch fixes the issue by comparing the window used for the event to our focused windows (either mouse or touch) and setting the proper event->device based on that. @fix Signed-off-by: Chris Michael <>
2017-06-05elput: fix sp. usefullBryce Harrington
Reviewers: cedric Reviewed By: cedric Subscribers: cedric, jpeg Differential Revision: Signed-off-by: Cedric BAIL <>
2017-06-02ecore-wl2: add null checks for xkb compose pointersMike Blumenkrantz
somehow these can fail to be created
2017-06-02ecore-wl2: do not unref non-matching input device upon removalMike Blumenkrantz
this is how you avoid crashing @fix
2017-05-26ecore-wl2: implement compose keysMike Blumenkrantz
@feature ref T5006
2017-05-26ecore-wl2: add weston copyright notice to ecore_wl2_input.cMike Blumenkrantz
this file contains code copied from weston
2017-05-19ecore-wl2: block key->string translation when appropriateMike Blumenkrantz
copied from libX11. I don't understand what's going on here but this fixes input bugs such as, e.g., holding ctrl and pressing shift affecting cursor position in terminology @fix
2017-05-19ecore-wl2: add copyright info to code copied from libX11Mike Blumenkrantz
this code has been slightly modified, but it was originally taken without attribution from libX11/src/KeyBind.c ref 08c804f5bb2de3cb5a7e95b1264b30043d1aea6f @fix
2017-05-19ecore-wl2: remove ecore_wl2_window_input_get()Mike Blumenkrantz
this function does not make sense within the context of wayland and seats, since a surface does not own and is not owned by a seat, nor is there a 1:1 association between surfaces and seats
2017-05-19ecore-wl2: add ecore_wl2_window_popup_input_set()Mike Blumenkrantz
this is a function for explicitly setting the seat which will be used for popup grabs @feature
2017-05-19wayland: move pointer-related functions to ecore_wl2_input namespaceMike Blumenkrantz
windows do not have pointers or cursors under wayland, seats do. due to lack of multiseat support, most components simply use the "default" seat with these functions, but this should make the corresponding code more easily adaptable
2017-05-19wayland: send focus in/out events when receiving/losing keyboard focusMike Blumenkrantz
since this is typically what efl defines as "focus" @fix
2017-05-12ecore-wl2: add events for changes in keymap, selection, and kbd repeat rateMike Blumenkrantz
2017-05-12ecore-wl2: add display object to all eventsMike Blumenkrantz
this is required in order to determine which connection an event originated from
2017-05-12ecore-wl2: add const to internal function paramMike Blumenkrantz
2017-05-12ecore-wl2: add some accessors for useful Ecore_Wl2_Input struct membersMike Blumenkrantz
2017-05-12ecore-wl2: split data offers into selection and dragMike Blumenkrantz
these are distinct objects and can coexist simultaneously; a drag source should not overwrite an existing selection source @fix
2017-05-12ecore-wl2: store names for inputs and add api for retrieving nameMike Blumenkrantz
2017-05-12ecore-wl2: add checks for a valid display object in ecore_wl2_input fnsMike Blumenkrantz
no display = invalid object, so this needs checking
2017-03-09ecore_wl2: Remove wl_shell client supportDerek Foreman
We're never going to encounter a compositor without at least xdg v5 support, so remove wl_shell support.
2017-02-08ecore-wl2: Support sending focus for wl_shellChris Michael
wl_shell does not use a surface state for activation, so we still need to send the focus in/out for that based on keyboard enter/leave. @fix Signed-off-by: Chris Michael <>
2017-02-08ecore-wl2: Don't send focus in/out events based on keyboard enter/leaveChris Michael
We should not be sending focus events based on keyboard behaviour, but rather send them according to xdg shell activate status. This makes our focus behaviour more "standards" compliant. @fix Signed-off-by: Chris Michael <>
2017-01-17ecore-wl2: Add function to get touch deviceChris Michael
When we are sending input events, if we have no pointer device then we should be setting ev->dev to a touch device (as touch events are treated as pointer events inside EFL). NB: This allows EFL clients to get touch events in Enlightenment. There are still some small hiccups here (can't close terminology by pressing the 'x' in the corner, cannot scroll elm_test srollbar, etc). Likely EFL needs to change wrt all this...perhaps adding events for touch that are separate from pointer ?... ref T5094 Signed-off-by: Chris Michael <>
2017-01-05ecore_wl2: Prevent use after free on input deletionDerek Foreman
Window structs keep inputs around, so we should sweep through them and NULL out any stale ones on a delete.
2017-01-05ecore_wl2: Remove the rest of the cursor frame callbackDerek Foreman
Oops, I made a clean spot, now I need to clean up the rest of this. ref 641dfab516b8de1cf27ca07671ff73de6c8d32bf
2017-01-03wayland: Fix cursor surface frame callsDerek Foreman
The common code was skipping frame callback when no shell surface was present - cursors aren't shell surfaces. Add the frame callback to the common path and remove the bespoke callback from the cursor code.