} // namespace
+#ifdef SAMSUNG_NEXT_BROWSER
+int getRotationDegreeByVconf()
+{
+ int orienatation = -1;
+ if (vconf_get_int("db/sysman/rotation_state", &orienatation)) {
+ LOG(WARNING) << "fail to get Orientation";
+ return -1;
+ }
+ LOG(INFO) << "retval = " << orienatation;
+
+ int rotation = -1;
+ if(orienatation == 1)
+ rotation = 0;
+ else if(orienatation == 2)
+ rotation = 90;
+ else if(orienatation == 0)
+ rotation = 270;
+ LOG(INFO) << "rotation : " << rotation;
+
+ return rotation;
+}
+#endif
+
Ecore_Evas* prepared_ee = nullptr;
Evas_Object* prepared_elm_win = nullptr;
prepared_elm_win = elm_win_add(NULL, "EFL_WINDOW", ELM_WIN_BASIC);
elm_win_autodel_set(prepared_elm_win, EINA_TRUE);
evas_object_resize(prepared_elm_win, bounds.width(), bounds.height());
+#ifdef SAMSUNG_NEXT_BROWSER
+ elm_win_aux_hint_add(prepared_elm_win, "wm.policy.win.screencontrol.transform", "disable");
+#endif
return ecore_evas_ecore_evas_get(evas_object_evas_get(prepared_elm_win));
}
void EflWindow::OnEcoreEvasResize(Ecore_Evas* ee) {
int width, height;
ecore_evas_geometry_get(ee, NULL, NULL, &width, &height);
-
+#ifndef SAMSUNG_NEXT_BROWSER
EflWindow* efl_window = EflWindowManager::GetWindowFromMap(ee);
efl_window->SetBoundsInPixels(gfx::Rect(width, height));
+#endif
}
#endif
return;
}
}
-
+#ifdef SAMSUNG_NEXT_BROWSER
+ ecore_evas_aux_hint_add(ee_ , "wm.policy.win.user.geometry", "1");
+ vconf_notify_key_changed("db/sysman/rotation_state", vconf_rotation_changed_cb, this);
+#endif
evas_ = ecore_evas_get(ee_);
#if !BUILDFLAG(IS_TIZEN)
EnsureIMContextEfl(ime_window);
#endif
}
+#ifdef SAMSUNG_NEXT_BROWSER
+void EflWindow::SetTransformHint(int rotation)
+{
+ aura::WindowTreeHostPlatform* host = static_cast<aura::WindowTreeHostPlatform*>(delegate_);
+ if(rotation == 90 || rotation == 270)
+ {
+ LOG(INFO) << "SetDisplayTransformHint to OVERLAY_TRANSFORM_ROTATE_270";
+ host->SetDisplayTransformHint(gfx::OVERLAY_TRANSFORM_ROTATE_CLOCKWISE_270);
+ }
+ else
+ {
+ LOG(INFO) << "SetDisplayTransformHint to OVERLAY_TRANSFORM_NONE";
+ host->SetDisplayTransformHint(gfx::OVERLAY_TRANSFORM_NONE);
+ }
+}
+void EflWindow::HandleRotation(int rotation)
+{
+ LOG(INFO) << "rotation : " << rotation;
+ int w = 1920;
+ int h = 1080;
+ if(rotation == 90 || rotation == 270)
+ {
+ std::swap(w,h);
+ }
+
+ aura::WindowTreeHostPlatform* host = static_cast<aura::WindowTreeHostPlatform*>(delegate_);
+ evas_object_resize(native_view(), w, h);
+ SetTransformHint(rotation);
+ bounds_ = gfx::Rect(0,0,w,h);
+ delegate_->OnBoundsChanged({false});
+ host->UpdateCompositorScaleAndSize(gfx::Size(1920,1080));
+}
+
+void EflWindow::vconf_rotation_changed_cb(keynode_t* keynodeName, void* data)
+{
+ EflWindow* win = static_cast<EflWindow*>(data);
+ int rotation = getRotationDegreeByVconf();
+ if(!win || rotation == -1)
+ {
+ return;
+ }
+ win->HandleRotation(rotation);
+}
+#endif
} // namespace ui