From: Sung-Jin Park Date: Thu, 20 Jun 2019 05:44:18 +0000 (+0900) Subject: e_comp_screen: set input rotation for a device added at runtime X-Git-Tag: accepted/tizen/unified/20190620.123700^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F208226%2F1;p=platform%2Fupstream%2Fenlightenment.git e_comp_screen: set input rotation for a device added at runtime Change-Id: Ic66bfa71c8f330a4c23213a51b0de5225e5bffd2 Signed-off-by: Sung-Jin Park --- diff --git a/src/bin/e_comp_screen.c b/src/bin/e_comp_screen.c index 725ff0e..0c527e3 100644 --- a/src/bin/e_comp_screen.c +++ b/src/bin/e_comp_screen.c @@ -251,6 +251,24 @@ end: return ECORE_CALLBACK_RENEW; } +static void +_e_comp_screen_input_rotation_set(int rotation) +{ + if (rotation > 0) + { + const Eina_List *l; + E_Input_Device *dev; + + EINA_LIST_FOREACH(e_input_devices_get(), l, dev) + { + e_input_device_touch_rotation_set(dev, rotation); + e_input_device_rotation_set(dev, rotation); + + INF("EE Input Device Rotate: %d", rotation); + } + } +} + static Eina_Bool _e_comp_screen_cb_input_device_add(void *data, int type, void *event) { @@ -276,6 +294,7 @@ _e_comp_screen_cb_input_device_add(void *data, int type, void *event) else if (e->clas == ECORE_DEVICE_CLASS_TOUCH) { e_comp_wl_input_touch_enabled_set(EINA_TRUE); + _e_comp_screen_input_rotation_set(e_comp->e_comp_screen->rotation); comp->wl_comp_data->touch.num_devices++; } @@ -1187,19 +1206,7 @@ e_comp_screen_init() E_LIST_HANDLER_APPEND(event_handlers, ECORE_EVENT_DEVICE_ADD, _e_comp_screen_cb_input_device_add, comp); E_LIST_HANDLER_APPEND(event_handlers, ECORE_EVENT_DEVICE_DEL, _e_comp_screen_cb_input_device_del, comp); - if (e_comp->e_comp_screen->rotation > 0) - { - const Eina_List *l; - E_Input_Device *dev; - - EINA_LIST_FOREACH(e_input_devices_get(), l, dev) - { - e_input_device_touch_rotation_set(dev, e_comp->e_comp_screen->rotation); - e_input_device_rotation_set(dev, e_comp->e_comp_screen->rotation); - - INF("EE Input Device Rotate: %d", e_comp->e_comp_screen->rotation); - } - } + _e_comp_screen_input_rotation_set(e_comp->e_comp_screen->rotation); TRACE_DS_END();