From 80afdb4549d849ac8aebaba2440cf02fa3037b7f Mon Sep 17 00:00:00 2001 From: MinJeong Kim Date: Wed, 18 May 2016 21:07:46 +0900 Subject: [PATCH] rotation: send angle change event early for landscape only app Some landscape-only app render with first configured size of ecore evas, so for supporting those apps angle change event has to be delivered to apps before first application side rendering begin. Change-Id: Id99a03ca53ac1abe99193a05b4f7c01c2cb46ace --- src/rotation/e_mod_rotation_wl.c | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/rotation/e_mod_rotation_wl.c b/src/rotation/e_mod_rotation_wl.c index 9e29b29..0f5efc7 100644 --- a/src/rotation/e_mod_rotation_wl.c +++ b/src/rotation/e_mod_rotation_wl.c @@ -192,6 +192,37 @@ _e_tizen_rotation_set_available_angles_cb(struct wl_client *client, ec->e.fetch.rot.available_rots = 1; EC_CHANGED(ec); + + /* for clients supporting landscape mode only */ + if ((rot->available_angles) && + !(rot->available_angles & TIZEN_ROTATION_ANGLE_0) && + !(rot->available_angles & TIZEN_ROTATION_ANGLE_180)) + { + enum tizen_rotation_angle tz_angle = 0; + uint32_t serial; + Eina_List *l; + struct wl_resource *res; + + if (rot->available_angles & TIZEN_ROTATION_ANGLE_90) + tz_angle = TIZEN_ROTATION_ANGLE_90; + else if (rot->available_angles & TIZEN_ROTATION_ANGLE_270) + tz_angle = TIZEN_ROTATION_ANGLE_270; + else + { + ERR("What's this impossible angle?? : %d", rot->available_angles); + } + + if (tz_angle) + { + EINF(ec, "Send Change Rotation: angle %d for redering preparation of landscape only app", tz_angle); + serial = wl_display_next_serial(e_comp_wl->wl.disp); + + EINA_LIST_FOREACH(rot->rotation_list, l, res) + { + tizen_rotation_send_angle_change(res, tz_angle, serial); + } + } + } } static void @@ -213,6 +244,38 @@ _e_tizen_rotation_set_preferred_angle_cb(struct wl_client *client, ec->e.fetch.rot.preferred_rot = 1; EC_CHANGED(ec); + + + /* for clients supporting landscape mode only */ + if ((rot->preferred_angle) && + !(rot->preferred_angle & TIZEN_ROTATION_ANGLE_0) && + !(rot->preferred_angle & TIZEN_ROTATION_ANGLE_180)) + { + enum tizen_rotation_angle tz_angle = 0; + uint32_t serial; + Eina_List *l; + struct wl_resource *res; + + if (rot->preferred_angle & TIZEN_ROTATION_ANGLE_90) + tz_angle = TIZEN_ROTATION_ANGLE_90; + else if (rot->preferred_angle & TIZEN_ROTATION_ANGLE_270) + tz_angle = TIZEN_ROTATION_ANGLE_270; + else + { + ERR("What's this impossible angle?? : %d", rot->preferred_angle); + } + + if (tz_angle) + { + EINF(ec, "Send Change Rotation: angle %d for redering preparation of landscape only app", tz_angle); + serial = wl_display_next_serial(e_comp_wl->wl.disp); + + EINA_LIST_FOREACH(rot->rotation_list, l, res) + { + tizen_rotation_send_angle_change(res, tz_angle, serial); + } + } + } } static void -- 2.7.4