1 | --- a/mi/miexpose.c.orig 2015-10-27 21:12:01.000000000 +0100 |
---|
2 | +++ a/mi/miexpose.c 2015-11-25 22:49:47.000000000 +0100 |
---|
3 | @@ -408,7 +408,8 @@ |
---|
4 | void RootlessStartDrawing(WindowPtr pWin); |
---|
5 | void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn); |
---|
6 | Bool IsFramedWindow(WindowPtr pWin); |
---|
7 | -#endif |
---|
8 | +#include "../fb/fb.h" |
---|
9 | +#endif |
---|
10 | |
---|
11 | void |
---|
12 | miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) |
---|
13 | @@ -437,23 +438,37 @@ |
---|
14 | Bool solid = TRUE; |
---|
15 | DrawablePtr drawable = &pWin->drawable; |
---|
16 | |
---|
17 | +#ifdef XQUARTZ_CLIP_DEBUG |
---|
18 | + ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative); |
---|
19 | + ErrorF(" Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1, |
---|
20 | + prgn->extents.x2 - prgn->extents.x1, |
---|
21 | + prgn->extents.y2 - prgn->extents.y1); |
---|
22 | + ErrorF(" Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y, |
---|
23 | + pWin->winSize.extents.x1, pWin->winSize.extents.y1, |
---|
24 | + pWin->winSize.extents.x2 - pWin->winSize.extents.x1, |
---|
25 | + pWin->winSize.extents.y2 - pWin->winSize.extents.y1); |
---|
26 | + ErrorF(" Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y, |
---|
27 | + pWin->drawable.width, pWin->drawable.height); |
---|
28 | +#endif |
---|
29 | + |
---|
30 | #ifdef ROOTLESS |
---|
31 | if (!drawable || drawable->type == UNDRAWABLE_WINDOW) |
---|
32 | return; |
---|
33 | +#endif |
---|
34 | + |
---|
35 | + if (what == PW_BACKGROUND) |
---|
36 | + { |
---|
37 | +#ifdef ROOTLESS |
---|
38 | + if(IsFramedWindow(pWin)) { |
---|
39 | + RootlessStartDrawing(pWin); |
---|
40 | + RootlessDamageRegion(pWin, prgn); |
---|
41 | |
---|
42 | - if (IsFramedWindow(pWin)) { |
---|
43 | - RootlessStartDrawing(pWin); |
---|
44 | - RootlessDamageRegion(pWin, prgn); |
---|
45 | - |
---|
46 | - if (pWin->backgroundState == ParentRelative) { |
---|
47 | - if ((what == PW_BACKGROUND) || |
---|
48 | - (what == PW_BORDER && !pWin->borderIsPixel)) |
---|
49 | + if(pWin->backgroundState == ParentRelative) { |
---|
50 | RootlessSetPixmapOfAncestors(pWin); |
---|
51 | + } |
---|
52 | } |
---|
53 | - } |
---|
54 | #endif |
---|
55 | |
---|
56 | - if (what == PW_BACKGROUND) { |
---|
57 | while (pWin->backgroundState == ParentRelative) |
---|
58 | pWin = pWin->parent; |
---|
59 | |
---|
60 | @@ -478,6 +493,18 @@ |
---|
61 | else { |
---|
62 | PixmapPtr pixmap; |
---|
63 | |
---|
64 | +#ifdef ROOTLESS |
---|
65 | + if(IsFramedWindow(pWin)) { |
---|
66 | + RootlessStartDrawing(pWin); |
---|
67 | + RootlessDamageRegion(pWin, prgn); |
---|
68 | + |
---|
69 | + if(!pWin->borderIsPixel && |
---|
70 | + pWin->backgroundState == ParentRelative) { |
---|
71 | + RootlessSetPixmapOfAncestors(pWin); |
---|
72 | + } |
---|
73 | + } |
---|
74 | +#endif |
---|
75 | + |
---|
76 | fill = pWin->border; |
---|
77 | solid = pWin->borderIsPixel; |
---|
78 | |
---|
79 | @@ -487,6 +514,11 @@ |
---|
80 | pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable); |
---|
81 | drawable = &pixmap->drawable; |
---|
82 | |
---|
83 | +#ifdef XQUARTZ_CLIP_DEBUG |
---|
84 | + ErrorF(" Draw: %d %d %d %d\n", |
---|
85 | + drawable->x, drawable->y, drawable->width, drawable->height); |
---|
86 | +#endif |
---|
87 | + |
---|
88 | while (pWin->backgroundState == ParentRelative) |
---|
89 | pWin = pWin->parent; |
---|
90 | |
---|
91 | @@ -553,6 +585,57 @@ |
---|
92 | ChangeGC(NullClient, pGC, gcmask, gcval); |
---|
93 | ValidateGC(drawable, pGC); |
---|
94 | |
---|
95 | +#ifdef XQUARTZ_CLIP_DEBUG |
---|
96 | + ErrorF(" GC: %d %d %d %d\n", |
---|
97 | + pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1, |
---|
98 | + pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1, |
---|
99 | + pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1); |
---|
100 | +#endif |
---|
101 | + |
---|
102 | +#ifdef XQUARTZ |
---|
103 | + /* Looks like our clipping isn't set right for some reason: |
---|
104 | + * http://xquartz.macosforge.org/trac/ticket/290 |
---|
105 | + */ |
---|
106 | + if(what == PW_BORDER) { |
---|
107 | + |
---|
108 | +#if 0 |
---|
109 | + if(solid) { |
---|
110 | +#if 1 |
---|
111 | + fbFillRegionSolid(&pWin->drawable, |
---|
112 | + prgn, |
---|
113 | + 0, |
---|
114 | + fbReplicatePixel(fill.pixel, |
---|
115 | + pWin->drawable.bitsPerPixel)); |
---|
116 | +#else |
---|
117 | + fbFillRegionSolid(drawable, |
---|
118 | + prgn, |
---|
119 | + 0, |
---|
120 | + fbReplicatePixel(fill.pixel, |
---|
121 | + drawable->bitsPerPixel)); |
---|
122 | +#endif |
---|
123 | + return; |
---|
124 | + } |
---|
125 | +#endif |
---|
126 | + |
---|
127 | + pGC->pCompositeClip->extents.x1 += prgn->extents.x1; |
---|
128 | + pGC->pCompositeClip->extents.y1 += prgn->extents.y1; |
---|
129 | + pGC->pCompositeClip->extents.x2 += prgn->extents.x1; |
---|
130 | + pGC->pCompositeClip->extents.y2 += prgn->extents.y1; |
---|
131 | + |
---|
132 | + if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width) |
---|
133 | + pGC->pCompositeClip->extents.x2 = drawable->pScreen->width; |
---|
134 | + if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height) |
---|
135 | + pGC->pCompositeClip->extents.y2 = drawable->pScreen->height; |
---|
136 | + } |
---|
137 | +#endif |
---|
138 | + |
---|
139 | +#ifdef XQUARTZ_CLIP_DEBUG |
---|
140 | + ErrorF(" GC: %d %d %d %d\n", |
---|
141 | + pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1, |
---|
142 | + pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1, |
---|
143 | + pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1); |
---|
144 | +#endif |
---|
145 | + |
---|
146 | numRects = RegionNumRects(prgn); |
---|
147 | pbox = RegionRects(prgn); |
---|
148 | for (i = numRects; --i >= 0; pbox++, prect++) { |
---|