From 7b7c5a70f178dfcb926a424d0f8eb2fbabb88927 Mon Sep 17 00:00:00 2001 From: JongHeon Choi Date: Thu, 23 Jun 2016 13:11:49 +0900 Subject: [PATCH] Rotate and resize window for landscape mode --- runtime/browser/web_application.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index ca56f97..46b55ca 100644 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -401,6 +401,17 @@ void WebApplication::Launch(std::unique_ptr appcontrol) { STEP_PROFILE_START("URL Set -> Rendered"); window_->SetContent(view->evas_object()); + + // rotate and resize window forcibily for landscape mode. + // window rotate event is generated after window show. so + // when app get width and height from viewport, wrong value can be returned. + if (app_data_->setting_info()->screen_orientation() == + wgt::parse::SettingInfo::ScreenOrientation::LANDSCAPE) { + LOGGER(DEBUG) << "rotate and resize window for landscape mode"; + elm_win_rotation_with_resize_set(window_->evas_object(), 270); + evas_norender(evas_object_evas_get(window_->evas_object())); + } + view->LoadUrl(res->uri(), res->mime()); view_stack_.push_front(view); -- 2.7.4