From cbe53e5431851588751c106996ea0d0144f488ad Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Tue, 6 Dec 2016 14:35:10 +0900 Subject: [PATCH 01/16] Packaging : update version to 0.1.2 Change-Id: Iee00d96b653e90648ed2ba67644dc63ce27249f6 Signed-off-by: Sung-Jin Park --- packaging/e-mod-tizen-gesture.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-mod-tizen-gesture.spec b/packaging/e-mod-tizen-gesture.spec index d3b41d9..f515751 100644 --- a/packaging/e-mod-tizen-gesture.spec +++ b/packaging/e-mod-tizen-gesture.spec @@ -2,7 +2,7 @@ %bcond_with wayland Name: e-mod-tizen-gesture -Version: 0.1.1 +Version: 0.1.2 Release: 1 Summary: The Enlightenment Gesture Module for Tizen URL: http://www.enlightenment.org -- 2.7.4 From d5b36ea4f47ea87c6d1a78c2259c8d8e528b3811 Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Wed, 7 Dec 2016 11:01:32 +0900 Subject: [PATCH 02/16] Fix a invalid return value Change-Id: Ide2683edc4d771437d0ac457b6e8349e55f5201c --- src/e_mod_gesture_events.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/e_mod_gesture_events.c b/src/e_mod_gesture_events.c index a72ea62..d91d31b 100644 --- a/src/e_mod_gesture_events.c +++ b/src/e_mod_gesture_events.c @@ -472,7 +472,7 @@ _e_gesture_process_mouse_button_up(void *event) if (gesture->gesture_events.num_pressed == 0) { - return EINA_TRUE; + return E_GESTURE_EVENT_STATE_PROPAGATE; } gesture->gesture_events.num_pressed--; @@ -518,7 +518,7 @@ _e_gesture_process_mouse_move(void *event) if (gesture->gesture_events.num_pressed == 0) { - return EINA_TRUE; + return gesture->event_state; } if (!gesture->grabbed_gesture) { -- 2.7.4 From 9eb1538aa133cb0afa3469d32ab9dbae4ff5ceeb Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Fri, 16 Dec 2016 11:36:48 +0900 Subject: [PATCH 03/16] aux hint hook added to enable/disable global gesture(s) for each e client Change-Id: I63bc479805bac9e4899c45f80063e16b53f27166 --- src/e_mod_main.c | 47 ++++++++++++++++++++++++++++++++++------------- src/e_mod_main.h | 1 + 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/e_mod_main.c b/src/e_mod_main.c index 95035cc..a7c7d95 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -319,17 +319,9 @@ _e_gesture_event_filter(void *data, void *loop_data EINA_UNUSED, int type, void return e_gesture_process_events(event, type); } -static Eina_Bool -_e_gesture_cb_client_focus_in(void *data, int type, void *event) +static void +_e_gesture_window_gesture_disabled_change(E_Client *ec) { - E_Client *ec; - E_Event_Client *ev = (E_Event_Client *)event; - - EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON); - ec = ev->ec; - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, ECORE_CALLBACK_PASS_ON); - EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, ECORE_CALLBACK_PASS_ON); - if (ec->gesture_disable && gesture->enable) { GTINF("Gesture disabled window\n"); @@ -345,11 +337,40 @@ _e_gesture_cb_client_focus_in(void *data, int type, void *event) { e_gesture_event_filter_enable(gesture->enabled_window); } +} + +static Eina_Bool +_e_gesture_cb_client_focus_in(void *data, int type, void *event) +{ + E_Client *ec; + E_Event_Client *ev = (E_Event_Client *)event; + + EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON); + ec = ev->ec; + EINA_SAFETY_ON_NULL_RETURN_VAL(ec, ECORE_CALLBACK_PASS_ON); + EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, ECORE_CALLBACK_PASS_ON); + + _e_gesture_window_gesture_disabled_change(ec); return ECORE_CALLBACK_PASS_ON; } static void +_e_gesture_cb_aux_hint_change(void *data EINA_UNUSED, E_Client *ec) +{ + E_Comp_Wl_Aux_Hint *hint; + Eina_List *l; + + if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; + if (!ec->comp_data->aux_hint.changed) return; + + /* Return if the aux hint change didn't happen to the focused ec */ + if (ec != e_client_focused_get()) return; + + _e_gesture_window_gesture_disabled_change(ec); +} + +static void _e_gesture_init_handlers(void) { gesture->ef_handler = ecore_event_filter_add(NULL, _e_gesture_event_filter, NULL, NULL); @@ -377,7 +398,7 @@ _e_gesture_init(E_Module *m) goto err; } - /* Add filtering mechanism + /* Add filtering mechanism * FIXME: Add handlers after first gesture is grabbed */ _e_gesture_init_handlers(); @@ -419,7 +440,7 @@ _e_gesture_init(E_Module *m) } e_gesture_device_keydev_set(gesture->config->conf->key_device_name); - + e_client_hook_add(E_CLIENT_HOOK_AUX_HINT_CHANGE, _e_gesture_cb_aux_hint_change, NULL); gesture->enable = EINA_TRUE; return gconfig; @@ -520,4 +541,4 @@ e_gesture_event_filter_enable(Eina_Bool enabled) GTINF("Gestures will be enabled from now.\n"); gesture->enable = EINA_FALSE; } -} \ No newline at end of file +} diff --git a/src/e_mod_main.h b/src/e_mod_main.h index 9179932..bd894d5 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -15,6 +15,7 @@ #define E_GESTURE_TYPE_MAX TIZEN_GESTURE_TYPE_EDGE_SWIPE+1 #define E_GESTURE_TYPE_ALL TIZEN_GESTURE_TYPE_EDGE_SWIPE #define E_GESTURE_KEYBOARD_NAME "Gesture Keyboard" +#define E_GESTURE_AUX_HINT_GESTURE_DISABLE "wm.policy.win.gesture.disable" /* FIX ME: Set values in contiguration file, do not use definition */ #define E_GESTURE_KEYBOARD_DEVICE "Any" -- 2.7.4 From cdac1cfc95eb2f84e130cb26a718ea944474c15f Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Fri, 16 Dec 2016 15:16:13 +0900 Subject: [PATCH 04/16] Deinitialize handlers and hooks Change-Id: I6779e86cd1606c56600d66e54b87c3ff83df51cf --- src/e_mod_main.c | 28 ++++++++++++++++++++++++---- src/e_mod_main.h | 1 + 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/e_mod_main.c b/src/e_mod_main.c index a7c7d95..4f5ca3b 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -358,9 +358,6 @@ _e_gesture_cb_client_focus_in(void *data, int type, void *event) static void _e_gesture_cb_aux_hint_change(void *data EINA_UNUSED, E_Client *ec) { - E_Comp_Wl_Aux_Hint *hint; - Eina_List *l; - if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; if (!ec->comp_data->aux_hint.changed) return; @@ -378,6 +375,29 @@ _e_gesture_init_handlers(void) gesture->handlers = eina_list_append(gesture->handlers, ecore_event_handler_add(E_EVENT_CLIENT_FOCUS_IN, _e_gesture_cb_client_focus_in, NULL)); + + gesture->hooks = eina_list_append(gesture->hooks, + e_client_hook_add(E_CLIENT_HOOK_AUX_HINT_CHANGE, + _e_gesture_cb_aux_hint_change, NULL)); +} + +static void +_e_gesture_deinit_handlers(void) +{ + Ecore_Event_Handler *event_handler; + E_Client_Hook *hook; + + ecore_event_filter_del(gesture->ef_handler); + + EINA_LIST_FREE(gesture->handlers, event_handler) + { + ecore_event_handler_del(event_handler); + } + + EINA_LIST_FREE(gesture->hooks, hook) + { + e_client_hook_del(hook); + } } static E_Gesture_Config_Data * @@ -440,7 +460,6 @@ _e_gesture_init(E_Module *m) } e_gesture_device_keydev_set(gesture->config->conf->key_device_name); - e_client_hook_add(E_CLIENT_HOOK_AUX_HINT_CHANGE, _e_gesture_cb_aux_hint_change, NULL); gesture->enable = EINA_TRUE; return gconfig; @@ -465,6 +484,7 @@ e_modapi_shutdown(E_Module *m) E_Gesture_Config_Data *gconfig = m->data; e_gesture_conf_deinit(gconfig); e_gesture_device_shutdown(); + _e_gesture_deinit_handlers(); return 1; } diff --git a/src/e_mod_main.h b/src/e_mod_main.h index bd894d5..da12291 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -159,6 +159,7 @@ struct _E_Gesture Ecore_Event_Filter *ef_handler; Eina_List *handlers; Eina_List *grab_client_list; + Eina_List *hooks; struct { -- 2.7.4 From d34ed57a8e14e6d5b36004ed203778da2d17c5c9 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Fri, 16 Dec 2016 15:25:44 +0900 Subject: [PATCH 05/16] Packaging : update version to 0.1.3 Change-Id: Ifbee3868eaf6a2d8226c0034b0a459d4b56916ed Signed-off-by: Sung-Jin Park --- packaging/e-mod-tizen-gesture.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-mod-tizen-gesture.spec b/packaging/e-mod-tizen-gesture.spec index f515751..ad6effa 100644 --- a/packaging/e-mod-tizen-gesture.spec +++ b/packaging/e-mod-tizen-gesture.spec @@ -2,7 +2,7 @@ %bcond_with wayland Name: e-mod-tizen-gesture -Version: 0.1.2 +Version: 0.1.3 Release: 1 Summary: The Enlightenment Gesture Module for Tizen URL: http://www.enlightenment.org -- 2.7.4 From 9d7d02ddfeb55ce30a89eeda8755674c0032757c Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Fri, 30 Dec 2016 15:42:35 +0900 Subject: [PATCH 06/16] Accept all of gesture disable request from quickpanel Change-Id: Ieb3a020e8c050acca5c0c3951a66e5393f47009f --- configure.ac | 3 ++- packaging/e-mod-tizen-gesture.spec | 1 + src/e_mod_gesture_events.c | 28 +++++++--------------------- src/e_mod_main.c | 32 +++++++++++++++++++++++++++++++- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index c1e5180..56fca6d 100644 --- a/configure.ac +++ b/configure.ac @@ -64,7 +64,8 @@ dnl ======================================================================== # checks for pkg-config dnl ======================================================================== PKG_CHECK_MODULES(ENLIGHTENMENT, [enlightenment, - dlog]) + dlog, + tzsh-server]) ENLIGHTENMENT_CFLAGS="${ENLIGHTENMENT_CFLAGS} -D_GNU_SOURCE " AC_SUBST(ENLIGHTENMENT_CFLAGS) AC_SUBST(ENLIGHTENMENT_LIBS) diff --git a/packaging/e-mod-tizen-gesture.spec b/packaging/e-mod-tizen-gesture.spec index ad6effa..aed0333 100644 --- a/packaging/e-mod-tizen-gesture.spec +++ b/packaging/e-mod-tizen-gesture.spec @@ -14,6 +14,7 @@ BuildRequires: gettext BuildRequires: pkgconfig(wayland-server) BuildRequires: pkgconfig(tizen-extension-server) BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(tzsh-server) %global TZ_SYS_RO_SHARE %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share} diff --git a/src/e_mod_gesture_events.c b/src/e_mod_gesture_events.c index d91d31b..6627b5c 100644 --- a/src/e_mod_gesture_events.c +++ b/src/e_mod_gesture_events.c @@ -322,11 +322,13 @@ _e_gesture_process_edge_swipe_down(Ecore_Event_Mouse_Button *ev) _e_gesture_event_flush(); _e_gesture_edge_swipe_cancel(); } - - edge_swipes->fingers[idx].start.x = ev->x; - edge_swipes->fingers[idx].start.y = ev->y; - edge_swipes->start_timer = ecore_timer_add(conf->edge_swipe.time_begin, _e_gesture_timer_edge_swipe_start, NULL); - edge_swipes->done_timer = ecore_timer_add(conf->edge_swipe.time_done, _e_gesture_timer_edge_swipe_done, NULL); + if (edge_swipes->edge != E_GESTURE_EDGE_NONE) + { + edge_swipes->fingers[idx].start.x = ev->x; + edge_swipes->fingers[idx].start.y = ev->y; + edge_swipes->start_timer = ecore_timer_add(conf->edge_swipe.time_begin, _e_gesture_timer_edge_swipe_start, NULL); + edge_swipes->done_timer = ecore_timer_add(conf->edge_swipe.time_done, _e_gesture_timer_edge_swipe_done, NULL); + } } else { @@ -429,8 +431,6 @@ _e_gesture_process_mouse_button_down(void *event) { Ecore_Event_Mouse_Button *ev = event; - gesture->gesture_events.num_pressed++; - if (!gesture->grabbed_gesture) { return E_GESTURE_EVENT_STATE_PROPAGATE; @@ -470,12 +470,6 @@ _e_gesture_process_mouse_button_up(void *event) { Ecore_Event_Mouse_Button *ev = event; - if (gesture->gesture_events.num_pressed == 0) - { - return E_GESTURE_EVENT_STATE_PROPAGATE; - } - - gesture->gesture_events.num_pressed--; if (!gesture->grabbed_gesture) { return E_GESTURE_EVENT_STATE_PROPAGATE; @@ -490,14 +484,6 @@ _e_gesture_process_mouse_button_up(void *event) if (gesture->gesture_events.num_pressed == 0) { gesture->gesture_events.recognized_gesture = 0x0; - if (!gesture->enable && gesture->enabled_window) - { - e_gesture_event_filter_enable(EINA_TRUE); - } - else if (gesture->enable && !gesture->enabled_window) - { - e_gesture_event_filter_enable(EINA_FALSE); - } } return E_GESTURE_EVENT_STATE_IGNORE; } diff --git a/src/e_mod_main.c b/src/e_mod_main.c index 4f5ca3b..c2ad892 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -1,6 +1,7 @@ #define E_COMP_WL #include "e_mod_main.h" #include +#include "e_service_quickpanel.h" E_GesturePtr gesture = NULL; E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Gesture Module of Window Manager" }; @@ -314,6 +315,30 @@ static Eina_Bool _e_gesture_event_filter(void *data, void *loop_data EINA_UNUSED, int type, void *event) { (void) data; + + if (type == ECORE_EVENT_MOUSE_BUTTON_DOWN) + { + gesture->gesture_events.num_pressed++; + } + else if (type == ECORE_EVENT_MOUSE_BUTTON_UP) + { + gesture->gesture_events.num_pressed--; + if (gesture->gesture_events.num_pressed < 0) + gesture->gesture_events.num_pressed = 0; + if (gesture->gesture_events.num_pressed == 0) + { + if (!gesture->enable && gesture->enabled_window) + { + e_gesture_event_filter_enable(EINA_TRUE); + return EINA_TRUE; + } + else if (gesture->enable && !gesture->enabled_window) + { + e_gesture_event_filter_enable(EINA_FALSE); + return e_gesture_process_events(event, type); + } + } + } if (!gesture->enable) return EINA_TRUE; return e_gesture_process_events(event, type); @@ -358,11 +383,16 @@ _e_gesture_cb_client_focus_in(void *data, int type, void *event) static void _e_gesture_cb_aux_hint_change(void *data EINA_UNUSED, E_Client *ec) { + E_Client *qp_ec; if (e_object_is_del(E_OBJECT(ec)) || !ec->comp_data) return; if (!ec->comp_data->aux_hint.changed) return; + qp_ec = e_service_quickpanel_client_get(); + /* Return if the aux hint change didn't happen to the focused ec */ - if (ec != e_client_focused_get()) return; + if ((ec != qp_ec) && + (ec != e_client_focused_get())) + return; _e_gesture_window_gesture_disabled_change(ec); } -- 2.7.4 From 5b839c704cfe4a83a58fa0ee25066f13ac98af33 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Thu, 5 Jan 2017 13:10:52 +0900 Subject: [PATCH 07/16] Packaging : update version to 0.1.4 Change-Id: Id7084952a4f23e93a6d50620fc2f7ca0d3a68924 --- packaging/e-mod-tizen-gesture.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-mod-tizen-gesture.spec b/packaging/e-mod-tizen-gesture.spec index aed0333..5a1e11e 100644 --- a/packaging/e-mod-tizen-gesture.spec +++ b/packaging/e-mod-tizen-gesture.spec @@ -2,7 +2,7 @@ %bcond_with wayland Name: e-mod-tizen-gesture -Version: 0.1.3 +Version: 0.1.4 Release: 1 Summary: The Enlightenment Gesture Module for Tizen URL: http://www.enlightenment.org -- 2.7.4 From 9e9b21c98d9451a4333f77787f7b67c539e7534e Mon Sep 17 00:00:00 2001 From: Minsu Han Date: Tue, 7 Feb 2017 09:24:21 +0900 Subject: [PATCH 08/16] Fix double free issue. To append device.touch_devices list in e_gesture_device_add(), we should use strdup(). If not, in e_gesture_device_del() we have chance to meet the crash. Change-Id: Ic78fc74cb925a2e83a5f2dccb1668d71fa5c1795 Signed-off-by: Minsu Han --- src/e_mod_gesture_device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/e_mod_gesture_device.c b/src/e_mod_gesture_device.c index 25b5446..6e26af3 100644 --- a/src/e_mod_gesture_device.c +++ b/src/e_mod_gesture_device.c @@ -89,7 +89,9 @@ e_gesture_device_add(Ecore_Event_Device_Info *ev) { if (ev->clas == ECORE_DEVICE_CLASS_TOUCH) { - gesture->device.touch_devices = eina_list_append(gesture->device.touch_devices, ev->identifier); + char *id; + id = strdup(ev->identifier); + gesture->device.touch_devices = eina_list_append(gesture->device.touch_devices, id); GTINF("%s(%s) device is touch device: add list\n", ev->name, ev->identifier); } if ((!gesture->device.kbd_identifier) && -- 2.7.4 From 943b993a02a9a4c2961c3c48a0d72a4a60248789 Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Mon, 20 Feb 2017 16:05:32 +0900 Subject: [PATCH 09/16] Move a priority about the mouse event filtering logic Change-Id: Ic5520a3b4b0aef0b93a4a991b5eafd65f452f572 --- src/e_mod_gesture_events.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/e_mod_gesture_events.c b/src/e_mod_gesture_events.c index 6627b5c..fde9512 100644 --- a/src/e_mod_gesture_events.c +++ b/src/e_mod_gesture_events.c @@ -502,6 +502,10 @@ _e_gesture_process_mouse_move(void *event) { Ecore_Event_Mouse_Move *ev = event; + if (e_gesture_is_touch_device(ev->dev) == EINA_FALSE) + { + return E_GESTURE_EVENT_STATE_PROPAGATE; + } if (gesture->gesture_events.num_pressed == 0) { return gesture->event_state; @@ -510,11 +514,6 @@ _e_gesture_process_mouse_move(void *event) { return E_GESTURE_EVENT_STATE_PROPAGATE; } - if (e_gesture_is_touch_device(ev->dev) == EINA_FALSE) - { - return E_GESTURE_EVENT_STATE_PROPAGATE; - } - if (gesture->gesture_events.recognized_gesture) { return E_GESTURE_EVENT_STATE_IGNORE; -- 2.7.4 From 1e599521b3ef72f7d7994f05d1fdf44ec1e83573 Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Mon, 20 Feb 2017 16:06:13 +0900 Subject: [PATCH 10/16] Packaging : update version to 0.1.5 Change-Id: Id0519ac91a065059b4d088f6a671c7fdd973d4cb --- packaging/e-mod-tizen-gesture.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-mod-tizen-gesture.spec b/packaging/e-mod-tizen-gesture.spec index 5a1e11e..1f74a5f 100644 --- a/packaging/e-mod-tizen-gesture.spec +++ b/packaging/e-mod-tizen-gesture.spec @@ -2,7 +2,7 @@ %bcond_with wayland Name: e-mod-tizen-gesture -Version: 0.1.4 +Version: 0.1.5 Release: 1 Summary: The Enlightenment Gesture Module for Tizen URL: http://www.enlightenment.org -- 2.7.4 From 47e942bc67d8d5732c6ff43ee040ab648f399085 Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Wed, 8 Mar 2017 14:43:59 +0900 Subject: [PATCH 11/16] Check grabbed edge when process a edge_swipe gesture Change-Id: I3fdbba711ef7ca407dd683771b4606e78f4b5ad9 --- src/e_mod_gesture_events.c | 16 ++++++++++------ src/e_mod_main.c | 17 ++++++++++++++++- src/e_mod_main.h | 3 +++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/e_mod_gesture_events.c b/src/e_mod_gesture_events.c index fde9512..19666b4 100644 --- a/src/e_mod_gesture_events.c +++ b/src/e_mod_gesture_events.c @@ -316,12 +316,10 @@ _e_gesture_process_edge_swipe_down(Ecore_Event_Mouse_Button *ev) edge_swipes->edge = E_GESTURE_EDGE_RIGHT; else if (ev->x > e_comp->w - conf->edge_swipe.area_offset) edge_swipes->edge = E_GESTURE_EDGE_LEFT; - else - { - if (edge_swipes->event_keep) - _e_gesture_event_flush(); - _e_gesture_edge_swipe_cancel(); - } + + if (!((1 << (edge_swipes->edge - 1)) & edge_swipes->enabled_edge)) + edge_swipes->edge = E_GESTURE_EDGE_NONE; + if (edge_swipes->edge != E_GESTURE_EDGE_NONE) { edge_swipes->fingers[idx].start.x = ev->x; @@ -329,6 +327,12 @@ _e_gesture_process_edge_swipe_down(Ecore_Event_Mouse_Button *ev) edge_swipes->start_timer = ecore_timer_add(conf->edge_swipe.time_begin, _e_gesture_timer_edge_swipe_start, NULL); edge_swipes->done_timer = ecore_timer_add(conf->edge_swipe.time_done, _e_gesture_timer_edge_swipe_done, NULL); } + else + { + if (edge_swipes->event_keep) + _e_gesture_event_flush(); + _e_gesture_edge_swipe_cancel(); + } } else { diff --git a/src/e_mod_main.c b/src/e_mod_main.c index c2ad892..ad13585 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -173,6 +173,7 @@ _e_gesture_cb_grab_edge_swipe(struct wl_client *client, gesture->grabbed_gesture |= TIZEN_GESTURE_TYPE_EDGE_SWIPE; gev->edge_swipes.fingers[fingers].enabled = EINA_TRUE; if (gev->edge_swipes.event_keep) gesture->event_state = E_GESTURE_EVENT_STATE_KEEP; + gev->edge_swipes.enabled_edge |= grabbed_edge; if (!grabbed_edge) tizen_gesture_send_grab_edge_swipe_notify(resource, fingers, edge, TIZEN_GESTURE_ERROR_NONE); @@ -197,7 +198,7 @@ _e_gesture_cb_ungrab_edge_swipe(struct wl_client *client, { GTWRN("Do not support %d fingers (max: %d)\n", fingers, E_GESTURE_FINGER_MAX); ret = TIZEN_GESTURE_ERROR_INVALID_DATA; - goto finish; + goto notify; } gev = &gesture->gesture_events; @@ -274,6 +275,20 @@ _e_gesture_cb_ungrab_edge_swipe(struct wl_client *client, } finish: + gev->edge_swipes.enabled_edge &= ~edge; + for (i = 0; i < E_GESTURE_FINGER_MAX+1; i++) + { + for (j = 1; j < E_GESTURE_EDGE_MAX+1; j++) + { + if (gev->edge_swipes.fingers[i].edge[j].client) + { + gev->edge_swipes.enabled_edge |= (1 << (j - 1)); + } + } + if (gev->edge_swipes.enabled_edge == E_GESTURE_EDGE_ALL) break; + } + +notify: tizen_gesture_send_grab_edge_swipe_notify(resouce, fingers, edge, ret); return; } diff --git a/src/e_mod_main.h b/src/e_mod_main.h index da12291..96c3cd8 100644 --- a/src/e_mod_main.h +++ b/src/e_mod_main.h @@ -51,6 +51,7 @@ typedef enum _E_Gesture_Event_State E_Gesture_Event_State; extern E_GesturePtr gesture; #define E_GESTURE_EDGE_MAX 4 +#define E_GESTURE_EDGE_ALL (TIZEN_GESTURE_EDGE_TOP | TIZEN_GESTURE_EDGE_RIGHT | TIZEN_GESTURE_EDGE_BOTTOM | TIZEN_GESTURE_EDGE_LEFT) enum _E_Gesture_Edge { @@ -135,6 +136,8 @@ struct _E_Gesture_Event_Edge_Swipe unsigned int back_keycode; unsigned int enabled_finger; + unsigned int enabled_edge; + Ecore_Timer *start_timer; Ecore_Timer *done_timer; -- 2.7.4 From 68c709bdb5ee91a031f8f7ba66b5fa6c6e0a22de Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Wed, 8 Mar 2017 14:48:57 +0900 Subject: [PATCH 12/16] Packaging: update version to 0.1.6 Change-Id: If45ecebc3633d9b384a8496b96338e469dcc0de0 --- packaging/e-mod-tizen-gesture.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-mod-tizen-gesture.spec b/packaging/e-mod-tizen-gesture.spec index 1f74a5f..149a0a6 100644 --- a/packaging/e-mod-tizen-gesture.spec +++ b/packaging/e-mod-tizen-gesture.spec @@ -2,7 +2,7 @@ %bcond_with wayland Name: e-mod-tizen-gesture -Version: 0.1.5 +Version: 0.1.6 Release: 1 Summary: The Enlightenment Gesture Module for Tizen URL: http://www.enlightenment.org -- 2.7.4 From b938fbf2e6d7c64e4a743be2d2b8dfe40e045d7b Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Wed, 22 Mar 2017 17:41:35 +0900 Subject: [PATCH 13/16] packaging: update packaging file to install license file via %license macro Change-Id: Ia41e402c996d11baae09c055c6396a8334abd033 Signed-off-by: Sung-Jin Park --- packaging/e-mod-tizen-gesture.spec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packaging/e-mod-tizen-gesture.spec b/packaging/e-mod-tizen-gesture.spec index 149a0a6..6171fa7 100644 --- a/packaging/e-mod-tizen-gesture.spec +++ b/packaging/e-mod-tizen-gesture.spec @@ -38,10 +38,6 @@ make %install rm -rf %{buildroot} -# for license notification -mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/license -cp -a %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/%{TZ_SYS_RO_SHARE}/license/%{name} - # install make install DESTDIR=%{buildroot} @@ -50,5 +46,5 @@ find %{buildroot}%{_libdir}/enlightenment/modules/%{name} -name *.la | xargs rm %files %defattr(-,root,root,-) +%license COPYING %{_libdir}/enlightenment/modules/e-mod-tizen-gesture -/%{TZ_SYS_RO_SHARE}/license/%{name} -- 2.7.4 From 0b331d8823b18cfd57fdb6b73d341c8dd9fb769d Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Thu, 23 Mar 2017 16:18:51 +0900 Subject: [PATCH 14/16] set (omitted) window variable of ecore key event with e_comp->ee_win Change-Id: I5414251cf7d6cfe437f531a6337481ef175d4e2a --- src/e_mod_gesture_events.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/e_mod_gesture_events.c b/src/e_mod_gesture_events.c index 19666b4..e1de548 100644 --- a/src/e_mod_gesture_events.c +++ b/src/e_mod_gesture_events.c @@ -176,6 +176,7 @@ _e_gesture_send_back_key(Eina_Bool pressed) ev->same_screen = 1; ev->keycode = conf->edge_swipe.back_key; ev->dev = gesture->device.kbd_device; + ev->window = e_comp->ee_win; if (pressed) ecore_event_add(ECORE_EVENT_KEY_DOWN, ev, _e_gesture_keyevent_free, NULL); -- 2.7.4 From 54d1b1668412343d5968d95d4772301bf5b4bd7c Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Thu, 23 Mar 2017 16:23:04 +0900 Subject: [PATCH 15/16] Packaging: update version to 0.1.7 Change-Id: I1c1aa90a435fd25565e01a4cfd17d35ddecccc74 --- packaging/e-mod-tizen-gesture.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/e-mod-tizen-gesture.spec b/packaging/e-mod-tizen-gesture.spec index 6171fa7..0a1e2e5 100644 --- a/packaging/e-mod-tizen-gesture.spec +++ b/packaging/e-mod-tizen-gesture.spec @@ -2,7 +2,7 @@ %bcond_with wayland Name: e-mod-tizen-gesture -Version: 0.1.6 +Version: 0.1.7 Release: 1 Summary: The Enlightenment Gesture Module for Tizen URL: http://www.enlightenment.org -- 2.7.4 From 174336bca573e31239e56b7b007c4aa3525a6acf Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Fri, 31 Mar 2017 14:09:28 +0900 Subject: [PATCH 16/16] Set top edge to enabled_edge if default back gesture is enabled Change-Id: I7a8fdc2dcca87803719521e7e038166ce8a836e6 --- src/e_mod_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/e_mod_main.c b/src/e_mod_main.c index ad13585..0edf9d4 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -498,6 +498,7 @@ _e_gesture_init(E_Module *m) gesture->gesture_events.edge_swipes.fingers[1].enabled = EINA_TRUE; gesture->gesture_events.edge_swipes.fingers[1].edge[E_GESTURE_EDGE_TOP].client = (void *)0x1; gesture->gesture_events.edge_swipes.fingers[1].edge[E_GESTURE_EDGE_TOP].res = (void *)0x1; + gesture->gesture_events.edge_swipes.enabled_edge |= TIZEN_GESTURE_EDGE_TOP; if (gesture->gesture_events.edge_swipes.event_keep) { gesture->event_state = E_GESTURE_EVENT_STATE_KEEP; -- 2.7.4