Commit Graph

124 Commits

Author SHA1 Message Date
Daniel Zaoui e8084e322c DnD: fix callbacks call on many DnD operations.
A leave callback is invoked on the drop target of the previous DnD
operation, leading to inconsistency for applications.
The state of the dropable target was not resetted during drop.
This patch fixes that.
2014-12-14 15:49:50 +02:00
Wonguk Jeong 122403ea44 elm_cnp: decode escaped ASCII-encoded URI for dnd
Summary:
encoded URI is pasted in terminology on dnd with file which has blank in name
ex. Test Blank.avi -> Test%20Blank.avi

Therefore, decode it when we extract file uris from uri list by using efreet.
by the way, copy and paste code likely needs refactoring..

Reviewers: raster, cedric

Subscribers: billiob, seoz

Differential Revision: https://phab.enlightenment.org/D1384
2014-11-29 16:06:50 +09:00
Tom Hacohen b12c544d21 Elm cnp: Fix infinite loop on drop target deletions in some cases.
In some cases, like having a drop target inside an inwin (looks like it
can be other containers too) can cause an infinite loop (as described in
the report). The reason for that is that while the drop target was added
when there was an X window available, the X window ws now gone, so the
non X path was being called which didn't have the code to remove the
item from the list being iterated. Yes, definition of spaghetti and
false assumptions.
Elm dnd/cnp need a massive overhaul, they are disgusting.

See the ticket for more information on the issue.

Fixes T1702
2014-10-20 17:24:07 +01:00
Daniel Zaoui 3d85a89b2c CnP/Wayland: Fix window check for Wayland invocations.
This was leading to never enter the cnp functions dedicated to Wayland,
as the given object was not a window. The Copy And Paste test was not
working for this reason.
2014-09-08 17:05:20 +03:00
Carsten Haitzler 2b6ae14af0 elm cnp - remove usless check/code according to CID 1193248 2014-08-08 16:45:28 +09:00
Jean-Philippe Andre 4d8e485fc8 elm_cnp: Break after we found the target we were looking for
Basic optimization of the search.
2014-07-09 09:09:16 +09:00
MinJeong Kim 0d530cd78f elm_cnp: Do not request for selection_set when buffer is empty
Summary:
When a wayland client requests selection_set, Wayland server doesn't care and doesn't know how long source data is.
so, it cannot ignore request for selection_set about empty buffer.
therefore to avoid copying empty buffer, it need to check length of buffer before request selection_set.

Test Plan:
1. Run "elementray_test -to entry5" with wayland server.
2. Drag text and try to paste.
3. Drag empty area in entry (request for selection_set on empty buffer is rejected)
4. Try to paste (you can see text of step 2).

Reviewers: devilhorns, raster, seoz

CC: gwanglim

Differential Revision: https://phab.enlightenment.org/D1146
2014-07-08 09:45:47 -04:00
Thiep Ha 36e153f956 dnd: rotate dragwin if main window is rotated when draging
Summary:
During drag, dragwin should be rotated when main window is rotated.

@fix

Reviewers: raster, JackDanielZ, woohyun

Reviewed By: raster

Differential Revision: https://phab.enlightenment.org/D976
2014-06-11 14:19:27 +09:00
Tom Hacohen efa41c7d75 Elm: Update code to use the new class names generated by eolian. 2014-06-03 11:54:44 +01:00
Jean-Philippe Andre 1952c510b9 elm_cnp: Fix build for windows (ecore_x) 2014-05-20 11:37:30 +09:00
Daniel Juyung Seo 8ffbf246f4 elm: fixed trivial formattings.
Just found them while reading codes.
2014-05-10 23:44:27 +09:00
Thiep Ha 7869c00600 dnd: Correct drag window positon in drag start
Summary:
If window is rotated, the drag window position is incorrect.

In drag start, the drag window is placed in incorrect position if main window is rotated.
Fix: Update drag window according to window rotation.

@fix

Reviewers: JackDanielZ, raster

Reviewed By: raster

CC: woohyun, seoz

Differential Revision: https://phab.enlightenment.org/D746
2014-04-21 17:27:46 +09:00
Carsten Haitzler 610ad7f44c FIX TOMS BREAKING OF ELEMENTARY! 2014-04-10 18:18:21 +09:00
Tom Hacohen a7c5d02257 Adjust code to use the slightly different Eo2 API.
With Eo2 you can return values directly without the need to use a pointer
(use the C return).

For example:
eo_do(obj, elm_object_text_get(&text));
becomes:
eo_do(obj, text = elm_object_text_get());

@feature
2014-04-10 09:49:22 +01:00
Tom Hacohen b39519aa12 cnp: Adjusted to Eo2. 2014-04-10 09:35:00 +01:00
Carsten Haitzler df206b852b elm cnip - fix new cnp problem where invalid mem ref done 2014-04-10 15:06:35 +09:00
Thiep Ha c1853c5ae0 dnd: Skip drag window when drag starts
Summary:
Currently, when drag starts, drag window is not skipped. It makes ecore_x cannot find dropable window in some cases.

Issue: Dropable window is not found if we drop inside the initialized area of drag window.
(Example: in Dnd Types of elementary test, try to start dragging at right edge of left label and drop to left edge of right label. The drop is failed).
Reason: Ecore_x considers drag window when it tries to find dropable window at specific position. Therefore, it cannot find dropable window.
Resolve: Skip drag window.
@fix

Reviewers: raster, JackDanielZ, seoz

CC: woohyun, seoz

Differential Revision: https://phab.enlightenment.org/D710
2014-04-10 11:20:50 +09:00
Thiep Ha 58b6b6596a [Elm_Dnd] Fix segmentation fault when deleting object with same registered drop callbacks
Summary:
In case we register two or more of same drop callbacks for one object, when that object is deleted, segmentation fault happens.

Test case: Register only same callbacks more than two times for one object. Delete that object (manual or auto). Segmentation fault happens.
Reason: When object is deleted, we remove all drop callbacks registered with the object. The _all_drops_targets_cbs_del and elm_drop_target_del are used to do that and they operates on the same cbs_list. If elm_drop_target_del remove the current and the next callbacks in cbs_list, the segmentation fault will happen at _all_drops_targets_cbs_del.
Fix: Check and use updated cbs_list.

@fix

Reviewers: JackDanielZ, raster, seoz

Reviewed By: JackDanielZ

CC: woohyun

Differential Revision: https://phab.enlightenment.org/D691
2014-04-03 19:08:07 +09:00
wonguk.jeong 26ebe359c7 cnp: check object type before getting window id
Summary:
problem:
1) elementary_test -> entry -> close entry window
2) type mismatch warning is shown on console as below

ERR<19427>:eo lib/eo/eo.c:342 _eo_dov_internal() in elm_win.eo.c:2067: Can't execute function Elm_Win:ELM_OBJ_WIN_SUB_ID_XWINDOW_GET (op 0x167) for class 'Elm_Entry'. Aborting.

solution:
check top object type before invoke elm_win_xwindow_get()/elm_wl_window_get().
if it's not a window, find window id by using ecore_evas APIs.

Fixes T1141

Test Plan: elementary_test -> entry -> close entry window -> check console

Reviewers: raster, seoz, uartie

Reviewed By: raster

CC: seoz

Maniphest Tasks: T1141

Differential Revision: https://phab.enlightenment.org/D684
2014-04-01 19:54:09 +09:00
Thiep Ha e416ea19a5 [Elm_Dnd] Correct drag position when rotation
Summary:
When window is rotated, the drag position is not updated.
It makes dnd cannot find out correct dropable objects.
This patch updates the drag position when window is rotated, so that dnd can find correct dropable objects.
@fix

P/S: This patch is originated from JackDanielZ (Daniel Zaoui). I update it to conform with lastest code.

Reviewers: JackDanielZ, raster

Reviewed By: JackDanielZ

CC: woohyun

Differential Revision: https://phab.enlightenment.org/D680
2014-04-01 09:39:16 +09:00
Carsten Haitzler 7cdd1d52ea silence complaints getting top widget if object is not an elm widget 2014-03-28 18:22:49 +09:00
Daniel Juyung Seo 13e4e1d7d0 cnp: Fixed cnp build warning by adding ifdef to cnp_debug.
This looks better.
Special thanks to barbieri for the suggestion.
2014-03-20 04:08:52 +09:00
Daniel Juyung Seo fc2f1d58d7 cnp: Fixed build warning.
elm_cnp.c: In function '_x11_dnd_leave':
elm_cnp.c:1547:69: warning: unused parameter 'ev' [-Wunused-parameter]
2014-03-20 02:10:08 +09:00
Thiep Ha a71fc8cbb8 [Elm_Dnd] Fix type matching of drag and drop target objects in X11.
Summary:
Type matching for drag and drop targets does not consider drop target objects' types.

For example, we have drag object which provides image type and drop target object which only accepts text type.
For current code, in _x11_dnd_drop function, we only check savedtypes.types with _x11_atoms.
As result, we allows the image to be dropped into text. You can refer to the test in D617.

This path fixes this issue by matching drag object's type with drop targets' types to find suitable one.
@fix

Reviewers: raster, JackDanielZ, seoz, woohyun

Differential Revision: https://phab.enlightenment.org/D628
2014-03-19 16:26:46 +09:00
Thiep Ha ae8c65f968 [DnD] Fix bug of hard-coded type when drag
Summary:
When we start dragging, the type is always set to "text/uri-list" no matter the format type set by application.
This patch fixs this hard-coded type issue. It will set types corresponding to the format type set by application.
For example, if application set format as ELM_SEL_FORMAT_TEXT, it will set types UTF8_STRING, STRING, COMPOUND_TEXT, TEXT,
text/plain, text/plain;charset=utf-8.

Reviewers: JackDanielZ, raster

Reviewed By: raster

CC: woohyun, seoz

Differential Revision: https://phab.enlightenment.org/D546
2014-02-18 15:47:08 +09:00
Daniel Hirt 41b6a932fe elm cnp: fix freeing selection buf
Moved a misplaced ELM_SAFE_FREE of the selection buffer,
 as valgrind still showed lost bytes with selection.
2014-02-09 13:22:24 +02:00
Ryuan Choi a3c5ee407f elm_cnp: Fix that calls _x11_elm_widget_xwin_get two times at elm_cnp_selection_{set|get}
small refactoring.
2014-01-23 22:22:33 +09:00
Daniel Juyung Seo 5353aa863c elm: Removed unnecessary null check for free. 2014-01-22 11:13:11 +09:00
Daniel Juyung Seo a4f3074f9c elm: Removed unnecessary null check for ecore_timer_del,
ecore_animator_del, and ecore_job_del.

As all efl public free apis get null as valid parameter, we do not need
to check null. I also removed some null check for other free apis which
were right next to timer/animator/job del. After this job code got
cleaner.
2014-01-21 23:18:16 +09:00
Carsten Haitzler 066b206a12 cnp - dont access null parent obj in getting xwin 2014-01-15 09:59:37 +09:00
Daniel Juyung Seo 5c0eccddd5 cnp: Fixed indentation while reading the code. 2014-01-13 23:01:34 +09:00
Carsten Haitzler 17083663ac elm cnp (dnd) - file:/ is the minimum, not file:// so work with other apps 2014-01-13 14:00:09 +09:00
Carsten Haitzler f165f26f28 fix mingw build for setuid fix/checks 2014-01-08 22:08:44 +09:00
Carsten Haitzler 430f98a628 setuid safeness - ensure if an app that is setuid doesn't do bad things
this makes efl ignore certain env vars for thnigs and entirely removes
user modules (that no one ever used) etc. etc. to ensure that *IF* an
app is setuid, there isn't a priv escalation path that is easy.
2014-01-08 20:33:09 +09:00
Daniel Juyung Seo fd5c046dfe elm: Changed __UNUSED__ to EINA_UNUSED. 2014-01-06 23:33:57 +09:00
Daniel Juyung Seo 6d71a23c3a elm lib: removed all the unnecessary empty lines.
being pedantic.
2013-12-15 06:18:35 +09:00
Daniel Zaoui e67db2c832 DnD: cancel feature during drag
This can be tested by running "Features DnD" test. Enable the 5s cancel
timeout, drag an item and wait for the cancellation.
2013-12-09 09:32:43 +02:00
Daniel Zaoui 75914e85d6 DnD: Valgrind fixes 2013-12-09 09:31:55 +02:00
Daniel Juyung Seo 8a0159df4f elm: long waited seasonal trailing whitespaces removal!
This is a ceremony of elementary 1.8 release!
2013-12-02 19:43:46 +09:00
Daniel Zaoui cfdb3eec4d Add callback when drag start in item containers 2013-11-28 16:24:01 +02:00
Daniel Zaoui bd79c328f3 DnD: safe inlist elements removal 2013-11-24 08:54:57 +02:00
Carsten Haitzler aff098868b wayland - fix cnp segv
this ACTUALLY fixes T471
2013-11-23 22:45:15 +09:00
Jihoon Kim 9e99a7f579 fix typos in doxygen and comments 2013-11-22 11:06:37 +09:00
Chris Michael b3b728acb7 Fix selection type when trying to get a selection. Also fix pasting
from terminology into other elm apps (selection format issue).

Wayland has no concept of primary or secondary clipboards so we need
to test for selection == those due to some X apps.

*cough*terminology*cough* using only Primary or Secondary.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-07 14:31:57 +00:00
Chris Michael b4925b0db0 Fix elementary copy/paste for wayland. Rework copy/paste code in elm.
This is part of a larger copy/paste fix for efl/elm wayland.
Previously, copy/paste would not work via keyboard shortcuts. This
series of changes fixes that issue (wrt elm_entry anyway).

This also adds addtional copy/paste support (wrt efl wayland),
including support for various mime types (text/plain, elm-markup, and
html).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2013-11-07 14:31:57 +00:00
Daniel Zaoui c4f8c9d5b7 DnD: Fix compilation errors by adapting the multi-callbacks to Wayland. 2013-11-05 13:41:57 -02:00
Daniel Zaoui b66233d128 DnD: multi-callbacks support
This features permits execution of more than one set of functions during
DnD.
Delete function API has been modified to give the developer the
possibility to remove a specific set of functions.
2013-11-05 08:28:54 +02:00
Daniel Zaoui 579d309cc5 DnD: Code improvement + variables renaming
Little code improvement
Rename cbdata with dropdata
2013-11-05 08:28:54 +02:00
Carsten Haitzler aae829f260 wayland support - unbreak build since structs are now private 2013-11-02 11:38:57 +09:00
Daniel Juyung Seo 0439d6eb62 elm_cnp.c: Disable cnp debug mode by default. 2013-11-02 04:28:06 +09:00