1 |
mrpouet 10/01/31 16:49:46 |
2 |
|
3 |
Added: compiz-0.8.4-crash-on-opening-windows.patch |
4 |
compiz-0.8.4-place-plugin.patch |
5 |
Log: |
6 |
Fix crash on opening windows, and placement mode. Replace URI per a bziped tarball, per bug #302308. Many thanks to Denilson. |
7 |
(Portage version: 2.2_rc62/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 x11-wm/compiz/files/compiz-0.8.4-crash-on-opening-windows.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-wm/compiz/files/compiz-0.8.4-crash-on-opening-windows.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-wm/compiz/files/compiz-0.8.4-crash-on-opening-windows.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: compiz-0.8.4-crash-on-opening-windows.patch |
16 |
=================================================================== |
17 |
From 43c269a377e7b446fb1bb70732835b7395ce9524 Mon Sep 17 00:00:00 2001 |
18 |
From: Danny Baumann <dannybaumann@×××.de> |
19 |
Date: Mon, 25 Jan 2010 06:28:34 +0000 |
20 |
Subject: Fix crash on opening windows. |
21 |
|
22 |
We must defer match evaluation until window initialization has finished |
23 |
for all plugins as match evaluation means wrapped function calls. |
24 |
--- |
25 |
diff --git a/plugins/obs.c b/plugins/obs.c |
26 |
index a8d67f1..0f5b9d0 100644 |
27 |
--- a/plugins/obs.c |
28 |
+++ b/plugins/obs.c |
29 |
@@ -88,6 +88,8 @@ typedef struct _ObsWindow |
30 |
{ |
31 |
int customFactor[MODIFIER_COUNT]; |
32 |
int matchFactor[MODIFIER_COUNT]; |
33 |
+ |
34 |
+ CompTimeoutHandle updateHandle; |
35 |
} ObsWindow; |
36 |
|
37 |
#define GET_OBS_DISPLAY(d) \ |
38 |
@@ -323,6 +325,22 @@ obsMatchPropertyChanged (CompDisplay *d, |
39 |
WRAP (od, d, matchPropertyChanged, obsMatchPropertyChanged); |
40 |
} |
41 |
|
42 |
+static Bool |
43 |
+obsUpdateWindow (void *closure) |
44 |
+{ |
45 |
+ CompWindow *w = (CompWindow *) closure; |
46 |
+ int i; |
47 |
+ |
48 |
+ OBS_WINDOW (w); |
49 |
+ |
50 |
+ for (i = 0; i < MODIFIER_COUNT; i++) |
51 |
+ updatePaintModifier (w, i); |
52 |
+ |
53 |
+ ow->updateHandle = 0; |
54 |
+ |
55 |
+ return FALSE; |
56 |
+} |
57 |
+ |
58 |
static CompOption * |
59 |
obsGetDisplayOptions (CompPlugin *p, |
60 |
CompDisplay *display, |
61 |
@@ -628,8 +646,8 @@ static CompBool |
62 |
obsInitWindow (CompPlugin *p, |
63 |
CompWindow *w) |
64 |
{ |
65 |
- ObsWindow *ow; |
66 |
- int i; |
67 |
+ ObsWindow *ow; |
68 |
+ int i; |
69 |
|
70 |
OBS_SCREEN (w->screen); |
71 |
|
72 |
@@ -643,10 +661,11 @@ obsInitWindow (CompPlugin *p, |
73 |
ow->matchFactor[i] = 100; |
74 |
} |
75 |
|
76 |
- w->base.privates[os->windowPrivateIndex].ptr = ow; |
77 |
+ /* defer initializing the factors from window matches as match evalution |
78 |
+ means wrapped function calls */ |
79 |
+ ow->updateHandle = compAddTimeout (0, 0, obsUpdateWindow, w); |
80 |
|
81 |
- for (i = 0; i < MODIFIER_COUNT; i++) |
82 |
- updatePaintModifier (w, i); |
83 |
+ w->base.privates[os->windowPrivateIndex].ptr = ow; |
84 |
|
85 |
return TRUE; |
86 |
} |
87 |
@@ -657,6 +676,9 @@ obsFiniWindow (CompPlugin *p, |
88 |
{ |
89 |
OBS_WINDOW (w); |
90 |
|
91 |
+ if (ow->updateHandle) |
92 |
+ compRemoveTimeout (ow->updateHandle); |
93 |
+ |
94 |
free (ow); |
95 |
} |
96 |
|
97 |
-- |
98 |
cgit v0.8.2 |
99 |
|
100 |
|
101 |
|
102 |
1.1 x11-wm/compiz/files/compiz-0.8.4-place-plugin.patch |
103 |
|
104 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-wm/compiz/files/compiz-0.8.4-place-plugin.patch?rev=1.1&view=markup |
105 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-wm/compiz/files/compiz-0.8.4-place-plugin.patch?rev=1.1&content-type=text/plain |
106 |
|
107 |
Index: compiz-0.8.4-place-plugin.patch |
108 |
=================================================================== |
109 |
From db88fb6f3f6c0fa3c81bc04a2a3468252d49f098 Mon Sep 17 00:00:00 2001 |
110 |
From: Danny Baumann <dannybaumann@×××.de> |
111 |
Date: Sun, 31 Jan 2010 12:36:42 +0000 |
112 |
Subject: Fix handling of windows that have a server border set. |
113 |
|
114 |
Also handle windows that have a server border set properly in pointer |
115 |
(placement mode) |
116 |
|
117 |
--- |
118 |
diff --git a/plugins/place.c b/plugins/place.c |
119 |
index d59de33..a54e60a 100644 |
120 |
--- a/plugins/place.c |
121 |
+++ b/plugins/place.c |
122 |
@@ -131,12 +131,15 @@ typedef enum { |
123 |
|
124 |
/* helper macros to get the full dimensions of a window, |
125 |
including decorations */ |
126 |
+#define BORDER_WIDTH(w) ((w)->input.left + (w)->input.right + \ |
127 |
+ 2 * (w)->serverBorderWidth) |
128 |
+#define BORDER_HEIGHT(w) ((w)->input.top + (w)->input.bottom + \ |
129 |
+ 2 * (w)->serverBorderWidth) |
130 |
+ |
131 |
#define WIN_FULL_X(w) ((w)->serverX - (w)->input.left) |
132 |
#define WIN_FULL_Y(w) ((w)->serverY - (w)->input.top) |
133 |
-#define WIN_FULL_W(w) ((w)->serverWidth + 2 * (w)->serverBorderWidth + \ |
134 |
- (w)->input.left + (w)->input.right) |
135 |
-#define WIN_FULL_H(w) ((w)->serverHeight + 2 * (w)->serverBorderWidth + \ |
136 |
- (w)->input.top + (w)->input.bottom) |
137 |
+#define WIN_FULL_W(w) ((w)->serverWidth + BORDER_WIDTH (w)) |
138 |
+#define WIN_FULL_H(w) ((w)->serverHeight + BORDER_HEIGHT (w)) |
139 |
|
140 |
static Bool |
141 |
placeMatchXYValue (CompWindow *w, |
142 |
@@ -1216,8 +1219,8 @@ placeConstrainToWorkarea (CompWindow *w, |
143 |
|
144 |
extents.left = *x - w->input.left; |
145 |
extents.top = *y - w->input.top; |
146 |
- extents.right = *x + w->serverWidth + w->input.right; |
147 |
- extents.bottom = *y + w->serverHeight + w->input.bottom; |
148 |
+ extents.right = extents.left + WIN_FULL_W (w); |
149 |
+ extents.bottom = extents.top + WIN_FULL_H (w); |
150 |
|
151 |
delta = workArea->x + workArea->width - extents.right; |
152 |
if (delta < 0) |
153 |
@@ -1419,9 +1422,9 @@ placeDoValidateWindowResizeRequest (CompWindow *w, |
154 |
} |
155 |
|
156 |
left = x - w->input.left; |
157 |
- right = x + xwc->width + w->input.right; |
158 |
+ right = left + xwc->width + BORDER_WIDTH (w); |
159 |
top = y - w->input.top; |
160 |
- bottom = y + xwc->height + w->input.bottom; |
161 |
+ bottom = top + xwc->height + BORDER_HEIGHT (w); |
162 |
|
163 |
output = outputDeviceForGeometry (s, |
164 |
xwc->x, xwc->y, |
165 |
@@ -1484,9 +1487,9 @@ placeDoValidateWindowResizeRequest (CompWindow *w, |
166 |
|
167 |
/* bring left/right/top/bottom to actual window coordinates */ |
168 |
left += w->input.left; |
169 |
- right -= w->input.right; |
170 |
+ right -= w->input.right + 2 * w->serverBorderWidth; |
171 |
top += w->input.top; |
172 |
- bottom -= w->input.bottom; |
173 |
+ bottom -= w->input.bottom + 2 * w->serverBorderWidth; |
174 |
|
175 |
if ((right - left) != xwc->width) |
176 |
{ |
177 |
@@ -1886,17 +1889,13 @@ placeDoHandleScreenSizeChange (CompScreen *s, |
178 |
{ |
179 |
mask |= CWX | CWWidth; |
180 |
xwc.x = vpX * s->width + workArea.x + w->input.left; |
181 |
- xwc.width = workArea.width - |
182 |
- (2 * w->serverBorderWidth + |
183 |
- w->input.left + w->input.right); |
184 |
+ xwc.width = workArea.width - BORDER_WIDTH (w); |
185 |
} |
186 |
if (w->state & CompWindowStateMaximizedVertMask) |
187 |
{ |
188 |
mask |= CWY | CWHeight; |
189 |
xwc.y = vpY * s->height + workArea.y + w->input.top; |
190 |
- xwc.height = workArea.height - |
191 |
- (2 * w->serverBorderWidth + |
192 |
- w->input.top + w->input.bottom); |
193 |
+ xwc.height = workArea.height - BORDER_HEIGHT (w); |
194 |
} |
195 |
} |
196 |
} |
197 |
--- a/plugins/place.c |
198 |
+++ b/plugins/place.c |
199 |
@@ -847,8 +847,8 @@ placePointer (CompWindow *w, |
200 |
|
201 |
if (placeGetPointerPosition (w->screen, &xPointer, &yPointer)) |
202 |
{ |
203 |
- *x = xPointer - (w->serverWidth / 2); |
204 |
- *y = yPointer - (w->serverHeight / 2); |
205 |
+ *x = xPointer - (w->serverWidth / 2) - w->serverBorderWidth; |
206 |
+ *y = yPointer - (w->serverHeight / 2) - w->serverBorderWidth; |
207 |
} |
208 |
else |
209 |
{ |
210 |
-- |
211 |
cgit v0.8.2 |