Bug 1168495 - Restrict updated region to fall within GTK window. r=jrmuizel
authorLee Salzman <lsalzman@mozilla.com>
Tue, 26 May 2015 14:09:18 -0400
changeset 268036 8e0ef5947c31d902bb2af7e5c770c46083eb10f7
parent 268035 42b94ddc1495ef3cc98a85896111db30c55ba9d7
child 268037 74707e11f71832919e58f0b5e396da8df692ae46
push id2294
push userbsmedberg@mozilla.com
push dateWed, 27 May 2015 15:05:10 +0000
reviewersjrmuizel
bugs1168495
milestone41.0a1
Bug 1168495 - Restrict updated region to fall within GTK window. r=jrmuizel
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -6163,16 +6163,20 @@ void
 nsWindow::EndRemoteDrawingInRegion(DrawTarget* aDrawTarget, nsIntRegion& aInvalidRegion)
 {
 #ifdef MOZ_X11
 #  ifdef MOZ_HAVE_SHMIMAGE
   if (!mGdkWindow || mIsFullyObscured || !mHasMappedToplevel || mIsDestroyed ||
       !mShmImage)
     return;
 
+  if (mThebesSurface) {
+    aInvalidRegion.AndWith(nsIntRect(nsIntPoint(0, 0), mThebesSurface->GetSize()));
+  }
+
   gint scale = GdkScaleFactor();
   if (scale != 1) {
     aInvalidRegion.ScaleInverseRoundOut(scale, scale);
   }
 
   mShmImage->Put(mGdkWindow, aInvalidRegion);
 
 #  endif // MOZ_HAVE_SHMIMAGE