Blame SOURCES/tigervnc-provide-correct-dimensions-for-xshm-setup.patch

cfbdf6
From 0f1ded057dbf875e69a0d72418d95610db8fa6a3 Mon Sep 17 00:00:00 2001
cfbdf6
From: Pierre Ossman <ossman@cendio.se>
cfbdf6
Date: Mon, 30 Dec 2019 10:50:52 +0100
cfbdf6
Subject: [PATCH] Provide correct dimensions for XShm setup
cfbdf6
cfbdf6
Since 53f913a we initialize the underlying PixelBuffer with 0x0
cfbdf6
dimensions, which means we need to keep more explicit track of what
cfbdf6
we are trying to allocate in the setup methods.
cfbdf6
---
cfbdf6
 vncviewer/PlatformPixelBuffer.cxx | 6 +++---
cfbdf6
 vncviewer/PlatformPixelBuffer.h   | 2 +-
cfbdf6
 2 files changed, 4 insertions(+), 4 deletions(-)
cfbdf6
cfbdf6
diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx
cfbdf6
index 61f7b743b..59e51d596 100644
cfbdf6
--- a/vncviewer/PlatformPixelBuffer.cxx
cfbdf6
+++ b/vncviewer/PlatformPixelBuffer.cxx
cfbdf6
@@ -43,7 +43,7 @@ PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) :
cfbdf6
 #endif
cfbdf6
 {
cfbdf6
 #if !defined(WIN32) && !defined(__APPLE__)
cfbdf6
-  if (!setupShm()) {
cfbdf6
+  if (!setupShm(width, height)) {
cfbdf6
     xim = XCreateImage(fl_display, CopyFromParent, 32,
cfbdf6
                        ZPixmap, 0, 0, width, height, 32, 0);
cfbdf6
     if (!xim)
cfbdf6
@@ -136,7 +136,7 @@ static int XShmAttachErrorHandler(Display *dpy, XErrorEvent *error)
cfbdf6
   return 0;
cfbdf6
 }
cfbdf6
 
cfbdf6
-bool PlatformPixelBuffer::setupShm()
cfbdf6
+bool PlatformPixelBuffer::setupShm(int width, int height)
cfbdf6
 {
cfbdf6
   int major, minor;
cfbdf6
   Bool pixmaps;
cfbdf6
@@ -153,7 +153,7 @@ bool PlatformPixelBuffer::setupShm()
cfbdf6
   shminfo = new XShmSegmentInfo;
cfbdf6
 
cfbdf6
   xim = XShmCreateImage(fl_display, CopyFromParent, 32,
cfbdf6
-                        ZPixmap, 0, shminfo, width(), height());
cfbdf6
+                        ZPixmap, 0, shminfo, width, height);
cfbdf6
   if (!xim)
cfbdf6
     goto free_shminfo;
cfbdf6
 
cfbdf6
diff --git a/vncviewer/PlatformPixelBuffer.h b/vncviewer/PlatformPixelBuffer.h
cfbdf6
index f9038cd9c..ec439f64f 100644
cfbdf6
--- a/vncviewer/PlatformPixelBuffer.h
cfbdf6
+++ b/vncviewer/PlatformPixelBuffer.h
cfbdf6
@@ -53,7 +53,7 @@ class PlatformPixelBuffer: public rfb::FullFramePixelBuffer, public Surface {
cfbdf6
 
cfbdf6
 #if !defined(WIN32) && !defined(__APPLE__)
cfbdf6
 protected:
cfbdf6
-  bool setupShm();
cfbdf6
+  bool setupShm(int width, int height);
cfbdf6
 
cfbdf6
 protected:
cfbdf6
   XShmSegmentInfo *shminfo;