Currently, screen is reversed on landscape mode.
In order to fix it, this patch migrates below patches which are related
with screen orientation. The below patch also contains changes of
context menu, which will be migrated along with context menu patches
Ref:
https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/219674
Change-Id: Id642a5144656550105065cbea8059fad109742f2
Signed-off-by: Suneel Kota <suneel.kota@samsung.com>
bool IsDragging() const;
void SetOrientation(int orientation);
+ int GetOrientation() const { return orientation_; }
void SetTouchEventsEnabled(bool);
void SetPageScaleFactor(float);
void QuerySelectionStyle();
namespace {
-int screen_orientation_ = 0;
-
static const char* kRendererCrashedHTMLMessage =
"<html><body><h1>Renderer process has crashed!</h1></body></html>";
}
void EWebView::SetOrientation(int orientation) {
- // For backward compatibility, a value in range of [0, 360] is used
- // instead of [-90, 180] because the class gfx::Display, containing
- // orientaion value, supports the former range.
- if (orientation == -90)
- orientation = 270;
- screen_orientation_ = orientation;
-
- if (screen_orientation_ == 0 || screen_orientation_ == 90 ||
- screen_orientation_ == 180 || screen_orientation_ == 270) {
- GetWebContentsViewEfl()->SetOrientation(screen_orientation_);
+ if (GetOrientation() == orientation)
+ return;
- // workaround for platform issue not resizing popup after rotation
- // this should be removed when when proper fix will be applied for platorm.
+ if (orientation == 0 || orientation == 90 || orientation == 180 ||
+ orientation == 270) {
+ GetWebContentsViewEfl()->SetOrientation(orientation);
int width = 0;
int height = 0;
}
int EWebView::GetOrientation() {
- return screen_orientation_;
+ return GetWebContentsViewEfl()->GetOrientation();
}
void EWebView::Show() {
class EWebView {
public:
static EWebView* FromEvasObject(Evas_Object* eo);
- static int GetOrientation();
EWebView(Ewk_Context*, Evas_Object* smart_object);
~EWebView();
void SetPageZoomFactor(double page_zoom_factor);
void ExecuteEditCommand(const char* command, const char* value);
void SetOrientation(int orientation);
+ int GetOrientation();
bool TouchEventsEnabled() const;
void SetTouchEventsEnabled(bool enabled);
bool MouseEventsEnabled() const;
return false;
}
-/*
- * Sends the new orientation of the device.
- *
- * If orientation value is changed, orientationchanged event will occur.
- *
- * @param view object to receive orientation event.
- * @param orientation the new orientation of the device. (degree)
- *
- * orientation will be 0 degrees when the device is oriented to natural position,
- * 90 degrees when it's left side is at the top,
- * -90 degrees when it's right side is at the top,
- * 180 degrees when it is upside down.
- */
void ewk_view_orientation_send(Evas_Object* ewkView, int orientation)
{
EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl);