diff options
3 files changed, 12 insertions, 10 deletions
diff --git a/android/source/src/java/org/libreoffice/LOKitThread.java b/android/source/src/java/org/libreoffice/LOKitThread.java index 547cb4acc6d2..a4d5ba99f1a2 100644 --- a/android/source/src/java/org/libreoffice/LOKitThread.java +++ b/android/source/src/java/org/libreoffice/LOKitThread.java @@ -295,7 +295,7 @@ class LOKitThread extends Thread { closeDocument(); break; case LOEvent.SIZE_CHANGED: - redraw(true); + redraw(false); break; case LOEvent.CHANGE_PART: changePart(event.mPartIndex); diff --git a/android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java b/android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java index 681fb6fd6019..72a96f0bb00f 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java @@ -80,7 +80,7 @@ public class GeckoLayerClient implements PanZoomTarget { mView.setLayerRenderer(mLayerRenderer); - sendResizeEventIfNecessary(); + sendResizeEventIfNecessary(false); mView.requestRender(); } @@ -124,21 +124,23 @@ public class GeckoLayerClient implements PanZoomTarget { * to the layer client. That way, the layer client won't be tempted to call this, which might * result in an infinite loop. */ - void setViewportSize(FloatSize size) { + void setViewportSize(FloatSize size, boolean forceResizeEvent) { mViewportMetrics = mViewportMetrics.setViewportSize(size.width, size.height); - sendResizeEventIfNecessary(); + sendResizeEventIfNecessary(forceResizeEvent); } PanZoomController getPanZoomController() { return mPanZoomController; } - /* Informs Gecko that the screen size has changed. */ - private void sendResizeEventIfNecessary() { + /* Informs Gecko that the screen size has changed. + * @param force: If true, a resize event will always be sent, otherwise + * it is only sent if size has changed. */ + private void sendResizeEventIfNecessary(boolean force) { DisplayMetrics metrics = mContext.getResources().getDisplayMetrics(); IntSize newScreenSize = new IntSize(metrics.widthPixels, metrics.heightPixels); - if (mScreenSize.equals(newScreenSize)) { + if (!force && mScreenSize.equals(newScreenSize)) { return; } @@ -233,7 +235,7 @@ public class GeckoLayerClient implements PanZoomTarget { } private void geometryChanged() { - sendResizeEventIfNecessary(); + sendResizeEventIfNecessary(false); if (getRedrawHint()) { adjustViewport(null); } diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java index 549b2a963bf5..c9c5ca003297 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java @@ -302,7 +302,7 @@ public class LayerView extends FrameLayout { private void onSizeChanged(int width, int height) { mGLController.surfaceChanged(width, height); - mLayerClient.setViewportSize(new FloatSize(width, height)); + mLayerClient.setViewportSize(new FloatSize(width, height), false); if (mListener != null) { mListener.surfaceChanged(width, height); @@ -367,7 +367,7 @@ public class LayerView extends FrameLayout { protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); if (changed) { - mLayerClient.setViewportSize(new FloatSize(right - left, bottom - top)); + mLayerClient.setViewportSize(new FloatSize(right - left, bottom - top), true); } } |