diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-04-14 11:29:43 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2020-04-14 11:29:43 -0400 |
commit | 0a2db329c8c92500bb9fa7b0289da61fb74d0dc3 (patch) | |
tree | 578a75ac8f70fdc501305e2eeba50e5f9ccc7cfe /src/lib/ecore_evas | |
parent | f2ed538d41c8ce8b25430dd209770e6dc1b133af (diff) |
ecore_evas: add API for finding out if event is used
Summary:
ecore_x_dnd_send_status can be used to indicate if a item can be dropped
on a client or not. However, we should only indicate that this can be
dropped, if there is a object we signaled that a drop is in.
Long story short: there is no assertion that after indicating that
things can be dropped, that a notify for the data is sent. A drag
implementation should always listen to a mouse up event, and abort the
drag if no further operations are sent.
Depends on D11698
Reviewers: zmike, stefan_schmidt, raster
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11699
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r-- | src/lib/ecore_evas/ecore_evas.c | 25 | ||||
-rw-r--r-- | src/lib/ecore_evas/ecore_evas_private.h | 4 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 75a0de18a6..f06c189ad9 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c | |||
@@ -5699,6 +5699,7 @@ ecore_evas_callback_drop_drop_set(Ecore_Evas *ee, Ecore_Evas_Drop_Cb cb) | |||
5699 | typedef struct { | 5699 | typedef struct { |
5700 | Eina_Array *available_mime_types; | 5700 | Eina_Array *available_mime_types; |
5701 | Eina_Position2D pos; | 5701 | Eina_Position2D pos; |
5702 | Eina_Bool last_motion_was_used; | ||
5702 | } Ecore_Evas_Active_Dnd; | 5703 | } Ecore_Evas_Active_Dnd; |
5703 | 5704 | ||
5704 | static void | 5705 | static void |
@@ -5734,18 +5735,34 @@ ecore_evas_dnd_enter(Ecore_Evas *ee, unsigned int seat, Eina_Iterator *available | |||
5734 | ee->func.fn_dnd_state_change(ee, seat, pos, EINA_TRUE); | 5735 | ee->func.fn_dnd_state_change(ee, seat, pos, EINA_TRUE); |
5735 | } | 5736 | } |
5736 | 5737 | ||
5737 | EAPI void | 5738 | EAPI Eina_Bool |
5738 | ecore_evas_dnd_position_set(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos) | 5739 | ecore_evas_dnd_position_set(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos) |
5739 | { | 5740 | { |
5740 | Ecore_Evas_Active_Dnd *dnd; | 5741 | Ecore_Evas_Active_Dnd *dnd; |
5741 | 5742 | ||
5742 | ECORE_EVAS_CHECK(ee); | 5743 | ECORE_EVAS_CHECK_GOTO(ee, err); |
5743 | EINA_SAFETY_ON_NULL_RETURN(ee->active_drags); | 5744 | EINA_SAFETY_ON_NULL_GOTO(ee->active_drags, err); |
5744 | dnd = eina_hash_find(ee->active_drags, &seat); | 5745 | dnd = eina_hash_find(ee->active_drags, &seat); |
5745 | EINA_SAFETY_ON_NULL_RETURN(dnd); | 5746 | EINA_SAFETY_ON_NULL_GOTO(dnd, err); |
5746 | dnd->pos = pos; | 5747 | dnd->pos = pos; |
5748 | dnd->last_motion_was_used = EINA_FALSE; | ||
5747 | if (ee->func.fn_dnd_motion) | 5749 | if (ee->func.fn_dnd_motion) |
5748 | ee->func.fn_dnd_motion(ee, seat, pos); | 5750 | ee->func.fn_dnd_motion(ee, seat, pos); |
5751 | return dnd->last_motion_was_used; | ||
5752 | err: | ||
5753 | return EINA_FALSE; | ||
5754 | } | ||
5755 | |||
5756 | EAPI void | ||
5757 | ecore_evas_dnd_mark_motion_used(Ecore_Evas *ee, unsigned int seat) | ||
5758 | { | ||
5759 | Ecore_Evas_Active_Dnd *dnd; | ||
5760 | |||
5761 | ECORE_EVAS_CHECK(ee); | ||
5762 | EINA_SAFETY_ON_NULL_RETURN(ee->active_drags); | ||
5763 | dnd = eina_hash_find(ee->active_drags, &seat); | ||
5764 | EINA_SAFETY_ON_NULL_RETURN(dnd); | ||
5765 | dnd->last_motion_was_used = EINA_TRUE; | ||
5749 | } | 5766 | } |
5750 | 5767 | ||
5751 | EAPI void | 5768 | EAPI void |
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index 6fb2c988b5..aba98b4a10 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h | |||
@@ -522,8 +522,8 @@ EAPI Eina_Bool ecore_evas_render(Ecore_Evas *ee); | |||
522 | 522 | ||
523 | EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h); | 523 | EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h); |
524 | EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window); | 524 | EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window); |
525 | 525 | EAPI void ecore_evas_dnd_mark_motion_used(Ecore_Evas *ee, unsigned int seat); | |
526 | EAPI void ecore_evas_dnd_position_set(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos); | 526 | EAPI Eina_Bool ecore_evas_dnd_position_set(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos); |
527 | EAPI void ecore_evas_dnd_leave(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos); | 527 | EAPI void ecore_evas_dnd_leave(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos); |
528 | EAPI void ecore_evas_dnd_enter(Ecore_Evas *ee, unsigned int seat, Eina_Iterator *available_types, Eina_Position2D pos); | 528 | EAPI void ecore_evas_dnd_enter(Ecore_Evas *ee, unsigned int seat, Eina_Iterator *available_types, Eina_Position2D pos); |
529 | EAPI Eina_Position2D ecore_evas_dnd_pos_get(Ecore_Evas *ee, unsigned int seat); | 529 | EAPI Eina_Position2D ecore_evas_dnd_pos_get(Ecore_Evas *ee, unsigned int seat); |