Commit Graph

64 Commits

Author SHA1 Message Date
Jean-Philippe Andre e9dffa723d win: Add Efl.Ui.Win_Inlined and remove parent2
Inlined windows are the only use case for parent2. We might as well want
to create a separate subclass for those special windows.

Ref T5322
Ref T5363
2017-08-23 11:16:45 +09:00
Carsten Haitzler b2809026bb elm cnp - check if selbuf is null or not and skip copying if null
this should fix CID 1377536
2017-07-23 18:56:43 +09:00
Mike Blumenkrantz 804ce5f514 elm_cnp: fix selections for wl windows and FAKE wins
don't use hardcoded seat names and attempt to use wl protocol for
FAKE wins
2017-07-07 15:22:24 -04:00
Mike Blumenkrantz f052a2c02f elm_cnp: use local cnp when elm_cnp owns the selection
no need to use protocol to send an app's own selection to itself
2017-07-07 15:22:24 -04:00
Mike Blumenkrantz 5ffa2e7922 elm_cnp: mark x11 selection as lost when selection is lost in event
do not pretend that a widget maintains the selection when notified that
the selection has been lost

@fix
2017-07-07 15:22:23 -04:00
Jean-Philippe Andre a173efd0a9 cnp: Fix copy & paste in inwin inside wayland
Scenario:
  ELM_DISPLAY=wl elementary_test -to "Window Inline"

Copy & paste some stuff between entries inside the inwins and
also in a standard window.
2017-06-15 17:35:44 +09:00
Jean-Philippe Andre e4d47ed3a5 cnp: Avoid CRI message about wayland in X
Test scenario:
  elementary_test -to "Window Inline"
  Click on an entry, select some text (maybe with the keyboard)

There was a CRI message inside _ecore_evas_interface_get because
ecore_evas_wayland2_window_get() was called on an X11 ecore_evas
(not wayland).

The function was supposed to return NULL here.
2017-06-15 17:35:44 +09:00
Mike Blumenkrantz a6d9d3119e elm_cnp: use correct pointer when emitting ELM_CNP_EVENT_SELECTION_CHANGED
CID ???
2017-05-22 07:00:18 -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 f289967927 elm_cnp: add elm_cnp_clipboard_selection_has_owner()
this already existed as an internal function which was improperly namespaced

@feature
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 0b2e15db0f elm_cnp: add event for selection change
@feature
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 31f98a6d81 elm_cnp: only attempt to manage wl selections which are created by elm_cnp
use serials of the selections and events to avoid mangling external selections
2017-05-12 12:08:25 -04:00
Mike Blumenkrantz 3b51b3047f elm_cnp: don't explicitly set wl window type when starting drag
this is no longer necessary
2017-05-12 12:08:24 -04:00
Bryce Harrington 13a9a508ce elm_cnp: Fix typo
Summary:
Removes extraneous 'or' in debug message due to change from commit
27375735.

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4859
2017-05-08 19:04:47 +02:00
Marcel Hollerbach 2737573501 elm_cnp: fixup behaviour
On touch devices there is the normal gesture to touch on the screen and
hold until the drag operation started.

For users of a mouse there is the gesture of just click and drag the
mouse away.

This commit changes the behaviour of the start based on the device that
sent the event
2017-05-05 20:53:06 +02:00
Derek Foreman 7359f0be6e elm_cnp: allocate space for null terminator in _wl_targets_converter
strcat needs room for a string terminator.
2017-02-28 17:23:03 -06:00
Daniel Zaoui 0f915ab497 DnD/Container: fix drag during animation
If the user icons are set but animation time is set to 0, the icons are
not deleted, resulting in ghosts images in the application.
Additionally, behavior was badly handled when animation time or timeout
before drag were set to 0.

@fix
2017-02-01 11:19:04 +02:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Cedric BAIL a07a267145 elementary: fix float comparison warning in c&p. 2016-12-20 16:39:30 -08:00
Daniel Zaoui 819c14c86f DnD: cancel drag if mouse moves too much
In the case of an entry inside a draggable gengrid, trying to select
text was always resulting in starting a DnD operation because mouse
coordinates were not checked.

Now we check that the mouse coords don't move more than a finger size.

@fix
2016-11-10 08:26:26 +02:00
Chris Michael a0cdbc9ec2 elementary: Fix call to offer_supports_mime function
As this function was misnamed in Ecore_Wl2, update the code here to
use the proper API function.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-17 10:43:43 -04:00
Chris Michael a8ba4c28fb elementary: Fix potential resource leak
If we fail to allocate memory for savedtypes.types here, then the
"known" array would end up leaking. Defer creation of 'known' array
until after savedtypes.types is allocated, this way we don't leak.

Fixes CID1363216

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-26 14:01:15 -04:00
Marcel Hollerbach fcfc9959c2 elm_cnp: handle format of a drop correctly
the format can also be the result of mutliple or´ed values.
The new code now also uses the same mimetypes to format type relation
than the selection code.

This fixes dragging onto a container with multiple formats.
Spotted by ApBBB while dragging from ephoto to terminology.

This also fixes T3320
2016-09-24 19:07:22 +02:00
Marcel Hollerbach 0e0d0179c3 elm_cnp: refactor selection_get callbacks
before the format was not passed correctly, now the format is passed
correctly to the callback.

Also if a dnd operation was started while a cnp receive call was
going on (this happend because weston-editor failed to close the fd, so
EOF was never sent), then elm_cnp would behave wrong, since the
requestwidget, action, format would be different.
2016-09-23 11:15:14 +02:00
Marcel Hollerbach 57d97b4df9 elm_cnp: handle actions probebly
ecore_wl2 passes the action which should be performed, this action is
now converted and passed to the action of the elm callback.
2016-09-23 11:15:14 +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
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Carsten Haitzler 4b145afcfe elm cnp windows - remove unused vars 2016-07-26 16:49:03 +09:00
Carsten Haitzler b3d40d393e elm cnp win32 - do one side at least of unix newlines to windows newln
this PARTLY addresses T3556 ... this handles our own conversion of
makrup to string then to a windows newlined string. this half. i wrote
the conversion code for the other way but it's unused as i am unsure
where exactly to plug in it. following the cnp code makes me not sure
where it goes so for now - not there, but ready to go.

to be clear. out API is unix text. utf8 strings at our api with UNIX
newlines. that is our api. that is the text we accept and produce. if
you deal with another file or interface that does not provide this
then the job of conversion is AT THAT POINT. eg elm_cnp.c has to do
this. as would file loads of text files (and saves) etc. - anything
else like forgivingly handling anything at the api level makes it
totally unclear what our api is and what should go in and come out.

to be portable we have to define what it is and the most portable
thing to do is at the api level within a process we define one and
only one format. UNIX \n format.

@fix - partial
2016-07-26 16:44:10 +09:00
Marcel Hollerbach d2926f74ff elm_cnp: use defined charset before falling back to default
the chance is very high that some glyphs are not fitting into the
default (US-ASCII) so better falling back here on specified utf8.

@ref T3972
2016-07-14 13:58:26 +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 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
Carsten Haitzler 4bc6ba4ff0 elm cnp - wl - fix memory leak
fix memory leak specified in CID 1357160 , 1357159 , 1357158 , 1357157
2016-07-08 16:00:29 +09:00
Jean-Philippe Andre 85d45ee9b1 elm: Fix cnp crash on WL
See D4144.

Original author: @slotus.lee

SEG_FAULT happens when the object which has selection is deleted,
and new selection is done at another object.
Reason: loss_cb is not removed when the object which has selection is deleted.
When new selection is set for new object, the loss_cb is called for deleted
object. As result, SEG_FAULT happens.
This issue was also happened in X11 (https://phab.enlightenment.org/D2763)

Test plan:
(on wayland environment) Run elementary test, open Entry, do selection,
close Entry window, open Entry one more time, do selection.
2016-07-08 14:34:26 +09:00
Artem Popov 71a0573187 Elementary: cnp - check on NULL data in elm_drag_start
Summary:
check on NULL add in wayland elm_drag_start API
@fix

Test Plan: Call elm_grag_start with data = NULL under wayland

Reviewers: zmike, NikaWhite, jpeg

Reviewed By: NikaWhite, jpeg

Subscribers: bu5hm4n, myoungwoon, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4119
2016-07-04 11:01:05 +09:00
Chris Michael dce25efef4 elementary: Fix explicit null dereference
This patch fixes an issue reported by coverity where 'type' variable
could be null and passing null to strcmp is not good ;)

Fixes Coverity CID1357147

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 10:59:28 -04:00
Chris Michael f024234090 elementary: Fix erroneous usage of EINA_UNUSED
'data' parameter is actually used in this function, so remove mis-use
of EINA_UNUSED in function

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 11:48:53 -04:00
Chris Michael 8fb9c91d8f elementary: Fix over-zealous optimization attempt
This is a fix for some over-zealous optimization attempt. Basically,
we cannot optimize out multiple calls to ecore_wl2_window_input_get as
the window can change in the for loop.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 10:52:34 -04:00
Chris Michael 2c85f3b525 elementary: Fix bug in wl dnd where all subsequent mimetypes would be
accepted

This fixes an issue where in wl dnd, if one mimetype was accepted by a
drop, then all subsequent types would have been accepted also..

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 09:59:32 -04:00
Chris Michael 0addbf9b44 elementary: Reformat elm_cnp to be readable
NB: No functional changes, just formatting so I can read this hot mess

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 09:27:17 -04:00
Marcel Hollerbach 12eb732d46 ecore_wl2: use ECORE_WL2_EVENT_DATA_SOURCE_END
this event is emited each time the dragging is cancled. So the dragwin
should be deleted here.
2016-06-28 17:03:05 +02:00
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Jean Guyomarc'h f53a739e0e ecore_cocoa: simplify clipboard functions naming
ecore_cocoa_selection_clipboard_xxxx() have been renamed into
ecore_cocoa_clipboard_xxxx() and they have nothing to do with
selection, only with clipboard.

Since the API is not stable yet, I can change it.
2016-06-07 22:20:31 +02:00
Ji-Youn Park 8cf9ee67bd efl_ui_win: rename elm_win to efl_ui_win 2016-06-07 23:11:48 +08:30
Cedric Bail 75a53ece10 eo: for consistency use object like all our API. 2016-05-18 08:18:04 -07:00
Carsten Haitzler 43661180f7 efl - key/data/value/obj attach to eo objects - make these properties
the key data now is a property so they come out in bindings really
nicely like:

  obj.key_data["blah"] = x;

  x = obj.key_data["blah"];

etc.
2016-05-18 02:02:45 +09:00
Chris Michael 8ed0aa02cf elementary: Don't define handlers if we are not going to use them
These handlers are only used when building for X11, not for Wayland,
so conditionally compile them in/out

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-15 09:53:16 -04:00
memeka b01af6e57c elementary: Fix build issue when x11 is disabled
When we compile efl using --with-x11=none, then
_tempfile_new and _tmpinfo_free end up being undefined, however these
functions are used by wayland too so they need to be defined regardless.

@fix
2016-05-14 06:44:39 -04:00