because it is wrong return value.
If webapp uses below metadata, it shows as portrait app.
<tizen:metadata key="http://samsung.com/tv/metadata/screen/orientation"
value="portrait"/>
This webapp get screen.orientation property in onload(),
screen.orientation.with and height is 1920x1080.
Correct width and height is 1080x1920 becuase it is portrait webapp.
The sequence is below.
1. WRT create window - set rotation related calls to window.
2. WRT call SetOrientation to WebContentsViewEfl
->set orientation to 270
3. WebContentsViewEfl::CreateViewForWidget() is called.
-> set orientation to 0 because ecore_evas_rotation_get() returns 0
Return value of ecore_evas_rotation_get() is not correct.
WRT always call SetOrientation(), so we donot have to get the
orientation value with ecore_evas_rotation_get() in
CreateViewForWidget()
Change-Id: I7a4e5f1f8314ef349e56813a275a0db738ae380b
Signed-off-by: Sujae Jo <sujae33.jo@samsung.com>
view->InitAsChild(nullptr);
view->SetTouchEventsEnabled(touch_enabled_);
- orientation_ =
- ecore_evas_rotation_get(ecore_evas_ecore_evas_get(view->evas()));
-
SetOrientation(orientation_);
RenderViewHost* render_view_host = web_contents_->GetRenderViewHost();
void WebContentsViewEfl::SetOrientation(int orientation) {
RenderWidgetHostViewEfl* rwhv = static_cast<RenderWidgetHostViewEfl*>(
web_contents_->GetRenderWidgetHostView());
-
if (rwhv) {
WebContentsImpl& contents_impl =
static_cast<WebContentsImpl&>(*web_contents_);
rwhv->UpdateRotationDegrees(orientation);
}
+ LOG(INFO) << "set orientation to " << orientation;
orientation_ = orientation;
}