Merge lp:~compiz-team/compiz-core/compiz-core.fix_873136 into lp:compiz-core/0.9.5
- compiz-core.fix_873136
- Merge into 0.9.5
Proposed by
Sam Spilsbury
Status: | Merged |
---|---|
Merged at revision: | 2889 |
Proposed branch: | lp:~compiz-team/compiz-core/compiz-core.fix_873136 |
Merge into: | lp:compiz-core/0.9.5 |
Diff against target: |
2475 lines (+988/-465) 18 files modified
gtk/window-decorator/cairo.c (+24/-5) gtk/window-decorator/decorator.c (+154/-125) gtk/window-decorator/decorprops.c (+3/-3) gtk/window-decorator/events.c (+14/-9) gtk/window-decorator/frames.c (+22/-22) gtk/window-decorator/gtk-window-decorator.c (+21/-8) gtk/window-decorator/gtk-window-decorator.h (+62/-27) gtk/window-decorator/gwd.schemas.in (+11/-0) gtk/window-decorator/metacity.c (+123/-23) gtk/window-decorator/settings.c (+129/-22) gtk/window-decorator/switcher.c (+17/-18) gtk/window-decorator/wnck.c (+101/-2) include/core/core.h (+1/-1) kde/window-decorator-kde4/decorator.cpp (+133/-84) kde/window-decorator-kde4/decorator.h (+15/-10) plugins/decor/decor.xml.in (+74/-34) plugins/decor/src/decor.cpp (+67/-55) src/window.cpp (+17/-17) |
To merge this branch: | bzr merge lp:~compiz-team/compiz-core/compiz-core.fix_873136 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Compiz Maintainers | Pending | ||
Review via email: mp+79461@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'gtk/window-decorator/cairo.c' |
2 | --- gtk/window-decorator/cairo.c 2011-05-07 08:58:10 +0000 |
3 | +++ gtk/window-decorator/cairo.c 2011-10-15 07:11:59 +0000 |
4 | @@ -766,7 +766,10 @@ |
5 | if (w < top_width) |
6 | top_width = MAX (ICON_SPACE + d->button_width, w); |
7 | |
8 | - decor_get_default_layout (&d->frame->window_context, top_width, 1, &layout); |
9 | + if (d->active) |
10 | + decor_get_default_layout (&d->frame->window_context_active, top_width, 1, &layout); |
11 | + else |
12 | + decor_get_default_layout (&d->frame->window_context_inactive, top_width, 1, &layout); |
13 | |
14 | if (!d->context || memcmp (&layout, &d->border_layout, sizeof (layout))) |
15 | { |
16 | @@ -774,8 +777,16 @@ |
17 | *height = layout.height; |
18 | |
19 | d->border_layout = layout; |
20 | - d->context = &d->frame->window_context; |
21 | - d->shadow = d->frame->border_shadow; |
22 | + if (d->active) |
23 | + { |
24 | + d->context = &d->frame->window_context_active; |
25 | + d->shadow = d->frame->border_shadow_active; |
26 | + } |
27 | + else |
28 | + { |
29 | + d->context = &d->frame->window_context_inactive; |
30 | + d->shadow = d->frame->border_shadow_inactive; |
31 | + } |
32 | |
33 | return TRUE; |
34 | } |
35 | @@ -797,8 +808,16 @@ |
36 | *height = layout.height; |
37 | |
38 | d->border_layout = layout; |
39 | - d->context = &d->frame->window_context_no_shadow; |
40 | - d->shadow = d->frame->border_no_shadow; |
41 | + if (d->active) |
42 | + { |
43 | + d->context = &d->frame->window_context_active; |
44 | + d->shadow = d->frame->border_shadow_active; |
45 | + } |
46 | + else |
47 | + { |
48 | + d->context = &d->frame->window_context_inactive; |
49 | + d->shadow = d->frame->border_shadow_inactive; |
50 | + } |
51 | |
52 | return TRUE; |
53 | } |
54 | |
55 | === modified file 'gtk/window-decorator/decorator.c' |
56 | --- gtk/window-decorator/decorator.c 2011-05-08 13:45:38 +0000 |
57 | +++ gtk/window-decorator/decorator.c 2011-10-15 07:11:59 +0000 |
58 | @@ -60,9 +60,11 @@ |
59 | frame->win_extents = _win_extents; |
60 | frame->max_win_extents = _max_win_extents; |
61 | frame->update_shadow = decor_frame_update_shadow; |
62 | - frame->window_context = _window_context; |
63 | + frame->window_context_active = _window_context; |
64 | + frame->window_context_inactive = _window_context; |
65 | frame->window_context_no_shadow = _window_context_no_shadow; |
66 | - frame->max_window_context = _max_window_context; |
67 | + frame->max_window_context_active = _max_window_context; |
68 | + frame->max_window_context_inactive = _max_window_context; |
69 | frame->max_window_context_no_shadow = _max_window_context_no_shadow; |
70 | |
71 | return frame; |
72 | @@ -89,9 +91,11 @@ |
73 | frame->win_extents = _shadow_extents; |
74 | frame->max_win_extents = _shadow_extents; |
75 | frame->win_extents = _shadow_extents; |
76 | - frame->window_context = _shadow_context; |
77 | + frame->window_context_active = _shadow_context; |
78 | + frame->window_context_inactive = _shadow_context; |
79 | frame->window_context_no_shadow = _shadow_context; |
80 | - frame->max_window_context = _shadow_context; |
81 | + frame->max_window_context_active = _shadow_context; |
82 | + frame->max_window_context_inactive = _shadow_context; |
83 | frame->max_window_context_no_shadow = _shadow_context; |
84 | frame->update_shadow = bare_frame_update_shadow; |
85 | |
86 | @@ -696,7 +700,20 @@ |
87 | |
88 | memset (&d, 0, sizeof (d)); |
89 | |
90 | - d.frame = info->frame; |
91 | + if (info) |
92 | + { |
93 | + gwd_decor_frame_ref (info->frame); |
94 | + |
95 | + d.frame = info->frame; |
96 | + d.state = info->state; |
97 | + d.actions = info->active; |
98 | + } |
99 | + else |
100 | + { |
101 | + d.frame = gwd_get_decor_frame ("normal"); |
102 | + d.state = 0; |
103 | + d.active = TRUE; |
104 | + } |
105 | |
106 | d.pixmap = gdk_pixmap_foreign_new_for_display (gdk_display_get_default (), |
107 | pixmap); |
108 | @@ -759,19 +776,23 @@ |
109 | */ |
110 | void |
111 | bare_frame_update_shadow (Display *xdisplay, |
112 | - Screen *screen, |
113 | - decor_frame_t *frame, |
114 | - decor_shadow_info_t *info, |
115 | - decor_shadow_options_t *opt_shadow, |
116 | - decor_shadow_options_t *opt_no_shadow) |
117 | + Screen *screen, |
118 | + decor_frame_t *frame, |
119 | + decor_shadow_t **shadow_normal, |
120 | + decor_context_t *context_normal, |
121 | + decor_shadow_t **shadow_max, |
122 | + decor_context_t *context_max, |
123 | + decor_shadow_info_t *info, |
124 | + decor_shadow_options_t *opt_shadow, |
125 | + decor_shadow_options_t *opt_no_shadow) |
126 | { |
127 | - if (frame->border_shadow) |
128 | + if (frame->border_shadow_active) |
129 | { |
130 | - decor_shadow_destroy (xdisplay, frame->border_shadow); |
131 | - frame->border_shadow = NULL; |
132 | + decor_shadow_destroy (xdisplay, frame->border_shadow_active); |
133 | + frame->border_shadow_active = NULL; |
134 | } |
135 | |
136 | - frame->border_shadow = decor_shadow_create (xdisplay, |
137 | + frame->border_shadow_active = decor_shadow_create (xdisplay, |
138 | screen, |
139 | 1, 1, |
140 | 0, |
141 | @@ -780,7 +801,7 @@ |
142 | 0, |
143 | 0, 0, 0, 0, |
144 | opt_shadow, |
145 | - &frame->window_context, |
146 | + &frame->window_context_active, |
147 | decor_draw_simple, |
148 | NULL); |
149 | } |
150 | @@ -789,17 +810,21 @@ |
151 | switcher_frame_update_shadow (Display *xdisplay, |
152 | Screen *screen, |
153 | decor_frame_t *frame, |
154 | + decor_shadow_t **shadow_normal, |
155 | + decor_context_t *context_normal, |
156 | + decor_shadow_t **shadow_max, |
157 | + decor_context_t *context_max, |
158 | decor_shadow_info_t *info, |
159 | decor_shadow_options_t *opt_shadow, |
160 | decor_shadow_options_t *opt_no_shadow) |
161 | { |
162 | - if (frame->border_shadow) |
163 | + if (frame->border_shadow_active) |
164 | { |
165 | - decor_shadow_destroy (xdisplay, frame->border_shadow); |
166 | - frame->border_shadow = NULL; |
167 | + decor_shadow_destroy (xdisplay, frame->border_shadow_active); |
168 | + frame->border_shadow_active = NULL; |
169 | } |
170 | |
171 | - frame->border_shadow = decor_shadow_create (xdisplay, |
172 | + frame->border_shadow_active = decor_shadow_create (xdisplay, |
173 | screen, |
174 | 1, 1, |
175 | frame->win_extents.left, |
176 | @@ -815,7 +840,7 @@ |
177 | frame->win_extents.bottom - |
178 | TRANSLUCENT_CORNER_SIZE, |
179 | opt_shadow, |
180 | - &frame->window_context, |
181 | + &frame->window_context_active, |
182 | decor_draw_simple, |
183 | NULL); |
184 | } |
185 | @@ -824,17 +849,21 @@ |
186 | decor_frame_update_shadow (Display *xdisplay, |
187 | Screen *screen, |
188 | decor_frame_t *frame, |
189 | + decor_shadow_t **shadow_normal, |
190 | + decor_context_t *context_normal, |
191 | + decor_shadow_t **shadow_max, |
192 | + decor_context_t *context_max, |
193 | decor_shadow_info_t *info, |
194 | decor_shadow_options_t *opt_shadow, |
195 | decor_shadow_options_t *opt_no_shadow) |
196 | { |
197 | - if (frame->border_shadow) |
198 | + if (*shadow_normal) |
199 | { |
200 | - decor_shadow_destroy (xdisplay, frame->border_shadow); |
201 | - frame->border_shadow = NULL; |
202 | + decor_shadow_destroy (xdisplay, *shadow_normal); |
203 | + *shadow_normal = NULL; |
204 | } |
205 | |
206 | - frame->border_shadow = decor_shadow_create (xdisplay, |
207 | + *shadow_normal = decor_shadow_create (xdisplay, |
208 | screen, |
209 | 1, 1, |
210 | frame->win_extents.left, |
211 | @@ -850,46 +879,21 @@ |
212 | frame->win_extents.bottom - |
213 | TRANSLUCENT_CORNER_SIZE, |
214 | opt_shadow, |
215 | - &frame->window_context, |
216 | + context_normal, |
217 | draw_border_shape, |
218 | (void *) info); |
219 | - if (frame->border_no_shadow) |
220 | - { |
221 | - decor_shadow_destroy (xdisplay, frame->border_no_shadow); |
222 | - frame->border_no_shadow = NULL; |
223 | - } |
224 | - |
225 | - frame->border_no_shadow = decor_shadow_create (xdisplay, |
226 | - screen, |
227 | - 1, 1, |
228 | - frame->win_extents.left, |
229 | - frame->win_extents.right, |
230 | - frame->win_extents.top + frame->titlebar_height, |
231 | - frame->win_extents.bottom, |
232 | - frame->win_extents.left - |
233 | - TRANSLUCENT_CORNER_SIZE, |
234 | - frame->win_extents.right - |
235 | - TRANSLUCENT_CORNER_SIZE, |
236 | - frame->win_extents.top + frame->titlebar_height - |
237 | - TRANSLUCENT_CORNER_SIZE, |
238 | - frame->win_extents.bottom - |
239 | - TRANSLUCENT_CORNER_SIZE, |
240 | - opt_no_shadow, |
241 | - &frame->window_context_no_shadow, |
242 | - draw_border_shape, |
243 | - 0); |
244 | |
245 | /* Maximized border shadow pixmap mode */ |
246 | - if (frame->max_border_shadow) |
247 | + if (*shadow_max) |
248 | { |
249 | - decor_shadow_destroy (xdisplay, frame->max_border_shadow); |
250 | - frame->max_border_shadow = NULL; |
251 | + decor_shadow_destroy (xdisplay, *shadow_max); |
252 | + *shadow_max = NULL; |
253 | } |
254 | |
255 | info->state = (WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY | |
256 | WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY); |
257 | |
258 | - frame->max_border_shadow = |
259 | + *shadow_max = |
260 | decor_shadow_create (xdisplay, |
261 | screen, |
262 | 1, 1, |
263 | @@ -903,54 +907,48 @@ |
264 | TRANSLUCENT_CORNER_SIZE, |
265 | frame->max_win_extents.bottom - TRANSLUCENT_CORNER_SIZE, |
266 | opt_shadow, |
267 | - &frame->max_window_context, |
268 | - draw_border_shape, |
269 | - (void *) info); |
270 | - |
271 | - /* Enforced maximize zero shadow reparenting mode */ |
272 | - if (frame->max_border_no_shadow) |
273 | - { |
274 | - decor_shadow_destroy (xdisplay, frame->max_border_shadow); |
275 | - frame->max_border_shadow = NULL; |
276 | - } |
277 | - |
278 | - frame->max_border_no_shadow = |
279 | - decor_shadow_create (xdisplay, |
280 | - screen, |
281 | - 1, 1, |
282 | - frame->max_win_extents.left, |
283 | - frame->max_win_extents.right, |
284 | - frame->max_win_extents.top + frame->max_titlebar_height, |
285 | - frame->max_win_extents.bottom, |
286 | - frame->max_win_extents.left - TRANSLUCENT_CORNER_SIZE, |
287 | - frame->max_win_extents.right - TRANSLUCENT_CORNER_SIZE, |
288 | - frame->max_win_extents.top + frame->max_titlebar_height - |
289 | - TRANSLUCENT_CORNER_SIZE, |
290 | - frame->max_win_extents.bottom - TRANSLUCENT_CORNER_SIZE, |
291 | - opt_no_shadow, |
292 | - &frame->max_window_context_no_shadow, |
293 | - draw_border_shape, |
294 | - (void *) info); |
295 | + context_max, |
296 | + draw_border_shape, |
297 | + (void *) info); |
298 | + |
299 | + /* Reset info->state */ |
300 | + info->state = 0; |
301 | } |
302 | |
303 | |
304 | typedef struct _tdtd_shadow_options |
305 | { |
306 | - decor_shadow_options_t *shadow; |
307 | - decor_shadow_options_t *no_shadow; |
308 | + decor_shadow_options_t *active_shadow; |
309 | + decor_shadow_options_t *inactive_shadow; |
310 | } tdtd_shadow_options_t; |
311 | |
312 | void |
313 | frame_update_shadow (decor_frame_t *frame, |
314 | decor_shadow_info_t *info, |
315 | - decor_shadow_options_t *opt_shadow, |
316 | - decor_shadow_options_t *opt_no_shadow) |
317 | + decor_shadow_options_t *opt_active_shadow, |
318 | + decor_shadow_options_t *opt_inactive_shadow) |
319 | { |
320 | gwd_decor_frame_ref (frame); |
321 | |
322 | + info->active = TRUE; |
323 | + |
324 | (*frame->update_shadow) (gdk_x11_get_default_xdisplay (), |
325 | gdk_x11_screen_get_xscreen (gdk_screen_get_default ()), |
326 | - frame, info, opt_shadow, opt_no_shadow); |
327 | + frame, &frame->border_shadow_active, |
328 | + &frame->window_context_active, |
329 | + &frame->max_border_shadow_inactive, |
330 | + &frame->max_window_context_active, |
331 | + info, opt_active_shadow, opt_inactive_shadow); |
332 | + |
333 | + info->active = FALSE; |
334 | + |
335 | + (*frame->update_shadow) (gdk_x11_get_default_xdisplay (), |
336 | + gdk_x11_screen_get_xscreen (gdk_screen_get_default ()), |
337 | + frame, &frame->border_shadow_inactive, |
338 | + &frame->window_context_inactive, |
339 | + &frame->max_border_shadow_inactive, |
340 | + &frame->max_window_context_inactive, |
341 | + info, opt_inactive_shadow, opt_active_shadow); |
342 | |
343 | gwd_decor_frame_unref (frame); |
344 | } |
345 | @@ -961,7 +959,19 @@ |
346 | gpointer user_data) |
347 | { |
348 | decor_frame_t *frame = (decor_frame_t *) value; |
349 | - tdtd_shadow_options_t *opts = (tdtd_shadow_options_t *) user_data; |
350 | + tdtd_shadow_options_t *opts; |
351 | + decor_shadow_options_t active_o, inactive_o; |
352 | + |
353 | + opts = malloc (sizeof (tdtd_shadow_options_t)); |
354 | + |
355 | + if (!opts) |
356 | + return; |
357 | + |
358 | + opts->active_shadow = &active_o; |
359 | + opts->inactive_shadow = &inactive_o; |
360 | + |
361 | + (*theme_get_shadow) (frame, opts->active_shadow, TRUE); |
362 | + (*theme_get_shadow) (frame, opts->inactive_shadow, FALSE); |
363 | |
364 | gwd_decor_frame_ref (frame); |
365 | |
366 | @@ -973,48 +983,67 @@ |
367 | info->frame = frame; |
368 | info->state = 0; |
369 | |
370 | - frame_update_shadow (frame, info, opts->shadow, opts->no_shadow); |
371 | + frame_update_shadow (frame, info, opts->active_shadow, opts->inactive_shadow); |
372 | |
373 | gwd_decor_frame_unref (frame); |
374 | |
375 | free (info); |
376 | info = NULL; |
377 | |
378 | + free (opts); |
379 | + opts = NULL; |
380 | + |
381 | +} |
382 | + |
383 | +void |
384 | +cairo_get_shadow (decor_frame_t *d, decor_shadow_options_t *opts, gboolean active) |
385 | +{ |
386 | + if (active) |
387 | + { |
388 | + memcpy (opts->shadow_color, settings->active_shadow_color, sizeof (settings->active_shadow_color)); |
389 | + opts->shadow_radius = settings->active_shadow_radius; |
390 | + opts->shadow_offset_x = settings->active_shadow_offset_x; |
391 | + opts->shadow_offset_y = settings->active_shadow_offset_y; |
392 | + opts->shadow_opacity = settings->active_shadow_opacity; |
393 | + } |
394 | + /* TODO: Inactive shadows */ |
395 | + else |
396 | + { |
397 | + memcpy (opts->shadow_color, settings->inactive_shadow_color, sizeof (settings->inactive_shadow_color)); |
398 | + opts->shadow_radius = settings->inactive_shadow_radius; |
399 | + opts->shadow_offset_x = settings->inactive_shadow_offset_x; |
400 | + opts->shadow_offset_y = settings->inactive_shadow_offset_y; |
401 | + opts->shadow_opacity = settings->inactive_shadow_opacity; |
402 | + } |
403 | +} |
404 | + |
405 | +void |
406 | +meta_get_shadow (decor_frame_t *frame, decor_shadow_options_t *opts, gboolean active) |
407 | +{ |
408 | + if (active) |
409 | + { |
410 | + memcpy (opts->shadow_color, settings->active_shadow_color, sizeof (settings->active_shadow_color)); |
411 | + opts->shadow_radius = settings->active_shadow_radius; |
412 | + opts->shadow_offset_x = settings->active_shadow_offset_x; |
413 | + opts->shadow_offset_y = settings->active_shadow_offset_y; |
414 | + opts->shadow_opacity = settings->active_shadow_opacity; |
415 | + } |
416 | + /* TODO: Inactive shadows */ |
417 | + else |
418 | + { |
419 | + memcpy (opts->shadow_color, settings->inactive_shadow_color, sizeof (settings->inactive_shadow_color)); |
420 | + opts->shadow_radius = settings->inactive_shadow_radius; |
421 | + opts->shadow_offset_x = settings->inactive_shadow_offset_x; |
422 | + opts->shadow_offset_y = settings->inactive_shadow_offset_y; |
423 | + opts->shadow_opacity = settings->inactive_shadow_opacity; |
424 | + } |
425 | + |
426 | } |
427 | |
428 | int |
429 | update_shadow (void) |
430 | { |
431 | - decor_shadow_options_t opt_shadow; |
432 | - decor_shadow_options_t opt_no_shadow; |
433 | - tdtd_shadow_options_t *opts; |
434 | - |
435 | - opts = malloc (sizeof (tdtd_shadow_options_t)); |
436 | - |
437 | - if (!opts) |
438 | - return 0; |
439 | - |
440 | - opt_shadow.shadow_radius = settings->shadow_radius; |
441 | - opt_shadow.shadow_opacity = settings->shadow_opacity; |
442 | - |
443 | - memcpy (opt_shadow.shadow_color, settings->shadow_color, sizeof (settings->shadow_color)); |
444 | - |
445 | - opt_shadow.shadow_offset_x = settings->shadow_offset_x; |
446 | - opt_shadow.shadow_offset_y = settings->shadow_offset_y; |
447 | - |
448 | - opt_no_shadow.shadow_radius = 0; |
449 | - opt_no_shadow.shadow_opacity = 0; |
450 | - |
451 | - opt_no_shadow.shadow_offset_x = 0; |
452 | - opt_no_shadow.shadow_offset_y = 0; |
453 | - |
454 | - opts->shadow = &opt_shadow; |
455 | - opts->no_shadow = &opt_no_shadow; |
456 | - |
457 | - gwd_frames_foreach (update_frames_shadows, (gpointer ) opts); |
458 | - |
459 | - if (opts) |
460 | - free (opts); |
461 | + gwd_frames_foreach (update_frames_shadows, NULL); |
462 | |
463 | return 1; |
464 | } |
465 | @@ -1275,7 +1304,7 @@ |
466 | bareAtom = XInternAtom (xdisplay, DECOR_BARE_ATOM_NAME, FALSE); |
467 | activeAtom = XInternAtom (xdisplay, DECOR_ACTIVE_ATOM_NAME, FALSE); |
468 | |
469 | - if (bare_frame->border_shadow) |
470 | + if (bare_frame->border_shadow_active) |
471 | { |
472 | decor_layout_t layout; |
473 | unsigned int frame_type = 0; |
474 | @@ -1286,12 +1315,12 @@ |
475 | |
476 | long *data = decor_alloc_property (1, WINDOW_DECORATION_TYPE_PIXMAP); |
477 | |
478 | - decor_get_default_layout (&bare_frame->window_context, 1, 1, &layout); |
479 | + decor_get_default_layout (&bare_frame->window_context_active, 1, 1, &layout); |
480 | |
481 | - nQuad = decor_set_lSrStSbS_window_quads (quads, &bare_frame->window_context, |
482 | + nQuad = decor_set_lSrStSbS_window_quads (quads, &bare_frame->window_context_active, |
483 | &layout); |
484 | |
485 | - decor_quads_to_property (data, 0, bare_frame->border_shadow->pixmap, |
486 | + decor_quads_to_property (data, 0, bare_frame->border_shadow_active->pixmap, |
487 | &bare_frame->win_extents, &bare_frame->win_extents, |
488 | &bare_frame->win_extents, &bare_frame->win_extents, |
489 | 0, 0, quads, nQuad, frame_type, frame_state, frame_actions); |
490 | @@ -1350,8 +1379,8 @@ |
491 | |
492 | default_frames[i].d = calloc (1, sizeof (decor_t)); |
493 | |
494 | - default_frames[i].d->context = &frame->window_context; |
495 | - default_frames[i].d->shadow = frame->border_shadow; |
496 | + default_frames[i].d->context = i < WINDOW_TYPE_FRAMES_NUM ? &frame->window_context_active : &frame->window_context_inactive; |
497 | + default_frames[i].d->shadow = i < WINDOW_TYPE_FRAMES_NUM ? frame->border_shadow_active : frame->border_shadow_inactive; |
498 | default_frames[i].d->layout = pango_layout_new (frame->pango_context); |
499 | |
500 | decor_get_default_layout (default_frames[i].d->context, 1, 1, &default_frames[i].d->border_layout); |
501 | |
502 | === modified file 'gtk/window-decorator/decorprops.c' |
503 | --- gtk/window-decorator/decorprops.c 2011-05-07 08:58:10 +0000 |
504 | +++ gtk/window-decorator/decorprops.c 2011-10-15 07:11:59 +0000 |
505 | @@ -139,12 +139,12 @@ |
506 | GtkStyle *style; |
507 | long fgColor[4]; |
508 | |
509 | - nQuad = decor_set_lSrStSbX_window_quads (quads, &d->frame->window_context, |
510 | + nQuad = decor_set_lSrStSbX_window_quads (quads, &d->frame->window_context_active, |
511 | &d->border_layout, |
512 | d->border_layout.top.x2 - |
513 | d->border_layout.top.x1 - |
514 | - d->frame->window_context.extents.left - |
515 | - d->frame->window_context.extents.right - |
516 | + d->frame->window_context_active.extents.left - |
517 | + d->frame->window_context_active.extents.right - |
518 | 32); |
519 | |
520 | data = decor_alloc_property (nOffset, WINDOW_DECORATION_TYPE_PIXMAP); |
521 | |
522 | === modified file 'gtk/window-decorator/events.c' |
523 | --- gtk/window-decorator/events.c 2011-02-28 12:57:42 +0000 |
524 | +++ gtk/window-decorator/events.c 2011-10-15 07:11:59 +0000 |
525 | @@ -86,7 +86,8 @@ |
526 | decor_t *d = g_object_get_data (G_OBJECT (win), "decor"); |
527 | guint state = d->button_states[button]; |
528 | |
529 | - handle_tooltip_event (win, gtkwd_event, gtkwd_type, state, tooltip); |
530 | + if (settings->use_tooltips) |
531 | + handle_tooltip_event (win, gtkwd_event, gtkwd_type, state, tooltip); |
532 | |
533 | if (d->frame_window && gtkwd_type == GEnterNotify) |
534 | { |
535 | @@ -164,7 +165,18 @@ |
536 | { |
537 | if (state == BUTTON_EVENT_ACTION_STATE) |
538 | { |
539 | - if (gtkwd_event->button == 2) |
540 | + if (gtkwd_event->button == 1) |
541 | + { |
542 | + if (wnck_window_is_maximized (win)) |
543 | + wnck_window_unmaximize (win); |
544 | + else if (wnck_window_is_maximized_vertically (win)) |
545 | + wnck_window_unmaximize_vertically (win); |
546 | + else if (wnck_window_is_maximized_horizontally (win)) |
547 | + wnck_window_unmaximize_horizontally (win); |
548 | + else |
549 | + wnck_window_maximize (win); |
550 | + } |
551 | + else if (gtkwd_event->button == 2) |
552 | { |
553 | if (wnck_window_is_maximized_vertically (win)) |
554 | wnck_window_unmaximize_vertically (win); |
555 | @@ -178,13 +190,6 @@ |
556 | else |
557 | wnck_window_maximize_horizontally (win); |
558 | } |
559 | - else |
560 | - { |
561 | - if (wnck_window_is_maximized (win)) |
562 | - wnck_window_unmaximize (win); |
563 | - else |
564 | - wnck_window_maximize (win); |
565 | - } |
566 | } |
567 | } |
568 | break; |
569 | |
570 | === modified file 'gtk/window-decorator/frames.c' |
571 | --- gtk/window-decorator/frames.c 2011-05-07 08:58:10 +0000 |
572 | +++ gtk/window-decorator/frames.c 2011-10-15 07:11:59 +0000 |
573 | @@ -34,10 +34,11 @@ |
574 | void |
575 | decor_frame_refresh (decor_frame_t *frame) |
576 | { |
577 | - decor_shadow_options_t opt_shadow; |
578 | - decor_shadow_options_t opt_no_shadow; |
579 | + decor_shadow_options_t active_o, inactive_o; |
580 | decor_shadow_info_t *info; |
581 | |
582 | + gwd_decor_frame_ref (frame); |
583 | + |
584 | update_style (frame->style_window_rgba); |
585 | update_style (frame->style_window_rgb); |
586 | |
587 | @@ -53,19 +54,8 @@ |
588 | strcmp (frame->type, "bare") != 0) |
589 | (*theme_update_border_extents) (frame); |
590 | |
591 | - opt_shadow.shadow_radius = settings->shadow_radius; |
592 | - opt_shadow.shadow_opacity = settings->shadow_opacity; |
593 | - |
594 | - memcpy (opt_shadow.shadow_color, settings->shadow_color, sizeof (settings->shadow_color)); |
595 | - |
596 | - opt_shadow.shadow_offset_x = settings->shadow_offset_x; |
597 | - opt_shadow.shadow_offset_y = settings->shadow_offset_y; |
598 | - |
599 | - opt_no_shadow.shadow_radius = 0; |
600 | - opt_no_shadow.shadow_opacity = 0; |
601 | - |
602 | - opt_no_shadow.shadow_offset_x = 0; |
603 | - opt_no_shadow.shadow_offset_y = 0; |
604 | + (*theme_get_shadow) (frame, &active_o, TRUE); |
605 | + (*theme_get_shadow) (frame, &inactive_o, FALSE); |
606 | |
607 | info = malloc (sizeof (decor_shadow_info_t)); |
608 | |
609 | @@ -75,7 +65,9 @@ |
610 | info->frame = frame; |
611 | info->state = 0; |
612 | |
613 | - frame_update_shadow (frame, info, &opt_shadow, &opt_no_shadow); |
614 | + frame_update_shadow (frame, info, &active_o, &inactive_o); |
615 | + |
616 | + gwd_decor_frame_unref (frame); |
617 | |
618 | free (info); |
619 | info = NULL; |
620 | @@ -221,10 +213,12 @@ |
621 | frame->refcount = 0; |
622 | frame->titlebar_height = 17; |
623 | frame->max_titlebar_height = 17; |
624 | - frame->border_shadow = NULL; |
625 | + frame->border_shadow_active = NULL; |
626 | + frame->border_shadow_inactive = NULL; |
627 | frame->border_no_shadow = NULL; |
628 | frame->max_border_no_shadow = NULL; |
629 | - frame->max_border_shadow = NULL; |
630 | + frame->max_border_shadow_active = NULL; |
631 | + frame->max_border_shadow_inactive = NULL; |
632 | frame->titlebar_font = NULL; |
633 | |
634 | frame->style_window_rgba = gtk_window_new (GTK_WINDOW_POPUP); |
635 | @@ -269,14 +263,20 @@ |
636 | { |
637 | Display *xdisplay = gdk_x11_get_default_xdisplay (); |
638 | |
639 | - if (frame->border_shadow) |
640 | - decor_shadow_destroy (xdisplay, frame->border_shadow); |
641 | + if (frame->border_shadow_active) |
642 | + decor_shadow_destroy (xdisplay, frame->border_shadow_active); |
643 | + |
644 | + if (frame->border_shadow_inactive) |
645 | + decor_shadow_destroy (xdisplay, frame->border_shadow_inactive); |
646 | |
647 | if (frame->border_no_shadow) |
648 | decor_shadow_destroy (xdisplay, frame->border_no_shadow); |
649 | |
650 | - if (frame->max_border_shadow) |
651 | - decor_shadow_destroy (xdisplay, frame->max_border_shadow); |
652 | + if (frame->max_border_shadow_active) |
653 | + decor_shadow_destroy (xdisplay, frame->max_border_shadow_active); |
654 | + |
655 | + if (frame->max_border_shadow_inactive) |
656 | + decor_shadow_destroy (xdisplay, frame->max_border_shadow_inactive); |
657 | |
658 | if (frame->max_border_no_shadow) |
659 | decor_shadow_destroy (xdisplay, frame->max_border_no_shadow); |
660 | |
661 | === modified file 'gtk/window-decorator/gtk-window-decorator.c' |
662 | --- gtk/window-decorator/gtk-window-decorator.c 2011-05-08 13:45:38 +0000 |
663 | +++ gtk/window-decorator/gtk-window-decorator.c 2011-10-15 07:11:59 +0000 |
664 | @@ -83,7 +83,7 @@ |
665 | }; |
666 | |
667 | #define WINDOW_TYPE_FRAMES_NUM 5 |
668 | -struct _default_frame_references default_frames[WINDOW_TYPE_FRAMES_NUM * 2] = { |
669 | +default_frame_references_t default_frames[WINDOW_TYPE_FRAMES_NUM * 2] = { |
670 | /* active */ |
671 | {"normal", NULL }, |
672 | {"dialog", NULL }, |
673 | @@ -164,14 +164,22 @@ |
674 | settings->blur_type = BLUR_TYPE_NONE; |
675 | settings->use_system_font = FALSE; |
676 | |
677 | - settings->shadow_radius = SHADOW_RADIUS; |
678 | - settings->shadow_opacity = SHADOW_OPACITY; |
679 | - settings->shadow_color[0] = SHADOW_COLOR_RED; |
680 | - settings->shadow_color[1] = SHADOW_COLOR_GREEN; |
681 | - settings->shadow_color[2] = SHADOW_COLOR_BLUE; |
682 | - settings->shadow_offset_x = SHADOW_OFFSET_X; |
683 | - settings->shadow_offset_y = SHADOW_OFFSET_Y; |
684 | + settings->active_shadow_radius = SHADOW_RADIUS; |
685 | + settings->active_shadow_opacity = SHADOW_OPACITY; |
686 | + settings->active_shadow_color[0] = SHADOW_COLOR_RED; |
687 | + settings->active_shadow_color[1] = SHADOW_COLOR_GREEN; |
688 | + settings->active_shadow_color[2] = SHADOW_COLOR_BLUE; |
689 | + settings->active_shadow_offset_x = SHADOW_OFFSET_X; |
690 | + settings->active_shadow_offset_y = SHADOW_OFFSET_Y; |
691 | + settings->inactive_shadow_radius = SHADOW_RADIUS; |
692 | + settings->inactive_shadow_opacity = SHADOW_OPACITY; |
693 | + settings->inactive_shadow_color[0] = SHADOW_COLOR_RED; |
694 | + settings->inactive_shadow_color[1] = SHADOW_COLOR_GREEN; |
695 | + settings->inactive_shadow_color[2] = SHADOW_COLOR_BLUE; |
696 | + settings->inactive_shadow_offset_x = SHADOW_OFFSET_X; |
697 | + settings->inactive_shadow_offset_y = SHADOW_OFFSET_Y; |
698 | settings->decoration_alpha = 0.5; |
699 | + settings->use_tooltips = TRUE; |
700 | |
701 | #ifdef USE_METACITY |
702 | |
703 | @@ -185,6 +193,9 @@ |
704 | |
705 | settings->font = strdup ("Sans Bold 12"); |
706 | |
707 | + settings->mutter_draggable_border_width = 10; |
708 | + settings->mutter_attach_modal_dialogs = FALSE; |
709 | + |
710 | for (i = 0; i < argc; i++) |
711 | { |
712 | if (strcmp (argv[i], "--minimal") == 0) |
713 | @@ -338,6 +349,7 @@ |
714 | theme_get_event_window_position = get_event_window_position; |
715 | theme_get_button_position = get_button_position; |
716 | theme_get_title_scale = get_title_scale; |
717 | + theme_get_shadow = cairo_get_shadow; |
718 | |
719 | #ifdef USE_METACITY |
720 | if (meta_theme) |
721 | @@ -360,6 +372,7 @@ |
722 | theme_get_event_window_position = meta_get_event_window_position; |
723 | theme_get_button_position = meta_get_button_position; |
724 | theme_get_title_scale = meta_get_title_scale; |
725 | + theme_get_shadow = meta_get_shadow; |
726 | } |
727 | #endif |
728 | |
729 | |
730 | === modified file 'gtk/window-decorator/gtk-window-decorator.h' |
731 | --- gtk/window-decorator/gtk-window-decorator.h 2011-05-08 13:45:38 +0000 |
732 | +++ gtk/window-decorator/gtk-window-decorator.h 2011-10-15 07:11:59 +0000 |
733 | @@ -110,6 +110,7 @@ |
734 | #endif |
735 | |
736 | #define METACITY_GCONF_DIR "/apps/metacity/general" |
737 | +#define MUTTER_GCONF_DIR "/apps/mutter/general" |
738 | |
739 | #define COMPIZ_USE_SYSTEM_FONT_KEY \ |
740 | METACITY_GCONF_DIR "/titlebar_uses_system_font" |
741 | @@ -126,22 +127,11 @@ |
742 | #define COMPIZ_RIGHT_CLICK_TITLEBAR_KEY \ |
743 | METACITY_GCONF_DIR "/action_right_click_titlebar" |
744 | |
745 | -#define COMPIZ_GCONF_DIR1 "/apps/compiz/plugins/decoration/allscreens/options" |
746 | - |
747 | -#define COMPIZ_SHADOW_RADIUS_KEY \ |
748 | -COMPIZ_GCONF_DIR1 "/shadow_radius" |
749 | - |
750 | -#define COMPIZ_SHADOW_OPACITY_KEY \ |
751 | -COMPIZ_GCONF_DIR1 "/shadow_opacity" |
752 | - |
753 | -#define COMPIZ_SHADOW_COLOR_KEY \ |
754 | -COMPIZ_GCONF_DIR1 "/shadow_color" |
755 | - |
756 | -#define COMPIZ_SHADOW_OFFSET_X_KEY \ |
757 | -COMPIZ_GCONF_DIR1 "/shadow_x_offset" |
758 | - |
759 | -#define COMPIZ_SHADOW_OFFSET_Y_KEY \ |
760 | -COMPIZ_GCONF_DIR1 "/shadow_y_offset" |
761 | +#define MUTTER_DRAGGABLE_BORDER_WIDTH_KEY \ |
762 | +MUTTER_GCONF_DIR "/draggable_border_width" |
763 | + |
764 | +#define MUTTER_ATTACH_MODAL_DIALOGS_KEY \ |
765 | +MUTTER_GCONF_DIR "/attach_modal_dialogs" |
766 | |
767 | #define META_THEME_KEY \ |
768 | METACITY_GCONF_DIR "/theme" |
769 | @@ -172,6 +162,9 @@ |
770 | #define WHEEL_ACTION_KEY \ |
771 | GCONF_DIR "/mouse_wheel_action" |
772 | |
773 | +#define USE_TOOLTIPS_KEY \ |
774 | +GCONF_DIR "/use_tooltips" |
775 | + |
776 | #define DBUS_DEST "org.freedesktop.compiz" |
777 | #define DBUS_PATH "/org/freedesktop/compiz/decor/screen0" |
778 | #define DBUS_INTERFACE "org.freedesktop.compiz" |
779 | @@ -256,11 +249,16 @@ |
780 | int middle_click_action; |
781 | int right_click_action; |
782 | int wheel_action; |
783 | - gdouble shadow_radius; |
784 | - gdouble shadow_opacity; |
785 | - gushort shadow_color[3]; |
786 | - gint shadow_offset_x; |
787 | - gint shadow_offset_y; |
788 | + gdouble active_shadow_radius; |
789 | + gdouble active_shadow_opacity; |
790 | + gushort active_shadow_color[3]; |
791 | + gint active_shadow_offset_x; |
792 | + gint active_shadow_offset_y; |
793 | + gdouble inactive_shadow_radius; |
794 | + gdouble inactive_shadow_opacity; |
795 | + gushort inactive_shadow_color[3]; |
796 | + gint inactive_shadow_offset_x; |
797 | + gint inactive_shadow_offset_y; |
798 | #ifdef USE_METACITY |
799 | double meta_opacity; |
800 | gboolean meta_shade_opacity; |
801 | @@ -274,6 +272,9 @@ |
802 | gboolean use_system_font; |
803 | gint blur_type; |
804 | gchar *font; |
805 | + guint mutter_draggable_border_width; |
806 | + gboolean mutter_attach_modal_dialogs; |
807 | + gboolean use_tooltips; |
808 | } decor_settings_t; |
809 | |
810 | #define DOUBLE_CLICK_ACTION_DEFAULT CLICK_ACTION_MAXIMIZE |
811 | @@ -381,11 +382,16 @@ |
812 | { |
813 | decor_frame_t *frame; |
814 | unsigned int state; |
815 | + gboolean active; |
816 | }; |
817 | |
818 | typedef void (*frame_update_shadow_proc) (Display *display, |
819 | Screen *screen, |
820 | decor_frame_t *frame, |
821 | + decor_shadow_t **shadow_normal, |
822 | + decor_context_t *context_normal, |
823 | + decor_shadow_t **shadow_max, |
824 | + decor_context_t *context_max, |
825 | decor_shadow_info_t *info, |
826 | decor_shadow_options_t *opt_shadow, |
827 | decor_shadow_options_t *opt_no_shadow); |
828 | @@ -398,13 +404,17 @@ |
829 | decor_extents_t max_win_extents; |
830 | int titlebar_height; |
831 | int max_titlebar_height; |
832 | - decor_shadow_t *border_shadow; |
833 | + decor_shadow_t *border_shadow_active; |
834 | + decor_shadow_t *border_shadow_inactive; |
835 | decor_shadow_t *border_no_shadow; |
836 | - decor_shadow_t *max_border_shadow; |
837 | + decor_shadow_t *max_border_shadow_active; |
838 | + decor_shadow_t *max_border_shadow_inactive; |
839 | decor_shadow_t *max_border_no_shadow; |
840 | - decor_context_t window_context; |
841 | + decor_context_t window_context_active; |
842 | + decor_context_t window_context_inactive; |
843 | decor_context_t window_context_no_shadow; |
844 | - decor_context_t max_window_context; |
845 | + decor_context_t max_window_context_active; |
846 | + decor_context_t max_window_context_inactive; |
847 | decor_context_t max_window_context_no_shadow; |
848 | PangoFontDescription *titlebar_font; |
849 | PangoContext *pango_context; |
850 | @@ -456,13 +466,19 @@ |
851 | } decor_t; |
852 | |
853 | #define WINDOW_TYPE_FRAMES_NUM 5 |
854 | -struct _default_frame_references |
855 | +typedef struct _default_frame_references |
856 | { |
857 | char *name; |
858 | decor_t *d; |
859 | -} extern default_frames[WINDOW_TYPE_FRAMES_NUM * 2]; |
860 | +} default_frame_references_t; |
861 | + |
862 | +extern default_frame_references_t default_frames[WINDOW_TYPE_FRAMES_NUM * 2]; |
863 | const gchar * window_type_frames[WINDOW_TYPE_FRAMES_NUM]; |
864 | |
865 | +void (*theme_get_shadow) (decor_frame_t *d, |
866 | + decor_shadow_options_t *, |
867 | + gboolean); |
868 | + |
869 | void (*theme_draw_window_decoration) (decor_t *d); |
870 | gboolean (*theme_calc_decoration_size) (decor_t *d, |
871 | int client_width, |
872 | @@ -580,6 +596,10 @@ |
873 | bare_frame_update_shadow (Display *xdisplay, |
874 | Screen *screen, |
875 | decor_frame_t *frame, |
876 | + decor_shadow_t **shadow_normal, |
877 | + decor_context_t *context_normal, |
878 | + decor_shadow_t **shadow_max, |
879 | + decor_context_t *context_max, |
880 | decor_shadow_info_t *info, |
881 | decor_shadow_options_t *opt_shadow, |
882 | decor_shadow_options_t *opt_no_shadow); |
883 | @@ -588,6 +608,10 @@ |
884 | decor_frame_update_shadow (Display *xdisplay, |
885 | Screen *screen, |
886 | decor_frame_t *frame, |
887 | + decor_shadow_t **shadow_normal, |
888 | + decor_context_t *context_normal, |
889 | + decor_shadow_t **shadow_max, |
890 | + decor_context_t *context_max, |
891 | decor_shadow_info_t *info, |
892 | decor_shadow_options_t *opt_shadow, |
893 | decor_shadow_options_t *opt_no_shadow); |
894 | @@ -795,6 +819,9 @@ |
895 | gfloat |
896 | get_title_scale (decor_frame_t *frame); |
897 | |
898 | +void |
899 | +cairo_get_shadow (decor_frame_t *, decor_shadow_options_t *opts, gboolean active); |
900 | + |
901 | /* gdk.c */ |
902 | |
903 | void |
904 | @@ -881,6 +908,10 @@ |
905 | |
906 | void |
907 | meta_update_button_layout (const char *value); |
908 | + |
909 | +void |
910 | +meta_get_shadow (decor_frame_t *, decor_shadow_options_t *opts, gboolean active); |
911 | + |
912 | #endif |
913 | /* switcher.c */ |
914 | |
915 | @@ -890,6 +921,10 @@ |
916 | switcher_frame_update_shadow (Display *xdisplay, |
917 | Screen *screen, |
918 | decor_frame_t *frame, |
919 | + decor_shadow_t **shadow_normal, |
920 | + decor_context_t *context_normal, |
921 | + decor_shadow_t **shadow_max, |
922 | + decor_context_t *context_max, |
923 | decor_shadow_info_t *info, |
924 | decor_shadow_options_t *opt_shadow, |
925 | decor_shadow_options_t *opt_no_shadow); |
926 | |
927 | === modified file 'gtk/window-decorator/gwd.schemas.in' |
928 | --- gtk/window-decorator/gwd.schemas.in 2007-09-09 06:55:46 +0000 |
929 | +++ gtk/window-decorator/gwd.schemas.in 2011-10-15 07:11:59 +0000 |
930 | @@ -77,5 +77,16 @@ |
931 | <long>Shade active windows with metacity theme decorations from opaque to translucent</long> |
932 | </locale> |
933 | </schema> |
934 | + <schema> |
935 | + <key>/schemas/apps/gwd/use_tooltops</key> |
936 | + <applyto>/apps/gwd/use_tooltips</applyto> |
937 | + <owner>gwd</owner> |
938 | + <type>bool</type> |
939 | + <default>true</default> |
940 | + <locale name="C"> |
941 | + <short>Use tooltips</short> |
942 | + <long>Show tooltip windows on decorator functions</long> |
943 | + </locale> |
944 | + </schema> |
945 | </schemalist> |
946 | </gconfschemafile> |
947 | |
948 | === modified file 'gtk/window-decorator/metacity.c' |
949 | --- gtk/window-decorator/metacity.c 2011-06-23 03:03:04 +0000 |
950 | +++ gtk/window-decorator/metacity.c 2011-10-15 07:11:59 +0000 |
951 | @@ -40,19 +40,31 @@ |
952 | Display *xdisplay = |
953 | GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); |
954 | gint nQuad; |
955 | - decor_extents_t win_extents = d->frame->win_extents; |
956 | - decor_extents_t max_win_extents = d->frame->max_win_extents; |
957 | + decor_extents_t win_extents, frame_win_extents; |
958 | + decor_extents_t max_win_extents, frame_max_win_extents; |
959 | decor_quad_t quads[N_QUADS_MAX]; |
960 | unsigned int nOffset = 1; |
961 | - unsigned int frame_type = populate_frame_type (d); |
962 | - unsigned int frame_state = populate_frame_state (d); |
963 | - unsigned int frame_actions = populate_frame_actions (d); |
964 | + unsigned int frame_type = populate_frame_type (d); |
965 | + unsigned int frame_state = populate_frame_state (d); |
966 | + unsigned int frame_actions = populate_frame_actions (d); |
967 | gint w, lh, rh; |
968 | gint top_stretch_offset; |
969 | gint bottom_stretch_offset; |
970 | gint left_stretch_offset; |
971 | gint right_stretch_offset; |
972 | |
973 | + win_extents = frame_win_extents = d->frame->win_extents; |
974 | + max_win_extents = frame_max_win_extents = d->frame->max_win_extents; |
975 | + |
976 | + /* Add the invisible grab area padding, but only for |
977 | + * pixmap type decorations */ |
978 | + if (!d->frame_window) |
979 | + { |
980 | + frame_win_extents.left += settings->mutter_draggable_border_width; |
981 | + frame_win_extents.right += settings->mutter_draggable_border_width; |
982 | + frame_win_extents.bottom += settings->mutter_draggable_border_width; |
983 | + } |
984 | + |
985 | w = d->border_layout.top.x2 - d->border_layout.top.x1 - |
986 | d->context->left_space - d->context->right_space; |
987 | |
988 | @@ -82,25 +94,29 @@ |
989 | bottom_stretch_offset); |
990 | |
991 | win_extents.top += d->frame->titlebar_height; |
992 | + frame_win_extents.top += d->frame->titlebar_height; |
993 | max_win_extents.top += d->frame->max_titlebar_height; |
994 | + frame_max_win_extents.top += d->frame->max_titlebar_height; |
995 | |
996 | if (d->frame_window) |
997 | { |
998 | - data = decor_alloc_property (nOffset, WINDOW_DECORATION_TYPE_WINDOW); |
999 | - decor_gen_window_property (data, nOffset - 1, &win_extents, &max_win_extents, 20, 20, frame_type, frame_state, frame_actions); |
1000 | + data = decor_alloc_property (nOffset, WINDOW_DECORATION_TYPE_WINDOW); |
1001 | + decor_gen_window_property (data, nOffset - 1, &win_extents, &max_win_extents, 20, 20, |
1002 | + frame_type, frame_state, frame_actions); |
1003 | } |
1004 | else |
1005 | { |
1006 | - data = decor_alloc_property (nOffset, WINDOW_DECORATION_TYPE_PIXMAP); |
1007 | - decor_quads_to_property (data, nOffset - 1, GDK_PIXMAP_XID (d->pixmap), |
1008 | - &win_extents, &win_extents, |
1009 | - &max_win_extents, &max_win_extents, |
1010 | + data = decor_alloc_property (nOffset, WINDOW_DECORATION_TYPE_PIXMAP); |
1011 | + decor_quads_to_property (data, nOffset - 1, GDK_PIXMAP_XID (d->pixmap), |
1012 | + &frame_win_extents, &win_extents, |
1013 | + &frame_max_win_extents, &max_win_extents, |
1014 | ICON_SPACE + d->button_width, |
1015 | 0, |
1016 | - quads, nQuad, 0, 0, 0); |
1017 | + quads, nQuad, frame_type, frame_state, frame_actions); |
1018 | } |
1019 | |
1020 | gdk_error_trap_push (); |
1021 | + |
1022 | XChangeProperty (xdisplay, d->prop_xid, |
1023 | win_decor_atom, |
1024 | XA_INTEGER, |
1025 | @@ -109,14 +125,14 @@ |
1026 | gdk_display_sync (gdk_display_get_default ()); |
1027 | gdk_error_trap_pop (); |
1028 | |
1029 | + free (data); |
1030 | + |
1031 | decor_update_blur_property (d, |
1032 | w, lh, |
1033 | top, top_stretch_offset, |
1034 | bottom, bottom_stretch_offset, |
1035 | left, left_stretch_offset, |
1036 | right, right_stretch_offset); |
1037 | - |
1038 | - free (data); |
1039 | } |
1040 | |
1041 | static void |
1042 | @@ -496,7 +512,7 @@ |
1043 | if (d->active) |
1044 | *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS; |
1045 | |
1046 | - if ((d->state & META_MAXIMIZED) == META_MAXIMIZED) |
1047 | + if ((d->state & META_MAXIMIZED)) |
1048 | *flags |= (MetaFrameFlags ) META_FRAME_MAXIMIZED; |
1049 | |
1050 | if (d->state & WNCK_WINDOW_STATE_STICKY) |
1051 | @@ -618,8 +634,6 @@ |
1052 | meta_get_decoration_geometry (d, theme, &flags, &fgeom, &button_layout, |
1053 | frame_type, &clip); |
1054 | |
1055 | - /* we only have to redraw the shadow background when decoration |
1056 | - changed size */ |
1057 | if ((d->prop_xid || !d->buffer_pixmap) && !d->frame_window) |
1058 | draw_shadow_background (d, cr, d->shadow, d->context); |
1059 | |
1060 | @@ -967,6 +981,7 @@ |
1061 | MetaFrameGeometry fgeom; |
1062 | MetaFrameFlags flags; |
1063 | MetaTheme *theme; |
1064 | + |
1065 | GdkRectangle clip; |
1066 | |
1067 | #ifdef HAVE_METACITY_2_15_21 |
1068 | @@ -1081,6 +1096,10 @@ |
1069 | *x += d->frame->win_extents.left + 4; |
1070 | *y += d->frame->win_extents.top + 2; |
1071 | } |
1072 | + else |
1073 | + { |
1074 | + *x += settings->mutter_draggable_border_width; |
1075 | + } |
1076 | |
1077 | return TRUE; |
1078 | } |
1079 | @@ -1114,12 +1133,20 @@ |
1080 | decor_context_t *context; |
1081 | decor_shadow_t *shadow; |
1082 | |
1083 | - if ((d->state & META_MAXIMIZED) == META_MAXIMIZED) |
1084 | + if ((d->state & META_MAXIMIZED)) |
1085 | { |
1086 | if (!d->frame_window) |
1087 | { |
1088 | - context = &d->frame->max_window_context; |
1089 | - shadow = d->frame->max_border_shadow; |
1090 | + if (d->active) |
1091 | + { |
1092 | + context = &d->frame->max_window_context_active; |
1093 | + shadow = d->frame->max_border_shadow_active; |
1094 | + } |
1095 | + else |
1096 | + { |
1097 | + context = &d->frame->max_window_context_inactive; |
1098 | + shadow = d->frame->max_border_shadow_inactive; |
1099 | + } |
1100 | } |
1101 | else |
1102 | { |
1103 | @@ -1131,8 +1158,16 @@ |
1104 | { |
1105 | if (!d->frame_window) |
1106 | { |
1107 | - context = &d->frame->window_context; |
1108 | - shadow = d->frame->border_shadow; |
1109 | + if (d->active) |
1110 | + { |
1111 | + context = &d->frame->window_context_active; |
1112 | + shadow = d->frame->border_shadow_active; |
1113 | + } |
1114 | + else |
1115 | + { |
1116 | + context = &d->frame->window_context_inactive; |
1117 | + shadow = d->frame->border_shadow_inactive; |
1118 | + } |
1119 | } |
1120 | else |
1121 | { |
1122 | @@ -1162,7 +1197,7 @@ |
1123 | } |
1124 | else |
1125 | { |
1126 | - if ((d->state & META_MAXIMIZED) == META_MAXIMIZED) |
1127 | + if ((d->state & META_MAXIMIZED)) |
1128 | decor_get_default_layout (context, d->client_width, |
1129 | d->client_height - d->frame->titlebar_height, |
1130 | &layout); |
1131 | @@ -1249,6 +1284,14 @@ |
1132 | } |
1133 | *w = fgeom.right_width + RESIZE_EXTENDS; |
1134 | *h = fgeom.bottom_height + RESIZE_EXTENDS; |
1135 | + |
1136 | + if (!d->frame_window) |
1137 | + { |
1138 | + *x += settings->mutter_draggable_border_width; |
1139 | + *w += settings->mutter_draggable_border_width; |
1140 | + *h += settings->mutter_draggable_border_width; |
1141 | + } |
1142 | + |
1143 | break; |
1144 | case 1: /* bottom */ |
1145 | *x = fgeom.left_width + RESIZE_EXTENDS; |
1146 | @@ -1258,6 +1301,14 @@ |
1147 | *w = width - fgeom.left_width - fgeom.right_width - |
1148 | (2 * RESIZE_EXTENDS); |
1149 | *h = fgeom.bottom_height; |
1150 | + |
1151 | + if (!d->frame_window) |
1152 | + { |
1153 | + *x -= settings->mutter_draggable_border_width; |
1154 | + *h += settings->mutter_draggable_border_width; |
1155 | + *w += settings->mutter_draggable_border_width * 2; |
1156 | + } |
1157 | + |
1158 | break; |
1159 | case 0: /* bottom left */ |
1160 | default: |
1161 | @@ -1270,6 +1321,13 @@ |
1162 | } |
1163 | *w = fgeom.left_width + RESIZE_EXTENDS; |
1164 | *h = fgeom.bottom_height + RESIZE_EXTENDS; |
1165 | + |
1166 | + if (!d->frame_window) |
1167 | + { |
1168 | + *w += settings->mutter_draggable_border_width; |
1169 | + *h += settings->mutter_draggable_border_width; |
1170 | + } |
1171 | + |
1172 | break; |
1173 | } |
1174 | break; |
1175 | @@ -1277,17 +1335,33 @@ |
1176 | switch (j) { |
1177 | case 2: /* right */ |
1178 | *x = width - fgeom.right_width; |
1179 | + *y = fgeom.top_height + RESIZE_EXTENDS; |
1180 | if (d->frame_window) |
1181 | *x += d->frame->win_extents.left + 2; |
1182 | *w = fgeom.right_width; |
1183 | *h = height - fgeom.top_height - fgeom.bottom_height - |
1184 | (2 * RESIZE_EXTENDS); |
1185 | + |
1186 | + if (!d->frame_window) |
1187 | + { |
1188 | + *x += settings->mutter_draggable_border_width; |
1189 | + *w += settings->mutter_draggable_border_width; |
1190 | + *h += settings->mutter_draggable_border_width; |
1191 | + } |
1192 | + |
1193 | + |
1194 | break; |
1195 | case 1: /* middle */ |
1196 | *x = fgeom.left_width; |
1197 | *y = fgeom.title_rect.y + TOP_RESIZE_HEIGHT; |
1198 | *w = width - fgeom.left_width - fgeom.right_width; |
1199 | *h = height - fgeom.top_titlebar_edge - fgeom.bottom_height; |
1200 | + |
1201 | + if (!d->frame_window) |
1202 | + { |
1203 | + *x += settings->mutter_draggable_border_width; |
1204 | + } |
1205 | + |
1206 | break; |
1207 | case 0: /* left */ |
1208 | default: |
1209 | @@ -1298,6 +1372,14 @@ |
1210 | *w = fgeom.left_width; |
1211 | *h = height - fgeom.top_height - fgeom.bottom_height - |
1212 | (2 * RESIZE_EXTENDS); |
1213 | + |
1214 | + if (!d->frame_window) |
1215 | + { |
1216 | + *h += settings->mutter_draggable_border_width; |
1217 | + *w += settings->mutter_draggable_border_width; |
1218 | + } |
1219 | + |
1220 | + |
1221 | break; |
1222 | } |
1223 | break; |
1224 | @@ -1314,6 +1396,12 @@ |
1225 | } |
1226 | *w = fgeom.right_width + RESIZE_EXTENDS; |
1227 | *h = fgeom.top_height + RESIZE_EXTENDS; |
1228 | + |
1229 | + if (!d->frame_window) |
1230 | + { |
1231 | + *x += settings->mutter_draggable_border_width; |
1232 | + *w += settings->mutter_draggable_border_width; |
1233 | + } |
1234 | break; |
1235 | case 1: /* top */ |
1236 | *x = fgeom.left_width + RESIZE_EXTENDS; |
1237 | @@ -1323,6 +1411,13 @@ |
1238 | *w = width - fgeom.left_width - fgeom.right_width - |
1239 | (2 * RESIZE_EXTENDS); |
1240 | *h = fgeom.title_rect.y + TOP_RESIZE_HEIGHT; |
1241 | + |
1242 | + if (!d->frame_window) |
1243 | + { |
1244 | + *x -= settings->mutter_draggable_border_width; |
1245 | + *w += settings->mutter_draggable_border_width * 2; |
1246 | + } |
1247 | + |
1248 | break; |
1249 | case 0: /* top left */ |
1250 | default: |
1251 | @@ -1335,6 +1430,10 @@ |
1252 | } |
1253 | *w = fgeom.left_width + RESIZE_EXTENDS; |
1254 | *h = fgeom.top_height + RESIZE_EXTENDS; |
1255 | + |
1256 | + if (!d->frame_window) |
1257 | + *w += settings->mutter_draggable_border_width; |
1258 | + |
1259 | break; |
1260 | } |
1261 | } |
1262 | @@ -1354,6 +1453,7 @@ |
1263 | } |
1264 | } |
1265 | |
1266 | + |
1267 | static MetaButtonFunction |
1268 | meta_button_function_from_string (const char *str) |
1269 | { |
1270 | |
1271 | === modified file 'gtk/window-decorator/settings.c' |
1272 | --- gtk/window-decorator/settings.c 2011-02-21 15:28:57 +0000 |
1273 | +++ gtk/window-decorator/settings.c 2011-10-15 07:11:59 +0000 |
1274 | @@ -46,29 +46,43 @@ |
1275 | if (result != Success) |
1276 | return FALSE; |
1277 | |
1278 | - if (n == 4) |
1279 | + if (n == 8) |
1280 | { |
1281 | long *data = (long *) prop_data; |
1282 | - gdouble radius = data[0]; |
1283 | - gdouble opacity = data[1]; |
1284 | - gint x_off = data[2]; |
1285 | - gint y_off = data[3]; |
1286 | + gdouble aradius = data[0]; |
1287 | + gdouble aopacity = data[1]; |
1288 | + gint ax_off = data[2]; |
1289 | + gint ay_off = data[3]; |
1290 | |
1291 | + gdouble iradius = data[4]; |
1292 | + gdouble iopacity = data[5]; |
1293 | + gint ix_off = data[6]; |
1294 | + gint iy_off = data[7]; |
1295 | /* Radius and Opacity are multiplied by 1000 to keep precision, |
1296 | * divide by that much to get our real radius and opacity |
1297 | */ |
1298 | - radius /= 1000; |
1299 | - opacity /= 1000; |
1300 | - |
1301 | - changed = radius != settings->shadow_radius || |
1302 | - opacity != settings->shadow_opacity || |
1303 | - x_off != settings->shadow_offset_x || |
1304 | - y_off != settings->shadow_offset_y; |
1305 | - |
1306 | - settings->shadow_radius = (gdouble) MAX (0.0, MIN (radius, 48.0)); |
1307 | - settings->shadow_opacity = (gdouble) MAX (0.0, MIN (opacity, 6.0)); |
1308 | - settings->shadow_offset_x = (gint) MAX (-16, MIN (x_off, 16)); |
1309 | - settings->shadow_offset_y = (gint) MAX (-16, MIN (y_off, 16)); |
1310 | + aradius /= 1000; |
1311 | + aopacity /= 1000; |
1312 | + iradius /= 1000; |
1313 | + iopacity /= 1000; |
1314 | + |
1315 | + changed = aradius != settings->active_shadow_radius || |
1316 | + aopacity != settings->active_shadow_opacity || |
1317 | + ax_off != settings->active_shadow_offset_x || |
1318 | + ay_off != settings->active_shadow_offset_y || |
1319 | + iradius != settings->inactive_shadow_radius || |
1320 | + iopacity != settings->inactive_shadow_opacity || |
1321 | + ix_off != settings->inactive_shadow_offset_x || |
1322 | + iy_off != settings->inactive_shadow_offset_y; |
1323 | + |
1324 | + settings->active_shadow_radius = (gdouble) MAX (0.0, MIN (aradius, 48.0)); |
1325 | + settings->active_shadow_opacity = (gdouble) MAX (0.0, MIN (aopacity, 6.0)); |
1326 | + settings->active_shadow_offset_x = (gint) MAX (-16, MIN (ax_off, 16)); |
1327 | + settings->active_shadow_offset_y = (gint) MAX (-16, MIN (ay_off, 16)); |
1328 | + settings->inactive_shadow_radius = (gdouble) MAX (0.0, MIN (iradius, 48.0)); |
1329 | + settings->inactive_shadow_opacity = (gdouble) MAX (0.0, MIN (iopacity, 6.0)); |
1330 | + settings->inactive_shadow_offset_x = (gint) MAX (-16, MIN (ix_off, 16)); |
1331 | + settings->inactive_shadow_offset_y = (gint) MAX (-16, MIN (iy_off, 16)); |
1332 | } |
1333 | |
1334 | XFree (prop_data); |
1335 | @@ -83,16 +97,25 @@ |
1336 | |
1337 | XTextPropertyToStringList (&shadow_color_xtp, &t_data, &ret_count); |
1338 | |
1339 | - if (ret_count == 1) |
1340 | + if (ret_count == 2) |
1341 | { |
1342 | int c[4]; |
1343 | |
1344 | if (sscanf (t_data[0], "#%2x%2x%2x%2x", |
1345 | &c[0], &c[1], &c[2], &c[3]) == 4) |
1346 | { |
1347 | - settings->shadow_color[0] = c[0] << 8 | c[0]; |
1348 | - settings->shadow_color[1] = c[1] << 8 | c[1]; |
1349 | - settings->shadow_color[2] = c[2] << 8 | c[2]; |
1350 | + settings->active_shadow_color[0] = c[0] << 8 | c[0]; |
1351 | + settings->active_shadow_color[1] = c[1] << 8 | c[1]; |
1352 | + settings->active_shadow_color[2] = c[2] << 8 | c[2]; |
1353 | + changed = TRUE; |
1354 | + } |
1355 | + |
1356 | + if (sscanf (t_data[1], "#%2x%2x%2x%2x", |
1357 | + &c[0], &c[1], &c[2], &c[3]) == 4) |
1358 | + { |
1359 | + settings->inactive_shadow_color[0] = c[0] << 8 | c[0]; |
1360 | + settings->inactive_shadow_color[1] = c[1] << 8 | c[1]; |
1361 | + settings->inactive_shadow_color[2] = c[2] << 8 | c[2]; |
1362 | changed = TRUE; |
1363 | } |
1364 | } |
1365 | @@ -107,6 +130,63 @@ |
1366 | |
1367 | #ifdef USE_GCONF |
1368 | static gboolean |
1369 | +use_tooltips_changed (GConfClient *client) |
1370 | +{ |
1371 | + gboolean new_use_tooltips; |
1372 | + gboolean use_tooltips = settings->use_tooltips; |
1373 | + |
1374 | + new_use_tooltips = gconf_client_get_bool (client, |
1375 | + USE_TOOLTIPS_KEY, |
1376 | + NULL); |
1377 | + |
1378 | + if (new_use_tooltips != use_tooltips) |
1379 | + { |
1380 | + settings->use_tooltips = new_use_tooltips; |
1381 | + return TRUE; |
1382 | + } |
1383 | + |
1384 | + return FALSE; |
1385 | +} |
1386 | + |
1387 | +static gboolean |
1388 | +mutter_draggable_border_width_changed (GConfClient *client) |
1389 | +{ |
1390 | + int new_width; |
1391 | + int width = settings->mutter_draggable_border_width; |
1392 | + |
1393 | + new_width = gconf_client_get_int (client, |
1394 | + MUTTER_DRAGGABLE_BORDER_WIDTH_KEY, |
1395 | + NULL); |
1396 | + |
1397 | + if (new_width != width) |
1398 | + { |
1399 | + settings->mutter_draggable_border_width = new_width; |
1400 | + return TRUE; |
1401 | + } |
1402 | + |
1403 | + return FALSE; |
1404 | +} |
1405 | + |
1406 | +static gboolean |
1407 | +mutter_attach_modal_dialogs_changed (GConfClient *client) |
1408 | +{ |
1409 | + gboolean new_attach; |
1410 | + gboolean attach = settings->mutter_attach_modal_dialogs; |
1411 | + |
1412 | + new_attach = gconf_client_get_bool (client, |
1413 | + MUTTER_ATTACH_MODAL_DIALOGS_KEY, |
1414 | + NULL); |
1415 | + |
1416 | + if (new_attach != attach) |
1417 | + { |
1418 | + settings->mutter_attach_modal_dialogs = new_attach; |
1419 | + return TRUE; |
1420 | + } |
1421 | + |
1422 | + return FALSE; |
1423 | +} |
1424 | + |
1425 | +static gboolean |
1426 | blur_settings_changed (GConfClient *client) |
1427 | { |
1428 | gchar *type; |
1429 | @@ -184,6 +264,7 @@ |
1430 | theme_get_event_window_position = meta_get_event_window_position; |
1431 | theme_get_button_position = meta_get_button_position; |
1432 | theme_get_title_scale = meta_get_title_scale; |
1433 | + theme_get_shadow = meta_get_shadow; |
1434 | } |
1435 | else |
1436 | { |
1437 | @@ -193,6 +274,7 @@ |
1438 | theme_get_event_window_position = get_event_window_position; |
1439 | theme_get_button_position = get_button_position; |
1440 | theme_get_title_scale = get_title_scale; |
1441 | + theme_get_shadow = cairo_get_shadow; |
1442 | } |
1443 | |
1444 | return TRUE; |
1445 | @@ -203,6 +285,7 @@ |
1446 | theme_get_event_window_position = get_event_window_position; |
1447 | theme_get_button_position = get_button_position; |
1448 | theme_get_title_scale = get_title_scale; |
1449 | + theme_get_shadow = cairo_get_shadow; |
1450 | |
1451 | return FALSE; |
1452 | #endif |
1453 | @@ -486,6 +569,21 @@ |
1454 | if (theme_opacity_changed (client)) |
1455 | changed = TRUE; |
1456 | } |
1457 | + else if (strcmp (key, MUTTER_DRAGGABLE_BORDER_WIDTH_KEY) == 0) |
1458 | + { |
1459 | + if (mutter_draggable_border_width_changed (client)) |
1460 | + changed = TRUE; |
1461 | + } |
1462 | + else if (strcmp (key, MUTTER_ATTACH_MODAL_DIALOGS_KEY) == 0) |
1463 | + { |
1464 | + if (mutter_attach_modal_dialogs_changed (client)) |
1465 | + changed = TRUE; |
1466 | + } |
1467 | + else if (strcmp (key, USE_TOOLTIPS_KEY) == 0) |
1468 | + { |
1469 | + if (use_tooltips_changed (client)) |
1470 | + changed = TRUE; |
1471 | + } |
1472 | |
1473 | if (changed) |
1474 | decorations_changed (data); |
1475 | @@ -510,6 +608,11 @@ |
1476 | GCONF_CLIENT_PRELOAD_ONELEVEL, |
1477 | NULL); |
1478 | |
1479 | + gconf_client_add_dir (gconf, |
1480 | + MUTTER_GCONF_DIR, |
1481 | + GCONF_CLIENT_PRELOAD_ONELEVEL, |
1482 | + NULL); |
1483 | + |
1484 | g_signal_connect (G_OBJECT (gconf), |
1485 | "value_changed", |
1486 | G_CALLBACK (value_changed), |
1487 | @@ -537,9 +640,13 @@ |
1488 | wheel_action_changed (gconf); |
1489 | blur_settings_changed (gconf); |
1490 | |
1491 | + mutter_draggable_border_width_changed (gconf); |
1492 | + mutter_attach_modal_dialogs_changed (gconf); |
1493 | + use_tooltips_changed (gconf); |
1494 | + |
1495 | g_object_unref (gconf); |
1496 | #endif |
1497 | - |
1498 | + |
1499 | shadow_property_changed (screen); |
1500 | |
1501 | return TRUE; |
1502 | |
1503 | === modified file 'gtk/window-decorator/switcher.c' |
1504 | --- gtk/window-decorator/switcher.c 2011-02-21 12:55:51 +0000 |
1505 | +++ gtk/window-decorator/switcher.c 2011-10-15 07:11:59 +0000 |
1506 | @@ -41,9 +41,11 @@ |
1507 | frame->win_extents = _switcher_extents; |
1508 | frame->max_win_extents = _switcher_extents; |
1509 | frame->win_extents = _switcher_extents; |
1510 | - frame->window_context = _switcher_context; |
1511 | + frame->window_context_inactive = _switcher_context; |
1512 | + frame->window_context_active = _switcher_context; |
1513 | frame->window_context_no_shadow = _switcher_context; |
1514 | - frame->max_window_context = _switcher_context; |
1515 | + frame->max_window_context_active = _switcher_context; |
1516 | + frame->max_window_context_inactive = _switcher_context; |
1517 | frame->max_window_context_no_shadow = _switcher_context; |
1518 | frame->update_shadow = switcher_frame_update_shadow; |
1519 | |
1520 | @@ -95,10 +97,10 @@ |
1521 | |
1522 | top = d->frame->win_extents.top; |
1523 | |
1524 | - x1 = d->frame->window_context.left_space - d->frame->win_extents.left; |
1525 | - y1 = d->frame->window_context.top_space - d->frame->win_extents.top; |
1526 | - x2 = d->width - d->frame->window_context.right_space + d->frame->win_extents.right; |
1527 | - y2 = d->height - d->frame->window_context.bottom_space + d->frame->win_extents.bottom; |
1528 | + x1 = d->frame->window_context_active.left_space - d->frame->win_extents.left; |
1529 | + y1 = d->frame->window_context_active.top_space - d->frame->win_extents.top; |
1530 | + x2 = d->width - d->frame->window_context_active.right_space + d->frame->win_extents.right; |
1531 | + y2 = d->height - d->frame->window_context_active.bottom_space + d->frame->win_extents.bottom; |
1532 | |
1533 | h = y2 - y1 - d->frame->win_extents.top - d->frame->win_extents.top; |
1534 | |
1535 | @@ -106,7 +108,7 @@ |
1536 | |
1537 | cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); |
1538 | |
1539 | - draw_shadow_background (d, cr, d->frame->border_shadow, &d->frame->window_context); |
1540 | + draw_shadow_background (d, cr, d->frame->border_shadow_active, &d->frame->window_context_active); |
1541 | |
1542 | fill_rounded_rectangle (cr, |
1543 | x1 + 0.5, |
1544 | @@ -280,10 +282,10 @@ |
1545 | |
1546 | cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); |
1547 | |
1548 | - cairo_rectangle (cr, d->frame->window_context.left_space, |
1549 | - d->height - d->frame->window_context.bottom_space, |
1550 | - d->width - d->frame->window_context.left_space - |
1551 | - d->frame->window_context.right_space, |
1552 | + cairo_rectangle (cr, d->frame->window_context_active.left_space, |
1553 | + d->height - d->frame->window_context_active.bottom_space, |
1554 | + d->width - d->frame->window_context_active.left_space - |
1555 | + d->frame->window_context_active.right_space, |
1556 | SWITCHER_SPACE); |
1557 | |
1558 | gdk_cairo_set_source_color_alpha (cr, |
1559 | @@ -304,7 +306,7 @@ |
1560 | pango_layout_get_pixel_size (d->layout, &w, NULL); |
1561 | |
1562 | cairo_move_to (cr, d->width / 2 - w / 2, |
1563 | - d->height - d->frame->window_context.bottom_space + |
1564 | + d->height - d->frame->window_context_active.bottom_space + |
1565 | SWITCHER_SPACE / 2 - d->frame->text_height / 2); |
1566 | |
1567 | pango_cairo_show_layout (cr, d->layout); |
1568 | @@ -394,7 +396,7 @@ |
1569 | d->draw = draw_switcher_decoration; |
1570 | d->frame = gwd_get_decor_frame ("switcher"); |
1571 | |
1572 | - decor_get_default_layout (&d->frame->window_context, width, 1, &d->border_layout); |
1573 | + decor_get_default_layout (&d->frame->window_context_active, width, 1, &d->border_layout); |
1574 | |
1575 | width = d->border_layout.width; |
1576 | height = d->border_layout.height; |
1577 | @@ -426,8 +428,8 @@ |
1578 | { |
1579 | int tw; |
1580 | |
1581 | - tw = width - d->frame->window_context.left_space - |
1582 | - d->frame->window_context.right_space - 64; |
1583 | + tw = width - d->frame->window_context_active.left_space - |
1584 | + d->frame->window_context_active.right_space - 64; |
1585 | pango_layout_set_auto_dir (d->layout, FALSE); |
1586 | pango_layout_set_width (d->layout, tw * PANGO_SCALE); |
1587 | pango_layout_set_text (d->layout, name, name_length); |
1588 | @@ -493,9 +495,6 @@ |
1589 | if (d->picture) |
1590 | XRenderFreePicture (xdisplay, d->picture); |
1591 | |
1592 | - g_object_ref (G_OBJECT (pixmap)); |
1593 | - g_object_ref (G_OBJECT (buffer_pixmap)); |
1594 | - |
1595 | d->pixmap = pixmap; |
1596 | d->buffer_pixmap = buffer_pixmap; |
1597 | d->cr = gdk_cairo_create (pixmap); |
1598 | |
1599 | === modified file 'gtk/window-decorator/wnck.c' |
1600 | --- gtk/window-decorator/wnck.c 2011-05-08 13:45:38 +0000 |
1601 | +++ gtk/window-decorator/wnck.c 2011-10-15 07:11:59 +0000 |
1602 | @@ -588,7 +588,56 @@ |
1603 | if (d && d->pixmap) |
1604 | { |
1605 | d->active = wnck_window_is_active (win); |
1606 | - queue_decor_draw (d); |
1607 | + if ((d->state & META_MAXIMIZED) == META_MAXIMIZED) |
1608 | + { |
1609 | + if (!d->frame_window) |
1610 | + { |
1611 | + if (d->active) |
1612 | + { |
1613 | + d->context = &d->frame->max_window_context_active; |
1614 | + d->shadow = d->frame->max_border_shadow_active; |
1615 | + } |
1616 | + else |
1617 | + { |
1618 | + d->context = &d->frame->max_window_context_inactive; |
1619 | + d->shadow = d->frame->max_border_shadow_inactive; |
1620 | + } |
1621 | + } |
1622 | + else |
1623 | + { |
1624 | + d->shadow = d->frame->max_border_no_shadow; |
1625 | + } |
1626 | + } |
1627 | + else |
1628 | + { |
1629 | + if (!d->frame_window) |
1630 | + { |
1631 | + if (d->active) |
1632 | + { |
1633 | + d->context = &d->frame->window_context_active; |
1634 | + d->shadow = d->frame->border_shadow_active; |
1635 | + } |
1636 | + else |
1637 | + { |
1638 | + d->context = &d->frame->window_context_inactive; |
1639 | + d->shadow = d->frame->border_shadow_inactive; |
1640 | + } |
1641 | + } |
1642 | + else |
1643 | + { |
1644 | + d->shadow = d->frame->border_no_shadow; |
1645 | + } |
1646 | + } |
1647 | + |
1648 | + /* We need to update the decoration size here |
1649 | + * since the shadow size might have changed and |
1650 | + * in that case the decoration will be redrawn, |
1651 | + * however if the shadow size doesn't change |
1652 | + * then we need to redraw the decoration anyways |
1653 | + * since the image would have changed */ |
1654 | + if (!update_window_decoration_size (d->win)) |
1655 | + queue_decor_draw (d); |
1656 | + |
1657 | } |
1658 | } |
1659 | |
1660 | @@ -599,7 +648,57 @@ |
1661 | if (d && d->pixmap) |
1662 | { |
1663 | d->active = wnck_window_is_active (win); |
1664 | - queue_decor_draw (d); |
1665 | + |
1666 | + if ((d->state & META_MAXIMIZED) == META_MAXIMIZED) |
1667 | + { |
1668 | + if (!d->frame_window) |
1669 | + { |
1670 | + if (d->active) |
1671 | + { |
1672 | + d->context = &d->frame->max_window_context_active; |
1673 | + d->shadow = d->frame->max_border_shadow_active; |
1674 | + } |
1675 | + else |
1676 | + { |
1677 | + d->context = &d->frame->max_window_context_inactive; |
1678 | + d->shadow = d->frame->max_border_shadow_inactive; |
1679 | + } |
1680 | + } |
1681 | + else |
1682 | + { |
1683 | + d->shadow = d->frame->max_border_no_shadow; |
1684 | + } |
1685 | + } |
1686 | + else |
1687 | + { |
1688 | + if (!d->frame_window) |
1689 | + { |
1690 | + if (d->active) |
1691 | + { |
1692 | + d->context = &d->frame->window_context_active; |
1693 | + d->shadow = d->frame->border_shadow_active; |
1694 | + } |
1695 | + else |
1696 | + { |
1697 | + d->context = &d->frame->window_context_inactive; |
1698 | + d->shadow = d->frame->border_shadow_inactive; |
1699 | + } |
1700 | + } |
1701 | + else |
1702 | + { |
1703 | + d->shadow = d->frame->border_no_shadow; |
1704 | + } |
1705 | + } |
1706 | + |
1707 | + /* We need to update the decoration size here |
1708 | + * since the shadow size might have changed and |
1709 | + * in that case the decoration will be redrawn, |
1710 | + * however if the shadow size doesn't change |
1711 | + * then we need to redraw the decoration anyways |
1712 | + * since the image would have changed */ |
1713 | + if (!update_window_decoration_size (d->win)) |
1714 | + queue_decor_draw (d); |
1715 | + |
1716 | } |
1717 | } |
1718 | } |
1719 | |
1720 | === modified file 'include/core/core.h' |
1721 | --- include/core/core.h 2011-09-19 12:54:22 +0000 |
1722 | +++ include/core/core.h 2011-10-15 07:11:59 +0000 |
1723 | @@ -27,7 +27,7 @@ |
1724 | #define _COMPIZ_CORE_H |
1725 | |
1726 | |
1727 | -#define CORE_ABIVERSION 20111011 |
1728 | +#define CORE_ABIVERSION 20110828 |
1729 | |
1730 | #include <stdio.h> |
1731 | #include <assert.h> |
1732 | |
1733 | === modified file 'kde/window-decorator-kde4/decorator.cpp' |
1734 | --- kde/window-decorator-kde4/decorator.cpp 2011-05-08 13:46:51 +0000 |
1735 | +++ kde/window-decorator-kde4/decorator.cpp 2011-10-15 07:11:59 +0000 |
1736 | @@ -61,7 +61,8 @@ |
1737 | KWD::Options *KWD::Decorator::mOptions = 0; |
1738 | NETRootInfo *KWD::Decorator::mRootInfo; |
1739 | WId KWD::Decorator::mActiveId; |
1740 | -decor_shadow_options_t KWD::Decorator::mShadowOptions; |
1741 | +decor_shadow_options_t KWD::Decorator::mActiveShadowOptions; |
1742 | +decor_shadow_options_t KWD::Decorator::mInactiveShadowOptions; |
1743 | |
1744 | KWD::Window *KWD::Decorator::mDecorNormal = NULL; |
1745 | KWD::Window *KWD::Decorator::mDecorActive = NULL; |
1746 | @@ -111,13 +112,21 @@ |
1747 | mOptions = new KWD::Options (mConfig); |
1748 | mPlugins = new PluginManager (KSharedConfig::openConfig ("kwinrc")); |
1749 | |
1750 | - mShadowOptions.shadow_radius = SHADOW_RADIUS; |
1751 | - mShadowOptions.shadow_opacity = SHADOW_OPACITY; |
1752 | - mShadowOptions.shadow_offset_x = SHADOW_OFFSET_X; |
1753 | - mShadowOptions.shadow_offset_y = SHADOW_OFFSET_Y; |
1754 | - mShadowOptions.shadow_color[0] = SHADOW_COLOR_RED; |
1755 | - mShadowOptions.shadow_color[1] = SHADOW_COLOR_GREEN; |
1756 | - mShadowOptions.shadow_color[2] = SHADOW_COLOR_BLUE; |
1757 | + mActiveShadowOptions.shadow_radius = SHADOW_RADIUS; |
1758 | + mActiveShadowOptions.shadow_opacity = SHADOW_OPACITY; |
1759 | + mActiveShadowOptions.shadow_offset_x = SHADOW_OFFSET_X; |
1760 | + mActiveShadowOptions.shadow_offset_y = SHADOW_OFFSET_Y; |
1761 | + mActiveShadowOptions.shadow_color[0] = SHADOW_COLOR_RED; |
1762 | + mActiveShadowOptions.shadow_color[1] = SHADOW_COLOR_GREEN; |
1763 | + mActiveShadowOptions.shadow_color[2] = SHADOW_COLOR_BLUE; |
1764 | + |
1765 | + mInactiveShadowOptions.shadow_radius = SHADOW_RADIUS; |
1766 | + mInactiveShadowOptions.shadow_opacity = SHADOW_OPACITY; |
1767 | + mInactiveShadowOptions.shadow_offset_x = SHADOW_OFFSET_X; |
1768 | + mInactiveShadowOptions.shadow_offset_y = SHADOW_OFFSET_Y; |
1769 | + mInactiveShadowOptions.shadow_color[0] = SHADOW_COLOR_RED; |
1770 | + mInactiveShadowOptions.shadow_color[1] = SHADOW_COLOR_GREEN; |
1771 | + mInactiveShadowOptions.shadow_color[2] = SHADOW_COLOR_BLUE; |
1772 | |
1773 | updateShadowProperties (QX11Info::appRootWindow ()); |
1774 | |
1775 | @@ -259,16 +268,24 @@ |
1776 | } |
1777 | |
1778 | void |
1779 | -KWD::Decorator::changeShadowOptions (decor_shadow_options_t *opt) |
1780 | +KWD::Decorator::changeShadowOptions (decor_shadow_options_t *aopt, decor_shadow_options_t *iopt) |
1781 | { |
1782 | - QMap <WId, KWD::Window *>::ConstIterator it; |
1783 | - |
1784 | - if (!memcmp (opt, &mShadowOptions, sizeof (decor_shadow_options_t))) |
1785 | - return; |
1786 | - |
1787 | - mShadowOptions = *opt; |
1788 | - |
1789 | - updateShadow (); |
1790 | + bool changed = false; |
1791 | + |
1792 | + if (memcmp (aopt, &mActiveShadowOptions, sizeof (decor_shadow_options_t))) |
1793 | + { |
1794 | + mActiveShadowOptions = *aopt; |
1795 | + changed = true; |
1796 | + } |
1797 | + |
1798 | + if (memcmp (aopt, &mInactiveShadowOptions, sizeof (decor_shadow_options_t))) |
1799 | + { |
1800 | + mInactiveShadowOptions = *iopt; |
1801 | + changed = true; |
1802 | + } |
1803 | + |
1804 | + if (changed) |
1805 | + updateShadow (); |
1806 | } |
1807 | |
1808 | void |
1809 | @@ -291,7 +308,7 @@ |
1810 | 0, |
1811 | 0, |
1812 | 0, 0, 0, 0, |
1813 | - &mShadowOptions, |
1814 | + &mActiveShadowOptions, |
1815 | &context, |
1816 | decor_draw_simple, |
1817 | 0); |
1818 | @@ -331,8 +348,10 @@ |
1819 | { |
1820 | int nItems; |
1821 | long *data; |
1822 | - double radius, opacity; |
1823 | - int xOffset, yOffset; |
1824 | + double aradius, aopacity; |
1825 | + int axOffset, ayOffset; |
1826 | + double iradius, iopacity; |
1827 | + int ixOffset, iyOffset; |
1828 | QVector<QString> shadowColor; |
1829 | |
1830 | if (id != QX11Info::appRootWindow ()) |
1831 | @@ -348,27 +367,40 @@ |
1832 | |
1833 | data = reinterpret_cast <long *> (propData); |
1834 | |
1835 | - radius = data[0]; |
1836 | - opacity = data[1]; |
1837 | + aradius = data[0]; |
1838 | + aopacity = data[1]; |
1839 | |
1840 | /* We multiplied by 1000 in compiz to keep |
1841 | * precision, now divide by that much */ |
1842 | |
1843 | - radius /= 1000; |
1844 | - opacity /= 1000; |
1845 | - |
1846 | - xOffset = data[2]; |
1847 | - yOffset = data[3]; |
1848 | - |
1849 | - shadowRadiusChanged (radius); |
1850 | - shadowOpacityChanged (opacity); |
1851 | - shadowXOffsetChanged (xOffset); |
1852 | - shadowYOffsetChanged (yOffset); |
1853 | + aradius /= 1000; |
1854 | + aopacity /= 1000; |
1855 | + |
1856 | + axOffset = data[2]; |
1857 | + ayOffset = data[3]; |
1858 | + |
1859 | + iradius = data[4]; |
1860 | + iopacity = data[5]; |
1861 | + |
1862 | + /* We multiplied by 1000 in compiz to keep |
1863 | + * precision, now divide by that much */ |
1864 | + |
1865 | + iradius /= 1000; |
1866 | + iopacity /= 1000; |
1867 | + |
1868 | + ixOffset = data[6]; |
1869 | + iyOffset = data[7]; |
1870 | + |
1871 | + |
1872 | + shadowRadiusChanged (aradius, iradius); |
1873 | + shadowOpacityChanged (aopacity, iopacity); |
1874 | + shadowXOffsetChanged (axOffset, ixOffset); |
1875 | + shadowYOffsetChanged (ayOffset, iyOffset); |
1876 | |
1877 | shadowColor = KWD::readPropertyString (id, Atoms::compizShadowColor); |
1878 | |
1879 | - if (shadowColor.size () == 1) |
1880 | - shadowColorChanged (shadowColor.at (0)); |
1881 | + if (shadowColor.size () == 2) |
1882 | + shadowColorChanged (shadowColor.at (0), shadowColor.at (1)); |
1883 | |
1884 | XFree (propData); |
1885 | } |
1886 | @@ -879,61 +911,78 @@ |
1887 | } |
1888 | |
1889 | void |
1890 | -KWD::Decorator::shadowRadiusChanged (double value) |
1891 | -{ |
1892 | - decor_shadow_options_t opt = *shadowOptions (); |
1893 | - |
1894 | - opt.shadow_radius = value; |
1895 | - |
1896 | - changeShadowOptions (&opt); |
1897 | -} |
1898 | - |
1899 | -void |
1900 | -KWD::Decorator::shadowOpacityChanged (double value) |
1901 | -{ |
1902 | - decor_shadow_options_t opt = *shadowOptions (); |
1903 | - |
1904 | - opt.shadow_opacity = value; |
1905 | - |
1906 | - changeShadowOptions (&opt); |
1907 | -} |
1908 | - |
1909 | -void |
1910 | -KWD::Decorator::shadowXOffsetChanged (int value) |
1911 | -{ |
1912 | - decor_shadow_options_t opt = *shadowOptions (); |
1913 | - |
1914 | - opt.shadow_offset_x = value; |
1915 | - |
1916 | - changeShadowOptions (&opt); |
1917 | -} |
1918 | - |
1919 | -void |
1920 | -KWD::Decorator::shadowYOffsetChanged (int value) |
1921 | -{ |
1922 | - decor_shadow_options_t opt = *shadowOptions (); |
1923 | - |
1924 | - opt.shadow_offset_y = value; |
1925 | - |
1926 | - changeShadowOptions (&opt); |
1927 | -} |
1928 | - |
1929 | -void |
1930 | -KWD::Decorator::shadowColorChanged (QString value) |
1931 | -{ |
1932 | - decor_shadow_options_t opt = *shadowOptions (); |
1933 | +KWD::Decorator::shadowRadiusChanged (double value_active, double value_inactive) |
1934 | +{ |
1935 | + decor_shadow_options_t aopt = *activeShadowOptions (); |
1936 | + decor_shadow_options_t iopt = *inactiveShadowOptions (); |
1937 | + |
1938 | + aopt.shadow_radius = value_active; |
1939 | + iopt.shadow_radius = value_inactive; |
1940 | + |
1941 | + changeShadowOptions (&aopt, &iopt); |
1942 | +} |
1943 | + |
1944 | +void |
1945 | +KWD::Decorator::shadowOpacityChanged (double value_active, double value_inactive) |
1946 | +{ |
1947 | + decor_shadow_options_t aopt = *activeShadowOptions (); |
1948 | + decor_shadow_options_t iopt = *inactiveShadowOptions (); |
1949 | + |
1950 | + aopt.shadow_opacity = value_active; |
1951 | + iopt.shadow_opacity = value_inactive; |
1952 | + |
1953 | + changeShadowOptions (&aopt, &iopt); |
1954 | +} |
1955 | + |
1956 | +void |
1957 | +KWD::Decorator::shadowXOffsetChanged (int value_active, int value_inactive) |
1958 | +{ |
1959 | + decor_shadow_options_t aopt = *activeShadowOptions (); |
1960 | + decor_shadow_options_t iopt = *inactiveShadowOptions (); |
1961 | + |
1962 | + aopt.shadow_offset_x = value_active; |
1963 | + iopt.shadow_offset_x = value_inactive; |
1964 | + |
1965 | + changeShadowOptions (&aopt, &iopt); |
1966 | +} |
1967 | + |
1968 | +void |
1969 | +KWD::Decorator::shadowYOffsetChanged (int value_active, double value_inactive) |
1970 | +{ |
1971 | + decor_shadow_options_t aopt = *activeShadowOptions (); |
1972 | + decor_shadow_options_t iopt = *inactiveShadowOptions (); |
1973 | + |
1974 | + aopt.shadow_offset_y = value_active; |
1975 | + iopt.shadow_offset_y = value_inactive; |
1976 | + |
1977 | + changeShadowOptions (&aopt, &iopt); |
1978 | +} |
1979 | + |
1980 | +void |
1981 | +KWD::Decorator::shadowColorChanged (QString value_active, QString value_inactive) |
1982 | +{ |
1983 | + decor_shadow_options_t aopt = *activeShadowOptions (); |
1984 | + decor_shadow_options_t iopt = *inactiveShadowOptions (); |
1985 | |
1986 | int c[4]; |
1987 | |
1988 | - if (sscanf (value.toAscii ().data (), "#%2x%2x%2x%2x", |
1989 | + if (sscanf (value_active.toAscii ().data (), "#%2x%2x%2x%2x", |
1990 | &c[0], &c[1], &c[2], &c[3]) == 4) |
1991 | { |
1992 | - opt.shadow_color[0] = c[0] << 8 | c[0]; |
1993 | - opt.shadow_color[1] = c[1] << 8 | c[1]; |
1994 | - opt.shadow_color[2] = c[2] << 8 | c[2]; |
1995 | - } |
1996 | - |
1997 | - changeShadowOptions (&opt); |
1998 | + aopt.shadow_color[0] = c[0] << 8 | c[0]; |
1999 | + aopt.shadow_color[1] = c[1] << 8 | c[1]; |
2000 | + aopt.shadow_color[2] = c[2] << 8 | c[2]; |
2001 | + } |
2002 | + |
2003 | + if (sscanf (value_inactive.toAscii ().data (), "#%2x%2x%2x%2x", |
2004 | + &c[0], &c[1], &c[2], &c[3]) == 4) |
2005 | + { |
2006 | + iopt.shadow_color[0] = c[0] << 8 | c[0]; |
2007 | + iopt.shadow_color[1] = c[1] << 8 | c[1]; |
2008 | + iopt.shadow_color[2] = c[2] << 8 | c[2]; |
2009 | + } |
2010 | + |
2011 | + changeShadowOptions (&aopt, &iopt); |
2012 | } |
2013 | |
2014 | void |
2015 | |
2016 | === modified file 'kde/window-decorator-kde4/decorator.h' |
2017 | --- kde/window-decorator-kde4/decorator.h 2011-05-08 13:46:51 +0000 |
2018 | +++ kde/window-decorator-kde4/decorator.h 2011-10-15 07:11:59 +0000 |
2019 | @@ -103,9 +103,13 @@ |
2020 | { |
2021 | return mActiveId; |
2022 | } |
2023 | - static decor_shadow_options_t *shadowOptions (void) |
2024 | - { |
2025 | - return &mShadowOptions; |
2026 | + static decor_shadow_options_t *activeShadowOptions (void) |
2027 | + { |
2028 | + return &mActiveShadowOptions; |
2029 | + } |
2030 | + static decor_shadow_options_t *inactiveShadowOptions (void) |
2031 | + { |
2032 | + return &mInactiveShadowOptions; |
2033 | } |
2034 | |
2035 | static KWD::Window *defaultNormal () |
2036 | @@ -133,7 +137,7 @@ |
2037 | |
2038 | bool enableDecorations (Time timestamp); |
2039 | bool x11EventFilter (XEvent *xevent); |
2040 | - void changeShadowOptions (decor_shadow_options_t *opt); |
2041 | + void changeShadowOptions (decor_shadow_options_t *aopt, decor_shadow_options_t *iopt); |
2042 | |
2043 | public slots: |
2044 | void reconfigure (void); |
2045 | @@ -151,11 +155,11 @@ |
2046 | void handleWindowChanged (WId id, |
2047 | const unsigned long *properties); |
2048 | |
2049 | - void shadowRadiusChanged (double value); |
2050 | - void shadowOpacityChanged (double value); |
2051 | - void shadowXOffsetChanged (int value); |
2052 | - void shadowYOffsetChanged (int value); |
2053 | - void shadowColorChanged (QString value); |
2054 | + void shadowRadiusChanged (double value_active, double value_inactive); |
2055 | + void shadowOpacityChanged (double value_active, double value_inactive); |
2056 | + void shadowXOffsetChanged (int value_active, int value_inactive); |
2057 | + void shadowYOffsetChanged (int value_active, double value_inactive); |
2058 | + void shadowColorChanged (QString value_active, QString value_inactive); |
2059 | |
2060 | void plasmaThemeChanged (); |
2061 | |
2062 | @@ -163,7 +167,8 @@ |
2063 | static PluginManager *mPlugins; |
2064 | static KWD::Options *mOptions; |
2065 | static decor_shadow_t *mNoBorderShadow; |
2066 | - static decor_shadow_options_t mShadowOptions; |
2067 | + static decor_shadow_options_t mActiveShadowOptions; |
2068 | + static decor_shadow_options_t mInactiveShadowOptions; |
2069 | static NETRootInfo *mRootInfo; |
2070 | static WId mActiveId; |
2071 | |
2072 | |
2073 | === modified file 'plugins/decor/decor.xml.in' |
2074 | --- plugins/decor/decor.xml.in 2009-08-08 06:00:14 +0000 |
2075 | +++ plugins/decor/decor.xml.in 2011-10-15 07:11:59 +0000 |
2076 | @@ -17,40 +17,80 @@ |
2077 | </relation> |
2078 | </deps> |
2079 | <options> |
2080 | - <option name="shadow_radius" type="float"> |
2081 | - <_short>Shadow Radius</_short> |
2082 | - <_long>Drop shadow radius</_long> |
2083 | - <default>8.0</default> |
2084 | - <min>0.1</min> |
2085 | - <max>18.0</max> |
2086 | - <precision>0.1</precision> |
2087 | - </option> |
2088 | - <option name="shadow_opacity" type="float"> |
2089 | - <_short>Shadow Opacity</_short> |
2090 | - <_long>Drop shadow opacity</_long> |
2091 | - <default>0.5</default> |
2092 | - <min>0.01</min> |
2093 | - <max>6.0</max> |
2094 | - <precision>0.01</precision> |
2095 | - </option> |
2096 | - <option name="shadow_color" type="color"> |
2097 | - <_short>Shadow Color</_short> |
2098 | - <_long>Drop shadow color</_long> |
2099 | - </option> |
2100 | - <option name="shadow_x_offset" type="int"> |
2101 | - <_short>Shadow Offset X</_short> |
2102 | - <_long>Drop shadow X offset</_long> |
2103 | - <default>1</default> |
2104 | - <min>-16</min> |
2105 | - <max>16</max> |
2106 | - </option> |
2107 | - <option name="shadow_y_offset" type="int"> |
2108 | - <_short>Shadow Offset Y</_short> |
2109 | - <_long>Drop shadow Y offset</_long> |
2110 | - <default>1</default> |
2111 | - <min>-16</min> |
2112 | - <max>16</max> |
2113 | - </option> |
2114 | + <subgroup> |
2115 | + <_short>Active Shadow</_short> |
2116 | + <option name="active_shadow_radius" type="float"> |
2117 | + <_short>Shadow Radius</_short> |
2118 | + <_long>Drop shadow radius</_long> |
2119 | + <default>8.0</default> |
2120 | + <min>0.1</min> |
2121 | + <max>18.0</max> |
2122 | + <precision>0.1</precision> |
2123 | + </option> |
2124 | + <option name="active_shadow_opacity" type="float"> |
2125 | + <_short>Shadow Opacity</_short> |
2126 | + <_long>Drop shadow opacity</_long> |
2127 | + <default>0.5</default> |
2128 | + <min>0.01</min> |
2129 | + <max>6.0</max> |
2130 | + <precision>0.01</precision> |
2131 | + </option> |
2132 | + <option name="active_shadow_color" type="color"> |
2133 | + <_short>Shadow Color</_short> |
2134 | + <_long>Drop shadow color</_long> |
2135 | + </option> |
2136 | + <option name="active_shadow_x_offset" type="int"> |
2137 | + <_short>Shadow Offset X</_short> |
2138 | + <_long>Drop shadow X offset</_long> |
2139 | + <default>1</default> |
2140 | + <min>-16</min> |
2141 | + <max>16</max> |
2142 | + </option> |
2143 | + <option name="active_shadow_y_offset" type="int"> |
2144 | + <_short>Shadow Offset Y</_short> |
2145 | + <_long>Drop shadow Y offset</_long> |
2146 | + <default>1</default> |
2147 | + <min>-16</min> |
2148 | + <max>16</max> |
2149 | + </option> |
2150 | + </subgroup> |
2151 | + <subgroup> |
2152 | + <_short>Inactive Shadow</_short> |
2153 | + <option name="inactive_shadow_radius" type="float"> |
2154 | + <_short>Shadow Radius</_short> |
2155 | + <_long>Drop shadow radius</_long> |
2156 | + <default>8.0</default> |
2157 | + <min>0.1</min> |
2158 | + <max>13.0</max> |
2159 | + <precision>0.1</precision> |
2160 | + </option> |
2161 | + <option name="inactive_shadow_opacity" type="float"> |
2162 | + <_short>Shadow Opacity</_short> |
2163 | + <_long>Drop shadow opacity</_long> |
2164 | + <default>0.5</default> |
2165 | + <min>0.01</min> |
2166 | + <max>6.0</max> |
2167 | + <precision>0.01</precision> |
2168 | + </option> |
2169 | + <option name="inactive_shadow_color" type="color"> |
2170 | + <_short>Shadow Color</_short> |
2171 | + <_long>Drop shadow color</_long> |
2172 | + </option> |
2173 | + <option name="inactive_shadow_x_offset" type="int"> |
2174 | + <_short>Shadow Offset X</_short> |
2175 | + <_long>Drop shadow X offset</_long> |
2176 | + <default>1</default> |
2177 | + <min>-16</min> |
2178 | + <max>16</max> |
2179 | + </option> |
2180 | + <option name="inactive_shadow_y_offset" type="int"> |
2181 | + <_short>Shadow Offset Y</_short> |
2182 | + <_long>Drop shadow Y offset</_long> |
2183 | + <default>1</default> |
2184 | + <min>-16</min> |
2185 | + <max>16</max> |
2186 | + </option> |
2187 | + </subgroup> |
2188 | <option name="command" type="string"> |
2189 | <_short>Command</_short> |
2190 | <_long>Decorator command line that is executed if no decorator is already running</_long> |
2191 | |
2192 | === modified file 'plugins/decor/src/decor.cpp' |
2193 | --- plugins/decor/src/decor.cpp 2011-10-11 14:55:47 +0000 |
2194 | +++ plugins/decor/src/decor.cpp 2011-10-15 07:11:59 +0000 |
2195 | @@ -1709,7 +1709,7 @@ |
2196 | parent = window->frame (); |
2197 | |
2198 | /* Determine frame extents */ |
2199 | - if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE) |
2200 | + if ((window->state () & MAXIMIZE_STATE)) |
2201 | { |
2202 | border = wd->decor->maxBorder; |
2203 | input = wd->decor->maxInput; |
2204 | @@ -1866,7 +1866,7 @@ |
2205 | CompWindowExtents input; |
2206 | |
2207 | /* Determine frame extents */ |
2208 | - if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE) |
2209 | + if ((window->state () & MAXIMIZE_STATE)) |
2210 | input = wd->decor->maxInput; |
2211 | else |
2212 | input = wd->decor->input; |
2213 | @@ -2576,41 +2576,51 @@ |
2214 | void |
2215 | DecorScreen::updateDefaultShadowProperty () |
2216 | { |
2217 | - long data[4]; |
2218 | - CompOption *colorOption = CompOption::findOption (getOptions (), "shadow_color"); |
2219 | - char *colorString; |
2220 | + long data[8]; |
2221 | + CompOption *activeColorOption = CompOption::findOption (getOptions (), "active_shadow_color"); |
2222 | + CompOption *inactiveColorOption = CompOption::findOption (getOptions (), "inactive_shadow_color"); |
2223 | + char *colorString[2]; |
2224 | XTextProperty xtp; |
2225 | |
2226 | - if (!colorOption) |
2227 | + if (!activeColorOption || !inactiveColorOption) |
2228 | return; |
2229 | |
2230 | - colorString = strdup (CompOption::colorToString (colorOption->value ().c ()).c_str ()); |
2231 | + colorString[0] = strdup (CompOption::colorToString (activeColorOption->value ().c ()).c_str ()); |
2232 | + colorString[1] = strdup (CompOption::colorToString (inactiveColorOption->value ().c ()).c_str ()); |
2233 | |
2234 | - /* 1) Shadow Radius |
2235 | - * 2) Shadow Opacity |
2236 | - * 3) Shadow Offset X |
2237 | - * 4) Shadow Offset Y |
2238 | + /* 1) Active Shadow Radius |
2239 | + * 2) Active Shadow Opacity |
2240 | + * 3) Active Shadow Offset X |
2241 | + * 4) Active Shadow Offset Y |
2242 | + * 5) Inactive Shadow Radius |
2243 | + * 6) Inactive Shadow Opacity |
2244 | + * 7) Inactive Shadow Offset X |
2245 | + * 8) Inactive Shadow Offset Y |
2246 | */ |
2247 | |
2248 | /* the precision is 0.0001, so multiply by 1000 */ |
2249 | - data[0] = optionGetShadowRadius () * 1000; |
2250 | - data[1] = optionGetShadowOpacity () * 1000; |
2251 | - data[2] = optionGetShadowXOffset (); |
2252 | - data[3] = optionGetShadowYOffset (); |
2253 | + data[0] = optionGetActiveShadowRadius () * 1000; |
2254 | + data[1] = optionGetActiveShadowOpacity () * 1000; |
2255 | + data[2] = optionGetActiveShadowXOffset (); |
2256 | + data[3] = optionGetActiveShadowYOffset (); |
2257 | + data[4] = optionGetInactiveShadowRadius () * 1000; |
2258 | + data[5] = optionGetInactiveShadowOpacity () * 1000; |
2259 | + data[6] = optionGetInactiveShadowXOffset (); |
2260 | + data[7] = optionGetInactiveShadowYOffset (); |
2261 | + |
2262 | |
2263 | XChangeProperty (screen->dpy (), screen->root (), |
2264 | shadowInfoAtom, XA_INTEGER, 32, |
2265 | - PropModeReplace, (unsigned char *) data, 4); |
2266 | + PropModeReplace, (unsigned char *) data, 8); |
2267 | |
2268 | - if (XStringListToTextProperty (&colorString, 1, &xtp)) |
2269 | + if (XStringListToTextProperty (colorString, 2, &xtp)) |
2270 | { |
2271 | XSetTextProperty (screen->dpy (), screen->root (), &xtp, shadowColorAtom); |
2272 | XFree (xtp.value); |
2273 | } |
2274 | |
2275 | - free (colorString); |
2276 | - |
2277 | - |
2278 | + free (colorString[0]); |
2279 | + free (colorString[1]); |
2280 | } |
2281 | |
2282 | bool |
2283 | @@ -2657,11 +2667,16 @@ |
2284 | foreach (CompWindow *w, screen->windows ()) |
2285 | DecorWindow::get (w)->update (true); |
2286 | break; |
2287 | - case DecorOptions::ShadowRadius: |
2288 | - case DecorOptions::ShadowOpacity: |
2289 | - case DecorOptions::ShadowColor: |
2290 | - case DecorOptions::ShadowXOffset: |
2291 | - case DecorOptions::ShadowYOffset: |
2292 | + case DecorOptions::ActiveShadowRadius: |
2293 | + case DecorOptions::ActiveShadowOpacity: |
2294 | + case DecorOptions::ActiveShadowColor: |
2295 | + case DecorOptions::ActiveShadowXOffset: |
2296 | + case DecorOptions::ActiveShadowYOffset: |
2297 | + case DecorOptions::InactiveShadowRadius: |
2298 | + case DecorOptions::InactiveShadowOpacity: |
2299 | + case DecorOptions::InactiveShadowColor: |
2300 | + case DecorOptions::InactiveShadowXOffset: |
2301 | + case DecorOptions::InactiveShadowYOffset: |
2302 | updateDefaultShadowProperty (); |
2303 | break; |
2304 | default: |
2305 | @@ -2780,37 +2795,34 @@ |
2306 | void |
2307 | DecorWindow::stateChangeNotify (unsigned int lastState) |
2308 | { |
2309 | - if (!update (true)) |
2310 | + if (wd && wd->decor) |
2311 | { |
2312 | - if (wd && wd->decor) |
2313 | - { |
2314 | - int oldShiftX = shiftX (); |
2315 | - int oldShiftY = shiftY (); |
2316 | - int moveDx, moveDy; |
2317 | - |
2318 | - if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE) |
2319 | - window->setWindowFrameExtents (&wd->decor->maxBorder, |
2320 | - &wd->decor->maxInput); |
2321 | - else |
2322 | - window->setWindowFrameExtents (&wd->decor->border, |
2323 | - &wd->decor->input); |
2324 | - |
2325 | - /* Since we immediately update the frame extents, we must |
2326 | - * also update the stored saved window geometry in order |
2327 | - * to prevent the window from shifting back too far once |
2328 | - * unmaximized */ |
2329 | - |
2330 | - moveDx = shiftX () - oldShiftX; |
2331 | - moveDy = shiftY () - oldShiftY; |
2332 | - |
2333 | - if (window->saveMask () & CWX) |
2334 | - window->saveWc ().x += moveDx; |
2335 | - |
2336 | - if (window->saveMask () & CWY) |
2337 | - window->saveWc ().y += moveDy; |
2338 | - |
2339 | - updateFrame (); |
2340 | - } |
2341 | + int oldShiftX = shiftX (); |
2342 | + int oldShiftY = shiftY (); |
2343 | + int moveDx, moveDy; |
2344 | + |
2345 | + if ((window->state () & MAXIMIZE_STATE)) |
2346 | + window->setWindowFrameExtents (&wd->decor->maxBorder, |
2347 | + &wd->decor->maxInput); |
2348 | + else |
2349 | + window->setWindowFrameExtents (&wd->decor->border, |
2350 | + &wd->decor->input); |
2351 | + |
2352 | + /* Since we immediately update the frame extents, we must |
2353 | + * also update the stored saved window geometry in order |
2354 | + * to prevent the window from shifting back too far once |
2355 | + * unmaximized */ |
2356 | + |
2357 | + moveDx = shiftX () - oldShiftX; |
2358 | + moveDy = shiftY () - oldShiftY; |
2359 | + |
2360 | + if (window->saveMask () & CWX) |
2361 | + window->saveWc ().x += moveDx; |
2362 | + |
2363 | + if (window->saveMask () & CWY) |
2364 | + window->saveWc ().y += moveDy; |
2365 | + |
2366 | + updateFrame (); |
2367 | } |
2368 | |
2369 | window->stateChangeNotify (lastState); |
2370 | |
2371 | === modified file 'src/window.cpp' |
2372 | --- src/window.cpp 2011-10-11 09:36:19 +0000 |
2373 | +++ src/window.cpp 2011-10-15 07:11:59 +0000 |
2374 | @@ -3876,8 +3876,8 @@ |
2375 | { |
2376 | saveGeometry (CWY | CWHeight); |
2377 | |
2378 | - xwc->height = workArea.height () - serverInput.top - |
2379 | - serverInput.bottom - old.border () * 2; |
2380 | + xwc->height = workArea.height () - border.top - |
2381 | + border.bottom - old.border () * 2; |
2382 | |
2383 | mask |= CWHeight; |
2384 | } |
2385 | @@ -3890,8 +3890,8 @@ |
2386 | { |
2387 | saveGeometry (CWX | CWWidth); |
2388 | |
2389 | - xwc->width = workArea.width () - serverInput.left - |
2390 | - serverInput.right - old.border () * 2; |
2391 | + xwc->width = workArea.width () - border.left - |
2392 | + border.right - old.border () * 2; |
2393 | |
2394 | mask |= CWWidth; |
2395 | } |
2396 | @@ -3962,7 +3962,7 @@ |
2397 | * by the gravity value (so that the corner that the gravity specifies |
2398 | * is 'anchored' to that edge of the workarea) */ |
2399 | |
2400 | - xwc->y = y + workArea.y () + serverInput.top; |
2401 | + xwc->y = y + workArea.y () + border.top; |
2402 | mask |= CWY; |
2403 | |
2404 | switch (priv->sizeHints.win_gravity) |
2405 | @@ -3974,9 +3974,9 @@ |
2406 | height = xwc->height + old.border () * 2; |
2407 | |
2408 | max = y + workArea.bottom (); |
2409 | - if (xwc->y + xwc->height + serverInput.bottom > max) |
2410 | + if (xwc->y + xwc->height + border.bottom > max) |
2411 | { |
2412 | - xwc->y = max - height - serverInput.bottom; |
2413 | + xwc->y = max - height - border.bottom; |
2414 | mask |= CWY; |
2415 | } |
2416 | break; |
2417 | @@ -3999,7 +3999,7 @@ |
2418 | |
2419 | if (state & CompWindowStateMaximizedHorzMask) |
2420 | { |
2421 | - xwc->x = x + workArea.x () + serverInput.left; |
2422 | + xwc->x = x + workArea.x () + border.left; |
2423 | mask |= CWX; |
2424 | |
2425 | switch (priv->sizeHints.win_gravity) |
2426 | @@ -4011,16 +4011,16 @@ |
2427 | |
2428 | max = x + workArea.right (); |
2429 | |
2430 | - if (old.x () + (int) old.width () + serverInput.right > max) |
2431 | + if (old.x () + (int) old.width () + border.right > max) |
2432 | { |
2433 | - xwc->x = max - width - serverInput.right; |
2434 | + xwc->x = max - width - border.right; |
2435 | mask |= CWX; |
2436 | } |
2437 | - else if (old.x () + width + serverInput.right > max) |
2438 | + else if (old.x () + width + border.right > max) |
2439 | { |
2440 | xwc->x = x + workArea.x () + |
2441 | - (workArea.width () - serverInput.left - width - |
2442 | - serverInput.right) / 2 + serverInput.left; |
2443 | + (workArea.width () - border.left - width - |
2444 | + border.right) / 2 + border.left; |
2445 | mask |= CWX; |
2446 | } |
2447 | /* For NorthGravity, SouthGravity and CenterGravity we default to the top |
2448 | @@ -4110,15 +4110,15 @@ |
2449 | case NorthGravity: |
2450 | case NorthEastGravity: |
2451 | if (xwcm & CWY) |
2452 | - newY = xwc->y + priv->serverInput.top * direction; |
2453 | + newY = xwc->y + priv->border.top * direction; |
2454 | break; |
2455 | |
2456 | case WestGravity: |
2457 | case CenterGravity: |
2458 | case EastGravity: |
2459 | if (xwcm & CWY) |
2460 | - newY -= (xwc->height / 2 - priv->serverInput.top + |
2461 | - (priv->serverInput.top + priv->serverInput.bottom) / 2) * direction; |
2462 | + newY -= (xwc->height / 2 - priv->border.top + |
2463 | + (priv->border.top + priv->border.bottom) / 2) * direction; |
2464 | else |
2465 | newY -= ((xwc->height - priv->serverGeometry.height ()) / 2) * direction; |
2466 | break; |
2467 | @@ -4127,7 +4127,7 @@ |
2468 | case SouthGravity: |
2469 | case SouthEastGravity: |
2470 | if (xwcm & CWY) |
2471 | - newY -= xwc->height + priv->serverInput.bottom * direction; |
2472 | + newY -= xwc->height + priv->border.bottom * direction; |
2473 | else |
2474 | newY -= (xwc->height - priv->serverGeometry.height ()) * direction; |
2475 | break; |