Merge lp:~unity-team/compiz-core/compiz-core.one_property_decor into lp:compiz-core/trunk
- compiz-core.one_property_decor
- Merge into trunk
Proposed by
Sam Spilsbury
Status: | Merged |
---|---|
Merged at revision: | 2751 |
Proposed branch: | lp:~unity-team/compiz-core/compiz-core.one_property_decor |
Merge into: | lp:compiz-core/trunk |
Prerequisite: | lp:~unity-team/compiz-core/compiz-core.bits_and_pieces_2011_05_21 |
Diff against target: |
711 lines (+226/-170) 12 files modified
gtk/window-decorator/decorator.c (+63/-124) gtk/window-decorator/gtk-window-decorator.c (+8/-1) gtk/window-decorator/gtk-window-decorator.h (+2/-3) gtk/window-decorator/wnck.c (+8/-8) include/decoration.h (+0/-1) kde/window-decorator-kde4/decorator.cpp (+9/-2) kde/window-decorator-kde4/decorator.h (+19/-2) kde/window-decorator-kde4/utils.cpp (+0/-2) kde/window-decorator-kde4/window.cpp (+105/-15) kde/window-decorator-kde4/window.h (+1/-1) plugins/decor/src/decor.cpp (+9/-8) plugins/decor/src/decor.h (+2/-3) |
To merge this branch: | bzr merge lp:~unity-team/compiz-core/compiz-core.one_property_decor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jason Smith (community) | Approve | ||
Sam Spilsbury | Pending | ||
Review via email: mp+61801@code.launchpad.net |
Commit message
Fixes LP#795071
Stuff all data into one single property, so that we aren't using two and aren't chained to the idea of having to have an active and inactive default decoration (esp when it might not be necessary, though that optimization hasn't been made yet).
Also add workaround for KDE4 Support.
Description of the change
Stuff all data into one single property, so that we aren't using two and aren't chained to the idea of having to have an active and inactive default decoration (esp when it might not be necessary, though that optimization hasn't been made yet).
Also add workaround for KDE4 Support.
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/decorator.c' | |||
2 | --- gtk/window-decorator/decorator.c 2011-05-20 16:52:31 +0000 | |||
3 | +++ gtk/window-decorator/decorator.c 2011-05-20 16:52:31 +0000 | |||
4 | @@ -1070,15 +1070,12 @@ | |||
5 | 1070 | { | 1070 | { |
6 | 1071 | unsigned int frame_state = 0; | 1071 | unsigned int frame_state = 0; |
7 | 1072 | 1072 | ||
12 | 1073 | if (!d->win) | 1073 | WnckWindowState win_state; |
9 | 1074 | return frame_state; | ||
10 | 1075 | |||
11 | 1076 | WnckWindowState win_state = wnck_window_get_state (d->win); | ||
13 | 1077 | const unsigned int n_state_bits = 3; | 1074 | const unsigned int n_state_bits = 3; |
14 | 1078 | unsigned int i; | 1075 | unsigned int i; |
15 | 1079 | 1076 | ||
16 | 1080 | if (d->active) | 1077 | if (d->active) |
18 | 1081 | frame_state &= DECOR_WINDOW_STATE_FOCUS; | 1078 | frame_state |= DECOR_WINDOW_STATE_FOCUS; |
19 | 1082 | 1079 | ||
20 | 1083 | struct typestrings { | 1080 | struct typestrings { |
21 | 1084 | unsigned int wnck_flag; | 1081 | unsigned int wnck_flag; |
22 | @@ -1090,6 +1087,13 @@ | |||
23 | 1090 | { WNCK_WINDOW_STATE_SHADED, DECOR_WINDOW_STATE_SHADED } | 1087 | { WNCK_WINDOW_STATE_SHADED, DECOR_WINDOW_STATE_SHADED } |
24 | 1091 | }; | 1088 | }; |
25 | 1092 | 1089 | ||
26 | 1090 | /* Not possible to match further than active or not if there is | ||
27 | 1091 | * no window but FIXME we might want to do that later down the line */ | ||
28 | 1092 | if (!d->win) | ||
29 | 1093 | return frame_state == 0; | ||
30 | 1094 | |||
31 | 1095 | win_state = wnck_window_get_state (d->win); | ||
32 | 1096 | |||
33 | 1093 | for (i = 0; i < n_state_bits; i++) | 1097 | for (i = 0; i < n_state_bits; i++) |
34 | 1094 | { | 1098 | { |
35 | 1095 | if (win_state & state_bits[i].wnck_flag) | 1099 | if (win_state & state_bits[i].wnck_flag) |
36 | @@ -1256,11 +1260,11 @@ | |||
37 | 1256 | void | 1260 | void |
38 | 1257 | update_default_decorations (GdkScreen *screen) | 1261 | update_default_decorations (GdkScreen *screen) |
39 | 1258 | { | 1262 | { |
41 | 1259 | long *active_data, *inactive_data; | 1263 | long *data; |
42 | 1260 | Window xroot; | 1264 | Window xroot; |
43 | 1261 | GdkDisplay *gdkdisplay = gdk_display_get_default (); | 1265 | GdkDisplay *gdkdisplay = gdk_display_get_default (); |
44 | 1262 | Display *xdisplay = gdk_x11_display_get_xdisplay (gdkdisplay); | 1266 | Display *xdisplay = gdk_x11_display_get_xdisplay (gdkdisplay); |
46 | 1263 | Atom bareAtom, normalAtom, activeAtom; | 1267 | Atom bareAtom, activeAtom; |
47 | 1264 | decor_frame_t *frame; | 1268 | decor_frame_t *frame; |
48 | 1265 | decor_frame_t *bare_frame = gwd_get_decor_frame ("bare"); | 1269 | decor_frame_t *bare_frame = gwd_get_decor_frame ("bare"); |
49 | 1266 | decor_extents_t extents; | 1270 | decor_extents_t extents; |
50 | @@ -1269,7 +1273,6 @@ | |||
51 | 1269 | xroot = RootWindowOfScreen (gdk_x11_screen_get_xscreen (screen)); | 1273 | xroot = RootWindowOfScreen (gdk_x11_screen_get_xscreen (screen)); |
52 | 1270 | 1274 | ||
53 | 1271 | bareAtom = XInternAtom (xdisplay, DECOR_BARE_ATOM_NAME, FALSE); | 1275 | bareAtom = XInternAtom (xdisplay, DECOR_BARE_ATOM_NAME, FALSE); |
54 | 1272 | normalAtom = XInternAtom (xdisplay, DECOR_NORMAL_ATOM_NAME, FALSE); | ||
55 | 1273 | activeAtom = XInternAtom (xdisplay, DECOR_ACTIVE_ATOM_NAME, FALSE); | 1276 | activeAtom = XInternAtom (xdisplay, DECOR_ACTIVE_ATOM_NAME, FALSE); |
56 | 1274 | 1277 | ||
57 | 1275 | if (bare_frame->border_shadow) | 1278 | if (bare_frame->border_shadow) |
58 | @@ -1302,11 +1305,6 @@ | |||
59 | 1302 | if (minimal) | 1305 | if (minimal) |
60 | 1303 | { | 1306 | { |
61 | 1304 | XChangeProperty (xdisplay, xroot, | 1307 | XChangeProperty (xdisplay, xroot, |
62 | 1305 | normalAtom, | ||
63 | 1306 | XA_INTEGER, | ||
64 | 1307 | 32, PropModeReplace, (guchar *) data, | ||
65 | 1308 | PROP_HEADER_SIZE + BASE_PROP_SIZE + QUAD_PROP_SIZE * N_QUADS_MAX); | ||
66 | 1309 | XChangeProperty (xdisplay, xroot, | ||
67 | 1310 | activeAtom, | 1308 | activeAtom, |
68 | 1311 | XA_INTEGER, | 1309 | XA_INTEGER, |
69 | 1312 | 32, PropModeReplace, (guchar *) data, | 1310 | 32, PropModeReplace, (guchar *) data, |
70 | @@ -1321,7 +1319,6 @@ | |||
71 | 1321 | 1319 | ||
72 | 1322 | if (minimal) | 1320 | if (minimal) |
73 | 1323 | { | 1321 | { |
74 | 1324 | XDeleteProperty (xdisplay, xroot, normalAtom); | ||
75 | 1325 | XDeleteProperty (xdisplay, xroot, activeAtom); | 1322 | XDeleteProperty (xdisplay, xroot, activeAtom); |
76 | 1326 | } | 1323 | } |
77 | 1327 | } | 1324 | } |
78 | @@ -1335,63 +1332,40 @@ | |||
79 | 1335 | XDeleteProperty (xdisplay, xroot, | 1332 | XDeleteProperty (xdisplay, xroot, |
80 | 1336 | activeAtom); | 1333 | activeAtom); |
81 | 1337 | 1334 | ||
89 | 1338 | XDeleteProperty (xdisplay, xroot, | 1335 | data = decor_alloc_property (WINDOW_TYPE_FRAMES_NUM * 2, WINDOW_DECORATION_TYPE_PIXMAP); |
90 | 1339 | normalAtom); | 1336 | |
91 | 1340 | 1337 | /* All active states and all inactive states */ | |
92 | 1341 | active_data = decor_alloc_property (WINDOW_TYPE_FRAMES_NUM, WINDOW_DECORATION_TYPE_PIXMAP); | 1338 | for (i = 0; i < WINDOW_TYPE_FRAMES_NUM * 2; i++) |
86 | 1342 | inactive_data = decor_alloc_property (WINDOW_TYPE_FRAMES_NUM, WINDOW_DECORATION_TYPE_PIXMAP); | ||
87 | 1343 | |||
88 | 1344 | for (i = 0; i < WINDOW_TYPE_FRAMES_NUM; i++) | ||
93 | 1345 | { | 1339 | { |
94 | 1346 | frame = gwd_get_decor_frame (default_frames[i].name); | 1340 | frame = gwd_get_decor_frame (default_frames[i].name); |
95 | 1347 | extents = frame->win_extents; | 1341 | extents = frame->win_extents; |
96 | 1348 | 1342 | ||
135 | 1349 | if (default_frames[i].active_d) | 1343 | if (default_frames[i].d) |
136 | 1350 | { | 1344 | { |
137 | 1351 | if (default_frames[i].active_d->pixmap) | 1345 | if (default_frames[i].d->pixmap) |
138 | 1352 | g_object_unref (G_OBJECT (default_frames[i].active_d->pixmap)); | 1346 | g_object_unref (G_OBJECT (default_frames[i].d->pixmap)); |
139 | 1353 | 1347 | ||
140 | 1354 | free (default_frames[i].active_d); | 1348 | free (default_frames[i].d); |
141 | 1355 | } | 1349 | } |
142 | 1356 | 1350 | ||
143 | 1357 | if (default_frames[i].inactive_d) | 1351 | default_frames[i].d = calloc (1, sizeof (decor_t)); |
144 | 1358 | { | 1352 | |
145 | 1359 | if (default_frames[i].inactive_d->pixmap) | 1353 | default_frames[i].d->context = &frame->window_context; |
146 | 1360 | g_object_unref (G_OBJECT (default_frames[i].inactive_d->pixmap)); | 1354 | default_frames[i].d->shadow = frame->border_shadow; |
147 | 1361 | 1355 | default_frames[i].d->layout = pango_layout_new (frame->pango_context); | |
148 | 1362 | free (default_frames[i].inactive_d); | 1356 | |
149 | 1363 | } | 1357 | decor_get_default_layout (default_frames[i].d->context, 1, 1, &default_frames[i].d->border_layout); |
150 | 1364 | 1358 | ||
151 | 1365 | default_frames[i].active_d = calloc (1, sizeof (decor_t)); | 1359 | default_frames[i].d->width = default_frames[i].d->border_layout.width; |
152 | 1366 | default_frames[i].inactive_d = calloc (1, sizeof (decor_t)); | 1360 | default_frames[i].d->height = default_frames[i].d->border_layout.height; |
153 | 1367 | 1361 | ||
154 | 1368 | default_frames[i].active_d->context = &frame->window_context; | 1362 | default_frames[i].d->frame = frame; |
155 | 1369 | default_frames[i].inactive_d->context = &frame->window_context; | 1363 | default_frames[i].d->active = i < WINDOW_TYPE_FRAMES_NUM ? TRUE : FALSE; |
118 | 1370 | default_frames[i].active_d->shadow = frame->border_shadow; | ||
119 | 1371 | default_frames[i].inactive_d->shadow = frame->border_shadow; | ||
120 | 1372 | default_frames[i].active_d->layout = pango_layout_new (frame->pango_context); | ||
121 | 1373 | default_frames[i].inactive_d->layout = pango_layout_new (frame->pango_context); | ||
122 | 1374 | |||
123 | 1375 | decor_get_default_layout (default_frames[i].active_d->context, 1, 1, &default_frames[i].active_d->border_layout); | ||
124 | 1376 | decor_get_default_layout (default_frames[i].inactive_d->context, 1, 1, &default_frames[i].inactive_d->border_layout); | ||
125 | 1377 | |||
126 | 1378 | default_frames[i].active_d->width = default_frames[i].active_d->border_layout.width; | ||
127 | 1379 | default_frames[i].active_d->height = default_frames[i].active_d->border_layout.height; | ||
128 | 1380 | |||
129 | 1381 | default_frames[i].active_d->frame = frame; | ||
130 | 1382 | |||
131 | 1383 | default_frames[i].inactive_d->width = default_frames[i].inactive_d->border_layout.width; | ||
132 | 1384 | default_frames[i].inactive_d->height = default_frames[i].inactive_d->border_layout.height; | ||
133 | 1385 | |||
134 | 1386 | default_frames[i].inactive_d->frame = frame; | ||
156 | 1387 | 1364 | ||
157 | 1388 | extents.top += frame->titlebar_height; | 1365 | extents.top += frame->titlebar_height; |
158 | 1389 | 1366 | ||
164 | 1390 | default_frames[i].inactive_d->draw = theme_draw_window_decoration; | 1367 | default_frames[i].d->draw = theme_draw_window_decoration; |
165 | 1391 | default_frames[i].active_d->draw = theme_draw_window_decoration; | 1368 | default_frames[i].d->pixmap = create_pixmap (default_frames[i].d->width, default_frames[i].d->height, frame->style_window_rgba); |
161 | 1392 | |||
162 | 1393 | default_frames[i].active_d->pixmap = create_pixmap (default_frames[i].active_d->width, default_frames[i].active_d->height, frame->style_window_rgba); | ||
163 | 1394 | default_frames[i].inactive_d->pixmap = create_pixmap (default_frames[i].active_d->width, default_frames[i].active_d->height, frame->style_window_rgba); | ||
166 | 1395 | 1369 | ||
167 | 1396 | unsigned int j, k; | 1370 | unsigned int j, k; |
168 | 1397 | 1371 | ||
169 | @@ -1399,61 +1373,34 @@ | |||
170 | 1399 | { | 1373 | { |
171 | 1400 | for (k = 0; k < 3; k++) | 1374 | for (k = 0; k < 3; k++) |
172 | 1401 | { | 1375 | { |
175 | 1402 | default_frames[i].active_d->event_windows[j][k].window = None; | 1376 | default_frames[i].d->event_windows[j][k].window = None; |
174 | 1403 | default_frames[i].inactive_d->event_windows[j][k].window = None; | ||
176 | 1404 | } | 1377 | } |
177 | 1405 | } | 1378 | } |
178 | 1406 | 1379 | ||
179 | 1407 | for (j = 0; j < BUTTON_NUM; j++) | 1380 | for (j = 0; j < BUTTON_NUM; j++) |
180 | 1408 | { | 1381 | { |
185 | 1409 | default_frames[i].active_d->button_windows[j].window = None; | 1382 | default_frames[i].d->button_windows[j].window = None; |
186 | 1410 | default_frames[i].active_d->button_states[j] = 0; | 1383 | default_frames[i].d->button_states[j] = 0; |
183 | 1411 | default_frames[i].inactive_d->button_windows[j].window = None; | ||
184 | 1412 | default_frames[i].inactive_d->button_states[j] = 0; | ||
187 | 1413 | } | 1384 | } |
188 | 1414 | 1385 | ||
231 | 1415 | if (default_frames[i].active_d->pixmap) | 1386 | if (default_frames[i].d->pixmap) |
232 | 1416 | { | 1387 | { |
233 | 1417 | gint nQuad; | 1388 | gint nQuad; |
234 | 1418 | unsigned int frame_type = populate_frame_type (default_frames[i].active_d); | 1389 | unsigned int frame_type = populate_frame_type (default_frames[i].d); |
235 | 1419 | unsigned int frame_state = populate_frame_state (default_frames[i].active_d); | 1390 | unsigned int frame_state = populate_frame_state (default_frames[i].d); |
236 | 1420 | unsigned int frame_actions = populate_frame_actions (default_frames[i].active_d); | 1391 | unsigned int frame_actions = populate_frame_actions (default_frames[i].d); |
237 | 1421 | decor_quad_t quads[N_QUADS_MAX]; | 1392 | decor_quad_t quads[N_QUADS_MAX]; |
238 | 1422 | 1393 | ||
239 | 1423 | nQuad = decor_set_lSrStSbS_window_quads (quads, default_frames[i].active_d->context, | 1394 | nQuad = decor_set_lSrStSbS_window_quads (quads, default_frames[i].d->context, |
240 | 1424 | &default_frames[i].active_d->border_layout); | 1395 | &default_frames[i].d->border_layout); |
241 | 1425 | 1396 | ||
242 | 1426 | default_frames[i].active_d->active = TRUE; | 1397 | default_frames[i].d->picture = XRenderCreatePicture (xdisplay, |
243 | 1427 | default_frames[i].active_d->picture = XRenderCreatePicture (xdisplay, | 1398 | GDK_PIXMAP_XID (default_frames[i].d->pixmap), |
244 | 1428 | GDK_PIXMAP_XID (default_frames[i].active_d->pixmap), | 1399 | xformat_rgba, 0, NULL); |
245 | 1429 | xformat_rgba, 0, NULL); | 1400 | |
246 | 1430 | 1401 | (*default_frames[i].d->draw) (default_frames[i].d); | |
247 | 1431 | (*default_frames[i].active_d->draw) (default_frames[i].active_d); | 1402 | |
248 | 1432 | 1403 | decor_quads_to_property (data, i, GDK_PIXMAP_XID (default_frames[i].d->pixmap), | |
207 | 1433 | decor_quads_to_property (active_data, i, GDK_PIXMAP_XID (default_frames[i].active_d->pixmap), | ||
208 | 1434 | &extents, &extents, | ||
209 | 1435 | &extents, &extents, 0, 0, quads, nQuad, frame_type, frame_state, frame_actions); | ||
210 | 1436 | } | ||
211 | 1437 | |||
212 | 1438 | if (default_frames[i].inactive_d->pixmap) | ||
213 | 1439 | { | ||
214 | 1440 | gint nQuad; | ||
215 | 1441 | unsigned int frame_type = populate_frame_type (default_frames[i].inactive_d); | ||
216 | 1442 | unsigned int frame_state = populate_frame_state (default_frames[i].inactive_d); | ||
217 | 1443 | unsigned int frame_actions = populate_frame_actions (default_frames[i].inactive_d); | ||
218 | 1444 | decor_quad_t quads[N_QUADS_MAX]; | ||
219 | 1445 | |||
220 | 1446 | nQuad = decor_set_lSrStSbS_window_quads (quads, default_frames[i].inactive_d->context, | ||
221 | 1447 | &default_frames[i].inactive_d->border_layout); | ||
222 | 1448 | |||
223 | 1449 | default_frames[i].inactive_d->active = FALSE; | ||
224 | 1450 | default_frames[i].inactive_d->picture = XRenderCreatePicture (xdisplay, | ||
225 | 1451 | GDK_PIXMAP_XID (default_frames[i].inactive_d->pixmap), | ||
226 | 1452 | xformat_rgba, 0, NULL); | ||
227 | 1453 | |||
228 | 1454 | (*default_frames[i].inactive_d->draw) (default_frames[i].inactive_d); | ||
229 | 1455 | |||
230 | 1456 | decor_quads_to_property (inactive_data, i, GDK_PIXMAP_XID (default_frames[i].inactive_d->pixmap), | ||
249 | 1457 | &extents, &extents, | 1404 | &extents, &extents, |
250 | 1458 | &extents, &extents, 0, 0, quads, nQuad, frame_type, frame_state, frame_actions); | 1405 | &extents, &extents, 0, 0, quads, nQuad, frame_type, frame_state, frame_actions); |
251 | 1459 | } | 1406 | } |
252 | @@ -1464,18 +1411,10 @@ | |||
253 | 1464 | XChangeProperty (xdisplay, xroot, | 1411 | XChangeProperty (xdisplay, xroot, |
254 | 1465 | activeAtom, | 1412 | activeAtom, |
255 | 1466 | XA_INTEGER, | 1413 | XA_INTEGER, |
268 | 1467 | 32, PropModeAppend, (guchar *) active_data, | 1414 | 32, PropModeAppend, (guchar *) data, |
269 | 1468 | PROP_HEADER_SIZE + (WINDOW_TYPE_FRAMES_NUM) * (BASE_PROP_SIZE + QUAD_PROP_SIZE * N_QUADS_MAX)); | 1415 | PROP_HEADER_SIZE + (WINDOW_TYPE_FRAMES_NUM * 2) * (BASE_PROP_SIZE + QUAD_PROP_SIZE * N_QUADS_MAX)); |
270 | 1469 | 1416 | ||
271 | 1470 | 1417 | free (data); | |
260 | 1471 | XChangeProperty (xdisplay, xroot, | ||
261 | 1472 | normalAtom, | ||
262 | 1473 | XA_INTEGER, | ||
263 | 1474 | 32, PropModeAppend, (guchar *) inactive_data, | ||
264 | 1475 | PROP_HEADER_SIZE + (WINDOW_TYPE_FRAMES_NUM) * (BASE_PROP_SIZE + QUAD_PROP_SIZE * N_QUADS_MAX)); | ||
265 | 1476 | |||
266 | 1477 | free (active_data); | ||
267 | 1478 | free (inactive_data); | ||
272 | 1479 | 1418 | ||
273 | 1480 | gwd_decor_frame_unref (bare_frame); | 1419 | gwd_decor_frame_unref (bare_frame); |
274 | 1481 | } | 1420 | } |
275 | 1482 | 1421 | ||
276 | === modified file 'gtk/window-decorator/gtk-window-decorator.c' | |||
277 | --- gtk/window-decorator/gtk-window-decorator.c 2011-05-20 16:52:31 +0000 | |||
278 | +++ gtk/window-decorator/gtk-window-decorator.c 2011-05-20 16:52:31 +0000 | |||
279 | @@ -83,7 +83,14 @@ | |||
280 | 83 | }; | 83 | }; |
281 | 84 | 84 | ||
282 | 85 | #define WINDOW_TYPE_FRAMES_NUM 5 | 85 | #define WINDOW_TYPE_FRAMES_NUM 5 |
284 | 86 | struct _default_frame_references default_frames[WINDOW_TYPE_FRAMES_NUM] = { | 86 | struct _default_frame_references default_frames[WINDOW_TYPE_FRAMES_NUM * 2] = { |
285 | 87 | /* active */ | ||
286 | 88 | {"normal", NULL }, | ||
287 | 89 | {"dialog", NULL }, | ||
288 | 90 | {"modal_dialog", NULL }, | ||
289 | 91 | {"menu", NULL }, | ||
290 | 92 | {"utility", NULL}, | ||
291 | 93 | /* inactive */ | ||
292 | 87 | {"normal", NULL }, | 94 | {"normal", NULL }, |
293 | 88 | {"dialog", NULL }, | 95 | {"dialog", NULL }, |
294 | 89 | {"modal_dialog", NULL }, | 96 | {"modal_dialog", NULL }, |
295 | 90 | 97 | ||
296 | === modified file 'gtk/window-decorator/gtk-window-decorator.h' | |||
297 | --- gtk/window-decorator/gtk-window-decorator.h 2011-05-20 16:52:31 +0000 | |||
298 | +++ gtk/window-decorator/gtk-window-decorator.h 2011-05-20 16:52:31 +0000 | |||
299 | @@ -459,9 +459,8 @@ | |||
300 | 459 | struct _default_frame_references | 459 | struct _default_frame_references |
301 | 460 | { | 460 | { |
302 | 461 | char *name; | 461 | char *name; |
306 | 462 | decor_t *active_d; | 462 | decor_t *d; |
307 | 463 | decor_t *inactive_d; | 463 | } extern default_frames[WINDOW_TYPE_FRAMES_NUM * 2]; |
305 | 464 | } extern default_frames[WINDOW_TYPE_FRAMES_NUM]; | ||
308 | 465 | const gchar * window_type_frames[WINDOW_TYPE_FRAMES_NUM]; | 464 | const gchar * window_type_frames[WINDOW_TYPE_FRAMES_NUM]; |
309 | 466 | 465 | ||
310 | 467 | void (*theme_draw_window_decoration) (decor_t *d); | 466 | void (*theme_draw_window_decoration) (decor_t *d); |
311 | 468 | 467 | ||
312 | === modified file 'gtk/window-decorator/wnck.c' | |||
313 | --- gtk/window-decorator/wnck.c 2011-05-20 16:52:31 +0000 | |||
314 | +++ gtk/window-decorator/wnck.c 2011-05-20 16:52:31 +0000 | |||
315 | @@ -690,19 +690,19 @@ | |||
316 | 690 | GList *windows; | 690 | GList *windows; |
317 | 691 | 691 | ||
318 | 692 | g_signal_connect_object (G_OBJECT (screen), "active_window_changed", | 692 | g_signal_connect_object (G_OBJECT (screen), "active_window_changed", |
321 | 693 | G_CALLBACK (active_window_changed), | 693 | G_CALLBACK (active_window_changed), |
322 | 694 | 0, 0); | 694 | 0, 0); |
323 | 695 | g_signal_connect_object (G_OBJECT (screen), "window_opened", | 695 | g_signal_connect_object (G_OBJECT (screen), "window_opened", |
326 | 696 | G_CALLBACK (window_opened), | 696 | G_CALLBACK (window_opened), |
327 | 697 | 0, 0); | 697 | 0, 0); |
328 | 698 | g_signal_connect_object (G_OBJECT (screen), "window_closed", | 698 | g_signal_connect_object (G_OBJECT (screen), "window_closed", |
331 | 699 | G_CALLBACK (window_closed), | 699 | G_CALLBACK (window_closed), |
332 | 700 | 0, 0); | 700 | 0, 0); |
333 | 701 | 701 | ||
334 | 702 | windows = wnck_screen_get_windows (screen); | 702 | windows = wnck_screen_get_windows (screen); |
335 | 703 | while (windows != NULL) | 703 | while (windows != NULL) |
336 | 704 | { | 704 | { |
339 | 705 | window_opened (screen, windows->data); | 705 | window_opened (screen, windows->data); |
340 | 706 | windows = windows->next; | 706 | windows = windows->next; |
341 | 707 | } | 707 | } |
342 | 708 | } | 708 | } |
343 | 709 | 709 | ||
344 | === modified file 'include/decoration.h' | |||
345 | --- include/decoration.h 2011-05-20 16:52:31 +0000 | |||
346 | +++ include/decoration.h 2011-05-20 16:52:31 +0000 | |||
347 | @@ -38,7 +38,6 @@ | |||
348 | 38 | 38 | ||
349 | 39 | #define DECOR_SUPPORTING_DM_CHECK_ATOM_NAME "_COMPIZ_SUPPORTING_DM_CHECK" | 39 | #define DECOR_SUPPORTING_DM_CHECK_ATOM_NAME "_COMPIZ_SUPPORTING_DM_CHECK" |
350 | 40 | #define DECOR_BARE_ATOM_NAME "_COMPIZ_WINDOW_DECOR_BARE" | 40 | #define DECOR_BARE_ATOM_NAME "_COMPIZ_WINDOW_DECOR_BARE" |
351 | 41 | #define DECOR_NORMAL_ATOM_NAME "_COMPIZ_WINDOW_DECOR_NORMAL" | ||
352 | 42 | #define DECOR_ACTIVE_ATOM_NAME "_COMPIZ_WINDOW_DECOR_ACTIVE" | 41 | #define DECOR_ACTIVE_ATOM_NAME "_COMPIZ_WINDOW_DECOR_ACTIVE" |
353 | 43 | #define DECOR_WINDOW_ATOM_NAME "_COMPIZ_WINDOW_DECOR" | 42 | #define DECOR_WINDOW_ATOM_NAME "_COMPIZ_WINDOW_DECOR" |
354 | 44 | #define DECOR_BLUR_ATOM_NAME "_COMPIZ_WM_WINDOW_BLUR_DECOR" | 43 | #define DECOR_BLUR_ATOM_NAME "_COMPIZ_WM_WINDOW_BLUR_DECOR" |
355 | 45 | 44 | ||
356 | === modified file 'kde/window-decorator-kde4/decorator.cpp' | |||
357 | --- kde/window-decorator-kde4/decorator.cpp 2011-05-20 16:52:31 +0000 | |||
358 | +++ kde/window-decorator-kde4/decorator.cpp 2011-05-20 16:52:31 +0000 | |||
359 | @@ -63,6 +63,10 @@ | |||
360 | 63 | WId KWD::Decorator::mActiveId; | 63 | WId KWD::Decorator::mActiveId; |
361 | 64 | decor_shadow_options_t KWD::Decorator::mShadowOptions; | 64 | decor_shadow_options_t KWD::Decorator::mShadowOptions; |
362 | 65 | 65 | ||
363 | 66 | KWD::Window *KWD::Decorator::mDecorNormal = NULL; | ||
364 | 67 | KWD::Window *KWD::Decorator::mDecorActive = NULL; | ||
365 | 68 | KWD::Decorator *KWD::Decorator::mSelf = NULL; | ||
366 | 69 | |||
367 | 66 | struct _cursor cursors[3][3] = { | 70 | struct _cursor cursors[3][3] = { |
368 | 67 | { C (top_left_corner), C (top_side), C (top_right_corner) }, | 71 | { C (top_left_corner), C (top_side), C (top_right_corner) }, |
369 | 68 | { C (left_side), C (left_ptr), C (right_side) }, | 72 | { C (left_side), C (left_ptr), C (right_side) }, |
370 | @@ -88,6 +92,8 @@ | |||
371 | 88 | XSetWindowAttributes attr; | 92 | XSetWindowAttributes attr; |
372 | 89 | int i, j; | 93 | int i, j; |
373 | 90 | 94 | ||
374 | 95 | mSelf = this; | ||
375 | 96 | |||
376 | 91 | mRootInfo = new NETRootInfo (QX11Info::display (), 0); | 97 | mRootInfo = new NETRootInfo (QX11Info::display (), 0); |
377 | 92 | 98 | ||
378 | 93 | mActiveId = 0; | 99 | mActiveId = 0; |
379 | @@ -192,9 +198,10 @@ | |||
380 | 192 | 198 | ||
381 | 193 | updateShadow (); | 199 | updateShadow (); |
382 | 194 | 200 | ||
383 | 201 | /* FIXME: Implement proper decoration lists and remove this */ | ||
384 | 195 | mDecorNormal = new KWD::Window (mCompositeWindow, | 202 | mDecorNormal = new KWD::Window (mCompositeWindow, |
387 | 196 | QX11Info::appRootWindow (), | 203 | QX11Info::appRootWindow (), |
388 | 197 | 0, Window::Default); | 204 | 0, Window::Default); |
389 | 198 | mDecorActive = new KWD::Window (mCompositeWindow, | 205 | mDecorActive = new KWD::Window (mCompositeWindow, |
390 | 199 | QX11Info::appRootWindow (), | 206 | QX11Info::appRootWindow (), |
391 | 200 | 0, Window::DefaultActive); | 207 | 0, Window::DefaultActive); |
392 | 201 | 208 | ||
393 | === modified file 'kde/window-decorator-kde4/decorator.h' | |||
394 | --- kde/window-decorator-kde4/decorator.h 2010-08-20 15:29:13 +0000 | |||
395 | +++ kde/window-decorator-kde4/decorator.h 2011-05-20 16:52:31 +0000 | |||
396 | @@ -108,6 +108,21 @@ | |||
397 | 108 | return &mShadowOptions; | 108 | return &mShadowOptions; |
398 | 109 | } | 109 | } |
399 | 110 | 110 | ||
400 | 111 | static KWD::Window *defaultNormal () | ||
401 | 112 | { | ||
402 | 113 | return mDecorNormal; | ||
403 | 114 | } | ||
404 | 115 | |||
405 | 116 | static KWD::Window *defaultActive () | ||
406 | 117 | { | ||
407 | 118 | return mDecorActive; | ||
408 | 119 | } | ||
409 | 120 | |||
410 | 121 | static KWD::Decorator *self () | ||
411 | 122 | { | ||
412 | 123 | return mSelf; | ||
413 | 124 | } | ||
414 | 125 | |||
415 | 111 | static void sendClientMessage (WId eventWid, | 126 | static void sendClientMessage (WId eventWid, |
416 | 112 | WId wid, | 127 | WId wid, |
417 | 113 | Atom atom, | 128 | Atom atom, |
418 | @@ -152,8 +167,8 @@ | |||
419 | 152 | static NETRootInfo *mRootInfo; | 167 | static NETRootInfo *mRootInfo; |
420 | 153 | static WId mActiveId; | 168 | static WId mActiveId; |
421 | 154 | 169 | ||
424 | 155 | KWD::Window *mDecorNormal; | 170 | static KWD::Window *mDecorNormal; |
425 | 156 | KWD::Window *mDecorActive; | 171 | static KWD::Window *mDecorActive; |
426 | 157 | QMap <WId, KWD::Window *>mClients; | 172 | QMap <WId, KWD::Window *>mClients; |
427 | 158 | QMap <WId, KWD::Window *>mFrames; | 173 | QMap <WId, KWD::Window *>mFrames; |
428 | 159 | KConfig *mConfig; | 174 | KConfig *mConfig; |
429 | @@ -162,6 +177,8 @@ | |||
430 | 162 | WId mCompositeWindow; | 177 | WId mCompositeWindow; |
431 | 163 | 178 | ||
432 | 164 | Switcher *mSwitcher; | 179 | Switcher *mSwitcher; |
433 | 180 | |||
434 | 181 | static KWD::Decorator *mSelf; /* XXX: Remove */ | ||
435 | 165 | }; | 182 | }; |
436 | 166 | } | 183 | } |
437 | 167 | 184 | ||
438 | 168 | 185 | ||
439 | === modified file 'kde/window-decorator-kde4/utils.cpp' | |||
440 | --- kde/window-decorator-kde4/utils.cpp 2010-10-24 14:42:07 +0000 | |||
441 | +++ kde/window-decorator-kde4/utils.cpp 2011-05-20 16:52:31 +0000 | |||
442 | @@ -221,8 +221,6 @@ | |||
443 | 221 | compizShadowColor = | 221 | compizShadowColor = |
444 | 222 | XInternAtom (xdisplay, "_COMPIZ_NET_CM_SHADOW_COLOR", false); | 222 | XInternAtom (xdisplay, "_COMPIZ_NET_CM_SHADOW_COLOR", false); |
445 | 223 | netWindowDecor = XInternAtom (xdisplay, DECOR_WINDOW_ATOM_NAME, false); | 223 | netWindowDecor = XInternAtom (xdisplay, DECOR_WINDOW_ATOM_NAME, false); |
446 | 224 | netWindowDecorNormal = | ||
447 | 225 | XInternAtom (xdisplay, DECOR_NORMAL_ATOM_NAME, false); | ||
448 | 226 | netWindowDecorActive = | 224 | netWindowDecorActive = |
449 | 227 | XInternAtom (xdisplay, DECOR_ACTIVE_ATOM_NAME, false); | 225 | XInternAtom (xdisplay, DECOR_ACTIVE_ATOM_NAME, false); |
450 | 228 | netWindowDecorBare = | 226 | netWindowDecorBare = |
451 | 229 | 227 | ||
452 | === modified file 'kde/window-decorator-kde4/window.cpp' | |||
453 | --- kde/window-decorator-kde4/window.cpp 2011-05-20 16:52:31 +0000 | |||
454 | +++ kde/window-decorator-kde4/window.cpp 2011-05-20 16:52:31 +0000 | |||
455 | @@ -185,6 +185,8 @@ | |||
456 | 185 | { | 185 | { |
457 | 186 | if (mType == DefaultActive) | 186 | if (mType == DefaultActive) |
458 | 187 | return true; | 187 | return true; |
459 | 188 | else if (mType == Default) | ||
460 | 189 | return false; | ||
461 | 188 | 190 | ||
462 | 189 | return Decorator::activeId () == mClientId; | 191 | return Decorator::activeId () == mClientId; |
463 | 190 | } | 192 | } |
464 | @@ -1004,7 +1006,30 @@ | |||
465 | 1004 | if (mPaintRedirector) | 1006 | if (mPaintRedirector) |
466 | 1005 | mUpdateProperty = true; | 1007 | mUpdateProperty = true; |
467 | 1006 | else | 1008 | else |
469 | 1007 | updateProperty (); | 1009 | { |
470 | 1010 | long *data = NULL; | ||
471 | 1011 | unsigned int propSize = 0; | ||
472 | 1012 | KWD::Window *otherUpdate = NULL; | ||
473 | 1013 | |||
474 | 1014 | if (mType == Default || mType == DefaultActive) | ||
475 | 1015 | { | ||
476 | 1016 | propSize = 2; | ||
477 | 1017 | data = decor_alloc_property (propSize, WINDOW_DECORATION_TYPE_PIXMAP); | ||
478 | 1018 | |||
479 | 1019 | if (mType == Default) | ||
480 | 1020 | otherUpdate = KWD::Decorator::self ()->defaultActive (); | ||
481 | 1021 | else if (mType == DefaultActive) | ||
482 | 1022 | otherUpdate = KWD::Decorator::self ()->defaultNormal (); | ||
483 | 1023 | } | ||
484 | 1024 | |||
485 | 1025 | data = updateProperty (data, propSize); | ||
486 | 1026 | |||
487 | 1027 | if (otherUpdate && data) | ||
488 | 1028 | { | ||
489 | 1029 | otherUpdate->updateProperty (data, propSize); | ||
490 | 1030 | free (data); | ||
491 | 1031 | } | ||
492 | 1032 | } | ||
493 | 1008 | } | 1033 | } |
494 | 1009 | 1034 | ||
495 | 1010 | void | 1035 | void |
496 | @@ -1111,22 +1136,50 @@ | |||
497 | 1111 | } | 1136 | } |
498 | 1112 | } | 1137 | } |
499 | 1113 | 1138 | ||
502 | 1114 | void | 1139 | long * |
503 | 1115 | KWD::Window::updateProperty (void) | 1140 | KWD::Window::updateProperty (long *data, |
504 | 1141 | unsigned int propSize) | ||
505 | 1116 | { | 1142 | { |
506 | 1117 | Atom atom = Atoms::netWindowDecor; | 1143 | Atom atom = Atoms::netWindowDecor; |
507 | 1118 | decor_extents_t maxExtents, normExtents; | 1144 | decor_extents_t maxExtents, normExtents; |
508 | 1119 | decor_quad_t quads[N_QUADS_MAX]; | 1145 | decor_quad_t quads[N_QUADS_MAX]; |
509 | 1146 | unsigned int nOffset = 1; | ||
510 | 1147 | unsigned int frameType = 0xffffff; | ||
511 | 1148 | unsigned int frameState = 0; | ||
512 | 1149 | unsigned int frameActions = 0; | ||
513 | 1120 | int nQuad = 0; | 1150 | int nQuad = 0; |
514 | 1121 | unsigned int nOffset = 1, frameType = 0, frameState = 0, frameActions = 0; | ||
515 | 1122 | long *data = NULL; | ||
516 | 1123 | int left, right, top, bottom, width, height; | 1151 | int left, right, top, bottom, width, height; |
517 | 1124 | unsigned int saveState; | 1152 | unsigned int saveState; |
523 | 1125 | 1153 | bool allocated = false; | |
524 | 1126 | if (mType == Default) | 1154 | |
525 | 1127 | atom = Atoms::netWindowDecorNormal; | 1155 | if (!propSize) |
526 | 1128 | else if (mType == DefaultActive) | 1156 | propSize = nOffset; |
527 | 1129 | atom = Atoms::netWindowDecorActive; | 1157 | |
528 | 1158 | /* FIXME: This is essentially a hack to put the default | ||
529 | 1159 | * active and inactive decorations in the same property, | ||
530 | 1160 | * since we take an existing allocated property and return | ||
531 | 1161 | * the data in there and then pass it to the next KWD::Window | ||
532 | 1162 | * to update the property again. That's sub-optimal, but | ||
533 | 1163 | * its the best solution until we implement proper decoration | ||
534 | 1164 | * lists inside of kde4-window-decorator */ | ||
535 | 1165 | |||
536 | 1166 | if (mType != Normal && mType != Normal2D) | ||
537 | 1167 | { | ||
538 | 1168 | atom = Atoms::netWindowDecorActive; | ||
539 | 1169 | |||
540 | 1170 | if (mType == Default) | ||
541 | 1171 | { | ||
542 | 1172 | frameState &= ~(DECOR_WINDOW_STATE_FOCUS); | ||
543 | 1173 | nOffset = 2; | ||
544 | 1174 | } | ||
545 | 1175 | else if (mType == DefaultActive) | ||
546 | 1176 | { | ||
547 | 1177 | frameState |= DECOR_WINDOW_STATE_FOCUS; | ||
548 | 1178 | nOffset = 1; | ||
549 | 1179 | } | ||
550 | 1180 | } | ||
551 | 1181 | else if (!propSize) | ||
552 | 1182 | propSize = nOffset; | ||
553 | 1130 | 1183 | ||
554 | 1131 | saveState = mState; | 1184 | saveState = mState; |
555 | 1132 | mState = NET::MaxVert | NET::MaxHoriz; | 1185 | mState = NET::MaxVert | NET::MaxHoriz; |
556 | @@ -1148,7 +1201,11 @@ | |||
557 | 1148 | 1201 | ||
558 | 1149 | if (mType != Normal2D) | 1202 | if (mType != Normal2D) |
559 | 1150 | { | 1203 | { |
561 | 1151 | data = decor_alloc_property (nOffset, WINDOW_DECORATION_TYPE_PIXMAP); | 1204 | if (!data) |
562 | 1205 | { | ||
563 | 1206 | allocated = true; | ||
564 | 1207 | data = decor_alloc_property (propSize, WINDOW_DECORATION_TYPE_PIXMAP); | ||
565 | 1208 | } | ||
566 | 1152 | if (mType == Normal) | 1209 | if (mType == Normal) |
567 | 1153 | { | 1210 | { |
568 | 1154 | decor_quad_t *q = quads; | 1211 | decor_quad_t *q = quads; |
569 | @@ -1246,7 +1303,11 @@ | |||
570 | 1246 | } | 1303 | } |
571 | 1247 | else | 1304 | else |
572 | 1248 | { | 1305 | { |
574 | 1249 | data = decor_alloc_property (nOffset, WINDOW_DECORATION_TYPE_WINDOW); | 1306 | if (!data) |
575 | 1307 | { | ||
576 | 1308 | allocated = true; | ||
577 | 1309 | data = decor_alloc_property (propSize, WINDOW_DECORATION_TYPE_PIXMAP); | ||
578 | 1310 | } | ||
579 | 1250 | decor_gen_window_property (data, nOffset - 1, &normExtents, &maxExtents, 1, 0, frameType, frameState, frameActions); | 1311 | decor_gen_window_property (data, nOffset - 1, &normExtents, &maxExtents, 1, 0, frameType, frameState, frameActions); |
580 | 1251 | } | 1312 | } |
581 | 1252 | 1313 | ||
582 | @@ -1254,12 +1315,18 @@ | |||
583 | 1254 | XChangeProperty (QX11Info::display(), mClientId, atom, | 1315 | XChangeProperty (QX11Info::display(), mClientId, atom, |
584 | 1255 | XA_INTEGER, | 1316 | XA_INTEGER, |
585 | 1256 | 32, PropModeReplace, (unsigned char *) data, | 1317 | 32, PropModeReplace, (unsigned char *) data, |
587 | 1257 | PROP_HEADER_SIZE + BASE_PROP_SIZE + QUAD_PROP_SIZE * N_QUADS_MAX); | 1318 | PROP_HEADER_SIZE + propSize * (BASE_PROP_SIZE + QUAD_PROP_SIZE * N_QUADS_MAX)); |
588 | 1258 | KWD::popXError (); | 1319 | KWD::popXError (); |
589 | 1259 | 1320 | ||
591 | 1260 | free (data); | 1321 | if (allocated) |
592 | 1322 | { | ||
593 | 1323 | free (data); | ||
594 | 1324 | data = NULL; | ||
595 | 1325 | } | ||
596 | 1261 | 1326 | ||
597 | 1262 | mUpdateProperty = false; | 1327 | mUpdateProperty = false; |
598 | 1328 | |||
599 | 1329 | return data; | ||
600 | 1263 | } | 1330 | } |
601 | 1264 | 1331 | ||
602 | 1265 | void | 1332 | void |
603 | @@ -1874,7 +1941,30 @@ | |||
604 | 1874 | } | 1941 | } |
605 | 1875 | 1942 | ||
606 | 1876 | if (mUpdateProperty) | 1943 | if (mUpdateProperty) |
608 | 1877 | updateProperty (); | 1944 | { |
609 | 1945 | long *data = NULL; | ||
610 | 1946 | unsigned int propSize = 0; | ||
611 | 1947 | KWD::Window *otherUpdate = NULL; | ||
612 | 1948 | |||
613 | 1949 | if (mType == Default || mType == DefaultActive) | ||
614 | 1950 | { | ||
615 | 1951 | propSize = 2; | ||
616 | 1952 | data = decor_alloc_property (propSize, WINDOW_DECORATION_TYPE_PIXMAP); | ||
617 | 1953 | |||
618 | 1954 | if (mType == Default) | ||
619 | 1955 | otherUpdate = KWD::Decorator::self ()->defaultActive (); | ||
620 | 1956 | else if (mType == DefaultActive) | ||
621 | 1957 | otherUpdate = KWD::Decorator::self ()->defaultNormal (); | ||
622 | 1958 | } | ||
623 | 1959 | |||
624 | 1960 | data = updateProperty (data, propSize); | ||
625 | 1961 | |||
626 | 1962 | if (otherUpdate && data) | ||
627 | 1963 | { | ||
628 | 1964 | otherUpdate->updateProperty (data, propSize); | ||
629 | 1965 | free (data); | ||
630 | 1966 | } | ||
631 | 1967 | } | ||
632 | 1878 | } | 1968 | } |
633 | 1879 | 1969 | ||
634 | 1880 | QWidget * | 1970 | QWidget * |
635 | 1881 | 1971 | ||
636 | === modified file 'kde/window-decorator-kde4/window.h' | |||
637 | --- kde/window-decorator-kde4/window.h 2010-02-12 20:11:21 +0000 | |||
638 | +++ kde/window-decorator-kde4/window.h 2011-05-20 16:52:31 +0000 | |||
639 | @@ -206,7 +206,7 @@ | |||
640 | 206 | int bottomOffset, | 206 | int bottomOffset, |
641 | 207 | int leftOffset, | 207 | int leftOffset, |
642 | 208 | int rightOffset); | 208 | int rightOffset); |
644 | 209 | void updateProperty (void); | 209 | long * updateProperty (long *, unsigned int); |
645 | 210 | void getWindowProtocols (void); | 210 | void getWindowProtocols (void); |
646 | 211 | 211 | ||
647 | 212 | Options::MouseCommand buttonToCommand (Qt::MouseButtons button); | 212 | Options::MouseCommand buttonToCommand (Qt::MouseButtons button); |
648 | 213 | 213 | ||
649 | === modified file 'plugins/decor/src/decor.cpp' | |||
650 | --- plugins/decor/src/decor.cpp 2011-05-20 16:52:31 +0000 | |||
651 | +++ plugins/decor/src/decor.cpp 2011-05-20 16:52:31 +0000 | |||
652 | @@ -558,6 +558,12 @@ | |||
653 | 558 | decoration->maxBorder.top = maxBorder.top; | 558 | decoration->maxBorder.top = maxBorder.top; |
654 | 559 | decoration->maxBorder.bottom = maxBorder.bottom; | 559 | decoration->maxBorder.bottom = maxBorder.bottom; |
655 | 560 | 560 | ||
656 | 561 | /* Decoration info */ | ||
657 | 562 | |||
658 | 563 | decoration->frameType = frameType; | ||
659 | 564 | decoration->frameState = frameState; | ||
660 | 565 | decoration->frameActions = frameActions; | ||
661 | 566 | |||
662 | 561 | decoration->refCount = 1; | 567 | decoration->refCount = 1; |
663 | 562 | decoration->type = type; | 568 | decoration->type = type; |
664 | 563 | 569 | ||
665 | @@ -645,7 +651,7 @@ | |||
666 | 645 | Decoration *d = Decoration::create (id, prop, n, type, i); | 651 | Decoration *d = Decoration::create (id, prop, n, type, i); |
667 | 646 | 652 | ||
668 | 647 | if (!d) | 653 | if (!d) |
670 | 648 | { | 654 | { |
671 | 649 | XFree (data); | 655 | XFree (data); |
672 | 650 | mList.clear (); | 656 | mList.clear (); |
673 | 651 | return false; | 657 | return false; |
674 | @@ -1067,10 +1073,7 @@ | |||
675 | 1067 | !(dScreen->dmSupports & WINDOW_DECORATION_TYPE_WINDOW && | 1073 | !(dScreen->dmSupports & WINDOW_DECORATION_TYPE_WINDOW && |
676 | 1068 | pixmapFailed)) | 1074 | pixmapFailed)) |
677 | 1069 | { | 1075 | { |
682 | 1070 | if (window->id () == screen->activeWindow ()) | 1076 | decoration = dScreen->decor[DECOR_ACTIVE].findMatchingDecoration (window, false); |
679 | 1071 | decoration = dScreen->decor[DECOR_ACTIVE].findMatchingDecoration (window, false); | ||
680 | 1072 | else | ||
681 | 1073 | decoration = dScreen->decor[DECOR_NORMAL].findMatchingDecoration (window, false); | ||
683 | 1074 | 1077 | ||
684 | 1075 | if (!decoration) | 1078 | if (!decoration) |
685 | 1076 | compLogMessage ("decor", CompLogLevelWarn, "No default decoration found, placement will not be correct"); | 1079 | compLogMessage ("decor", CompLogLevelWarn, "No default decoration found, placement will not be correct"); |
686 | @@ -2218,9 +2221,7 @@ | |||
687 | 2218 | winDecorAtom = | 2221 | winDecorAtom = |
688 | 2219 | XInternAtom (s->dpy (), DECOR_WINDOW_ATOM_NAME, 0); | 2222 | XInternAtom (s->dpy (), DECOR_WINDOW_ATOM_NAME, 0); |
689 | 2220 | decorAtom[DECOR_BARE] = | 2223 | decorAtom[DECOR_BARE] = |
693 | 2221 | XInternAtom (s->dpy (), DECOR_BARE_ATOM_NAME, 0); | 2224 | XInternAtom (s->dpy (), DECOR_BARE_ATOM_NAME, 0); |
691 | 2222 | decorAtom[DECOR_NORMAL] = | ||
692 | 2223 | XInternAtom (s->dpy (), DECOR_NORMAL_ATOM_NAME, 0); | ||
694 | 2224 | decorAtom[DECOR_ACTIVE] = | 2225 | decorAtom[DECOR_ACTIVE] = |
695 | 2225 | XInternAtom (s->dpy (), DECOR_ACTIVE_ATOM_NAME, 0); | 2226 | XInternAtom (s->dpy (), DECOR_ACTIVE_ATOM_NAME, 0); |
696 | 2226 | inputFrameAtom = | 2227 | inputFrameAtom = |
697 | 2227 | 2228 | ||
698 | === modified file 'plugins/decor/src/decor.h' | |||
699 | --- plugins/decor/src/decor.h 2011-05-20 16:52:31 +0000 | |||
700 | +++ plugins/decor/src/decor.h 2011-05-20 16:52:31 +0000 | |||
701 | @@ -45,9 +45,8 @@ | |||
702 | 45 | 45 | ||
703 | 46 | /* FIXME: Remove */ | 46 | /* FIXME: Remove */ |
704 | 47 | #define DECOR_BARE 0 | 47 | #define DECOR_BARE 0 |
708 | 48 | #define DECOR_NORMAL 1 | 48 | #define DECOR_ACTIVE 1 |
709 | 49 | #define DECOR_ACTIVE 2 | 49 | #define DECOR_NUM 2 |
707 | 50 | #define DECOR_NUM 3 | ||
710 | 51 | 50 | ||
711 | 52 | class DecorTexture { | 51 | class DecorTexture { |
712 | 53 | 52 |
+1 code looks good