diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 7faa520..d0f52cb 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -550,12 +550,12 @@
         WallpaperManager wpm = (WallpaperManager)getSystemService(WALLPAPER_SERVICE);
 
         Display display = getWindowManager().getDefaultDisplay();
-        // TODO: Put back when we decide about scrolling the wallpaper
-        // boolean isPortrait = display.getWidth() < display.getHeight();
-        // final int width = isPortrait ? display.getWidth() : display.getHeight();
-        // final int height = isPortrait ? display.getHeight() : display.getWidth();
-        wpm.suggestDesiredDimensions(Math.max(display.getWidth(), display.getHeight()),
-                Math.max(display.getWidth(), display.getHeight()));
+        boolean isPortrait = display.getWidth() < display.getHeight();
+        // find width and height when in portrait mode
+        final int width = isPortrait ? display.getWidth() : display.getHeight();
+        final int height = isPortrait ? display.getHeight() : display.getWidth();
+        wpm.suggestDesiredDimensions((int) (Math.max(width, height) * 1.5f),
+                Math.max(width, height));
     }
 
     // Note: This doesn't do all the client-id magic that BrowserProvider does
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index ff42282..d65f692 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -394,7 +394,7 @@
     @Override
     void setCurrentPage(int currentPage) {
         super.setCurrentPage(currentPage);
-        updateWallpaperOffset(mScrollX);
+        updateWallpaperOffset();
     }
 
     /**
@@ -558,19 +558,25 @@
         Launcher.setScreen(mCurrentPage);
     };
 
-    private void updateWallpaperOffset(int scrollRange) {
-        final boolean isStaticWallpaper = (mWallpaperManager != null) &&
-                (mWallpaperManager.getWallpaperInfo() == null);
-        if (LauncherApplication.isScreenXLarge() && !isStaticWallpaper) {
+    private void updateWallpaperOffset() {
+        if (LauncherApplication.isScreenXLarge()) {
             IBinder token = getWindowToken();
+            int scrollRange = getChildOffset(getChildCount() - 1) - getChildOffset(0);
             if (token != null) {
-                mWallpaperManager.setWallpaperOffsetSteps(1.0f / (getChildCount() - 1), 0 );
+                mWallpaperManager.setWallpaperOffsetSteps(1.0f / (getChildCount() - 1), 0);
+                float offset = mScrollX / (float) scrollRange;
                 mWallpaperManager.setWallpaperOffsets(getWindowToken(),
-                        Math.max(0.f, Math.min(mScrollX/(float)scrollRange, 1.f)), 0);
+                        Math.max(0.f, Math.min(offset, 1.0f)), 0);
             }
         }
     }
 
+    @Override
+    public void computeScroll() {
+        super.computeScroll();
+        updateWallpaperOffset();
+    }
+
     public void showOutlines() {
         if (!mIsSmall && !mIsInUnshrinkAnimation) {
             if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel();
