From a6f61b6e11afd71e01328880bbc5197c210f3f43 Mon Sep 17 00:00:00 2001 From: "bunam.jeon" Date: Wed, 4 Sep 2013 20:13:15 +0900 Subject: [PATCH] Fix for screen shift upward after showing ime [Title] Fix for screen shift upward after showing ime [Issue#] P130902-00494 [Problem] Screen shift upward after showing ime [Cause] Do not update visible content when input field zoom [Solution] update visible content rect when input fileld zoom Change-Id: I1f88c845455550b693f7d03c3c3f374b3987ccad --- Source/WebKit2/UIProcess/API/efl/ewk_view.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index 08cbcff..e7ca8c7 100755 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -2550,14 +2550,37 @@ bool ewk_view_focused_node_adjust(Evas_Object* ewkView, Eina_Bool adjustForExter return false; #endif + double scaleFactor = impl->pageClient->scaleFactor(); + IntSize contentsSize = impl->pageProxy->contentsSize(); + + double newScaleFactor = scaleFactor; + // Readable zoom value is dependent on device DPI + if (scaleFactor < impl->pageProxy->deviceScaleFactor() + && impl->pageClient->viewportConstraints().userScalable) + newScaleFactor = impl->pageProxy->deviceScaleFactor(); + + // Readable zoom value should be inside of viewport scale range + newScaleFactor = impl->pageClient->adjustScaleWithViewport(newScaleFactor); + // caret position can be outside of visible rect. // we need to consider it. IntRect selectionRect = impl->pageProxy->editorState().selectionRect; IntRect focusedNodeRect = impl->pageClient->focusedNodeRect(); + IntRect focusedNodeRectScaled = focusedNodeRect; if (selectionRect.isEmpty()) return false; +#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE) + focusedNodeRectScaled.scale(newScaleFactor); +#else + focusedNodeRectScaled.scale(newScaleFactor / scaleFactor); +#endif + + IntRect visibleRect = impl->pageClient->visibleContentRect(); + if (visibleRect.contains(focusedNodeRectScaled)) + return false; + #if ENABLE(TIZEN_WEBKIT2_INPUT_FIELD_ZOOM) impl->inputFieldZoom->startInputFieldZoom(impl->transformFromScene().mapPoint(IntPoint(focusedNodeRect.x(), focusedNodeRect.y())) ,focusedNodeRect); #endif -- 2.7.4