aboutsummaryrefslogtreecommitdiffstats
path: root/testing/xrdp-git/cd077979ebeb81a6e85a9ba7f9c463beda1606ba.patch
blob: c50e7b11847fc29c81c3bf90043b29280b87ed3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From cd077979ebeb81a6e85a9ba7f9c463beda1606ba Mon Sep 17 00:00:00 2001
From: Jay Sorg <jay.sorg@gmail.com>
Date: Thu, 30 Jul 2015 14:09:00 -0700
Subject: [PATCH] fix for clientClipType removed in newer xorg versions

---
 module/rdpDraw.c | 64 +++++++++++++++++++++++++++++++-------------------------
 1 file changed, 35 insertions(+), 29 deletions(-)

diff --git a/module/rdpDraw.c b/module/rdpDraw.c
index 5772923..605c511 100644
--- a/xorgxrdp/module/rdpDraw.c
+++ b/xorgxrdp/module/rdpDraw.c
@@ -50,6 +50,21 @@ misc draw calls
 #define LLOGLN(_level, _args) \
     do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
 
+#if !defined(XORG_VERSION_CURRENT)
+#warning XORG_VERSION_CURRENT not defined
+#endif
+
+/******************************************************************************/
+static int
+is_clientClip_region(GCPtr gc)
+{
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1, 16, 99, 901, 0)
+    return gc->clientClipType == CT_REGION;
+#else
+    return gc->clientClip != NULL;
+#endif
+}
+
 /******************************************************************************/
 /* return 0, draw nothing */
 /* return 1, draw with no clip */
@@ -66,19 +81,15 @@ rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC)
 
     if (pDrawable->type == DRAWABLE_PIXMAP)
     {
-        switch (pGC->clientClipType)
+        if (is_clientClip_region(pGC))
         {
-            case CT_NONE:
-                rv = 1;
-                break;
-            case CT_REGION:
-                rv = 2;
-                rdpRegionCopy(pRegion, pGC->clientClip);
-                break;
-            default:
-                LLOGLN(0, ("rdpDrawGetClip: unimp clip type %d",
-                       pGC->clientClipType));
-                break;
+            miComputeCompositeClip(pGC, pDrawable);
+            RegionCopy(pRegion, pGC->pCompositeClip);
+            rv = 2;
+        }
+        else
+        {
+            rv = 1;
         }
 
         if (rv == 2) /* check if the clip is the entire pixmap */
@@ -111,24 +122,19 @@ rdpDrawGetClip(rdpPtr dev, RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC)
 
             if (rdpRegionNotEmpty(temp))
             {
-                switch (pGC->clientClipType)
+                if (is_clientClip_region(pGC))
+                {
+                    rdpRegionCopy(pRegion, pGC->clientClip);
+                    rdpRegionTranslate(pRegion,
+                                       pDrawable->x + pGC->clipOrg.x,
+                                       pDrawable->y + pGC->clipOrg.y);
+                    rdpRegionIntersect(pRegion, pRegion, temp);
+                    rv = 2;
+                }
+                else
                 {
-                    case CT_NONE:
-                        rv = 2;
-                        rdpRegionCopy(pRegion, temp);
-                        break;
-                    case CT_REGION:
-                        rv = 2;
-                        rdpRegionCopy(pRegion, pGC->clientClip);
-                        rdpRegionTranslate(pRegion,
-                                           pDrawable->x + pGC->clipOrg.x,
-                                           pDrawable->y + pGC->clipOrg.y);
-                        rdpRegionIntersect(pRegion, pRegion, temp);
-                        break;
-                    default:
-                        LLOGLN(0, ("rdpDrawGetClip: unimp clip type %d",
-                               pGC->clientClipType));
-                        break;
+                    rdpRegionCopy(pRegion, temp);
+                    rv = 2;
                 }
 
                 if (rv == 2) /* check if the clip is the entire screen */