diff options
author | Jim Grandy <jgrandy@authentic8.com> | 2013-07-03 09:08:14 -0700 |
---|---|---|
committer | Jim Grandy <jgrandy@authentic8.com> | 2013-08-22 12:49:40 -0700 |
commit | 984e12a54ee7fa663e68ca3ffbf08a28af829cfd (patch) | |
tree | 0065f27fc34f8622b3425a41eed7273f7e3d70bb /xorg | |
parent | 81488cd6154a527f3cf7ebb1dcc568b0fbf57217 (diff) | |
download | xrdp-proprietary-984e12a54ee7fa663e68ca3ffbf08a28af829cfd.tar.gz xrdp-proprietary-984e12a54ee7fa663e68ca3ffbf08a28af829cfd.zip |
Hand-apply patches (X11rdp: fix for frame buffer getting smaller in randr) from Authentic8 branch: 1e92a08
Diffstat (limited to 'xorg')
-rw-r--r-- | xorg/X11R7.6/rdp/rdp.h | 4 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpmain.c | 1 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdprandr.c | 9 |
3 files changed, 11 insertions, 3 deletions
diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index 6fd7c38a..b2cbf449 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -114,7 +114,9 @@ struct _rdpScreenInfoRec int height; int depth; int bitsPerPixel; - int sizeInBytes; + int sizeInBytes; /* size of current used frame buffer */ + int sizeInBytesAlloc; /* size of current alloc frame buffer, + always >= sizeInBytes */ char* pfbMemory; Pixel blackPixel; Pixel whitePixel; diff --git a/xorg/X11R7.6/rdp/rdpmain.c b/xorg/X11R7.6/rdp/rdpmain.c index a574f325..9e68f910 100644 --- a/xorg/X11R7.6/rdp/rdpmain.c +++ b/xorg/X11R7.6/rdp/rdpmain.c @@ -274,6 +274,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) (g_rdpScreen.paddedWidthInBytes * g_rdpScreen.height); ErrorF("buffer size %d\n", g_rdpScreen.sizeInBytes); g_rdpScreen.pfbMemory = (char *)g_malloc(g_rdpScreen.sizeInBytes, 1); + g_rdpScreen.sizeInBytesAlloc = g_rdpScreen.sizeInBytes; } if (g_rdpScreen.pfbMemory == 0) diff --git a/xorg/X11R7.6/rdp/rdprandr.c b/xorg/X11R7.6/rdp/rdprandr.c index 26b56bfe..8b3eb582 100644 --- a/xorg/X11R7.6/rdp/rdprandr.c +++ b/xorg/X11R7.6/rdp/rdprandr.c @@ -156,8 +156,13 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ErrorF(" resizing screenPixmap [%p] to %dx%d, currently at %dx%d\n", (void *)screenPixmap, width, height, screenPixmap->drawable.width, screenPixmap->drawable.height); - g_free(g_rdpScreen.pfbMemory); - g_rdpScreen.pfbMemory = g_malloc(g_rdpScreen.sizeInBytes, 1); + if (g_rdpScreen.sizeInBytes > g_rdpScreen.sizeInBytesAlloc) + { + g_free(g_rdpScreen.pfbMemory); + g_rdpScreen.pfbMemory = (char*)g_malloc(g_rdpScreen.sizeInBytes, 1); + g_rdpScreen.sizeInBytesAlloc = g_rdpScreen.sizeInBytes; + ErrorF("new buffer size %d\n", g_rdpScreen.sizeInBytes); + } pScreen->ModifyPixmapHeader(screenPixmap, width, height, g_rdpScreen.depth, g_rdpScreen.bitsPerPixel, g_rdpScreen.paddedWidthInBytes, |