Преглед на файлове

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.
tags/v1.10.90
Pierre Ossman преди 4 години
родител
ревизия
0f1ded057d
променени са 2 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 3
    3
      vncviewer/PlatformPixelBuffer.cxx
  2. 1
    1
      vncviewer/PlatformPixelBuffer.h

+ 3
- 3
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;


+ 1
- 1
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;

Loading…
Отказ
Запис