Merge lp:~mterry/notify-osd/no-border into lp:~canonical-dx-team/notify-osd/precise
- no-border
- Merge into precise
Status: | Merged |
---|---|
Approved by: | Allan LeSage |
Approved revision: | 457 |
Merged at revision: | 457 |
Proposed branch: | lp:~mterry/notify-osd/no-border |
Merge into: | lp:~canonical-dx-team/notify-osd/precise |
Diff against target: |
770 lines (+212/-178) 5 files modified
src/bubble.c (+162/-138) src/defaults.c (+23/-22) src/defaults.h (+4/-3) src/display.c (+13/-10) src/stack.c (+10/-5) |
To merge this branch: | bzr merge lp:~mterry/notify-osd/no-border |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Didier Roche-Tolomelli | Approve | ||
jenkins (community) | continuous-integration | Approve | |
Mirco Müller | Pending | ||
Review via email: mp+121956@code.launchpad.net |
Commit message
Description of the change
When running without a compositor, there is an ugly black border.
This branch fixes that by:
1) Adding an 'is_composited' argument to defaults_
2) Adding a 'GdkScreen **screen' argument to defaults_
3) Using these throughout to check composited state wherever these are used.
Additionally, I had to add some oddness in bubble.c for _refresh_
jenkins (martin-mrazik+qa) wrote : | # |
Omer Akram (om26er) wrote : | # |
This fix is worth having in Quantal for a better user experience. Since now notfy-osd appears at the login screen where no compositor is running so this problem becomes more visible than it used to be.
Michael Terry (mterry) wrote : | # |
I already patched this into quantal, so no worries from a timing perspective.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:457
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Didier Roche-Tolomelli (didrocks) wrote : | # |
was never approved and it's in ubuntu for a while, approving.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Allan LeSage (allanlesage) wrote : | # |
Will kick off this job again--caught in-between landing inline packaging.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
Approved revid is not set in launchpad (maybe a permission problem?).
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Allan LeSage (allanlesage) wrote : | # |
Apologies; will *approve* and thereby kick off again.
Preview Diff
1 | === modified file 'src/bubble.c' |
2 | --- src/bubble.c 2012-03-09 21:20:47 +0000 |
3 | +++ src/bubble.c 2012-08-29 22:11:20 +0000 |
4 | @@ -487,6 +487,22 @@ |
5 | cairo_surface_destroy (new_surface); |
6 | } |
7 | |
8 | +static gdouble |
9 | +get_shadow_size (Bubble *bubble) |
10 | +{ |
11 | + BubblePrivate* priv = GET_PRIVATE (bubble); |
12 | + Defaults* d = bubble->defaults; |
13 | + return defaults_get_bubble_shadow_size (d, priv->composited); |
14 | +} |
15 | + |
16 | +static gdouble |
17 | +get_corner_radius (Bubble *bubble) |
18 | +{ |
19 | + BubblePrivate* priv = GET_PRIVATE (bubble); |
20 | + Defaults* d = bubble->defaults; |
21 | + return defaults_get_bubble_corner_radius (d, priv->composited); |
22 | +} |
23 | + |
24 | static void |
25 | _draw_layout_grid (cairo_t* cr, |
26 | Bubble* bubble) |
27 | @@ -501,112 +517,112 @@ |
28 | |
29 | // all vertical grid lines |
30 | cairo_move_to (cr, |
31 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
32 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
33 | - cairo_line_to (cr, |
34 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
35 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
36 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
37 | - cairo_move_to (cr, |
38 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
39 | - EM2PIXELS (defaults_get_margin_size (d), d), |
40 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
41 | - cairo_line_to (cr, |
42 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
43 | - EM2PIXELS (defaults_get_margin_size (d), d), |
44 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
45 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
46 | - cairo_move_to (cr, |
47 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
48 | - EM2PIXELS (defaults_get_margin_size (d), d) + |
49 | - EM2PIXELS (defaults_get_icon_size (d), d), |
50 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
51 | - cairo_line_to (cr, |
52 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
53 | - EM2PIXELS (defaults_get_margin_size (d), d) + |
54 | - EM2PIXELS (defaults_get_icon_size (d), d), |
55 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
56 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
57 | - cairo_move_to (cr, |
58 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
59 | - EM2PIXELS (2 * defaults_get_margin_size (d), d) + |
60 | - EM2PIXELS (defaults_get_icon_size (d), d), |
61 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
62 | - cairo_line_to (cr, |
63 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
64 | - EM2PIXELS (2 * defaults_get_margin_size (d), d) + |
65 | - EM2PIXELS (defaults_get_icon_size (d), d), |
66 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
67 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
68 | - cairo_move_to (cr, |
69 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
70 | - EM2PIXELS (defaults_get_bubble_width (d), d) - |
71 | - EM2PIXELS (defaults_get_margin_size (d), d), |
72 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
73 | - cairo_line_to (cr, |
74 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
75 | - EM2PIXELS (defaults_get_bubble_width (d), d) - |
76 | - EM2PIXELS (defaults_get_margin_size (d), d), |
77 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
78 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
79 | - cairo_move_to (cr, |
80 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
81 | - EM2PIXELS (defaults_get_bubble_width (d), d), |
82 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
83 | - cairo_line_to (cr, |
84 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
85 | - EM2PIXELS (defaults_get_bubble_width (d), d), |
86 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
87 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
88 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d), |
89 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d)); |
90 | + cairo_line_to (cr, |
91 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d), |
92 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
93 | + EM2PIXELS (get_shadow_size (bubble), d)); |
94 | + cairo_move_to (cr, |
95 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
96 | + EM2PIXELS (defaults_get_margin_size (d), d), |
97 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d)); |
98 | + cairo_line_to (cr, |
99 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
100 | + EM2PIXELS (defaults_get_margin_size (d), d), |
101 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
102 | + EM2PIXELS (get_shadow_size (bubble), d)); |
103 | + cairo_move_to (cr, |
104 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
105 | + EM2PIXELS (defaults_get_margin_size (d), d) + |
106 | + EM2PIXELS (defaults_get_icon_size (d), d), |
107 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d)); |
108 | + cairo_line_to (cr, |
109 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
110 | + EM2PIXELS (defaults_get_margin_size (d), d) + |
111 | + EM2PIXELS (defaults_get_icon_size (d), d), |
112 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
113 | + EM2PIXELS (get_shadow_size (bubble), d)); |
114 | + cairo_move_to (cr, |
115 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
116 | + EM2PIXELS (2 * defaults_get_margin_size (d), d) + |
117 | + EM2PIXELS (defaults_get_icon_size (d), d), |
118 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d)); |
119 | + cairo_line_to (cr, |
120 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
121 | + EM2PIXELS (2 * defaults_get_margin_size (d), d) + |
122 | + EM2PIXELS (defaults_get_icon_size (d), d), |
123 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
124 | + EM2PIXELS (get_shadow_size (bubble), d)); |
125 | + cairo_move_to (cr, |
126 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
127 | + EM2PIXELS (defaults_get_bubble_width (d), d) - |
128 | + EM2PIXELS (defaults_get_margin_size (d), d), |
129 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d)); |
130 | + cairo_line_to (cr, |
131 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
132 | + EM2PIXELS (defaults_get_bubble_width (d), d) - |
133 | + EM2PIXELS (defaults_get_margin_size (d), d), |
134 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
135 | + EM2PIXELS (get_shadow_size (bubble), d)); |
136 | + cairo_move_to (cr, |
137 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
138 | + EM2PIXELS (defaults_get_bubble_width (d), d), |
139 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d)); |
140 | + cairo_line_to (cr, |
141 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
142 | + EM2PIXELS (defaults_get_bubble_width (d), d), |
143 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
144 | + EM2PIXELS (get_shadow_size (bubble), d)); |
145 | |
146 | // all horizontal grid lines |
147 | cairo_move_to (cr, |
148 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
149 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
150 | - cairo_line_to (cr, |
151 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
152 | - EM2PIXELS (defaults_get_bubble_width (d), d), |
153 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
154 | - cairo_move_to (cr, |
155 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
156 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
157 | - EM2PIXELS (defaults_get_margin_size (d), d)); |
158 | - cairo_line_to (cr, |
159 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
160 | - EM2PIXELS (defaults_get_bubble_width (d), d), |
161 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
162 | - EM2PIXELS (defaults_get_margin_size (d), d)); |
163 | - cairo_move_to (cr, |
164 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
165 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
166 | - EM2PIXELS (defaults_get_margin_size (d), d) + |
167 | - EM2PIXELS (defaults_get_icon_size (d), d)); |
168 | - cairo_line_to (cr, |
169 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
170 | - EM2PIXELS (defaults_get_bubble_width (d), d), |
171 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
172 | - EM2PIXELS (defaults_get_margin_size (d), d) + |
173 | - EM2PIXELS (defaults_get_icon_size (d), d)); |
174 | - cairo_move_to (cr, |
175 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
176 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
177 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d) - |
178 | - EM2PIXELS (defaults_get_margin_size (d), d)); |
179 | - cairo_line_to (cr, |
180 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
181 | - EM2PIXELS (defaults_get_bubble_width (d), d), |
182 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
183 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d) - |
184 | - EM2PIXELS (defaults_get_margin_size (d), d)); |
185 | - cairo_move_to (cr, |
186 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
187 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
188 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
189 | - cairo_line_to (cr, |
190 | - 0.5f + EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
191 | - EM2PIXELS (defaults_get_bubble_width (d), d), |
192 | - 0.5f + (gdouble) bubble_get_height (bubble) - |
193 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
194 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d), |
195 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d)); |
196 | + cairo_line_to (cr, |
197 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
198 | + EM2PIXELS (defaults_get_bubble_width (d), d), |
199 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d)); |
200 | + cairo_move_to (cr, |
201 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d), |
202 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
203 | + EM2PIXELS (defaults_get_margin_size (d), d)); |
204 | + cairo_line_to (cr, |
205 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
206 | + EM2PIXELS (defaults_get_bubble_width (d), d), |
207 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
208 | + EM2PIXELS (defaults_get_margin_size (d), d)); |
209 | + cairo_move_to (cr, |
210 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d), |
211 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
212 | + EM2PIXELS (defaults_get_margin_size (d), d) + |
213 | + EM2PIXELS (defaults_get_icon_size (d), d)); |
214 | + cairo_line_to (cr, |
215 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
216 | + EM2PIXELS (defaults_get_bubble_width (d), d), |
217 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
218 | + EM2PIXELS (defaults_get_margin_size (d), d) + |
219 | + EM2PIXELS (defaults_get_icon_size (d), d)); |
220 | + cairo_move_to (cr, |
221 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d), |
222 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
223 | + EM2PIXELS (get_shadow_size (bubble), d) - |
224 | + EM2PIXELS (defaults_get_margin_size (d), d)); |
225 | + cairo_line_to (cr, |
226 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
227 | + EM2PIXELS (defaults_get_bubble_width (d), d), |
228 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
229 | + EM2PIXELS (get_shadow_size (bubble), d) - |
230 | + EM2PIXELS (defaults_get_margin_size (d), d)); |
231 | + cairo_move_to (cr, |
232 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d), |
233 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
234 | + EM2PIXELS (get_shadow_size (bubble), d)); |
235 | + cairo_line_to (cr, |
236 | + 0.5f + EM2PIXELS (get_shadow_size (bubble), d) + |
237 | + EM2PIXELS (defaults_get_bubble_width (d), d), |
238 | + 0.5f + (gdouble) bubble_get_height (bubble) - |
239 | + EM2PIXELS (get_shadow_size (bubble), d)); |
240 | |
241 | cairo_stroke (cr); |
242 | } |
243 | @@ -625,20 +641,28 @@ |
244 | raico_blur_t* blur = NULL; |
245 | gint width; |
246 | gint height; |
247 | + gint scratch_shadow_size; |
248 | |
249 | bubble_get_size (self, &width, &height); |
250 | |
251 | // create temp. scratch surface for top-left shadow/background part |
252 | if (priv->composited) |
253 | + { |
254 | + scratch_shadow_size = EM2PIXELS (get_shadow_size (self), d); |
255 | scratch = cairo_image_surface_create ( |
256 | CAIRO_FORMAT_ARGB32, |
257 | - 3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
258 | - 3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
259 | + 3 * scratch_shadow_size, |
260 | + 3 * scratch_shadow_size); |
261 | + } |
262 | else |
263 | + { |
264 | + // We must have at least some width to this scratch surface. |
265 | + scratch_shadow_size = 1; |
266 | scratch = cairo_image_surface_create ( |
267 | CAIRO_FORMAT_RGB24, |
268 | - 3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
269 | - 3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
270 | + 3 * scratch_shadow_size, |
271 | + 3 * scratch_shadow_size); |
272 | + } |
273 | |
274 | g_return_if_fail (scratch); |
275 | |
276 | @@ -680,18 +704,18 @@ |
277 | cr, |
278 | width, |
279 | height, |
280 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
281 | - EM2PIXELS (defaults_get_bubble_corner_radius (d), d)); |
282 | + EM2PIXELS (get_shadow_size (self), d), |
283 | + EM2PIXELS (get_corner_radius (self), d)); |
284 | cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); |
285 | draw_round_rect ( |
286 | cr, |
287 | 1.0f, |
288 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
289 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
290 | - EM2PIXELS (defaults_get_bubble_corner_radius (d), d), |
291 | + EM2PIXELS (get_shadow_size (self), d), |
292 | + EM2PIXELS (get_shadow_size (self), d), |
293 | + EM2PIXELS (get_corner_radius (self), d), |
294 | EM2PIXELS (defaults_get_bubble_width (d), d), |
295 | (gdouble) bubble_get_height (self) - |
296 | - 2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
297 | + 2.0f * EM2PIXELS (get_shadow_size (self), d)); |
298 | cairo_fill (cr); |
299 | cairo_set_operator (cr, CAIRO_OPERATOR_OVER); |
300 | cairo_set_source_rgba (cr, |
301 | @@ -709,12 +733,12 @@ |
302 | draw_round_rect ( |
303 | cr, |
304 | 1.0f, |
305 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
306 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
307 | - EM2PIXELS (defaults_get_bubble_corner_radius (d), d), |
308 | + EM2PIXELS (get_shadow_size (self), d), |
309 | + EM2PIXELS (get_shadow_size (self), d), |
310 | + EM2PIXELS (get_corner_radius (self), d), |
311 | EM2PIXELS (defaults_get_bubble_width (d), d), |
312 | (gdouble) bubble_get_height (self) - |
313 | - 2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
314 | + 2.0f * EM2PIXELS (get_shadow_size (self), d)); |
315 | cairo_fill (cr); |
316 | cairo_destroy (cr); |
317 | |
318 | @@ -722,8 +746,8 @@ |
319 | dummy = cairo_image_surface_create_for_data ( |
320 | cairo_image_surface_get_data (scratch), |
321 | cairo_image_surface_get_format (scratch), |
322 | - 3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
323 | - 3 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
324 | + 3 * scratch_shadow_size, |
325 | + 3 * scratch_shadow_size, |
326 | cairo_image_surface_get_stride (scratch)); |
327 | clone = copy_surface (dummy); |
328 | cairo_surface_destroy (dummy); |
329 | @@ -732,8 +756,8 @@ |
330 | dummy = cairo_image_surface_create_for_data ( |
331 | cairo_image_surface_get_data (clone), |
332 | cairo_image_surface_get_format (clone), |
333 | - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
334 | - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
335 | + 2 * scratch_shadow_size, |
336 | + 2 * scratch_shadow_size, |
337 | cairo_image_surface_get_stride (clone)); |
338 | normal = copy_surface (dummy); |
339 | cairo_surface_destroy (dummy); |
340 | @@ -748,8 +772,8 @@ |
341 | dummy = cairo_image_surface_create_for_data ( |
342 | cairo_image_surface_get_data (clone), |
343 | cairo_image_surface_get_format (clone), |
344 | - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
345 | - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d), |
346 | + 2 * scratch_shadow_size, |
347 | + 2 * scratch_shadow_size, |
348 | cairo_image_surface_get_stride (clone)); |
349 | blurred = copy_surface (dummy); |
350 | cairo_surface_destroy (dummy); |
351 | @@ -1265,11 +1289,11 @@ |
352 | draw_round_rect ( |
353 | cr, |
354 | 1.0f, |
355 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + 2.0f, |
356 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + 2.0f, |
357 | - EM2PIXELS (defaults_get_bubble_corner_radius (d), d) - 2.0f, |
358 | + EM2PIXELS (get_shadow_size (self), d) + 2.0f, |
359 | + EM2PIXELS (get_shadow_size (self), d) + 2.0f, |
360 | + EM2PIXELS (get_corner_radius (self), d) - 2.0f, |
361 | EM2PIXELS (defaults_get_bubble_width (d), d) - 4.0f, |
362 | - 2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d) - 2.0f); |
363 | + 2.0f * EM2PIXELS (get_shadow_size (self), d) - 2.0f); |
364 | cairo_fill (cr); |
365 | |
366 | cairo_set_source_rgb (cr, 0.0f, 0.0f, 0.0f); |
367 | @@ -1279,12 +1303,12 @@ |
368 | cairo_move_to ( |
369 | cr, |
370 | EM2PIXELS (defaults_get_text_body_size (d), d) + |
371 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
372 | + EM2PIXELS (get_shadow_size (self), d) + |
373 | 2.0f, |
374 | EM2PIXELS (defaults_get_text_body_size (d), d) + |
375 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d) + |
376 | + EM2PIXELS (get_shadow_size (self), d) + |
377 | 2.0f + |
378 | - ((2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d) - 2.0f) - |
379 | + ((2.0f * EM2PIXELS (get_shadow_size (self), d) - 2.0f) - |
380 | EM2PIXELS (defaults_get_text_body_size (d), d)) / 2); |
381 | |
382 | switch (bubble_get_urgency (self)) |
383 | @@ -1428,7 +1452,7 @@ |
384 | gdouble alpha_blur) |
385 | { |
386 | Defaults* d = self->defaults; |
387 | - gint shadow = EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
388 | + gint shadow = EM2PIXELS (get_shadow_size (self), d); |
389 | gint icon_half = EM2PIXELS (defaults_get_icon_size (d), d) / 2; |
390 | gint width_half = EM2PIXELS (defaults_get_bubble_width (d), d) / 2; |
391 | gint height_half = EM2PIXELS (defaults_get_bubble_min_height (d), d) / 2; |
392 | @@ -1730,7 +1754,7 @@ |
393 | |
394 | _set_bg_blur (window, |
395 | TRUE, |
396 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d)); |
397 | + EM2PIXELS (get_shadow_size (bubble), d)); |
398 | |
399 | return TRUE; |
400 | } |
401 | @@ -3379,7 +3403,7 @@ |
402 | |
403 | new_bubble_width = |
404 | EM2PIXELS (defaults_get_bubble_width (d), d) + |
405 | - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
406 | + 2 * EM2PIXELS (get_shadow_size (self), d); |
407 | |
408 | switch (priv->layout) |
409 | { |
410 | @@ -3397,7 +3421,7 @@ |
411 | |
412 | new_bubble_height = |
413 | EM2PIXELS (defaults_get_bubble_min_height (d), d) + |
414 | - 2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
415 | + 2.0f * EM2PIXELS (get_shadow_size (self), d); |
416 | break; |
417 | |
418 | case LAYOUT_ICON_TITLE_BODY: |
419 | @@ -3446,7 +3470,7 @@ |
420 | new_bubble_height = |
421 | EM2PIXELS (defaults_get_icon_size (d), d) + |
422 | 2.0f * EM2PIXELS (defaults_get_margin_size (d), d) + |
423 | - 2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
424 | + 2.0f * EM2PIXELS (get_shadow_size (self), d); |
425 | } |
426 | else |
427 | { |
428 | @@ -3454,7 +3478,7 @@ |
429 | priv->body_height + |
430 | priv->title_height + |
431 | 2.0f * EM2PIXELS (defaults_get_margin_size (d), d) + |
432 | - 2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
433 | + 2.0f * EM2PIXELS (get_shadow_size (self), d); |
434 | } |
435 | } |
436 | } |
437 | @@ -3501,7 +3525,7 @@ |
438 | priv->body_height + |
439 | priv->title_height + |
440 | 2.0f * EM2PIXELS (defaults_get_margin_size (d), d) + |
441 | - 2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
442 | + 2.0f * EM2PIXELS (get_shadow_size (self), d); |
443 | } |
444 | } |
445 | break; |
446 | @@ -3518,7 +3542,7 @@ |
447 | |
448 | new_bubble_height = priv->title_height + |
449 | 2.0f * EM2PIXELS (defaults_get_margin_size (d), d) + |
450 | - 2.0f * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
451 | + 2.0f * EM2PIXELS (get_shadow_size (self), d); |
452 | } |
453 | break; |
454 | |
455 | |
456 | === modified file 'src/defaults.c' |
457 | --- src/defaults.c 2012-03-23 11:04:46 +0000 |
458 | +++ src/defaults.c 2012-08-29 22:11:20 +0000 |
459 | @@ -1762,11 +1762,11 @@ |
460 | } |
461 | |
462 | gdouble |
463 | -defaults_get_bubble_shadow_size (Defaults* self) |
464 | +defaults_get_bubble_shadow_size (Defaults* self, gboolean is_composited) |
465 | { |
466 | gdouble bubble_shadow_size; |
467 | |
468 | - if (!self || !IS_DEFAULTS (self)) |
469 | + if (!self || !IS_DEFAULTS (self) || !is_composited) |
470 | return 0.0f; |
471 | |
472 | g_object_get (self, "bubble-shadow-size", &bubble_shadow_size, NULL); |
473 | @@ -1841,11 +1841,11 @@ |
474 | } |
475 | |
476 | gdouble |
477 | -defaults_get_bubble_corner_radius (Defaults* self) |
478 | +defaults_get_bubble_corner_radius (Defaults* self, gboolean is_composited) |
479 | { |
480 | gdouble bubble_corner_radius; |
481 | |
482 | - if (!self || !IS_DEFAULTS (self)) |
483 | + if (!self || !IS_DEFAULTS (self) || !is_composited) |
484 | return 0.0f; |
485 | |
486 | g_object_get (self, |
487 | @@ -2205,11 +2205,10 @@ |
488 | } |
489 | |
490 | void |
491 | -defaults_get_top_corner (Defaults *self, gint *x, gint *y) |
492 | +defaults_get_top_corner (Defaults *self, GdkScreen **screen, gint *x, gint *y) |
493 | { |
494 | GdkRectangle rect; |
495 | GdkRectangle panel_rect = {0, 0, 0, 0}; |
496 | - GdkScreen* screen = NULL; |
497 | GdkWindow* active_window = NULL; |
498 | GdkWindow* panel_window = NULL; |
499 | gint mx; |
500 | @@ -2219,21 +2218,23 @@ |
501 | gint aw_monitor; |
502 | gboolean has_panel_window = FALSE; |
503 | gboolean follow_focus = defaults_multihead_does_focus_follow (self); |
504 | + gboolean is_composited = FALSE; |
505 | |
506 | g_return_if_fail (self != NULL && IS_DEFAULTS (self)); |
507 | |
508 | gdk_display_get_pointer (gdk_display_get_default (), |
509 | - &screen, |
510 | + screen, |
511 | &mx, |
512 | &my, |
513 | NULL); |
514 | |
515 | + is_composited = gdk_screen_is_composited (*screen); |
516 | panel_window = get_panel_window (); |
517 | |
518 | if (panel_window != NULL) |
519 | { |
520 | gdk_window_get_frame_extents (panel_window, &panel_rect); |
521 | - panel_monitor = gdk_screen_get_monitor_at_window (screen, |
522 | + panel_monitor = gdk_screen_get_monitor_at_window (*screen, |
523 | panel_window); |
524 | monitor = panel_monitor; |
525 | g_debug ("found panel (%d,%d) - %dx%d on monitor %d", |
526 | @@ -2249,12 +2250,12 @@ |
527 | if (follow_focus) |
528 | { |
529 | g_debug ("multi_head_focus_follow mode"); |
530 | - monitor = gdk_screen_get_monitor_at_point (screen, mx, my); |
531 | - active_window = gdk_screen_get_active_window (screen); |
532 | + monitor = gdk_screen_get_monitor_at_point (*screen, mx, my); |
533 | + active_window = gdk_screen_get_active_window (*screen); |
534 | if (active_window != NULL) |
535 | { |
536 | aw_monitor = gdk_screen_get_monitor_at_window ( |
537 | - screen, |
538 | + *screen, |
539 | active_window); |
540 | |
541 | if (monitor != aw_monitor) |
542 | @@ -2270,7 +2271,7 @@ |
543 | } |
544 | } |
545 | |
546 | - gdk_screen_get_monitor_geometry (screen, monitor, &rect); |
547 | + gdk_screen_get_monitor_geometry (*screen, monitor, &rect); |
548 | g_debug ("selecting monitor %d at (%d,%d) - %dx%d", |
549 | monitor, |
550 | rect.x, |
551 | @@ -2299,7 +2300,7 @@ |
552 | |
553 | *y = rect.y; |
554 | *y += EM2PIXELS (defaults_get_bubble_vert_gap (self), self) |
555 | - - EM2PIXELS (defaults_get_bubble_shadow_size (self), self); |
556 | + - EM2PIXELS (defaults_get_bubble_shadow_size (self, is_composited), self); |
557 | |
558 | /* correct potential offset in multi-monitor setups with two (or more) |
559 | * monitors side by side, all having different vertical resolutions and |
560 | @@ -2307,9 +2308,9 @@ |
561 | * the top edge of the monitor with the lowest vertical resolution, |
562 | * LP: #716458 */ |
563 | GdkRectangle cur_geo = {0, 0, 0, 0}; |
564 | - int num_monitors = gdk_screen_get_n_monitors (screen); |
565 | - int screen_width = gdk_screen_get_width (screen); |
566 | - int screen_height = gdk_screen_get_height (screen); |
567 | + int num_monitors = gdk_screen_get_n_monitors (*screen); |
568 | + int screen_width = gdk_screen_get_width (*screen); |
569 | + int screen_height = gdk_screen_get_height (*screen); |
570 | |
571 | if (!follow_focus && num_monitors > 1) |
572 | { |
573 | @@ -2319,10 +2320,10 @@ |
574 | { |
575 | int right_most_monitor = 0; |
576 | |
577 | - right_most_monitor = gdk_screen_get_monitor_at_point (screen, |
578 | + right_most_monitor = gdk_screen_get_monitor_at_point (*screen, |
579 | screen_width, |
580 | screen_height / 2); |
581 | - gdk_screen_get_monitor_geometry (screen, |
582 | + gdk_screen_get_monitor_geometry (*screen, |
583 | right_most_monitor, |
584 | &cur_geo); |
585 | if (cur_geo.y != 0) |
586 | @@ -2332,10 +2333,10 @@ |
587 | { |
588 | int left_most_monitor = 0; |
589 | |
590 | - left_most_monitor = gdk_screen_get_monitor_at_point (screen, |
591 | + left_most_monitor = gdk_screen_get_monitor_at_point (*screen, |
592 | 0, |
593 | screen_height / 2); |
594 | - gdk_screen_get_monitor_geometry (screen, |
595 | + gdk_screen_get_monitor_geometry (*screen, |
596 | left_most_monitor, |
597 | &cur_geo); |
598 | if (cur_geo.y != 0) |
599 | @@ -2348,12 +2349,12 @@ |
600 | if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_LTR) |
601 | { |
602 | *x = rect.x + rect.width; |
603 | - *x -= EM2PIXELS (defaults_get_bubble_shadow_size (self), self) |
604 | + *x -= EM2PIXELS (defaults_get_bubble_shadow_size (self, is_composited), self) |
605 | + EM2PIXELS (defaults_get_bubble_horz_gap (self), self) |
606 | + EM2PIXELS (defaults_get_bubble_width (self), self); |
607 | } else { |
608 | *x = rect.x |
609 | - - EM2PIXELS (defaults_get_bubble_shadow_size (self), self) |
610 | + - EM2PIXELS (defaults_get_bubble_shadow_size (self, is_composited), self) |
611 | + EM2PIXELS (defaults_get_bubble_horz_gap (self), self); |
612 | } |
613 | |
614 | |
615 | === modified file 'src/defaults.h' |
616 | --- src/defaults.h 2012-03-09 21:21:20 +0000 |
617 | +++ src/defaults.h 2012-08-29 22:11:20 +0000 |
618 | @@ -31,6 +31,7 @@ |
619 | |
620 | #include <glib-object.h> |
621 | #include <gio/gio.h> |
622 | +#include <gdk/gdk.h> |
623 | |
624 | G_BEGIN_DECLS |
625 | |
626 | @@ -177,7 +178,7 @@ |
627 | defaults_get_bubble_horz_gap (Defaults* self); |
628 | |
629 | gdouble |
630 | -defaults_get_bubble_shadow_size (Defaults* self); |
631 | +defaults_get_bubble_shadow_size (Defaults* self, gboolean is_composited); |
632 | |
633 | gchar* |
634 | defaults_get_bubble_shadow_color (Defaults* self); |
635 | @@ -192,7 +193,7 @@ |
636 | defaults_get_bubble_hover_opacity (Defaults* self); |
637 | |
638 | gdouble |
639 | -defaults_get_bubble_corner_radius (Defaults* self); |
640 | +defaults_get_bubble_corner_radius (Defaults* self, gboolean is_composited); |
641 | |
642 | gdouble |
643 | defaults_get_content_shadow_size (Defaults* self); |
644 | @@ -258,7 +259,7 @@ |
645 | defaults_refresh_screen_dimension_properties (Defaults *self); |
646 | |
647 | void |
648 | -defaults_get_top_corner (Defaults *self, gint *x, gint *y); |
649 | +defaults_get_top_corner (Defaults *self, GdkScreen **screen, gint *x, gint *y); |
650 | |
651 | Gravity |
652 | defaults_get_gravity (Defaults *self); |
653 | |
654 | === modified file 'src/display.c' |
655 | --- src/display.c 2009-10-20 08:51:11 +0000 |
656 | +++ src/display.c 2012-08-29 22:11:20 +0000 |
657 | @@ -60,12 +60,13 @@ |
658 | static gboolean |
659 | stack_is_at_top_corner (Stack *self, Bubble *bubble) |
660 | { |
661 | + GdkScreen* screen; |
662 | gint x, y1, y2; |
663 | |
664 | g_assert (IS_STACK (self)); |
665 | g_assert (IS_BUBBLE (bubble)); |
666 | |
667 | - defaults_get_top_corner (self->defaults, &x, &y1); |
668 | + defaults_get_top_corner (self->defaults, &screen, &x, &y1); |
669 | bubble_get_position (bubble, &x, &y2); |
670 | |
671 | return y1 == y2; |
672 | @@ -74,11 +75,12 @@ |
673 | static void |
674 | stack_display_position_sync_bubble (Stack *self, Bubble *bubble) |
675 | { |
676 | - Defaults* d = self->defaults; |
677 | - gint y = 0; |
678 | - gint x = 0; |
679 | + Defaults* d = self->defaults; |
680 | + GdkScreen* screen; |
681 | + gint y = 0; |
682 | + gint x = 0; |
683 | |
684 | - defaults_get_top_corner (d, &x, &y); |
685 | + defaults_get_top_corner (d, &screen, &x, &y); |
686 | |
687 | // TODO: with multi-head, in focus follow mode, there may be enough |
688 | // space left on the top monitor |
689 | @@ -279,10 +281,11 @@ |
690 | static void |
691 | stack_layout (Stack* self) |
692 | { |
693 | - Bubble* bubble = NULL; |
694 | - Defaults* d; |
695 | - gint y = 0; |
696 | - gint x = 0; |
697 | + Bubble* bubble = NULL; |
698 | + Defaults* d; |
699 | + GdkScreen* screen; |
700 | + gint y = 0; |
701 | + gint x = 0; |
702 | |
703 | g_return_if_fail (self != NULL); |
704 | |
705 | @@ -313,7 +316,7 @@ |
706 | bubble_set_timeout (bubble, |
707 | defaults_get_on_screen_timeout (self->defaults)); |
708 | |
709 | - defaults_get_top_corner (self->defaults, &x, &y); |
710 | + defaults_get_top_corner (self->defaults, &screen, &x, &y); |
711 | |
712 | d = self->defaults; |
713 | |
714 | |
715 | === modified file 'src/stack.c' |
716 | --- src/stack.c 2011-07-01 18:23:39 +0000 |
717 | +++ src/stack.c 2012-08-29 22:11:20 +0000 |
718 | @@ -885,6 +885,9 @@ |
719 | gint* x, |
720 | gint* y) |
721 | { |
722 | + GdkScreen* screen = NULL; |
723 | + gboolean is_composited = FALSE; |
724 | + |
725 | // sanity checks |
726 | if (!x && !y) |
727 | return; |
728 | @@ -904,7 +907,9 @@ |
729 | } |
730 | |
731 | // initialize x and y |
732 | - defaults_get_top_corner (self->defaults, x, y); |
733 | + defaults_get_top_corner (self->defaults, &screen, x, y); |
734 | + |
735 | + is_composited = gdk_screen_is_composited (screen); |
736 | |
737 | // differentiate returned top-left corner for top and bottom slot |
738 | // depending on the placement |
739 | @@ -920,12 +925,12 @@ |
740 | *y += defaults_get_desktop_height (d) / 2 - |
741 | EM2PIXELS (defaults_get_bubble_vert_gap (d) / 2.0f, d) - |
742 | bubble_height + |
743 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
744 | + EM2PIXELS (defaults_get_bubble_shadow_size (d, is_composited), d); |
745 | // the position for the async. bubble |
746 | else if (slot == SLOT_BOTTOM) |
747 | *y += defaults_get_desktop_height (d) / 2 + |
748 | EM2PIXELS (defaults_get_bubble_vert_gap (d) / 2.0f, d) - |
749 | - EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
750 | + EM2PIXELS (defaults_get_bubble_shadow_size (d, is_composited), d); |
751 | break; |
752 | |
753 | case GRAVITY_NORTH_EAST: |
754 | @@ -945,14 +950,14 @@ |
755 | *y += EM2PIXELS (defaults_get_icon_size (d), d) + |
756 | 2 * EM2PIXELS (defaults_get_margin_size (d), d) + |
757 | EM2PIXELS (defaults_get_bubble_vert_gap (d), d); /* + |
758 | - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d);*/ |
759 | + 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d, is_composited), d);*/ |
760 | break; |
761 | |
762 | case SLOT_ALLOCATION_DYNAMIC: |
763 | g_assert (stack_is_slot_vacant (self, SLOT_TOP) == OCCUPIED); |
764 | *y += bubble_get_height (self->slots[SLOT_TOP]) + |
765 | EM2PIXELS (defaults_get_bubble_vert_gap (d), d) - |
766 | - 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d), d); |
767 | + 2 * EM2PIXELS (defaults_get_bubble_shadow_size (d, is_composited), d); |
768 | break; |
769 | |
770 | default: |
PASSED: Continuous integration, rev:457 s-jenkins: 8080/job/ notify- osd-ci/ 3/ s-jenkins: 8080/job/ notify- osd-ci/ ./label= precise- clean-amd64/ 3/console s-jenkins: 8080/job/ notify- osd-ci/ ./label= precise- clean-i386/ 3/console
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://