Commit Graph

72 Commits

Author SHA1 Message Date
Marcel Hollerbach ad715eebd6 ecore_wayland WIP
- motion,enter,leave can have negative coordinates.
2020-02-10 21:21:41 +01:00
Yeongjong Lee 788507961a ecore_wl2_dnd: initialize source to NULL when it destroy
Summary:
This prevent double destruction of source. if _ecore_wl2_input_del is called
with destroyed source, it can make unexpected troubles.

Reviewers: Hermet, id213sin, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7265
2018-11-15 09:11:38 -05:00
Derek Foreman 78f27a3eff ecore_wl2: Replace window ids with pointers
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: https://phab.enlightenment.org/D6522
2018-07-06 10:16:21 -04:00
Carsten Haitzler 9ee741cf7f ecore wl2 - fix null checing of drag offer - coverity
fix CID 1378629
2017-09-28 15:28:00 +09:00
Mike Blumenkrantz aae4d21b63 ecore-wl2: handle null offer drags more effectively
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-24 08:30:05 -04:00
Mike Blumenkrantz 451a93d9d2 Revert "ecore wl2 - dnd - handle NULL drags... shouldnt happen but does"
This reverts commit 85e5858466.

please do not randomly add null checks for the purpose of quickly closing tickets.
2017-07-24 08:29:45 -04:00
Carsten Haitzler 85e5858466 ecore wl2 - dnd - handle NULL drags... shouldnt happen but does
this should fix T5770

@fix
2017-07-24 18:53:33 +09:00
Cedric BAIL 183c45d35a ecore_wl2: silence gcc warning.
Code is correct, but gcc can not follow the branch if and believe it
is worth triggering a warning.
2017-06-05 12:07:57 -07:00
Mike Blumenkrantz fb082484b0 ecore-wl2: permit null drag icon window in ecore_wl2_dnd_drag_start()
this is explicitly allowed in the spec

@fix
2017-05-19 15:53:52 -04:00
Mike Blumenkrantz 2fe7878235 wayland: move pointer-related functions to ecore_wl2_input namespace
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-19 12:41:17 -04:00
Mike Blumenkrantz 68a3f43d1e ecore-wl2: add functions for proxying a selection receive externally
in some cases (e.g,, x11 bridged selections) it is necessary to use
alternate means when transferring a selection, and so performing the
entire piped receive is not necessary. instead, extend the lifetime
of the data offer until the proxied receive has completed

@feature
2017-05-12 12:08:26 -04:00
Mike Blumenkrantz 8afdbaba48 ecore-wl2: add function for setting a drag source's actions without a drag
in some cases it may be desired to have a drag data source without ever
initiating a drag, so ensure that it's possible to set the actions of the
source which will be passed for drag operations in this case

@feature
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz f6964f50e3 ecore-wl2: add function for accepting a single mime type
@feature
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 9f69882211 ecore-wl2: do not offer a null mime first in ecore_wl2_offer_mimes_set()
this seems to have been done to account for the case where no mimes were
passed, but sending null in this way is bad behavior for a client. the
spec indicates that null should be sent only when no mimes are accepted

@fix
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 2e5251b364 ecore-wl2: add events for changes in keymap, selection, and kbd repeat rate
@feature
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz d119fdded9 ecore-wl2: add 'cancelled' to Ecore_Wl2_Event_Data_Source_End
it's impossible to know the result of a drag operation without this
member
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 05fd3771e7 ecore-wl2: add display object to all events
this is required in order to determine which connection an event originated
from
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 4f2a8b8679 ecore-wl2: add seat id to most events
seat id is required in order to handle multiseat environments
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 37ff7b43f1 ecore-wl2: emit serials in selection-related events
these allow apps to match the serial of their selection to the related
event in order to avoid mangling selections from other components
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz d51252a69e ecore-wl2: change selection setting apis to return the serial of the request
in the case where multiple places in an app may be handling selections, this
is necessary in order to manage the selections accurately

@feature
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 5869767355 ecore-wl2: remove ERR when trying to find the focused window id
this can trigger in the case where a selection transfer occurs and
no input resource has received an enter (e.g., the window is not focused)

@fix
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 44f22a250e ecore-wl2: split data offers into selection and drag
these are distinct objects and can coexist simultaneously; a drag
source should not overwrite an existing selection source

@fix
2017-05-12 12:08:25 -04:00
Jean-Philippe Andre a33815eeef ecore wl2: Fix compilation 2017-04-21 10:08:52 +09:00
Derek Foreman f45b63edbd ecore_wl2: Don't crash when drag and drop is unsupported by compositor
Check for presence of data device manager so we don't crash if it's not
there.
2017-04-20 14:41:54 -05:00
Chris Michael 79815ea851 ecore-wl2: Fix typo in API function name
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-17 10:43:27 -04:00
Marcel Hollerbach 174f355446 ecore_wl2: fix array overflow
fixes CID 1363215
2016-09-26 13:17:24 +02:00
Marcel Hollerbach 203b7a8fc6 ecore_wl2: support parallel receiving of different mimetypes
The mimetypes are now populated with the event and the data.

This also fixes CID 1363217
2016-09-26 13:17:24 +02:00
Marcel Hollerbach 296446b878 ecore_wl2: fix null dereference issue
if we dont get the userdata of a offer something in the protocol went
very very bad, we should not emit there a error, just return.

Also if we are getting a null offer we should dereference the nulled out
offer object.

This fixes CID 1363214
2016-09-26 13:17:24 +02:00
Marcel Hollerbach d8e6fb7820 ecore_wl2: utilize the event window_ids
if a dnd operation enters a surface the window_id is clear, so a offer
is always specific to a window. If we have a source we try to fetch the
id from the focus/prevfocus or keyboardfocus.

This fixes dropping into a efl app which never got focus before.
2016-09-24 19:18:21 +02:00
Marcel Hollerbach 5884bba096 ecore_wl2: introduce offer api
This commits adds api to deal with wayland offers.
It also ports elm_cnp to use the new api.

The selection_get and dnd_drag_get calls are replaced by simply receive
data from the offer.

The Offer object is now also emitted in every Enter,Motion,Drop and
Leave event, so a potential user can prefetch data and display it.
To finish a dnd operation positiv, the user has to call the finish call
before the offer is destroyed
2016-09-23 11:15:14 +02:00
Marcel Hollerbach 7d6fd10523 ecore_wl2: save action of data source in seperated field
the drag.source is only available if the drag is happing inside the same
client.

So for the case there are two efl apps (A,B) , where A started the dnd and
the B is currently entered by the dnd, then A has the data source, and B
has the offer, if B sets a action on the offer A tried to set it on a
field which does not exist there, this fixes that. It saves the action
to a undepended field.
2016-09-23 11:14:41 +02:00
Stefan Schmidt 7d443f30e2 ecore_wl2: dnd: fix leak of event resource when not used
In the else branch the allocated event is never used. Make sure we free the
resource before returning.

CID: 1357753
2016-07-19 14:52:28 +02:00
Marcel Hollerbach 67917c27fe ecore_wl2: clear out read_data and len
they are passed to the event struct, and later freed in there.
2016-07-13 17:52:46 +02:00
Chris Michael 5fc4b971dc ecore-wl2: Fix issue of misleading 'if' statement
Gcc reports that this 'if' statement is misleading due to indentation.
We should only be sending the 'finish' call if the dnd version
supports it, however we should always be sending 'destroy'

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-11 11:56:17 -04:00
Marcel Hollerbach f0325fc190 ecore_wl2: Make offer destroy more secure
Check if it is NULL and NULL after each destroy call
2016-07-11 11:02:52 +02:00
Marcel Hollerbach 75bb8060b3 ecore_wl2: split of cnp_selection_data_ready and
dnd_selection_data_ready

before there was the case that both handlers are called even if just dnd
data arrived.
2016-07-11 11:02:52 +02:00
Marcel Hollerbach 63e88bdcfa ecore_wl2: only destroy source when not needed anymore.
Otherwise we are destroying the source before getting dnd_finished or
cancled events, which is a problem.
2016-07-11 11:02:52 +02:00
Marcel Hollerbach c300678391 ecore_wl2: buffer reading of the data
Otherwise callbacks can go out even if the selection data is not ready
to read.
2016-07-11 11:02:52 +02:00
Marcel Hollerbach cf5a79ea60 ecore_wl2: delay the destruction of the offer or do it in the read 2016-07-11 11:02:52 +02:00
Chris Michael 7496df08aa ecore-wl2: Fix error handling for bad fd
If we end up failing to get the fd from ecore_main_fd_handler_fd_get,
then we should just bail out of this function and try again later.

Fixes Coverity CID1357213

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-07-03 18:23:45 -04:00
Chris Michael 183a611cde ecore-wl2: Fix uninitialized variable
Coverity reports that len is used un-init here, so let's give it a
value at declaration time

Fixes Coverity CID1357214

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-07-02 07:17:23 -04:00
Chris Michael 79277d1cb4 ecore-wl2: Fix issue of passing negative number to close() and read()
We should be checking the return value of ecore_main_fd_handler_fd_get
calls as they can return a negative number...which cannot be passed to
the close() or read() functions.

Fixes Coverity CID1357152 and CID1357153

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 11:09:11 -04:00
Chris Michael 35f76fe8a8 ecore-wl2: Check the return value of ecore_main_fd_handler_fd_get
This patch fixes an issue where ecore_main_fd_handler_fd_get could be
returning a negative number and passing that to close() which cannot
accept negative numbers.

Fixes Coverity CID1357152

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 11:05:14 -04:00
Chris Michael bbdb4e5a53 ecore-wl2: Fix formatting
NB: No functional changes

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 13:08:26 -04:00
Marcel Hollerbach 5ce3c4a049 ecore_wl2: Fix dnd breakage when focus leaves window
Summary:
If dnd in the same window is activated, the focus goes away from the
ecore_wl2 window to the dnd window, after that focus.pointer is NULL.
After focus.pointer is NULL ev->win of all the events will be 0 which
breaks dnd-motions, drop and end.

With prev_pointer beeing the last focused window, we can simply set this
window as event window. After that dnd with jesus works perfectly.

@fix

Reviewers: devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4093
2016-06-27 11:32:18 -04:00
Mike Blumenkrantz 37ed59474e Revert "elm cnp/Wl: Remove duplicated data receive callback"
This reverts commit f5d10f1961.

this breaks pasting into efl applications on wayland

fix T3455
2016-05-10 13:23:05 -04:00
Thiep Ha f5d10f1961 elm cnp/Wl: Remove duplicated data receive callback
If we do drag & drop and then do copy & paste, both _wl_selection_receive
and _wl_dnd_receive are called for one action (dnd or cnp). It is reduntdant.
We only need one data received callback to handle two cases dnd and cnp.
2016-05-03 17:13:47 +00:00
Thiep Ha aa0ace21d7 ecore wayland: add selection type
We have copy & paste and drag & drop selection types, but we cannot
distinguish between these two types when requesters receive data
from data ready event.
This patch adds a new enum to help selection requesters distinguish
between two selection types and have suitable actions for each type.
2016-05-03 17:13:47 +00:00
Mike Blumenkrantz 49302010f4 ecore-wl2: preserve data selection source after receiving the selection
this is copied from weston, except all the code which is supposed to be of
struct type "offer" has been renamed "source" and then reused in the same way
that weston uses "offer" in order to maximize reader confusion

deleting the source here is invalid since the selection only changes in the
corresponding callback from the wayland interface
2016-04-25 16:15:59 -04:00
Mike Blumenkrantz 7da4d8a4ae ecore-wl2: isolate regular selection requests from dnd-specific code
fix T3455
2016-04-22 11:32:08 -04:00