From c6e9d3b2da9d1a3e9d0dd65663d22a32b0ed1699 Mon Sep 17 00:00:00 2001 From: jeon Date: Tue, 6 Nov 2018 18:52:15 +0900 Subject: [PATCH] e_output: get touched information from e_input insteads of e_comp_wl Change-Id: Ie008c2606af890a3e06600c1ea7f8f63ba692fbb --- src/bin/e_output.c | 34 +++++++++++++++++++++++++++------- src/bin/e_output.h | 2 +- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/bin/e_output.c b/src/bin/e_output.c index c137577..47e9f9a 100644 --- a/src/bin/e_output.c +++ b/src/bin/e_output.c @@ -317,23 +317,34 @@ _e_output_zoom_touch_transform(E_Output *output, Eina_Bool set) } static Eina_Bool -_e_output_cb_ecore_event_mouse_up(void *data, int type EINA_UNUSED, void *event EINA_UNUSED) +_e_output_cb_ecore_event_filter(void *data, void *loop_data EINA_UNUSED, int type, void *event EINA_UNUSED) { E_Output *output = NULL; + E_Input_Device *dev = NULL; + + if (type != ECORE_EVENT_MOUSE_BUTTON_UP) + return ECORE_CALLBACK_PASS_ON; if (!data) return ECORE_CALLBACK_PASS_ON; output = data; + dev = eina_list_data_get(e_input_devices_get()); + if (!dev) + { + ERR("fail get e_input_device"); + return ECORE_CALLBACK_PASS_ON; + } + if (output->zoom_conf.need_touch_set) { - if (e_comp_wl->touch.pressed == 0) + if (e_input_device_touch_pressed_get(dev) == 0) { _e_output_zoom_touch_transform(output, EINA_TRUE); output->zoom_conf.need_touch_set = EINA_FALSE; - E_FREE_FUNC(output->touch_up_handler, ecore_event_handler_del); + E_FREE_FUNC(output->touch_up_handler, ecore_event_filter_del); } } @@ -344,14 +355,23 @@ static Eina_Bool _e_output_zoom_touch_set(E_Output *output) { Eina_Bool ret = EINA_FALSE; + E_Input_Device *dev = NULL; if (output->zoom_conf.need_touch_set) return EINA_TRUE; - if (e_comp_wl->touch.pressed) + dev = eina_list_data_get(e_input_devices_get()); + if (!dev) + { + ERR("fail get e_input_device"); + return EINA_FALSE; + } + + if (e_input_device_touch_pressed_get(dev)) { if (output->touch_up_handler == NULL) - output->touch_up_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, - _e_output_cb_ecore_event_mouse_up, output); + output->touch_up_handler = ecore_event_filter_add(NULL, + _e_output_cb_ecore_event_filter, + NULL, output); output->zoom_conf.need_touch_set = EINA_TRUE; return EINA_TRUE; @@ -373,7 +393,7 @@ _e_output_zoom_touch_unset(E_Output *output) output->zoom_conf.need_touch_set = EINA_FALSE; if (output->touch_up_handler) - E_FREE_FUNC(output->touch_up_handler, ecore_event_handler_del); + E_FREE_FUNC(output->touch_up_handler, ecore_event_filter_del); ret = _e_output_zoom_touch_transform(output, EINA_FALSE); diff --git a/src/bin/e_output.h b/src/bin/e_output.h index 079f6e0..1dde619 100644 --- a/src/bin/e_output.h +++ b/src/bin/e_output.h @@ -106,7 +106,7 @@ struct _E_Output Eina_Bool need_touch_set; Eina_Bool unset_skip; } zoom_conf; - Ecore_Event_Handler *touch_up_handler; + Ecore_Event_Filter *touch_up_handler; struct { -- 2.7.4