Issue:
1. When app is launched, rotation_degree is equal preferred rotation degree,
but this degree is fail to pass to engine, because RenderWidgetHostViewAura
is not created at this time.
2. Window Manager send Rotation callback, but rotation_degree is the same as
Rotation callback degree, so OnRotation is not called, then page is not updated,
and engine still has a default degree 0.
Solution:
1. Should not set rotation_degree to preferred rotation degree at first,
this value can't pass to engine, and will cause Rotation callback can't trigger.
2. Notice window manager preferred rotation is done in WillDraw, otherwise,
need to wait 10s(Window Manager time out), then app can show
Change-Id: I0a548fac85db03f16a72224b6370f7be7fd7ecfa
Signed-off-by: zhaosy <shiyusy.zhao@samsung.com>
#include "wrt/src/browser/api/wrt_api_web_contents.h"
+#include <Ecore_Wl2.h>
#include <Elementary.h>
#include "base/bind.h"
frame_output_size_.set_width(frame_data_output_size.width());
auto* ee = WRTNativeWindow::GetPlatformCanvas();
if (EINA_TRUE == ecore_evas_wm_rotation_manual_rotation_done_get(ee)) {
- LOG(INFO) << "finalize window rotation done";
+ LOG(INFO) << "finalize window manual rotation done";
ecore_evas_wm_rotation_manual_rotation_done(ee);
+ } else if (ecore_evas_wm_rotation_preferred_rotation_get(ee) > 0) {
+ LOG(INFO) << "finalize window preferred rotation done";
+ Ecore_Wl2_Window* wl_win = ecore_evas_wayland2_window_get(ee);
+ ecore_wl2_window_rotation_change_done_send(
+ wl_win, new_rotation, frame_data_output_size.width(),
+ frame_data_output_size.height());
}
}
// static
void WRTNativeWindow::SetRotationState(bool is_auto, int degree) {
- rotation_degree = native_window_delegate->SetRotationState(is_auto, degree);
+ native_window_delegate->SetRotationState(is_auto, degree);
}
// static