Bug 700006 - [layers] about:home show dead space [r=dougt]
authorBrian Nicholson <bnicholson@mozilla.com>
Mon, 14 Nov 2011 11:14:02 -0500
changeset 83451 772155060499b9377cb5fb2239782831dbd80e3f
parent 83450 1c92e36629f597e2b3dc269d9c06a7ea9a0fdb02
child 83452 16ab009adcb0bc7962d5521b9a24d7f35ce166d4
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs700006
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 700006 - [layers] about:home show dead space [r=dougt]
embedding/android/GeckoApp.java
--- a/embedding/android/GeckoApp.java
+++ b/embedding/android/GeckoApp.java
@@ -745,17 +745,24 @@ abstract public class GeckoApp
                         if (sMenu != null)
                             sMenu.findItem(R.id.preferences).setEnabled(true);
                     }
                 });
             } else if (event.equals("PanZoom:Ack")) {
                 final IntRect rect = new IntRect(message.getJSONObject("rect"));
                 mSoftwareLayerClient.jsPanZoomCompleted(rect);
             } else if (event.equals("PanZoom:Resize")) {
-                final IntSize size = new IntSize(message.getJSONObject("size"));
+                IntSize size = new IntSize(message.getJSONObject("size"));
+                int layoutWidth = mGeckoLayout.getMeasuredWidth();
+                int layoutHeight = mGeckoLayout.getMeasuredHeight();
+                // increase page size if smaller than layout dimensions
+                if (size.width < layoutWidth || size.height < layoutHeight) {
+                    size = new IntSize(Math.max(size.width, layoutWidth),
+                                       Math.max(size.height, layoutHeight));
+                }
                 mSoftwareLayerClient.setPageSize(size);
             } else if (event.equals("ToggleChrome:Hide")) {
                 mMainHandler.post(new Runnable() {
                     public void run() {
                         mBrowserToolbar.setVisibility(View.GONE);
                     }
                 });
             } else if (event.equals("ToggleChrome:Show")) {