From aa3fad894db4e9b02999b229eb7e63fd8e91bdf6 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Sat, 19 May 2012 19:25:08 -0700 Subject: [PATCH] xorg: work on offscreen bitmaps --- xorg/X11R7.6/rdp/rdp.h | 17 +-- xorg/X11R7.6/rdp/rdpCopyArea.c | 18 ++-- xorg/X11R7.6/rdp/rdpCopyPlane.c | 2 +- xorg/X11R7.6/rdp/rdpFillPolygon.c | 2 +- xorg/X11R7.6/rdp/rdpFillSpans.c | 2 +- xorg/X11R7.6/rdp/rdpImageGlyphBlt.c | 2 +- xorg/X11R7.6/rdp/rdpImageText16.c | 2 +- xorg/X11R7.6/rdp/rdpImageText8.c | 2 +- xorg/X11R7.6/rdp/rdpPolyArc.c | 2 +- xorg/X11R7.6/rdp/rdpPolyFillArc.c | 2 +- xorg/X11R7.6/rdp/rdpPolyFillRect.c | 2 +- xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c | 2 +- xorg/X11R7.6/rdp/rdpPolyPoint.c | 2 +- xorg/X11R7.6/rdp/rdpPolyRectangle.c | 2 +- xorg/X11R7.6/rdp/rdpPolySegment.c | 2 +- xorg/X11R7.6/rdp/rdpPolyText16.c | 2 +- xorg/X11R7.6/rdp/rdpPolyText8.c | 2 +- xorg/X11R7.6/rdp/rdpPolylines.c | 2 +- xorg/X11R7.6/rdp/rdpPushPixels.c | 2 +- xorg/X11R7.6/rdp/rdpPutImage.c | 4 +- xorg/X11R7.6/rdp/rdpSetSpans.c | 2 +- xorg/X11R7.6/rdp/rdpdraw.c | 45 +++----- xorg/X11R7.6/rdp/rdprandr.c | 2 +- xorg/X11R7.6/rdp/rdpup.c | 161 +++++++++++++++++++++------- xrdp/xrdp.h | 8 +- xrdp/xrdp_cache.c | 67 ++++-------- xrdp/xrdp_mm.c | 54 ++++++---- xrdp/xrdp_painter.c | 29 +++-- xrdp/xrdp_types.h | 8 +- xup/xup.h | 8 +- 30 files changed, 267 insertions(+), 190 deletions(-) diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index 7df24c48..5cd84a5d 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -173,7 +173,7 @@ typedef rdpWindowRec* rdpWindowPtr; struct _rdpPixmapRec { int status; - int rdpid; /* unique id for xrdp */ + int rdpindex; int allocBytes; int con_number; }; @@ -182,8 +182,7 @@ typedef rdpPixmapRec* rdpPixmapPtr; #define GETPIXPRIV(_pPixmap) \ (rdpPixmapPtr)dixGetPrivateAddr(&(_pPixmap->devPrivates), &g_rdpPixmapIndex) -#define XRDP_IS_OS(_priv) ((_priv->status != 0) && \ - (_priv->con_number == g_con_number)) +#define XRDP_IS_OS(_priv) (_priv->status != 0) /* rdpmisc.c */ void @@ -336,6 +335,10 @@ void KbdSync(int param1); /* rdpup.c */ +int +rdpup_add_os_bitmap(PixmapPtr pixmap, rdpPixmapPtr priv); +int +rdpup_remove_os_bitmap(int rdpindex); void rdpup_get_screen_image_rect(struct image_data* id); void @@ -375,15 +378,15 @@ rdpup_send_area(struct image_data* id, int x, int y, int w, int h); int rdpup_set_cursor(short x, short y, char* cur_data, char* cur_mask); int -rdpup_create_os_surface(int rdpid, int width, int height); +rdpup_create_os_surface(int rdpindexd, int width, int height); int -rdpup_switch_os_surface(int rdpid); +rdpup_switch_os_surface(int rdpindex); int -rdpup_delete_os_surface(int rdpid); +rdpup_delete_os_surface(int rdpindex); void rdpup_paint_rect_os(int x, int y, int cx, int cy, - int rdpid, int srcx, int srcy); + int rdpindex, int srcx, int srcy); void rdpup_set_hints(int hints, int mask); diff --git a/xorg/X11R7.6/rdp/rdpCopyArea.c b/xorg/X11R7.6/rdp/rdpCopyArea.c index 3c3d371b..27ddab28 100644 --- a/xorg/X11R7.6/rdp/rdpCopyArea.c +++ b/xorg/X11R7.6/rdp/rdpCopyArea.c @@ -158,7 +158,7 @@ rdpCopyAreaWndToPixmap(WindowPtr pSrcWnd, ldsty = pDstPixmap->drawable.y + dsty; if (cd == 1) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_begin_update(); rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy); rdpup_end_update(); @@ -169,7 +169,7 @@ rdpCopyAreaWndToPixmap(WindowPtr pSrcWnd, num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips > 0) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_begin_update(); dx = dstx - srcx; dy = dsty - srcy; @@ -232,7 +232,7 @@ rdpCopyAreaPixmapToWnd(PixmapPtr pSrcPixmap, rdpPixmapRec* pSrcPriv, if (cd == 1) { rdpup_begin_update(); - rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpid, lsrcx, lsrcy); + rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy); rdpup_end_update(); } else if (cd == 2) @@ -246,7 +246,7 @@ rdpCopyAreaPixmapToWnd(PixmapPtr pSrcPixmap, rdpPixmapRec* pSrcPriv, box = REGION_RECTS(&clip_reg)[j]; LLOGLN(10, ("rdpCopyAreaPixmapToWnd: %d %d %d %d", box.x1, box.y1, box.x2, box.y2)); rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); - rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpid, lsrcx, lsrcy); + rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy); } rdpup_reset_clip(); rdpup_end_update(); @@ -287,9 +287,9 @@ rdpCopyAreaPixmapToPixmap(PixmapPtr pSrcPixmap, rdpPixmapRec* pSrcPriv, lsrcy = pSrcPixmap->drawable.y + srcy; if (cd == 1) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_begin_update(); - rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpid, lsrcx, lsrcy); + rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy); rdpup_end_update(); rdpup_switch_os_surface(-1); } @@ -298,13 +298,13 @@ rdpCopyAreaPixmapToPixmap(PixmapPtr pSrcPixmap, rdpPixmapRec* pSrcPriv, num_clips = REGION_NUM_RECTS(&clip_reg); if (num_clips > 0) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_begin_update(); for (j = 0; j < num_clips; j++) { box = REGION_RECTS(&clip_reg)[j]; rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); - rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpid, lsrcx, lsrcy); + rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy); } rdpup_reset_clip(); rdpup_end_update(); @@ -414,7 +414,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpCopyPlane.c b/xorg/X11R7.6/rdp/rdpCopyPlane.c index b6efa0bf..f0a54d9e 100644 --- a/xorg/X11R7.6/rdp/rdpCopyPlane.c +++ b/xorg/X11R7.6/rdp/rdpCopyPlane.c @@ -91,7 +91,7 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpFillPolygon.c b/xorg/X11R7.6/rdp/rdpFillPolygon.c index 459ba73e..362e8d15 100644 --- a/xorg/X11R7.6/rdp/rdpFillPolygon.c +++ b/xorg/X11R7.6/rdp/rdpFillPolygon.c @@ -91,7 +91,7 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpFillSpans.c b/xorg/X11R7.6/rdp/rdpFillSpans.c index 0939b50a..1f655d01 100644 --- a/xorg/X11R7.6/rdp/rdpFillSpans.c +++ b/xorg/X11R7.6/rdp/rdpFillSpans.c @@ -80,7 +80,7 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpImageGlyphBlt.c b/xorg/X11R7.6/rdp/rdpImageGlyphBlt.c index 22839af9..35c19bc1 100644 --- a/xorg/X11R7.6/rdp/rdpImageGlyphBlt.c +++ b/xorg/X11R7.6/rdp/rdpImageGlyphBlt.c @@ -91,7 +91,7 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpImageText16.c b/xorg/X11R7.6/rdp/rdpImageText16.c index cb6f3cfb..e2261147 100644 --- a/xorg/X11R7.6/rdp/rdpImageText16.c +++ b/xorg/X11R7.6/rdp/rdpImageText16.c @@ -89,7 +89,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpImageText8.c b/xorg/X11R7.6/rdp/rdpImageText8.c index 81b754c0..34bf35be 100644 --- a/xorg/X11R7.6/rdp/rdpImageText8.c +++ b/xorg/X11R7.6/rdp/rdpImageText8.c @@ -89,7 +89,7 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyArc.c b/xorg/X11R7.6/rdp/rdpPolyArc.c index 3f7dc4b8..be56821a 100644 --- a/xorg/X11R7.6/rdp/rdpPolyArc.c +++ b/xorg/X11R7.6/rdp/rdpPolyArc.c @@ -104,7 +104,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyFillArc.c b/xorg/X11R7.6/rdp/rdpPolyFillArc.c index 3603b932..91ab7899 100644 --- a/xorg/X11R7.6/rdp/rdpPolyFillArc.c +++ b/xorg/X11R7.6/rdp/rdpPolyFillArc.c @@ -104,7 +104,7 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyFillRect.c b/xorg/X11R7.6/rdp/rdpPolyFillRect.c index 66eb50fe..070dd255 100644 --- a/xorg/X11R7.6/rdp/rdpPolyFillRect.c +++ b/xorg/X11R7.6/rdp/rdpPolyFillRect.c @@ -88,7 +88,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c b/xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c index 3ec438db..871e7cf4 100644 --- a/xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c +++ b/xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c @@ -91,7 +91,7 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyPoint.c b/xorg/X11R7.6/rdp/rdpPolyPoint.c index 7b4e9842..d6bc5e6b 100644 --- a/xorg/X11R7.6/rdp/rdpPolyPoint.c +++ b/xorg/X11R7.6/rdp/rdpPolyPoint.c @@ -130,7 +130,7 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyRectangle.c b/xorg/X11R7.6/rdp/rdpPolyRectangle.c index 0d2e7afa..0d2beede 100644 --- a/xorg/X11R7.6/rdp/rdpPolyRectangle.c +++ b/xorg/X11R7.6/rdp/rdpPolyRectangle.c @@ -100,7 +100,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolySegment.c b/xorg/X11R7.6/rdp/rdpPolySegment.c index 223a5327..2e5609b5 100644 --- a/xorg/X11R7.6/rdp/rdpPolySegment.c +++ b/xorg/X11R7.6/rdp/rdpPolySegment.c @@ -95,7 +95,7 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs) pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyText16.c b/xorg/X11R7.6/rdp/rdpPolyText16.c index 4feb2f03..609df35d 100644 --- a/xorg/X11R7.6/rdp/rdpPolyText16.c +++ b/xorg/X11R7.6/rdp/rdpPolyText16.c @@ -92,7 +92,7 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyText8.c b/xorg/X11R7.6/rdp/rdpPolyText8.c index 21f4e18a..3cb7b5a0 100644 --- a/xorg/X11R7.6/rdp/rdpPolyText8.c +++ b/xorg/X11R7.6/rdp/rdpPolyText8.c @@ -92,7 +92,7 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolylines.c b/xorg/X11R7.6/rdp/rdpPolylines.c index 9f5ca7c3..b8400904 100644 --- a/xorg/X11R7.6/rdp/rdpPolylines.c +++ b/xorg/X11R7.6/rdp/rdpPolylines.c @@ -99,7 +99,7 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPushPixels.c b/xorg/X11R7.6/rdp/rdpPushPixels.c index 8e774c53..5129f0e2 100644 --- a/xorg/X11R7.6/rdp/rdpPushPixels.c +++ b/xorg/X11R7.6/rdp/rdpPushPixels.c @@ -84,7 +84,7 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPutImage.c b/xorg/X11R7.6/rdp/rdpPutImage.c index 7a132f8c..a5072c23 100644 --- a/xorg/X11R7.6/rdp/rdpPutImage.c +++ b/xorg/X11R7.6/rdp/rdpPutImage.c @@ -73,7 +73,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, rdpPixmapRec* pDstPriv; LLOGLN(10, ("rdpPutImage:")); - LLOGLN(10, ("rdpPutImage: drawable id 0x%x", pDst->id)); + LLOGLN(10, ("rdpPutImage: drawable id 0x%x", (int)(pDst->id))); /* do original call */ rdpPutImageOrg(pDst, pGC, depth, x, y, w, h, leftPad, format, pBits); @@ -84,7 +84,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpSetSpans.c b/xorg/X11R7.6/rdp/rdpSetSpans.c index d7a41e7e..7b763091 100644 --- a/xorg/X11R7.6/rdp/rdpSetSpans.c +++ b/xorg/X11R7.6/rdp/rdpSetSpans.c @@ -81,7 +81,7 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpdraw.c b/xorg/X11R7.6/rdp/rdpdraw.c index 6e2846ed..f35e4de1 100644 --- a/xorg/X11R7.6/rdp/rdpdraw.c +++ b/xorg/X11R7.6/rdp/rdpdraw.c @@ -68,15 +68,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from rdpmain.c */ -extern int g_con_number; /* in rdpup.c */ -extern int g_connected; /* in rdpup.c */ - ColormapPtr g_rdpInstalledColormap; -static int g_pixmap_rdpid = 1; -int g_pixmap_byte_total = 0; -int g_pixmap_num_used = 0; - GCFuncs g_rdpGCFuncs = { rdpValidateGC, rdpChangeGC, rdpCopyGC, rdpDestroyGC, rdpChangeClip, @@ -408,20 +401,17 @@ rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, pScreen->CreatePixmap = g_rdpScreen.CreatePixmap; rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint); priv = GETPIXPRIV(rv); - if ((g_rdpScreen.client_info.offscreen_support_level > 0) && - (rv->drawable.depth == g_rdpScreen.depth) && - (org_width > 1) && (height > 1) && g_connected) + priv->rdpindex = -1; + if ((rv->drawable.depth == g_rdpScreen.depth) && + (org_width > 1) && (height > 1)) { - priv->allocBytes = width * height * 4; - g_pixmap_byte_total += priv->allocBytes; - g_pixmap_num_used++; - priv->status = 1; - priv->rdpid = g_pixmap_rdpid; - g_pixmap_rdpid++; - priv->con_number = g_con_number; - rdpup_create_os_surface(priv->rdpid, width, height); - LLOGLN(0, ("rdpCreatePixmap: g_pixmap_byte_total %d g_pixmap_num_used %d", - g_pixmap_byte_total, g_pixmap_num_used)); + priv->allocBytes = width * height * g_Bpp; + priv->rdpindex = rdpup_add_os_bitmap(rv, priv); + if (priv->rdpindex >= 0) + { + priv->status = 1; + rdpup_create_os_surface(priv->rdpindex, width, height); + } } pScreen->ModifyPixmapHeader(rv, org_width, 0, 0, 0, 0, 0); pScreen->CreatePixmap = rdpCreatePixmap; @@ -441,15 +431,10 @@ rdpDestroyPixmap(PixmapPtr pPixmap) LLOGLN(10, ("status %d refcnt %d", priv->status, pPixmap->refcnt)); if (pPixmap->refcnt < 2) { - if (XRDP_IS_OS(priv) && g_connected) + if (XRDP_IS_OS(priv)) { - g_pixmap_byte_total -= priv->allocBytes; - g_pixmap_num_used--; - LLOGLN(0, ("rdpDestroyPixmap: id 0x%x " - "rdpid 0x%x g_pixmap_byte_total %d g_pixmap_num_used %d", - pPixmap->drawable.id, priv->rdpid, - g_pixmap_byte_total, g_pixmap_num_used)); - rdpup_delete_os_surface(priv->rdpid); + rdpup_remove_os_bitmap(priv->rdpindex); + rdpup_delete_os_surface(priv->rdpindex); } } pScreen = pPixmap->drawable.pScreen; @@ -748,7 +733,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpid); + rdpup_switch_os_surface(pDstPriv->rdpindex); rdpup_get_pixmap_image_rect(pDstPixmap, &id); got_id = 1; } @@ -828,7 +813,7 @@ rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, for (index = 0; index < lists->len; index++) { LLOGLN(10, (" index %d size %d refcnt %d width %d height %d", - index, glyphs[index]->size, glyphs[index]->refcnt, + index, (int)(glyphs[index]->size), (int)(glyphs[index]->refcnt), glyphs[index]->info.width, glyphs[index]->info.height)); } ps = GetPictureScreen(g_pScreen); diff --git a/xorg/X11R7.6/rdp/rdprandr.c b/xorg/X11R7.6/rdp/rdprandr.c index 29f1c6e3..978e48aa 100644 --- a/xorg/X11R7.6/rdp/rdprandr.c +++ b/xorg/X11R7.6/rdp/rdprandr.c @@ -123,7 +123,7 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, BoxRec box; ErrorF("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d\n", - width, height, mmWidth, mmHeight); + width, height, (int)mmWidth, (int)mmHeight); if ((width < 1) || (height < 1)) { diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c index 4a8bf9f8..fa2092e2 100644 --- a/xorg/X11R7.6/rdp/rdpup.c +++ b/xorg/X11R7.6/rdp/rdpup.c @@ -38,9 +38,7 @@ int g_con_number = 0; /* increments for each connection */ static int g_listen_sck = 0; static int g_sck = 0; static int g_sck_closed = 0; - -int g_connected = 0; - +static int g_connected = 0; static int g_dis_listen_sck = 0; //static int g_dis_sck = 0; //static int g_dis_sck_closed = 0; @@ -55,7 +53,7 @@ static int g_cursor_y = 0; static OsTimerPtr g_timer = 0; static int g_scheduled = 0; static int g_count = 0; -static int g_rdpid = -1; +static int g_rdpindex = -1; extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern int g_Bpp; /* from rdpmain.c */ @@ -69,6 +67,21 @@ extern char g_uds_data[]; /* in rdpmain.c */ extern int g_pixmap_byte_total; /* in rdpdraw.c */ extern int g_pixmap_num_used; /* in rdpdraw.c */ +struct rdpup_os_bitmap +{ + int used; + PixmapPtr pixmap; + rdpPixmapPtr priv; + int stamp; +}; + +static struct rdpup_os_bitmap* g_os_bitmaps = 0; +static int g_max_os_bitmaps = 0; +static int g_os_bitmap_stamp = 0; + +int g_pixmap_byte_total = 0; +int g_pixmap_num_used = 0; + /* 0 GXclear, 0 1 GXnor, DPon @@ -108,6 +121,86 @@ static int g_rdp_opcodes[16] = 0xff /* GXset 0xf 1 */ }; +/*****************************************************************************/ +int +rdpup_add_os_bitmap(PixmapPtr pixmap, rdpPixmapPtr priv) +{ + int index; + int rv; + int oldest; + int oldest_index; + + if (!g_connected) + { + return -1; + } + rv = -1; + index = 0; + while (index < g_max_os_bitmaps) + { + if (g_os_bitmaps[index].used == 0) + { + g_os_bitmaps[index].used = 1; + g_os_bitmaps[index].pixmap = pixmap; + g_os_bitmaps[index].priv = priv; + g_os_bitmaps[index].stamp = g_os_bitmap_stamp; + g_os_bitmap_stamp++; + g_pixmap_num_used++; + rv = index; + break; + } + index++; + } + if (rv == -1) + { + /* find oldest */ + oldest = 0x7fffffff; + oldest_index = 0; + index = 0; + while (index < g_max_os_bitmaps) + { + if (g_os_bitmaps[index].stamp < oldest) + { + oldest = g_os_bitmaps[index].stamp; + oldest_index = index; + } + index++; + } + LLOGLN(0, ("rdpup_add_os_bitmap: evicting old, oldest_index %d", oldest_index)); + /* evict old */ + g_os_bitmaps[oldest_index].priv->status = 0; + /* set new */ + g_os_bitmaps[oldest_index].pixmap = pixmap; + g_os_bitmaps[oldest_index].priv = priv; + g_os_bitmaps[oldest_index].stamp = g_os_bitmap_stamp; + g_os_bitmap_stamp++; + rv = oldest_index; + } + LLOGLN(0, ("rdpup_add_os_bitmap: new bitmap index %d", rv)); + LLOGLN(0, (" g_pixmap_num_used %d", g_pixmap_num_used)); + return rv; +} + +/*****************************************************************************/ +int +rdpup_remove_os_bitmap(int rdpindex) +{ + LLOGLN(0, ("rdpup_remove_os_bitmap: index %d", rdpindex)); + if ((rdpindex < 0) && (rdpindex >= g_max_os_bitmaps)) + { + return 1; + } + if (g_os_bitmaps[rdpindex].used) + { + g_os_bitmaps[rdpindex].used = 0; + g_os_bitmaps[rdpindex].pixmap = 0; + g_os_bitmaps[rdpindex].priv = 0; + g_pixmap_num_used--; + } + LLOGLN(0, (" g_pixmap_num_used %d", g_pixmap_num_used)); + return 0; +} + /*****************************************************************************/ /* returns error */ static int @@ -250,8 +343,8 @@ rdpup_recv(char* data, int len) g_tcp_close(g_sck); g_sck = 0; g_sck_closed = 1; - g_pixmap_byte_total = 0; - g_pixmap_num_used = 0; + //g_pixmap_byte_total = 0; + //g_pixmap_num_used = 0; return 1; } } @@ -262,8 +355,8 @@ rdpup_recv(char* data, int len) g_tcp_close(g_sck); g_sck = 0; g_sck_closed = 1; - g_pixmap_byte_total = 0; - g_pixmap_num_used = 0; + //g_pixmap_byte_total = 0; + //g_pixmap_num_used = 0; return 1; } else @@ -540,6 +633,15 @@ param4 %d\n", msg, param1, param2, param3, param4)); g_rdpScreen.client_info.offscreen_cache_size); ErrorF(" offscreen entries %d\n", g_rdpScreen.client_info.offscreen_cache_entries); + if (g_rdpScreen.client_info.offscreen_support_level > 0) + { + if (g_rdpScreen.client_info.offscreen_cache_entries > 0) + { + g_max_os_bitmaps = g_rdpScreen.client_info.offscreen_cache_entries; + g_os_bitmaps = (struct rdpup_os_bitmap*) + g_malloc(sizeof(struct rdpup_os_bitmap) * g_max_os_bitmaps, 1); + } + } } else { @@ -1085,7 +1187,7 @@ rdpup_set_cursor(short x, short y, char* cur_data, char* cur_mask) /******************************************************************************/ int -rdpup_create_os_surface(int rdpid, int width, int height) +rdpup_create_os_surface(int rdpindex, int width, int height) { LLOGLN(10, ("rdpup_create_os_surface:")); if (g_connected) @@ -1095,7 +1197,7 @@ rdpup_create_os_surface(int rdpid, int width, int height) out_uint16_le(g_out_s, 20); out_uint16_le(g_out_s, 12); g_count++; - out_uint32_le(g_out_s, rdpid); + out_uint32_le(g_out_s, rdpindex); out_uint16_le(g_out_s, width); out_uint16_le(g_out_s, height); } @@ -1104,53 +1206,40 @@ rdpup_create_os_surface(int rdpid, int width, int height) /******************************************************************************/ int -rdpup_switch_os_surface(int rdpid) +rdpup_switch_os_surface(int rdpindex) { LLOGLN(10, ("rdpup_switch_os_surface:")); if (g_connected) { - if (g_rdpid == rdpid) + if (g_rdpindex == rdpindex) { return 0; } - g_rdpid = rdpid; - rdpup_send_pending(); // TODO: do we need this ? - // the protocol allows switch the surface anytime - - LLOGLN(10, ("rdpup_switch_os_surface: rdpid %d", rdpid)); - + g_rdpindex = rdpindex; + LLOGLN(10, ("rdpup_switch_os_surface: rdpindex %d", rdpindex)); /* switch surface */ + rdpup_pre_check(8); out_uint16_le(g_out_s, 21); out_uint16_le(g_out_s, 8); - out_uint32_le(g_out_s, rdpid); - - /* begin update */ - out_uint16_le(g_out_s, 1); - out_uint16_le(g_out_s, 4); - g_begin = 1; - g_count = 2; - + out_uint32_le(g_out_s, rdpindex); + g_count++; } return 0; } /******************************************************************************/ int -rdpup_delete_os_surface(int rdpid) +rdpup_delete_os_surface(int rdpindex) { - LLOGLN(10, ("rdpup_delete_os_surface: rdpid %d", rdpid)); + LLOGLN(10, ("rdpup_delete_os_surface: rdpindex %d", rdpindex)); if (g_connected) { - LLOGLN(10, ("rdpup_delete_os_surface: rdpid %d", rdpid)); - //if (g_current_surface == rdpid) - //{ - // g_current_surface = -1; - //} + LLOGLN(10, ("rdpup_delete_os_surface: rdpindex %d", rdpindex)); rdpup_pre_check(8); out_uint16_le(g_out_s, 22); out_uint16_le(g_out_s, 8); g_count++; - out_uint32_le(g_out_s, rdpid); + out_uint32_le(g_out_s, rdpindex); } return 0; } @@ -1341,7 +1430,7 @@ rdpup_send_area(struct image_data* id, int x, int y, int w, int h) /******************************************************************************/ void rdpup_paint_rect_os(int x, int y, int cx, int cy, - int rdpid, int srcx, int srcy) + int rdpindex, int srcx, int srcy) { if (g_connected) { @@ -1353,7 +1442,7 @@ rdpup_paint_rect_os(int x, int y, int cx, int cy, out_uint16_le(g_out_s, y); out_uint16_le(g_out_s, cx); out_uint16_le(g_out_s, cy); - out_uint32_le(g_out_s, rdpid); + out_uint32_le(g_out_s, rdpindex); out_uint16_le(g_out_s, srcx); out_uint16_le(g_out_s, srcy); } diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h index e295408c..bc22a935 100644 --- a/xrdp/xrdp.h +++ b/xrdp/xrdp.h @@ -83,11 +83,11 @@ xrdp_cache_add_brush(struct xrdp_cache* self, char* brush_item_data); int APP_CC xrdp_cache_add_os_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap, - int id); + int rdpindex); int APP_CC -xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int id); +xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int rdpindex); struct xrdp_os_bitmap_item* APP_CC -xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int id); +xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int rdpindex); /* xrdp_wm.c */ struct xrdp_wm* APP_CC @@ -240,6 +240,8 @@ xrdp_painter_create(struct xrdp_wm* wm, struct xrdp_session* session); void APP_CC xrdp_painter_delete(struct xrdp_painter* self); int APP_CC +wm_painter_set_target(struct xrdp_painter* self); +int APP_CC xrdp_painter_begin_update(struct xrdp_painter* self); int APP_CC xrdp_painter_end_update(struct xrdp_painter* self); diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c index a63a8210..59c7c98b 100644 --- a/xrdp/xrdp_cache.c +++ b/xrdp/xrdp_cache.c @@ -541,76 +541,49 @@ xrdp_cache_add_brush(struct xrdp_cache* self, } /*****************************************************************************/ -/* returns index */ +/* returns error */ int APP_CC xrdp_cache_add_os_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap, - int id) + int rdpindex) { - int index; struct xrdp_os_bitmap_item* bi; - if (id < 1) + if ((rdpindex < 0) || (rdpindex >= 2000)) { - return -1; + return 1; } - index = 0; - for (index = 0; index < 2000; index++) - { - bi = self->os_bitmap_items + index; - if (bi->bitmap == 0) - { - bi->id = id; - bi->bitmap = bitmap; - //g_writeln("xrdp_cache_add_os_bitmap: bitmap id 0x%x added at index %d", id, index); - return index; - } - } - g_writeln("xrdp_cache_add_os_bitmap: bitmap id 0x%x not added, full", id); - return -1; + bi = self->os_bitmap_items + rdpindex; + bi->bitmap = bitmap; + return 0; } /*****************************************************************************/ -/* returns index */ +/* returns error */ int APP_CC -xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int id) +xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int rdpindex) { - int index; struct xrdp_os_bitmap_item* bi; - if (id < 1) - { - return -1; - } - for (index = 0; index < 2000; index++) + if ((rdpindex < 0) || (rdpindex >= 2000)) { - bi = self->os_bitmap_items + index; - if (bi->id == id) - { - xrdp_bitmap_delete(bi->bitmap); - g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item)); - //g_writeln("xrdp_cache_remove_os_bitmap: bitmap id 0x%x removed from index %d", id, index); - return index; - } + return 1; } - return -1; + bi = self->os_bitmap_items + rdpindex; + xrdp_bitmap_delete(bi->bitmap); + g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item)); + return 0; } /*****************************************************************************/ struct xrdp_os_bitmap_item* APP_CC -xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int id) +xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int rdpindex) { - int index; struct xrdp_os_bitmap_item* bi; - for (index = 0; index < 2000; index++) + if ((rdpindex < 0) || (rdpindex >= 2000)) { - bi = self->os_bitmap_items + index; - if (bi->id == id) - { - //g_writeln("xrdp_cache_get_os_bitmap: bitmap id 0x%x found at index %d", id, index); - return bi; - } + return 0; } - g_writeln("xrdp_cache_get_os_bitmap: bitmap id 0x%x not found", id); - return 0; + bi = self->os_bitmap_items + rdpindex; + return bi; } diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index f0ecc249..223b128b 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1594,81 +1594,99 @@ server_send_to_channel(struct xrdp_mod* mod, int channel_id, /*****************************************************************************/ int DEFAULT_CC -server_create_os_surface(struct xrdp_mod* mod, int id, +server_create_os_surface(struct xrdp_mod* mod, int rdpindex, int width, int height) { struct xrdp_wm* wm; struct xrdp_bitmap* bitmap; - int index; + int error; - //g_writeln("server_create_os_surface: id 0x%x, width %d height %d", - // id, width, height); wm = (struct xrdp_wm*)(mod->wm); bitmap = xrdp_bitmap_create(width, height, wm->screen->bpp, WND_TYPE_OFFSCREEN, wm); - bitmap->id = id; - index = xrdp_cache_add_os_bitmap(wm->cache, bitmap, id); - if (index < 0) + error = xrdp_cache_add_os_bitmap(wm->cache, bitmap, rdpindex); + if (error != 0) { g_writeln("server_create_os_surface: xrdp_cache_add_os_bitmap failed"); return 1; } - bitmap->item_index = index; + bitmap->item_index = rdpindex; + bitmap->id = rdpindex; return 0; } /*****************************************************************************/ int DEFAULT_CC -server_switch_os_surface(struct xrdp_mod* mod, int id) +server_switch_os_surface(struct xrdp_mod* mod, int rdpindex) { struct xrdp_wm* wm; struct xrdp_os_bitmap_item* bi; + struct xrdp_painter* p; //g_writeln("server_switch_os_surface: id 0x%x", id); wm = (struct xrdp_wm*)(mod->wm); - if (id == -1) + if (rdpindex == -1) { //g_writeln("server_switch_os_surface: setting target_surface to screen"); wm->target_surface = wm->screen; + p = (struct xrdp_painter*)(mod->painter); + if (p != 0) + { + //g_writeln("setting target"); + wm_painter_set_target(p); + } return 0; } - bi = xrdp_cache_get_os_bitmap(wm->cache, id); + bi = xrdp_cache_get_os_bitmap(wm->cache, rdpindex); if (bi != 0) { //g_writeln("server_switch_os_surface: setting target_surface to rdpid %d", id); wm->target_surface = bi->bitmap; + p = (struct xrdp_painter*)(mod->painter); + if (p != 0) + { + //g_writeln("setting target"); + wm_painter_set_target(p); + } } else { - g_writeln("server_switch_os_surface: error finding id 0x%x", id); + g_writeln("server_switch_os_surface: error finding id %d", rdpindex); } return 0; } /*****************************************************************************/ int DEFAULT_CC -server_delete_os_surface(struct xrdp_mod* mod, int id) +server_delete_os_surface(struct xrdp_mod* mod, int rdpindex) { struct xrdp_wm* wm; + struct xrdp_painter* p; //g_writeln("server_delete_os_surface: id 0x%x", id); wm = (struct xrdp_wm*)(mod->wm); if (wm->target_surface->type == WND_TYPE_OFFSCREEN) { - if (wm->target_surface->id == id) + if (wm->target_surface->id == rdpindex) { g_writeln("server_delete_os_surface: setting target_surface to screen"); wm->target_surface = wm->screen; + p = (struct xrdp_painter*)(mod->painter); + if (p != 0) + { + //g_writeln("setting target"); + wm_painter_set_target(p); + } } } - xrdp_cache_remove_os_bitmap(wm->cache, id); + xrdp_cache_remove_os_bitmap(wm->cache, rdpindex); return 0; } /*****************************************************************************/ int DEFAULT_CC server_paint_rect_os(struct xrdp_mod* mod, int x, int y, int cx, int cy, - int id, int srcx, int srcy) + int rdpindex, int srcx, int srcy) { struct xrdp_wm* wm; struct xrdp_bitmap* b; @@ -1681,7 +1699,7 @@ server_paint_rect_os(struct xrdp_mod* mod, int x, int y, int cx, int cy, return 0; } wm = (struct xrdp_wm*)(mod->wm); - bi = xrdp_cache_get_os_bitmap(wm->cache, id); + bi = xrdp_cache_get_os_bitmap(wm->cache, rdpindex); if (bi != 0) { b = bi->bitmap; @@ -1689,7 +1707,7 @@ server_paint_rect_os(struct xrdp_mod* mod, int x, int y, int cx, int cy, } else { - g_writeln("server_paint_rect_os: error finding id 0x%x", id); + g_writeln("server_paint_rect_os: error finding id %d", rdpindex); } return 0; } diff --git a/xrdp/xrdp_painter.c b/xrdp/xrdp_painter.c index 117d68a4..9cf9438d 100644 --- a/xrdp/xrdp_painter.c +++ b/xrdp/xrdp_painter.c @@ -49,16 +49,10 @@ xrdp_painter_delete(struct xrdp_painter* self) /*****************************************************************************/ int APP_CC -xrdp_painter_begin_update(struct xrdp_painter* self) +wm_painter_set_target(struct xrdp_painter* self) { int surface_index; - if (self == 0) - { - return 0; - } - libxrdp_orders_init(self->session); - if (self->wm->target_surface->type == WND_TYPE_SCREEN) { if (self->wm->current_surface_index != 0xffff) @@ -75,8 +69,8 @@ xrdp_painter_begin_update(struct xrdp_painter* self) if (self->wm->target_surface->tab_stop == 0) /* tab_stop is hack */ { libxrdp_orders_send_create_os_surface(self->session, surface_index, - self->wm->target_surface->width, - self->wm->target_surface->height); + self->wm->target_surface->width, + self->wm->target_surface->height); self->wm->target_surface->tab_stop = 1; } libxrdp_orders_send_switch_os_surface(self->session, surface_index); @@ -90,6 +84,19 @@ xrdp_painter_begin_update(struct xrdp_painter* self) return 0; } +/*****************************************************************************/ +int APP_CC +xrdp_painter_begin_update(struct xrdp_painter* self) +{ + if (self == 0) + { + return 0; + } + libxrdp_orders_init(self->session); + wm_painter_set_target(self); + return 0; +} + /*****************************************************************************/ int APP_CC xrdp_painter_end_update(struct xrdp_painter* self) @@ -667,13 +674,13 @@ xrdp_painter_copy(struct xrdp_painter* self, region = xrdp_region_create(self->wm); if (dst->type != WND_TYPE_OFFSCREEN) { - g_writeln("off screen to screen"); + //g_writeln("off screen to screen"); xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, region, self->clip_children); } else { - g_writeln("off screen to off screen"); + //g_writeln("off screen to off screen"); xrdp_region_add_rect(region, &clip_rect); } x += dx; diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h index 73bb066c..a54fd85c 100644 --- a/xrdp/xrdp_types.h +++ b/xrdp/xrdp_types.h @@ -80,13 +80,13 @@ struct xrdp_mod char* data, int data_len, int total_data_len, int flags); int (*server_bell_trigger)(struct xrdp_mod* v); - int (*server_create_os_surface)(struct xrdp_mod* v, int id, + int (*server_create_os_surface)(struct xrdp_mod* v, int rdpindex, int width, int height); - int (*server_switch_os_surface)(struct xrdp_mod* v, int id); - int (*server_delete_os_surface)(struct xrdp_mod* v, int id); + int (*server_switch_os_surface)(struct xrdp_mod* v, int rdpindex); + int (*server_delete_os_surface)(struct xrdp_mod* v, int rdpindex); int (*server_paint_rect_os)(struct xrdp_mod* mod, int x, int y, int cx, int cy, - int id, int srcx, int srcy); + int rdpindex, int srcx, int srcy); int (*server_set_hints)(struct xrdp_mod* mod, int hints, int mask); long server_dumby[100 - 30]; /* align, 100 minus the number of server functions above */ diff --git a/xup/xup.h b/xup/xup.h index 9e0a4489..75226fe7 100644 --- a/xup/xup.h +++ b/xup/xup.h @@ -88,13 +88,13 @@ struct mod char* data, int data_len, int total_data_len, int flags); int (*server_bell_trigger)(struct mod* v); - int (*server_create_os_surface)(struct mod* v, int id, + int (*server_create_os_surface)(struct mod* v, int rdpindex, int width, int height); - int (*server_switch_os_surface)(struct mod* v, int id); - int (*server_delete_os_surface)(struct mod* v, int id); + int (*server_switch_os_surface)(struct mod* v, int rdpindex); + int (*server_delete_os_surface)(struct mod* v, int rdpindex); int (*server_paint_rect_os)(struct mod* v, int x, int y, int cx, int cy, - int id, int srcx, int srcy); + int rdpindex, int srcx, int srcy); int (*server_set_hints)(struct mod* v, int hints, int mask); tbus server_dumby[100 - 30]; /* align, 100 minus the number of server functions above */