1 |
From ec6007e6f7772a90713c9c51c64359229961ce27 Mon Sep 17 00:00:00 2001
|
2 |
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
|
3 |
Date: Sun, 6 Apr 2014 05:32:00 -0700
|
4 |
Subject: [PATCH] XQuartz: Ensure we wait for the server thread to terminate
|
5 |
|
6 |
AKA: XQuartz 2.7.5 doesn't delete its /tmp/.X$d-lock
|
7 |
|
8 |
http://xquartz.macosforge.org/trac/ticket/823
|
9 |
|
10 |
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
|
11 |
---
|
12 |
hw/xquartz/X11Controller.m | 5 ++---
|
13 |
1 file changed, 2 insertions(+), 3 deletions(-)
|
14 |
|
15 |
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
|
16 |
index 5445c6f..022e832 100644
|
17 |
--- a/hw/xquartz/X11Controller.m
|
18 |
+++ b/hw/xquartz/X11Controller.m
|
19 |
@@ -942,9 +942,8 @@ extern char *bundle_id_prefix;
|
20 |
/* shutdown the X server, it will exit () for us. */
|
21 |
DarwinSendDDXEvent(kXquartzQuit, 0);
|
22 |
|
23 |
- /* In case it doesn't, exit anyway after a while. */
|
24 |
- remain = 10000000;
|
25 |
- while ((remain = usleep(remain)) > 0) ;
|
26 |
+ /* In case it doesn't, exit anyway after 5s. */
|
27 |
+ [NSThread sleepForTimeInterval:5.0];
|
28 |
|
29 |
exit(1);
|
30 |
}
|
31 |
--
|
32 |
1.9.1
|
33 |
|
34 |
From 152a52f607d68c65683eebc61cbb288ec2670b2a Mon Sep 17 00:00:00 2001
|
35 |
From: Jeremy Huddleston <jeremyhu@apple.com>
|
36 |
Date: Fri, 30 Apr 2010 13:08:25 -0700
|
37 |
Subject: [PATCH 5001/5004] Workaround the GC clipping problem in miPaintWindow
|
38 |
and add some debugging output.
|
39 |
|
40 |
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
41 |
---
|
42 |
mi/miexpose.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
|
43 |
1 file changed, 94 insertions(+), 10 deletions(-)
|
44 |
|
45 |
diff --git a/mi/miexpose.c b/mi/miexpose.c
|
46 |
index 8b7c93f..3e972f7 100644
|
47 |
--- a/mi/miexpose.c
|
48 |
+++ b/mi/miexpose.c
|
49 |
@@ -489,7 +489,8 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
|
50 |
void RootlessStartDrawing(WindowPtr pWin);
|
51 |
void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
|
52 |
Bool IsFramedWindow(WindowPtr pWin);
|
53 |
-#endif
|
54 |
+#include "../fb/fb.h"
|
55 |
+#endif
|
56 |
|
57 |
void
|
58 |
miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
59 |
@@ -518,23 +519,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
60 |
Bool solid = TRUE;
|
61 |
DrawablePtr drawable = &pWin->drawable;
|
62 |
|
63 |
+#ifdef XQUARTZ_CLIP_DEBUG
|
64 |
+ ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
|
65 |
+ ErrorF(" Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
|
66 |
+ prgn->extents.x2 - prgn->extents.x1,
|
67 |
+ prgn->extents.y2 - prgn->extents.y1);
|
68 |
+ ErrorF(" Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
|
69 |
+ pWin->winSize.extents.x1, pWin->winSize.extents.y1,
|
70 |
+ pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
|
71 |
+ pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
|
72 |
+ ErrorF(" Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
|
73 |
+ pWin->drawable.width, pWin->drawable.height);
|
74 |
+#endif
|
75 |
+
|
76 |
#ifdef ROOTLESS
|
77 |
if (!drawable || drawable->type == UNDRAWABLE_WINDOW)
|
78 |
return;
|
79 |
+#endif
|
80 |
+
|
81 |
+ if (what == PW_BACKGROUND)
|
82 |
+ {
|
83 |
+#ifdef ROOTLESS
|
84 |
+ if(IsFramedWindow(pWin)) {
|
85 |
+ RootlessStartDrawing(pWin);
|
86 |
+ RootlessDamageRegion(pWin, prgn);
|
87 |
|
88 |
- if (IsFramedWindow(pWin)) {
|
89 |
- RootlessStartDrawing(pWin);
|
90 |
- RootlessDamageRegion(pWin, prgn);
|
91 |
-
|
92 |
- if (pWin->backgroundState == ParentRelative) {
|
93 |
- if ((what == PW_BACKGROUND) ||
|
94 |
- (what == PW_BORDER && !pWin->borderIsPixel))
|
95 |
+ if(pWin->backgroundState == ParentRelative) {
|
96 |
RootlessSetPixmapOfAncestors(pWin);
|
97 |
+ }
|
98 |
}
|
99 |
- }
|
100 |
#endif
|
101 |
|
102 |
- if (what == PW_BACKGROUND) {
|
103 |
while (pWin->backgroundState == ParentRelative)
|
104 |
pWin = pWin->parent;
|
105 |
|
106 |
@@ -559,6 +574,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
107 |
else {
|
108 |
PixmapPtr pixmap;
|
109 |
|
110 |
+#ifdef ROOTLESS
|
111 |
+ if(IsFramedWindow(pWin)) {
|
112 |
+ RootlessStartDrawing(pWin);
|
113 |
+ RootlessDamageRegion(pWin, prgn);
|
114 |
+
|
115 |
+ if(!pWin->borderIsPixel &&
|
116 |
+ pWin->backgroundState == ParentRelative) {
|
117 |
+ RootlessSetPixmapOfAncestors(pWin);
|
118 |
+ }
|
119 |
+ }
|
120 |
+#endif
|
121 |
+
|
122 |
tile_x_off = drawable->x;
|
123 |
tile_y_off = drawable->y;
|
124 |
|
125 |
@@ -567,6 +594,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
126 |
return;
|
127 |
pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
|
128 |
drawable = &pixmap->drawable;
|
129 |
+
|
130 |
+#ifdef XQUARTZ_CLIP_DEBUG
|
131 |
+ ErrorF(" Draw: %d %d %d %d\n",
|
132 |
+ drawable->x, drawable->y, drawable->width, drawable->height);
|
133 |
+#endif
|
134 |
+
|
135 |
#ifdef COMPOSITE
|
136 |
draw_x_off = pixmap->screen_x;
|
137 |
draw_y_off = pixmap->screen_y;
|
138 |
@@ -629,6 +662,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
|
139 |
ChangeGC(NullClient, pGC, gcmask, gcval);
|
140 |
ValidateGC(drawable, pGC);
|
141 |
|
142 |
+#ifdef XQUARTZ_CLIP_DEBUG
|
143 |
+ ErrorF(" GC: %d %d %d %d\n",
|
144 |
+ pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
|
145 |
+ pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
|
146 |
+ pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
|
147 |
+#endif
|
148 |
+
|
149 |
+#ifdef XQUARTZ
|
150 |
+ /* Looks like our clipping isn't set right for some reason:
|
151 |
+ * http://xquartz.macosforge.org/trac/ticket/290
|
152 |
+ */
|
153 |
+ if(what == PW_BORDER) {
|
154 |
+
|
155 |
+#if 0
|
156 |
+ if(solid) {
|
157 |
+#if 1
|
158 |
+ fbFillRegionSolid(&pWin->drawable,
|
159 |
+ prgn,
|
160 |
+ 0,
|
161 |
+ fbReplicatePixel(fill.pixel,
|
162 |
+ pWin->drawable.bitsPerPixel));
|
163 |
+#else
|
164 |
+ fbFillRegionSolid(drawable,
|
165 |
+ prgn,
|
166 |
+ 0,
|
167 |
+ fbReplicatePixel(fill.pixel,
|
168 |
+ drawable->bitsPerPixel));
|
169 |
+#endif
|
170 |
+ return;
|
171 |
+ }
|
172 |
+#endif
|
173 |
+
|
174 |
+ pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
|
175 |
+ pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
|
176 |
+ pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
|
177 |
+ pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
|
178 |
+
|
179 |
+ if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
|
180 |
+ pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
|
181 |
+ if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
|
182 |
+ pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
|
183 |
+ }
|
184 |
+#endif
|
185 |
+
|
186 |
+#ifdef XQUARTZ_CLIP_DEBUG
|
187 |
+ ErrorF(" GC: %d %d %d %d\n",
|
188 |
+ pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
|
189 |
+ pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
|
190 |
+ pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
|
191 |
+#endif
|
192 |
+
|
193 |
numRects = RegionNumRects(prgn);
|
194 |
pbox = RegionRects(prgn);
|
195 |
for (i = numRects; --i >= 0; pbox++, prect++) {
|
196 |
--
|
197 |
1.9.1
|
198 |
|