Bug 700006 - [layers] about:home show dead space [r=dougt]
authorBrian Nicholson <bnicholson@mozilla.com>
Mon, 14 Nov 2011 11:14:02 -0500
changeset 81812 772155060499b9377cb5fb2239782831dbd80e3f
parent 81811 1c92e36629f597e2b3dc269d9c06a7ea9a0fdb02
child 81813 16ab009adcb0bc7962d5521b9a24d7f35ce166d4
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs700006
milestone10.0a1
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")) {