debian/changelog                        |    6 +
 debian/patches/fix-setwindowpixmap.diff |  111 ++++++++++++++++++++++++++++++++
 debian/patches/series                   |    1 
 3 files changed, 118 insertions(+)

New commits:
commit 6c00123265b99308710d92066153f8e82a71d547
Author: Maarten Lankhorst <maarten.lankho...@canonical.com>
Date:   Tue Nov 5 14:13:16 2013 +0100

    Add a hook to SetWindowPixmap to fix recordmydesktop crashing. (LP: 
#1244324)

diff --git a/debian/changelog b/debian/changelog
index 4653091..8e7e85f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+glamor-egl (0.5.1-0ubuntu6) UNRELEASED; urgency=low
+
+  * Add a hook to SetWindowPixmap to fix recordmydesktop crashing. (LP: 
#1244324)
+
+ -- Maarten Lankhorst <maarten.lankho...@ubuntu.com>  Tue, 05 Nov 2013 
14:11:10 +0100
+
 glamor-egl (0.5.1-0ubuntu5) trusty; urgency=low
 
   * Actually link against glapi to fix a symbol error. (LP: #1232658)
diff --git a/debian/patches/fix-setwindowpixmap.diff 
b/debian/patches/fix-setwindowpixmap.diff
new file mode 100644
index 0000000..2d91f33
--- /dev/null
+++ b/debian/patches/fix-setwindowpixmap.diff
@@ -0,0 +1,111 @@
+diff --git a/src/glamor.c b/src/glamor.c
+index 7637f3b..e8e68be 100644
+--- a/src/glamor.c
++++ b/src/glamor.c
+@@ -413,6 +413,9 @@ glamor_init(ScreenPtr screen, unsigned int flags)
+       glamor_priv->saved_procs.create_picture = ps->CreatePicture;
+       ps->CreatePicture = glamor_create_picture;
+ 
++      glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap;
++      screen->SetWindowPixmap = glamor_set_window_pixmap;
++
+       glamor_priv->saved_procs.destroy_picture = ps->DestroyPicture;
+       ps->DestroyPicture = glamor_destroy_picture;
+       glamor_init_composite_shaders(screen);
+@@ -531,6 +534,7 @@ glamor_close_screen(CLOSE_SCREEN_ARGS_DECL)
+       ps->CompositeRects = glamor_priv->saved_procs.composite_rects;
+       ps->Glyphs = glamor_priv->saved_procs.glyphs;
+       ps->UnrealizeGlyph = glamor_priv->saved_procs.unrealize_glyph;
++      screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap;
+ #endif
+       screen_pixmap = screen->GetScreenPixmap(screen);
+       glamor_set_pixmap_private(screen_pixmap, NULL);
+diff --git a/src/glamor_compositerects.c b/src/glamor_compositerects.c
+index f1564a2..1a57699 100644
+--- a/src/glamor_compositerects.c
++++ b/src/glamor_compositerects.c
+@@ -215,8 +215,8 @@ glamor_composite_rectangles(CARD8   op,
+       if (dst->pCompositeClip->data &&
+           (!pixman_region_intersect(&region, &region, dst->pCompositeClip) ||
+            region_is_empty(&region))) {
+-              DEBUGF(("%s: zero-intersection between rectangles and clip\n",
+-                   __FUNCTION__));
++              DEBUGF("%s: zero-intersection between rectangles and clip\n",
++                   __FUNCTION__);
+               pixman_region_fini(&region);
+               return;
+       }
+diff --git a/src/glamor_fbo.c b/src/glamor_fbo.c
+index a46a740..4838a27 100644
+--- a/src/glamor_fbo.c
++++ b/src/glamor_fbo.c
+@@ -212,7 +212,7 @@ glamor_pixmap_ensure_fb(glamor_pixmap_fbo *fbo)
+                       break;
+               }
+ 
+-              FatalError("destination is framebuffer incomplete: %s [%#x]\n",
++              FatalError("destination is framebuffer incomplete: %s [%x]\n",
+                          str, status);
+       }
+       glamor_put_dispatch(fbo->glamor_priv);
+diff --git a/src/glamor_priv.h b/src/glamor_priv.h
+index ffdd7fd..b6a1075 100644
+--- a/src/glamor_priv.h
++++ b/src/glamor_priv.h
+@@ -221,6 +221,7 @@ struct glamor_saved_procs {
+       CreatePictureProcPtr create_picture;
+       DestroyPictureProcPtr destroy_picture;
+       UnrealizeGlyphProcPtr unrealize_glyph;
++      SetWindowPixmapProcPtr set_window_pixmap;
+ };
+ 
+ #ifdef GLAMOR_GLES2
+@@ -934,6 +935,8 @@ void glamor_destroy_upload_pixmap(PixmapPtr pixmap);
+ 
+ int glamor_create_picture(PicturePtr picture);
+ 
++void glamor_set_window_pixmap(WindowPtr pWindow, PixmapPtr pPixmap);
++
+ Bool
+ glamor_prepare_access_picture(PicturePtr picture, glamor_access_t access);
+ 
+diff --git a/src/glamor_window.c b/src/glamor_window.c
+index 3da11e4..b67c728 100644
+--- a/src/glamor_window.c
++++ b/src/glamor_window.c
+@@ -69,3 +69,35 @@ glamor_change_window_attributes(WindowPtr pWin, unsigned 
long mask)
+       }
+       return TRUE;
+ }
++
++void
++glamor_set_window_pixmap(WindowPtr win, PixmapPtr pPixmap)
++{
++      ScreenPtr screen = win->drawable.pScreen;
++      glamor_screen_private *glamor_priv =
++              glamor_get_screen_private(screen);
++      PixmapPtr old = screen->GetWindowPixmap(win);
++
++      if (pPixmap != old) {
++              glamor_pixmap_private *pixmap_priv;
++              PicturePtr pic = NULL;
++
++              pixmap_priv = glamor_get_pixmap_private(old);
++              if (GLAMOR_PIXMAP_PRIV_IS_PICTURE(pixmap_priv) && 
pixmap_priv->base.picture->pDrawable == (DrawablePtr)win) {
++                      pic = pixmap_priv->base.picture;
++                      pixmap_priv->base.is_picture = 0;
++                      pixmap_priv->base.picture = NULL;
++              }
++
++              pixmap_priv = glamor_get_pixmap_private(pPixmap);
++              if (pixmap_priv) {
++                      pixmap_priv->base.is_picture = !!pic;
++                      pixmap_priv->base.picture = pic;
++              }
++      }
++
++      screen->SetWindowPixmap = glamor_priv->saved_procs.set_window_pixmap;
++      (screen->SetWindowPixmap)(win, pPixmap);
++      glamor_priv->saved_procs.set_window_pixmap = screen->SetWindowPixmap;
++      screen->SetWindowPixmap = glamor_set_window_pixmap;
++}
diff --git a/debian/patches/series b/debian/patches/series
index 05d1c8f..fb2d6e7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 fix-fdo65964.diff
 glapi-link.patch
+fix-setwindowpixmap.diff


-- 
To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1vdzca-00075s...@vasks.debian.org

Reply via email to