diff options
author | Pierre Ossman <ossman@cendio.se> | 2019-12-30 10:50:52 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2019-12-30 10:52:23 +0100 |
commit | 0f1ded057dbf875e69a0d72418d95610db8fa6a3 (patch) | |
tree | 354651b1ac45087ad58fd5a56b9c6b9ec48c5e4a /vncviewer | |
parent | 6208f47dcbf68ff1e751b0b526bb643f0da867a6 (diff) | |
download | tigervnc-0f1ded057dbf875e69a0d72418d95610db8fa6a3.tar.gz tigervnc-0f1ded057dbf875e69a0d72418d95610db8fa6a3.zip |
Provide correct dimensions for XShm setup
Since 53f913a we initialize the underlying PixelBuffer with 0x0
dimensions, which means we need to keep more explicit track of what
we are trying to allocate in the setup methods.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/PlatformPixelBuffer.cxx | 6 | ||||
-rw-r--r-- | vncviewer/PlatformPixelBuffer.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx index 61f7b743..59e51d59 100644 --- a/vncviewer/PlatformPixelBuffer.cxx +++ b/vncviewer/PlatformPixelBuffer.cxx @@ -43,7 +43,7 @@ PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) : #endif { #if !defined(WIN32) && !defined(__APPLE__) - if (!setupShm()) { + if (!setupShm(width, height)) { xim = XCreateImage(fl_display, CopyFromParent, 32, ZPixmap, 0, 0, width, height, 32, 0); if (!xim) @@ -136,7 +136,7 @@ static int XShmAttachErrorHandler(Display *dpy, XErrorEvent *error) return 0; } -bool PlatformPixelBuffer::setupShm() +bool PlatformPixelBuffer::setupShm(int width, int height) { int major, minor; Bool pixmaps; @@ -153,7 +153,7 @@ bool PlatformPixelBuffer::setupShm() shminfo = new XShmSegmentInfo; xim = XShmCreateImage(fl_display, CopyFromParent, 32, - ZPixmap, 0, shminfo, width(), height()); + ZPixmap, 0, shminfo, width, height); if (!xim) goto free_shminfo; diff --git a/vncviewer/PlatformPixelBuffer.h b/vncviewer/PlatformPixelBuffer.h index f9038cd9..ec439f64 100644 --- a/vncviewer/PlatformPixelBuffer.h +++ b/vncviewer/PlatformPixelBuffer.h @@ -53,7 +53,7 @@ protected: #if !defined(WIN32) && !defined(__APPLE__) protected: - bool setupShm(); + bool setupShm(int width, int height); protected: XShmSegmentInfo *shminfo; |