summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-09-17 19:14:57 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-09-17 19:14:57 -0400
commit2640e61109a6e6c696c90b14c6616c9fccf92c31 (patch)
tree7250d155a7c0944ff5baac19b388ee768400331f
parent631456917a445d17eca90d9843b90b3c8cda6ede (diff)
init: TRAINING WHEELS OFF
-rw-r--r--.gitignore16
-rw-r--r--COPYING4
-rw-r--r--COPYING-COMPIZ3
-rw-r--r--COPYING-ICONS1
-rw-r--r--Compiz_logo.pngbin0 -> 35877 bytes
-rw-r--r--Makefile.am15
-rw-r--r--e-module-compiz.edc499
-rw-r--r--e_modules-compiz.spec.in2
-rw-r--r--src/compiz.c435
-rw-r--r--src/e_mod_main.h6
-rw-r--r--src/exports/core.c5
-rw-r--r--src/exports/display.c58
-rw-r--r--src/exports/event.c67
-rw-r--r--src/exports/main.c1
-rw-r--r--src/exports/paint.c17
-rw-r--r--src/exports/screen.c136
-rw-r--r--src/exports/texture.c1
-rw-r--r--src/exports/window.c16
18 files changed, 462 insertions, 820 deletions
diff --git a/.gitignore b/.gitignore
index 89e5f75..7d02833 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,19 @@
5.dirstamp 5.dirstamp
6.libs 6.libs
7config.* 7config.*
8Makefile
9Makefile.in
10aclocal.m4
11autom4te.cache/
12compile
13configure
14depcomp
15e-module-compiz.edj
16e_modules-compiz.spec
17install-sh
18libtool
19ltmain.sh
20missing
21module.desktop
22stamp-h1
23
diff --git a/COPYING b/COPYING
index d3a8b13..9317229 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
1Copyright notice for desksanity 1Copyright notice for compiz module
2 2
3Copyright (C) 2013 Mike Blumenkrantz and various contributors (see AUTHORS) 3Copyright (C) 2015 Mike Blumenkrantz and various contributors (see AUTHORS)
4 4
5All rights reserved. 5All rights reserved.
6 6
diff --git a/COPYING-COMPIZ b/COPYING-COMPIZ
new file mode 100644
index 0000000..20d4534
--- /dev/null
+++ b/COPYING-COMPIZ
@@ -0,0 +1,3 @@
1All files in src/exports directory are originally from compiz 0.8 branch.
2While they have been modified by me, they are subject to the original copying
3notices at the top of each file.
diff --git a/COPYING-ICONS b/COPYING-ICONS
new file mode 100644
index 0000000..4355848
--- /dev/null
+++ b/COPYING-ICONS
@@ -0,0 +1 @@
"Compiz logo" by Jakub Steiner (Jimmac) - http://compiz.org/. Licensed under LGPL via Commons - https://commons.wikimedia.org/wiki/File:Compiz_logo.svg#/media/File:Compiz_logo.svg
diff --git a/Compiz_logo.png b/Compiz_logo.png
new file mode 100644
index 0000000..821e53e
--- /dev/null
+++ b/Compiz_logo.png
Binary files differ
diff --git a/Makefile.am b/Makefile.am
index 0443aaa..bb0c4ae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,16 +13,15 @@ include src/Makefile.mk
13#endif 13#endif
14 14
15filesdir = $(module_dir)/$(PACKAGE) 15filesdir = $(module_dir)/$(PACKAGE)
16files_DATA = module.desktop #e-module-compiz.edj # images/icon.png 16files_DATA = module.desktop e-module-compiz.edj # images/icon.png
17 17
18EXTRA_DIST = module.desktop.in 18EXTRA_DIST = \
19# e_modules-compiz.spec.in \ 19module.desktop.in \
20# e-module-compiz.edc \ 20e-module-compiz.edc \
21# epic-e-256.png \ 21Compiz_logo.png
22# win_shadow.png
23 22
24#e-module-compiz.edj: e-module-compiz.edc 23e-module-compiz.edj: e-module-compiz.edc
25# $(EDJE_CC) -id $(top_srcdir) $< $@ 24 $(EDJE_CC) -id $(top_srcdir) $< $@
26 25
27clean-local: 26clean-local:
28 rm -rf *.edj module.desktop e_modules-compiz.spec *~ 27 rm -rf *.edj module.desktop e_modules-compiz.spec *~
diff --git a/e-module-compiz.edc b/e-module-compiz.edc
index bb24447..bd3194d 100644
--- a/e-module-compiz.edc
+++ b/e-module-compiz.edc
@@ -1,506 +1,11 @@
1collections { 1collections {
2 group { name: "icon"; 2 group { name: "icon";
3 images.image: "epic-e-256.png" COMP; 3 images.image: "Compiz_logo.png" COMP;
4 parts { 4 parts {
5 part { name: "icon"; mouse_events: 0; 5 part { name: "icon"; mouse_events: 0;
6 description { state: "default"; 6 description { state: "default";
7 aspect_preference: BOTH; 7 aspect_preference: BOTH;
8 image.normal: "epic-e-256.png"; 8 image.normal: "Compiz_logo.png";
9 }
10 }
11 }
12 }
13 group { name: "e/modules/desksanity/moveresize";
14 parts {
15 part { name: "outline"; type: TEXT; mouse_events: 0;
16 effect: OUTLINE;
17 scale: 1;
18 description { state: "default" 0.0;
19 rel1.to: "e.text";
20 rel1.offset: -1 -1;
21 rel2.to: "e.text";
22 color: 0 0 0 255;
23 color2: 0 0 0 255;
24 color3: 0 0 0 255;
25 text { font: "Sans"; size: 16;
26 text_source: "e.text";
27 min: 1 1;
28 ellipsis: -1;
29 }
30 }
31 }
32 part { name: "e.text"; type: TEXT; mouse_events: 0;
33 effect: GLOW;
34 scale: 1;
35 description { state: "default" 0.0;
36 color: 51 153 255 255;
37 color2: 51 153 255 24;
38 color3: 51 153 255 18;
39 text { font: "Sans"; size: 16;
40 min: 1 1;
41 ellipsis: -1;
42 }
43 }
44 }
45 }
46 }
47 group { name: "e/modules/desksanity/zoom/base"; program_source: "e";
48 parts {
49 rect { "drag_clip"; nomouse;
50 desc { hid; }
51 desc { "vis";
52 link.base: "e,state,dragging";
53 }
54 }
55 rect { "zoomt"; clip: "drag_clip"; nomouse;
56 desc {
57 min: 0 4;
58 max: -1 4;
59 fixed: 1 1;
60 rel2.relative: 1 0;
61 color: 51 153 255 0;
62 hid;
63 }
64 desc { "enable"; inherit: "default";
65 color: 51 153 255 200;
66 vis;
67 }
68 desc { "anim"; inherit: "enable";
69 rel1.relative: 0.5 0.5;
70 rel2.relative: 0.5 0.5;
71 }
72 }
73 rect { "zooml"; clip: "drag_clip"; nomouse;
74 desc {
75 min: 4 0;
76 max: 4 -1;
77 fixed: 1 1;
78 rel2.relative: 0 1;
79 color: 51 153 255 0;
80 hid;
81 }
82 desc { "enable"; inherit: "default";
83 color: 51 153 255 200;
84 vis;
85 }
86 desc { "anim"; inherit: "enable";
87 rel1.relative: 0.5 0.5;
88 rel2.relative: 0.5 0.5;
89 }
90 }
91 rect { "zoomr"; clip: "drag_clip"; nomouse;
92 desc {
93 min: 4 0;
94 max: 4 -1;
95 fixed: 1 1;
96 rel1.relative: 1 0;
97 color: 51 153 255 0;
98 hid;
99 }
100 desc { "enable"; inherit: "default";
101 color: 51 153 255 200;
102 vis;
103 }
104 desc { "anim"; inherit: "enable";
105 rel1.relative: 0.5 0.5;
106 rel2.relative: 0.5 0.5;
107 }
108 }
109 rect { "zoomb"; clip: "drag_clip"; nomouse;
110 desc {
111 min: 0 4;
112 max: -1 4;
113 fixed: 1 1;
114 rel1.relative: 0 1;
115 color: 51 153 255 0;
116 hid;
117 }
118 desc { "enable"; inherit: "default";
119 color: 51 153 255 200;
120 vis;
121 }
122 desc { "anim"; inherit: "enable";
123 rel1.relative: 0.5 0.5;
124 rel2.relative: 0.5 0.5;
125 }
126 }
127 program { signal: "e,state,current";
128 after: "drag_start";
129 }
130 program { "drag_start"; filter: "drag_clip" "vis";
131 signal: "mouse,in"; source: "events";
132 action: STATE_SET "enable";
133 transition: LINEAR 0.1;
134 targets: "zoomt" "zooml" "zoomr" "zoomb";
135 after: "drag_anim";
136 }
137 program { filter: "drag_clip" "vis";
138 signal: "mouse,out"; source: "events";
139 action: STATE_SET "default";
140 transition: ACCEL 0.1;
141 targets: "zoomt" "zooml" "zoomr" "zoomb";
142 }
143 program { "drag_anim";
144 action: STATE_SET "anim";
145 transition: ACCEL 0.8;
146 targets: "zoomt" "zooml" "zoomr" "zoomb";
147 after: "drag_anim2";
148 }
149 program { "drag_anim2";
150 action: STATE_SET "default";
151 targets: "zoomt" "zooml" "zoomr" "zoomb";
152 after: "drag_anim";
153 }
154 swallow { "e.swallow.background"; clip: "clip";
155 }
156 rect { "fader";
157 desc {
158 color: 0 0 0 0;
159 link.base: "e,state,dragging";
160 link.transition: LINEAR 0.3;
161 link.base: "e,state,inactive";
162 link.transition: LINEAR 0.3;
163 link.after: "fade_post";
164 }
165 desc { "fade";
166 color: 0 0 0 192;
167 link.base: "e,state,active";
168 link.transition: LINEAR 0.3;
169 }
170 program { "fade_post";
171 action: SIGNAL_EMIT "e,action,done" "e";
172 }
173 }
174 rect { "clip";
175 desc { hid; color: 255 255 255 0;
176 link.base: "e,state,dragging";
177 link.transition: LINEAR 0.3;
178 link.base: "e,state,inactive";
179 link.transition: LINEAR 0.3;
180 }
181 desc { "active";
182 link.base: "e,state,active";
183 link.transition: LINEAR 0.3;
184 }
185 }
186 swallow { "e.swallow.layout"; clip: "clip"; }
187 program { signal: "e,state,inactive";
188 action: SIGNAL_EMIT "e,state,hiding" "e";
189 }
190 rect { "events"; repeat;
191 desc { color: 0 0 0 0; }
192 }
193 }
194 }
195 group { name: "e/modules/desksanity/zoom/scrollframe";
196 parts {
197 rect { "clipper"; nomouse;
198 desc {
199 rel1.to: "elm.swallow.content";
200 rel2.to: "elm.swallow.content";
201 }
202 }
203 swallow { "elm.swallow.content";
204 clip: "clipper";
205 }
206 }
207 }
208 group { name: "e/modules/desksanity/zoom/client"; nomouse;
209 images.image: "win_shadow.png" COMP;
210 script {
211 public message(Msg_Type:type, id, ...) {
212 if (type == MSG_INT_SET) {
213 /* client diff geom[4] */
214 new x, y, w, h;
215
216 x = getarg(2);
217 y = getarg(3);
218 w = getarg(4);
219 h = getarg(5);
220
221 custom_state(PART:"spacer", "default", 0.0);
222 set_state_val(PART:"spacer", STATE_REL1_OFFSET, x, y);
223 set_state_val(PART:"spacer", STATE_REL2_OFFSET, w, h);
224 set_state(PART:"spacer", "custom", 0.0);
225 }
226 }
227 }
228 parts {
229 spacer { "spacer";
230 program { signal: "e,action,show"; source: "e";
231 action: STATE_SET "default" 0.0;
232 transition: LINEAR 0.3;
233 target: "spacer";
234 //after: "idle";
235 }
236 program { signal: "e,action,hide"; source: "e";
237 action: STATE_SET "custom" 0.0;
238 transition: LINEAR 0.3;
239 target: "spacer";
240 }
241 }
242 part { "shadow"; clip: "clip";
243 desc {
244 image.normal: "win_shadow.png";
245 image.border: 14 14 14 14;
246 image.middle: 0;
247 rel1.to: "e.swallow.client";
248 rel1.offset: -7 -3;
249 rel2.to: "e.swallow.client";
250 rel2.offset: 6 11;
251 fill.smooth: 0;
252 }
253 }
254 rect { "outline";
255 desc {
256 color: 51 153 255 0;
257 rel1.to: "e.swallow.client";
258 rel1.offset: -2 -2;
259 rel2.to: "e.swallow.client";
260 rel2.offset: 2 2;
261 visible: 0;
262 link.base: "e,state,unfocused" "e";
263 link.transition: LINEAR 0.2;
264 }
265 desc { "active"; inherit: "default";
266 color: 51 153 255 170;
267 visible: 1;
268 link.base: "e,state,focused" "e";
269 link.transition: LINEAR 0.2;
270 }
271 }
272 rect { "bg";
273 desc {
274 color: 0 0 0 255;
275 rel1.to: "e.swallow.client";
276 rel2.to: "e.swallow.client";
277 }
278 }
279 swallow { "e.swallow.client"; clip: "clip";
280 desc {
281 rel1.to: "spacer";
282 rel2.to: "spacer";
283 rel1.offset: 10 10;
284 rel2.offset: -10 -10;
285 map.on: 1;
286 link.base: "mouse,out" "events";
287 link.transition: LINEAR 0.2;
288 //link.after: "idle";
289 }
290 desc { "active";
291 rel1.to: "spacer";
292 rel2.to: "spacer";
293 rel2.relative: 1.3 1.3;
294 rel2.offset: -1 -1;
295 link.base: "mouse,in" "events";
296 link.transition: LINEAR 0.2;
297 }
298 desc { "idle1"; inherit: "default";
299 map.on: 1;
300 map.rotation.z: -5;
301 }
302 desc { "idle2"; inherit: "idle1";
303 map.rotation.z: 5;
304 }
305 desc { "idle3"; inherit: "idle1";
306 map.rotation.z: 5;
307 map.rotation.x: -70;
308 }
309 desc { "idle4"; inherit: "idle1";
310 map.rotation.z: 0;
311 map.rotation.x: -360;
312 map.rotation.y: 360;
313 }
314 program { "idle";
315 in: 2.0 10.0;
316 action: STATE_SET "idle1";
317 transition: SINUSOIDAL 6.0;
318 target: "e.swallow.client";
319 sequence {
320 action: STATE_SET "idle2";
321 name: "idle2";
322 transition: SINUSOIDAL 6.0;
323 target: "e.swallow.client";
324 in: 2.0 10.0;
325
326 action: STATE_SET "idle3";
327 name: "idle3";
328 transition: ACCEL 6.0;
329 target: "e.swallow.client";
330 in: 2.0 10.0;
331
332 action: STATE_SET "idle4";
333 name: "idle4";
334 transition: SINUSOIDAL 6.0;
335 target: "e.swallow.client";
336 in: 2.0 10.0;
337 after: "idle";
338 }
339 }
340 }
341 rect { "clip";
342 desc {
343 rel1.offset: -9999 -9999;
344 rel2.offset: 9999 9999;
345 color: 255 255 255 200;
346 link.base: "mouse,out" "events";
347 link.transition: LINEAR 0.2;
348 }
349 desc { "active"; inherit: "default";
350 color: 255 255 255 255;
351 link.base: "mouse,in" "events";
352 link.transition: LINEAR 0.2;
353 }
354 }
355 proxy { "clone";
356 desc {
357 source: "e.swallow.client";
358 rel1.to: "e.swallow.client";
359 rel2.to: "e.swallow.client";
360 hid;
361 color: 255 255 255 0;
362 }
363 desc { "urgent1"; inherit: "default";
364 vis;
365 color: 255 255 255 255;
366 }
367 desc { "urgent2"; inherit: "default";
368 vis;
369 rel1.relative: -0.5 -0.5;
370 rel2.relative: 1.5 1.5;
371 color: 255 255 255 0;
372 }
373 program { name: "urgent";
374 signal: "e,state,urgent"; source: "e";
375 action: ACTION_STOP;
376 target: "go_big";
377 target: "go_big2";
378 after: "go_big";
379 }
380 program { name: "go_big";
381 action: STATE_SET "urgent1" 0.0;
382 target: "clone";
383 after: "go_big2";
384 }
385 program { name: "go_big2";
386 action: STATE_SET "urgent2" 0.0;
387 transition: LINEAR 0.5;
388 target: "clone";
389 after: "go_big";
390 }
391 program { name: "not_urgent";
392 signal: "e,state,not_urgent"; source: "e";
393 action: ACTION_STOP;
394 target: "go_big";
395 target: "go_big2";
396 after: "go_hid";
397 }
398 program { name: "go_hid";
399 action: STATE_SET "default" 0.0;
400 transition: LINEAR 0.5;
401 target: "clone";
402 }
403 }
404 text { "e.text.title"; clip: "clip"; effect: OUTLINE;
405 desc {
406 fixed: 1 1;
407 align: 0.0 0.0;
408 rel1.to_x: "e.swallow.icon";
409 rel1.to_y: "e.swallow.client";
410 rel1.relative: 1.0 1.0;
411 rel1.offset: 0 10;
412 rel2.to: "e.swallow.client";
413 color: 255 255 255 255;
414 color2: 0 0 0 255;
415 text {
416 font: "Sans:style=Bold"; size: 12;
417 }
418 }
419 }
420 swallow { "e.swallow.icon"; clip: "clip";
421 desc {
422 fixed: 1 1;
423 min: 16 16;
424 align: 0.0 0.0;
425 rel1.to_x: "e.swallow.client";
426 rel1.to_y: "e.text.title";
427 rel1.offset: 0 -6;
428 rel2.to: "e.swallow.client";
429 rel2.relative: 0.0 1.0;
430 }
431 }
432 rect { "events"; mouse; repeat;
433 desc { color: 0 0 0 0; };
434 program { signal: "mouse,clicked,1"; source: "events";
435 action: SIGNAL_EMIT "e,action,activate" "e";
436 }
437 program { signal: "mouse,in"; source: "events";
438 action: SIGNAL_EMIT "e,state,active" "e";
439 sequence {
440 action: ACTION_STOP;
441 targets: "idle" "idle2" "idle3" "idle4";
442 }
443 }
444 program { signal: "mouse,out"; source: "events";
445 action: SIGNAL_EMIT "e,state,inactive" "e";
446 }
447 }
448 }
449 }
450 group { "e/modules/desksanity/zoom/client/drag";
451 images.image: "win_shadow.png" COMP;
452 script {
453 public message(Msg_Type:type, id, ...) {
454 if (type == MSG_INT_SET) {
455 /* client diff geom[4] */
456 new x, y, w, h;
457
458 x = getarg(2);
459 y = getarg(3);
460 w = getarg(4);
461 h = getarg(5);
462
463 custom_state(PART:"e.swallow.client", "default", 0.0);
464 set_state_val(PART:"e.swallow.client", STATE_REL1_OFFSET, x, y);
465 set_state_val(PART:"e.swallow.client", STATE_REL2_OFFSET, w, h);
466 }
467 }
468 }
469 parts {
470 rect { "clip";
471 desc {}
472 desc { "hid"; hid;
473 color: 255 255 255 0;
474 link.base: "e,drag,release" "e";
475 link.transition: LINEAR 0.1;
476 }
477 }
478 image { "shadow"; clip: "clip";
479 desc {
480 image.normal: "win_shadow.png";
481 image.border: 14 14 14 14;
482 image.middle: 0;
483 rel1.to: "e.swallow.client";
484 rel1.offset: -7 -3;
485 rel2.to: "e.swallow.client";
486 rel2.offset: 6 11;
487 fill.smooth: 0;
488 }
489 }
490 swallow { "e.swallow.client"; }
491 rect { "over"; clip: "clip";
492 desc {
493 rel1.to: "e.swallow.client";
494 rel2.to: "e.swallow.client";
495 color: 255 255 255 90;
496 }
497 }
498 program { signal: "e,drag,release"; source: "e";
499 action: STATE_SET "custom";
500 target: "e.swallow.client";
501 transition: LINEAR 0.1;
502 sequence {
503 action: SIGNAL_EMIT "e,action,done" "e";
504 } 9 }
505 } 10 }
506 } 11 }
diff --git a/e_modules-compiz.spec.in b/e_modules-compiz.spec.in
index c7ddd6d..8b03768 100644
--- a/e_modules-compiz.spec.in
+++ b/e_modules-compiz.spec.in
@@ -1,4 +1,4 @@
1%define module_name desksanity 1%define module_name compiz
2%{!?_rel:%{expand:%%global _rel 0.enl%{?dist}}} 2%{!?_rel:%{expand:%%global _rel 0.enl%{?dist}}}
3 3
4Summary: %{module_name} module for the Enlightenment window manager 4Summary: %{module_name} module for the Enlightenment window manager
diff --git a/src/compiz.c b/src/compiz.c
index ba2ca2e..924818d 100644
--- a/src/compiz.c
+++ b/src/compiz.c
@@ -1,28 +1,3 @@
1/*
2 * Copyright © 2005 Novell, Inc.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * Novell, Inc. not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * Novell, Inc. makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Author: David Reveman <davidr@novell.com>
24 */
25
26#include "e_mod_main.h" 1#include "e_mod_main.h"
27 2
28static Eina_Hash *wins; 3static Eina_Hash *wins;
@@ -34,9 +9,13 @@ static Eina_List *hooks;
34static Eina_Array *events; 9static Eina_Array *events;
35static Ecore_Animator *compiz_anim; 10static Ecore_Animator *compiz_anim;
36static Ecore_Timer *compiz_timer; 11static Ecore_Timer *compiz_timer;
12static Eina_Tiler *tiler;
37 13
38static Eina_Bool init = EINA_FALSE; 14static Eina_Bool init = EINA_FALSE;
39 15
16static Eina_Bool doclear = EINA_FALSE;
17EINTERN Eina_Bool noclear = EINA_FALSE;
18
40E_API int pointerX = 0; 19E_API int pointerX = 0;
41E_API int pointerY = 0; 20E_API int pointerY = 0;
42E_API int lastPointerX = 0; 21E_API int lastPointerX = 0;
@@ -44,16 +23,15 @@ E_API int lastPointerY = 0;
44 23
45typedef struct 24typedef struct
46{ 25{
47 Evas_GL_Context *ctx;
48 Evas_GL_Surface *sfc; 26 Evas_GL_Surface *sfc;
49 GLuint fbo; 27 GLuint fbo;
50 E_Client *ec; 28 E_Client *ec;
51 Evas_Object *obj; 29 Evas_Object *obj;
52 Eina_Tiler *damage;
53 Eina_Bool clear : 1; 30 Eina_Bool clear : 1;
54} Compiz_GL; 31} Compiz_GL;
55EINTERN Evas_GL *gl = NULL; 32EINTERN Evas_GL *gl = NULL;
56static Evas_GL_Config *glcfg = NULL; 33static Evas_GL_Config *glcfg = NULL;
34static Evas_GL_Context *glctx = NULL;
57E_API Evas_GL_API *compiz_glapi = NULL; 35E_API Evas_GL_API *compiz_glapi = NULL;
58 36
59EINTERN int compiz_main(void); 37EINTERN int compiz_main(void);
@@ -94,12 +72,13 @@ compiz_damage(void)
94 E_Client *ec; 72 E_Client *ec;
95 73
96 ec = compiz_win_to_client(w); 74 ec = compiz_win_to_client(w);
75 if (w->grabbed && ((!ec->moving) && (!e_client_util_resizing_get(ec))))
76 w->screen->windowUngrabNotify(w);
97 if ((w->attrib.x == ec->client.x) && (w->attrib.y == ec->client.y)) 77 if ((w->attrib.x == ec->client.x) && (w->attrib.y == ec->client.y))
98 continue; 78 continue;
99 moveWindow(w, ec->client.x - w->attrib.x, ec->client.y - w->attrib.y, TRUE, TRUE); 79 moveWindow(w, ec->client.x - w->attrib.x, ec->client.y - w->attrib.y, TRUE, TRUE);
100 syncWindowPosition(w); 80 syncWindowPosition(w);
101 if (w->grabbed) 81 compiz_texture_clear(w->texture);
102 w->screen->windowUngrabNotify(w);
103 } 82 }
104 if (s->damageMask) 83 if (s->damageMask)
105 { 84 {
@@ -146,7 +125,11 @@ compiz_timers(void)
146static void 125static void
147compiz_client_frame_recalc(E_Client *ec) 126compiz_client_frame_recalc(E_Client *ec)
148{ 127{
149 updateWindowOutputExtents(eina_hash_find(clients, &ec)); 128 CompWindow *w;
129
130 w = eina_hash_find(clients, &ec);
131 if (w)
132 updateWindowOutputExtents(w);
150} 133}
151 134
152static void 135static void
@@ -159,12 +142,12 @@ static Eina_Bool
159compiz_idle_cb(void *data EINA_UNUSED) 142compiz_idle_cb(void *data EINA_UNUSED)
160{ 143{
161 struct timeval tv; 144 struct timeval tv;
145 Eina_Iterator *it;
146 XEvent *ev;
162 147
163 while (eina_array_count(events)) 148 it = eina_array_iterator_new(events);
149 EINA_ITERATOR_FOREACH(it, ev)
164 { 150 {
165 XEvent *ev;
166
167 ev = eina_array_pop(events);
168 if (ev->type == CreateNotify) 151 if (ev->type == CreateNotify)
169 { 152 {
170 E_Client *ec; 153 E_Client *ec;
@@ -178,6 +161,8 @@ compiz_idle_cb(void *data EINA_UNUSED)
178 handleDisplayEvent(ecore_x_display_get(), ev); 161 handleDisplayEvent(ecore_x_display_get(), ev);
179 free(ev); 162 free(ev);
180 } 163 }
164 eina_iterator_free(it);
165 eina_array_clean(events);
181 gettimeofday (&tv, 0); 166 gettimeofday (&tv, 0);
182 handleTimeouts(&tv); 167 handleTimeouts(&tv);
183 compiz_timers(); 168 compiz_timers();
@@ -193,6 +178,71 @@ compiz_job(XEvent *event)
193} 178}
194 179
195static void 180static void
181compwindow_update(E_Client *ec)
182{
183 CompWindow *w;
184
185 w = eina_hash_find(clients, &ec);
186 if (w)
187 w->id = window_get(ec);
188}
189
190static void
191mapnotify(E_Client *ec)
192{
193 XEvent *event;
194
195 compwindow_update(ec);
196 event = calloc(1, sizeof(XEvent));
197 event->type = MapNotify;
198 event->xmap.display = ecore_x_display_get();
199 event->xmap.event = event->xmap.window = window_get(ec);
200 event->xmap.override_redirect = ec->override;
201 compiz_job(event);
202}
203
204static void
205configurenotify(E_Client *ec)
206{
207 XEvent *event;
208 E_Client *bec;
209 int w, h;
210
211 compwindow_update(ec);
212 event = calloc(1, sizeof(XEvent));
213 event->type = ConfigureNotify;
214 event->xconfigure.display = ecore_x_display_get();
215 event->xconfigure.event = event->xconfigure.window = window_get(ec);
216 /* catch shading */
217 e_comp_object_frame_xy_unadjust(ec->frame, ec->x, ec->y, &event->xconfigure.x, &event->xconfigure.y);
218 e_comp_object_frame_wh_unadjust(ec->frame, ec->w, ec->h, &event->xconfigure.width, &event->xconfigure.height);
219 bec = e_client_below_get(ec);
220 if (bec)
221 {
222 compwindow_update(bec);
223 event->xconfigure.above = window_get(bec);
224 }
225 event->xconfigure.override_redirect = ec->override;
226 compiz_job(event);
227}
228
229static void
230maprequest(E_Client *ec)
231{
232 XEvent *event;
233
234 event = calloc(1, sizeof(XEvent));
235 event->type = MapRequest;
236 event->xmaprequest.display = ecore_x_display_get();
237 if (ec->parent)
238 event->xmaprequest.parent = window_get(ec->parent);
239 else
240 event->xmaprequest.parent = e_comp->root;
241 event->xmaprequest.window = window_get(ec);
242 compiz_job(event);
243}
244
245static void
196createnotify(E_Client *ec) 246createnotify(E_Client *ec)
197{ 247{
198 XEvent *event; 248 XEvent *event;
@@ -212,25 +262,26 @@ createnotify(E_Client *ec)
212 event->xcreatewindow.override_redirect = ec->override; 262 event->xcreatewindow.override_redirect = ec->override;
213 e_object_ref(E_OBJECT(ec)); 263 e_object_ref(E_OBJECT(ec));
214 compiz_job(event); 264 compiz_job(event);
265 if (evas_object_visible_get(ec->frame))
266 maprequest(ec);
215} 267}
216 268
217static void 269static void
218compiz_client_new_client(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 270unmapnotify(E_Client *ec)
219{ 271{
220 E_Client *ec = data; 272 XEvent *event;
221 273
222 createnotify(ec); 274 event = calloc(1, sizeof(XEvent));
223 evas_object_smart_callback_del(ec->frame, "new_client", compiz_client_new_client); 275 event->type = UnmapNotify;
276 event->xunmap.display = ecore_x_display_get();
277 event->xunmap.event = event->xunmap.window = window_get(ec);
278 compiz_job(event);
224} 279}
225 280
226static Eina_Bool 281static Eina_Bool
227compiz_client_add(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev) 282compiz_client_add(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
228{ 283{
229 if (ev->ec->new_client) 284 createnotify(ev->ec);
230 evas_object_smart_callback_add(ev->ec->frame, "new_client", compiz_client_new_client, ev->ec);
231 else
232 createnotify(ev->ec);
233
234 return ECORE_CALLBACK_RENEW; 285 return ECORE_CALLBACK_RENEW;
235} 286}
236 287
@@ -245,7 +296,6 @@ compiz_client_del(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
245 event->type = DestroyNotify; 296 event->type = DestroyNotify;
246 event->xdestroywindow.display = ecore_x_display_get(); 297 event->xdestroywindow.display = ecore_x_display_get();
247 event->xdestroywindow.window = event->xdestroywindow.event = w->id; 298 event->xdestroywindow.window = event->xdestroywindow.event = w->id;
248 evas_object_smart_callback_del(ev->ec->frame, "new_client", compiz_client_new_client);
249 compiz_job(event); 299 compiz_job(event);
250 return ECORE_CALLBACK_RENEW; 300 return ECORE_CALLBACK_RENEW;
251} 301}
@@ -253,51 +303,27 @@ compiz_client_del(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
253static Eina_Bool 303static Eina_Bool
254compiz_client_configure(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev) 304compiz_client_configure(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
255{ 305{
256 XEvent *event; 306 configurenotify(ev->ec);
257 E_Client *bec;
258
259 event = calloc(1, sizeof(XEvent));
260 event->type = ConfigureNotify;
261 event->xconfigure.display = ecore_x_display_get();
262 event->xconfigure.event = event->xconfigure.window = window_get(ev->ec);
263 event->xconfigure.x = ev->ec->client.x;
264 event->xconfigure.y = ev->ec->client.y;
265 event->xconfigure.width = ev->ec->client.w;
266 event->xconfigure.height = ev->ec->client.h;
267 bec = e_client_below_get(ev->ec);
268 if (bec)
269 event->xconfigure.above = window_get(bec);
270 event->xconfigure.override_redirect = ev->ec->override;
271 compiz_job(event);
272 return ECORE_CALLBACK_RENEW; 307 return ECORE_CALLBACK_RENEW;
273} 308}
274 309
275static Eina_Bool 310static Eina_Bool
276compiz_client_show(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev) 311compiz_client_show(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
277{ 312{
278 XEvent *event; 313 mapnotify(ev->ec);
279
280 event = calloc(1, sizeof(XEvent));
281 event->type = MapNotify;
282 event->xmap.display = ecore_x_display_get();
283 event->xmap.event = event->xmap.window = window_get(ev->ec);
284 event->xmap.override_redirect = ev->ec->override;
285 compiz_job(event);
286 return ECORE_CALLBACK_RENEW; 314 return ECORE_CALLBACK_RENEW;
287} 315}
288 316
289static Eina_Bool 317static void
290compiz_client_hide(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev) 318compiz_client_hide(void *data, ...)
291{ 319{
292 XEvent *event; 320 XEvent *event;
321 E_Client *ec = data;
293 322
294 if (ev->ec->hidden) return ECORE_CALLBACK_RENEW; 323 compwindow_update(ec);
295 event = calloc(1, sizeof(XEvent)); 324 if (ec->desk && (!ec->desk->visible)) return;
296 event->type = UnmapNotify; 325 if ((!ec->iconic) || evas_object_visible_get(ec->frame))
297 event->xunmap.display = ecore_x_display_get(); 326 unmapnotify(ec);
298 event->xunmap.event = event->xunmap.window = window_get(ev->ec);
299 compiz_job(event);
300 return ECORE_CALLBACK_RENEW;
301} 327}
302 328
303EINTERN unsigned int 329EINTERN unsigned int
@@ -370,19 +396,9 @@ compiz_win_to_client(CompWindow *w)
370} 396}
371 397
372static void 398static void
373win_hash_free(E_Client *ec)
374{
375 eina_hash_del_by_key(clients, &ec);
376 e_object_unref(E_OBJECT(ec));
377}
378
379static void
380compiz_client_stack(void *data, Evas *e, Evas_Object *obj, void *event_info) 399compiz_client_stack(void *data, Evas *e, Evas_Object *obj, void *event_info)
381{ 400{
382 E_Event_Client ev; 401 configurenotify(data);
383
384 ev.ec = data;
385 compiz_client_configure(NULL, 0, &ev);
386} 402}
387 403
388static void 404static void
@@ -390,15 +406,12 @@ compiz_client_damage(void *data, Evas_Object *obj, void *event_info)
390{ 406{
391 CompWindow *w = data; 407 CompWindow *w = data;
392 E_Client *ec; 408 E_Client *ec;
393 Compiz_GL *cgl;
394 Eina_Rectangle *r = event_info; 409 Eina_Rectangle *r = event_info;
395 XEvent *event; 410 XEvent *event;
396 XDamageNotifyEvent *de; 411 XDamageNotifyEvent *de;
397 412
398 ec = e_comp_object_client_get(obj); 413 ec = e_comp_object_client_get(obj);
399 cgl = eina_hash_find(textures, &w->texture); 414 compwindow_update(ec);
400 if (cgl)
401 eina_tiler_rect_add(cgl->damage, &(Eina_Rectangle){ec->client.x + r->x, ec->client.y + r->y, r->w, r->h});
402 event = calloc(1, sizeof(XEvent)); 415 event = calloc(1, sizeof(XEvent));
403 event->type = DAMAGE_EVENT + XDamageNotify; 416 event->type = DAMAGE_EVENT + XDamageNotify;
404 de = (XDamageNotifyEvent*)event; 417 de = (XDamageNotifyEvent*)event;
@@ -416,19 +429,13 @@ compiz_client_damage(void *data, Evas_Object *obj, void *event_info)
416} 429}
417 430
418static void 431static void
419compiz_client_render(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
420{
421 fprintf(stderr, "COMPIZ RENDER\n");
422}
423
424static void
425compiz_client_maximize(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) 432compiz_client_maximize(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
426{ 433{
427 CompWindow *w = data; 434 CompWindow *w = data;
428 E_Client *ec = e_comp_object_client_get(obj); 435 E_Client *ec = e_comp_object_client_get(obj);
429 436
430 if (ec->maximized) //unmaximizing 437 if (ec->maximized) //unmaximizing
431 changeWindowState(w, w->state ^= MAXIMIZE_STATE); 438 changeWindowState(w, w->state &= ~MAXIMIZE_STATE);
432 else 439 else
433 changeWindowState(w, w->state |= MAXIMIZE_STATE); 440 changeWindowState(w, w->state |= MAXIMIZE_STATE);
434 updateWindowAttributes(w, CompStackingUpdateModeNone); 441 updateWindowAttributes(w, CompStackingUpdateModeNone);
@@ -439,32 +446,58 @@ compiz_client_shade(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
439{ 446{
440 CompWindow *w = data; 447 CompWindow *w = data;
441 E_Client *ec = e_comp_object_client_get(obj); 448 E_Client *ec = e_comp_object_client_get(obj);
449 unsigned int state;
442 450
451 state = w->state;
443 if (ec->shaded) 452 if (ec->shaded)
444 changeWindowState(w, w->state ^= CompWindowStateShadedMask); 453 state &= ~CompWindowStateShadedMask;
445 else 454 else
446 changeWindowState(w, w->state |= CompWindowStateShadedMask); 455 state |= CompWindowStateShadedMask;
456 if (w->state == state) return;
457 changeWindowState(w, state);
447 updateWindowAttributes(w, CompStackingUpdateModeNone); 458 updateWindowAttributes(w, CompStackingUpdateModeNone);
459 if (ec->shaded)
460 mapnotify(ec);
461 else
462 unmapnotify(ec);
463}
464
465static Eina_Bool
466compiz_client_iconify(void *d EINA_UNUSED, int t EINA_UNUSED, E_Event_Client *ev)
467{
468 CompWindow *w;
469
470 w = eina_hash_find(clients, &ev->ec);
471 if (!w) return ECORE_CALLBACK_RENEW;
472 if (ev->ec->iconic)
473 minimizeWindow(w);
474 else
475 {
476 unminimizeWindow(w);
477 compiz_client_damage(w, ev->ec->frame, &(Eina_Rectangle){0, 0, ev->ec->client.w, ev->ec->client.h});
478 }
479 return ECORE_CALLBACK_RENEW;
448} 480}
449 481
450EINTERN void 482EINTERN void
451compiz_win_hash_client(CompWindow *w, E_Client *ec) 483compiz_win_hash_client(CompWindow *w, E_Client *ec)
452{ 484{
453 E_Event_Client ev;
454 485
455 eina_hash_set(wins, &w, ec); 486 eina_hash_set(wins, &w, ec);
456 eina_hash_set(clients, &ec, w); 487 eina_hash_set(clients, &ec, w);
457 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_RESTACK, compiz_client_stack, ec); 488 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_RESTACK, compiz_client_stack, ec);
458 evas_object_smart_callback_add(ec->frame, "render", compiz_client_render, w);
459 evas_object_smart_callback_add(ec->frame, "damage", compiz_client_damage, w); 489 evas_object_smart_callback_add(ec->frame, "damage", compiz_client_damage, w);
460 evas_object_smart_callback_add(ec->frame, "maximize_pre", compiz_client_maximize, w); 490 evas_object_smart_callback_add(ec->frame, "maximize_pre", compiz_client_maximize, w);
461 evas_object_smart_callback_add(ec->frame, "unmaximize_pre", compiz_client_maximize, w); 491 evas_object_smart_callback_add(ec->frame, "unmaximize_pre", compiz_client_maximize, w);
492 evas_object_smart_callback_add(ec->frame, "shading", compiz_client_shade, w);
462 evas_object_smart_callback_add(ec->frame, "shaded", compiz_client_shade, w); 493 evas_object_smart_callback_add(ec->frame, "shaded", compiz_client_shade, w);
494 evas_object_smart_callback_add(ec->frame, "unshading", compiz_client_shade, w);
463 evas_object_smart_callback_add(ec->frame, "unshaded", compiz_client_shade, w); 495 evas_object_smart_callback_add(ec->frame, "unshaded", compiz_client_shade, w);
464 evas_object_smart_callback_add(ec->frame, "shade_done", compiz_client_shade, w); 496 evas_object_smart_callback_add(ec->frame, "shade_done", compiz_client_shade, w);
465 evas_object_smart_callback_add(ec->frame, "frame_recalc_done", compiz_client_frame_calc, ec); 497 evas_object_smart_callback_add(ec->frame, "frame_recalc_done", compiz_client_frame_calc, ec);
466 ev.ec = ec; 498 evas_object_smart_callback_add(ec->frame, "hiding", (void*)compiz_client_hide, ec);
467 compiz_client_configure(NULL, 0, &ev); 499 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_HIDE, (void*)compiz_client_hide, ec);
500 configurenotify(ec);
468 ecore_job_add((Ecore_Cb)compiz_idle_cb, NULL); 501 ecore_job_add((Ecore_Cb)compiz_idle_cb, NULL);
469} 502}
470 503
@@ -475,28 +508,38 @@ compiz_win_hash_del(CompWindow *w)
475} 508}
476 509
477EINTERN void 510EINTERN void
478compiz_texture_activate(CompTexture *texture, Eina_Bool set) 511compiz_texture_activate(CompTexture *texture, Eina_Bool set, Region region)
479{ 512{
480 Compiz_GL *cgl; 513 Compiz_GL *cgl;
514 Eina_Iterator *it;
515 Eina_Rectangle *r;
516 long i;
481 517
482 if (!set) 518 if (!set)
483 compiz_glapi->glFinish(); 519 compiz_glapi->glFinish();
484 if (!set) return; 520 if (!set) return;
485 cgl = eina_hash_find(textures, &texture); 521 cgl = eina_hash_find(textures, &texture);
486 evas_gl_make_current(gl, cgl->sfc, cgl->ctx); 522 if (!cgl) return;
523 evas_gl_make_current(gl, cgl->sfc, glctx);
524 if (!region) return;
487 compiz_glapi->glViewport(0, 0, e_comp->w, e_comp->h); 525 compiz_glapi->glViewport(0, 0, e_comp->w, e_comp->h);
526 for (i = 0; i < region->numRects; i++)
527 evas_object_image_data_update_add(cgl->obj, region->rects[i].x1, region->rects[i].y1, region->rects[i].x2 - region->rects[i].x1, region->rects[i].y2 - region->rects[i].y1);
488 if (cgl->clear) 528 if (cgl->clear)
489 compiz_glapi->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 529 compiz_glapi->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
490 cgl->clear = 0; 530 cgl->clear = 0;
491} 531}
492 532
533
493EINTERN void 534EINTERN void
494compiz_texture_clear(CompTexture *texture) 535compiz_texture_clear(CompTexture *texture)
495{ 536{
496 Compiz_GL *cgl; 537 Compiz_GL *cgl;
497 538
539 if (noclear) return;
498 cgl = eina_hash_find(textures, &texture); 540 cgl = eina_hash_find(textures, &texture);
499 if (cgl) cgl->clear = 1; 541 if (cgl && ((intptr_t)cgl != 0x1)) cgl->clear = 1;
542 else eina_hash_set(textures, &texture, (void*)0x1);
500} 543}
501 544
502static void 545static void
@@ -511,42 +554,6 @@ chide(void *data, ...)
511 evas_object_hide(data); 554 evas_object_hide(data);
512} 555}
513 556
514static void
515cdirty(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
516{
517 Compiz_GL *cgl = data;
518 Evas_Native_Surface ns;
519
520 if (eina_tiler_empty(cgl->damage))
521 evas_object_image_data_update_add(cgl->obj, cgl->ec->client.x, cgl->ec->client.y, cgl->ec->client.w, cgl->ec->client.h);
522 else
523 {
524 Eina_Iterator *it;
525 Eina_Rectangle *r;
526
527 it = eina_tiler_iterator_new(cgl->damage);
528 EINA_ITERATOR_FOREACH(it, r)
529 evas_object_image_data_update_add(cgl->obj, r->x, r->y, r->w, r->h);
530 eina_iterator_free(it);
531 }
532 eina_tiler_clear(cgl->damage);
533 evas_gl_native_surface_get(gl, cgl->sfc, &ns);
534 evas_object_image_native_surface_set(cgl->obj, &ns);
535}
536
537static void
538cshade(void *d, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
539{
540 Compiz_GL *cgl = d;
541
542 if (!cgl->ec->shaded)
543 evas_object_hide(cgl->obj);
544}
545
546static void
547cpixels(void *d EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
548{}
549
550EINTERN void 557EINTERN void
551compiz_texture_init(CompTexture *texture) 558compiz_texture_init(CompTexture *texture)
552{ 559{
@@ -566,31 +573,28 @@ compiz_texture_init(CompTexture *texture)
566 ec = compiz_win_to_client(win); 573 ec = compiz_win_to_client(win);
567 e_pixmap_size_get(ec->pixmap, &w, &h); 574 e_pixmap_size_get(ec->pixmap, &w, &h);
568 cgl = eina_hash_find(textures, &texture); 575 cgl = eina_hash_find(textures, &texture);
576 if ((intptr_t)cgl == 0x1)
577 cgl = NULL;
569 if (cgl) return; 578 if (cgl) return;
570 { 579 {
571 cgl = malloc(sizeof(Compiz_GL)); 580 cgl = malloc(sizeof(Compiz_GL));
572 cgl->ctx = evas_gl_context_create(gl, NULL);
573 cgl->ec = ec; 581 cgl->ec = ec;
574 compiz_client_frame_recalc(ec); 582 compiz_client_frame_recalc(ec);
575 cgl->obj = evas_object_image_filled_add(e_comp->evas); 583 cgl->obj = evas_object_image_filled_add(e_comp->evas);
576 evas_object_name_set(cgl->obj, "compiz!"); 584 evas_object_name_set(cgl->obj, "compiz!");
577 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW, (void*)cshow, cgl->obj); 585 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW, (void*)cshow, cgl->obj);
578 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_HIDE, (void*)chide, cgl->obj); 586 evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_HIDE, (void*)chide, cgl->obj);
579 evas_object_smart_callback_add(ec->frame, "shaded", (void*)chide, cgl->obj); 587 //evas_object_smart_callback_add(ec->frame, "shaded", (void*)chide, cgl->obj);
580 evas_object_smart_callback_add(ec->frame, "shade_done", cshade, cgl); 588 //evas_object_smart_callback_add(ec->frame, "unshading", (void*)cshow, cgl->obj);
581 evas_object_smart_callback_add(ec->frame, "unshading", (void*)cshow, cgl->obj); 589 //evas_object_smart_callback_add(ec->frame, "unshaded", (void*)cshow, cgl->obj);
582 evas_object_smart_callback_add(ec->frame, "unshaded", (void*)cshow, cgl->obj);
583 evas_object_smart_callback_add(ec->frame, "dirty", cdirty, cgl);
584 evas_object_image_data_update_add(cgl->obj, 0, 0, e_comp->w, e_comp->h); 590 evas_object_image_data_update_add(cgl->obj, 0, 0, e_comp->w, e_comp->h);
585 evas_object_image_alpha_set(cgl->obj, 1); 591 evas_object_image_alpha_set(cgl->obj, 1);
586 evas_object_pass_events_set(cgl->obj, 1); 592 evas_object_pass_events_set(cgl->obj, 1);
587 evas_object_image_pixels_get_callback_set(cgl->obj, cpixels, NULL);
588 evas_object_smart_member_add(cgl->obj, ec->frame); 593 evas_object_smart_member_add(cgl->obj, ec->frame);
589 //evas_object_layer_set(cgl->obj, E_LAYER_CLIENT_ABOVE); 594 //evas_object_layer_set(cgl->obj, E_LAYER_CLIENT_ABOVE);
590 cgl->damage = eina_tiler_new(e_comp->w, e_comp->h);
591 if (evas_object_visible_get(ec->frame)) 595 if (evas_object_visible_get(ec->frame))
592 evas_object_show(cgl->obj); 596 evas_object_show(cgl->obj);
593 evas_gl_make_current(gl, NULL, cgl->ctx); 597 evas_gl_make_current(gl, NULL, glctx);
594 compiz_glapi->glGenFramebuffers(1, &cgl->fbo); 598 compiz_glapi->glGenFramebuffers(1, &cgl->fbo);
595 compiz_glapi->glClearColor (0.0, 0.0, 0.0, 0.0); 599 compiz_glapi->glClearColor (0.0, 0.0, 0.0, 0.0);
596 compiz_glapi->glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); 600 compiz_glapi->glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
@@ -611,12 +615,13 @@ compiz_texture_init(CompTexture *texture)
611 compiz_glapi->glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight); 615 compiz_glapi->glLightfv(GL_LIGHT0, GL_AMBIENT, ambientLight);
612 compiz_glapi->glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight); 616 compiz_glapi->glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuseLight);
613 compiz_glapi->glLightfv(GL_LIGHT0, GL_POSITION, light0Position); 617 compiz_glapi->glLightfv(GL_LIGHT0, GL_POSITION, light0Position);
614 eina_hash_add(textures, &texture, cgl); 618 eina_hash_set(textures, &texture, cgl);
615 win->id = window_get(ec); 619 if (window_get(ec) != e_client_util_win_get(ec))
620 win->id = window_get(ec);
616 } 621 }
617 compiz_render_resize(cgl); 622 compiz_render_resize(cgl);
618 cgl->sfc = evas_gl_surface_create(gl, glcfg, e_comp->w, e_comp->h); 623 cgl->sfc = evas_gl_surface_create(gl, glcfg, e_comp->w, e_comp->h);
619 evas_gl_make_current(gl, cgl->sfc, cgl->ctx); 624 evas_gl_make_current(gl, cgl->sfc, glctx);
620 compiz_glapi->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 625 compiz_glapi->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
621 evas_gl_native_surface_get(gl, cgl->sfc, &ns); 626 evas_gl_native_surface_get(gl, cgl->sfc, &ns);
622 evas_object_image_native_surface_set(cgl->obj, &ns); 627 evas_object_image_native_surface_set(cgl->obj, &ns);
@@ -627,11 +632,23 @@ EINTERN void
627compiz_texture_bind(CompTexture *texture) 632compiz_texture_bind(CompTexture *texture)
628{ 633{
629 Compiz_GL *cgl; 634 Compiz_GL *cgl;
635 Evas_Native_Surface ns;
630 636
631 cgl = eina_hash_find(textures, &texture); 637 cgl = eina_hash_find(textures, &texture);
638 EINA_SAFETY_ON_NULL_RETURN(cgl);
639 ns.type = EVAS_NATIVE_SURFACE_OPENGL;
640 ns.data.opengl.framebuffer_id = cgl->fbo;
641 ns.data.opengl.texture_id = texture->name;
642 ns.data.opengl.internal_format = GL_RGBA;
643 ns.data.opengl.format = GL_BGRA_EXT;
644 ns.data.opengl.x = ns.data.opengl.y = 0;
645 ns.data.opengl.w = cgl->ec->client.w;
646 ns.data.opengl.h = cgl->ec->client.h;
632 compiz_glapi->glBindFramebuffer(GL_FRAMEBUFFER, cgl->fbo); 647 compiz_glapi->glBindFramebuffer(GL_FRAMEBUFFER, cgl->fbo);
633 compiz_glapi->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->name, 0); 648 compiz_glapi->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture->name, 0);
634 compiz_glapi->glBindFramebuffer(GL_FRAMEBUFFER, 0); 649 compiz_glapi->glBindFramebuffer(GL_FRAMEBUFFER, 0);
650 e_comp_object_native_surface_override(cgl->ec->frame, &ns);
651 //e_comp_object_damage(cgl->ec->frame, 0, 0, cgl->ec->w, cgl->ec->h);
635} 652}
636 653
637EINTERN void 654EINTERN void
@@ -646,21 +663,20 @@ compiz_texture_del(CompTexture *texture)
646 Compiz_GL *cgl; 663 Compiz_GL *cgl;
647 664
648 cgl = eina_hash_set(textures, &texture, NULL); 665 cgl = eina_hash_set(textures, &texture, NULL);
649 if (!cgl) return; //wtf 666 if ((!cgl) || ((intptr_t)cgl == 0x1)) return;
650 evas_object_event_callback_del_full(cgl->ec->frame, EVAS_CALLBACK_SHOW, (void*)cshow, cgl->obj); 667 evas_object_event_callback_del_full(cgl->ec->frame, EVAS_CALLBACK_SHOW, (void*)cshow, cgl->obj);
651 evas_object_event_callback_del_full(cgl->ec->frame, EVAS_CALLBACK_HIDE, (void*)chide, cgl->obj); 668 evas_object_event_callback_del_full(cgl->ec->frame, EVAS_CALLBACK_HIDE, (void*)chide, cgl->obj);
652 evas_object_smart_callback_del_full(cgl->ec->frame, "shaded", (void*)chide, cgl->obj); 669
653 evas_object_smart_callback_del_full(cgl->ec->frame, "shade_done", cshade, cgl); 670 evas_gl_make_current(gl, cgl->sfc, glctx);
654 evas_object_smart_callback_del_full(cgl->ec->frame, "unshading", (void*)cshow, cgl->obj);
655 evas_object_smart_callback_del_full(cgl->ec->frame, "unshaded", (void*)cshow, cgl->obj);
656 evas_object_smart_callback_del_full(cgl->ec->frame, "dirty", cdirty, cgl);
657 evas_gl_make_current(gl, cgl->sfc, cgl->ctx);
658 compiz_glapi->glDeleteFramebuffers(1, &cgl->fbo); 671 compiz_glapi->glDeleteFramebuffers(1, &cgl->fbo);
659 evas_gl_surface_destroy(gl, cgl->sfc); 672 evas_gl_surface_destroy(gl, cgl->sfc);
660 evas_gl_context_destroy(gl, cgl->ctx); 673 if (!e_object_is_del(E_OBJECT(cgl->ec)))
674 {
675 e_comp_object_native_surface_override(cgl->ec->frame, NULL);
676 e_comp_object_blank(cgl->ec->frame, 0);
677 }
678
661 evas_object_del(cgl->obj); 679 evas_object_del(cgl->obj);
662 e_comp_object_blank(cgl->ec->frame, 0);
663 eina_tiler_free(cgl->damage);
664 free(cgl); 680 free(cgl);
665} 681}
666 682
@@ -705,11 +721,16 @@ compiz_gl_init(void)
705{ 721{
706 CompDisplay *d; 722 CompDisplay *d;
707 CompScreen *s; 723 CompScreen *s;
724 E_Client *ec;
708 725
726 glctx = evas_gl_context_create(gl, NULL);
709 assert(!compiz_main()); 727 assert(!compiz_main());
710 for (d = core.displays; d; d = d->next) 728 for (d = core.displays; d; d = d->next)
711 for (s = d->screens; s; s = s->next) 729 for (s = d->screens; s; s = s->next)
712 s->getOutputExtentsForWindow = compiz_getOutputExtentsForWindow; 730 s->getOutputExtentsForWindow = compiz_getOutputExtentsForWindow;
731 E_CLIENT_FOREACH(ec)
732 e_object_ref(E_OBJECT(ec));
733 e_comp_shape_queue();
713} 734}
714 735
715static void 736static void
@@ -722,11 +743,13 @@ compiz_gl_render(void)
722 compiz_gl_init(); 743 compiz_gl_init();
723 init = EINA_TRUE; 744 init = EINA_TRUE;
724 } 745 }
746 compiz_idle_cb(NULL);
725 gettimeofday (&tv, 0); 747 gettimeofday (&tv, 0);
726 handleTimeouts(&tv); 748 handleTimeouts(&tv);
727 compiz_timers(); 749 compiz_timers();
728 fprintf(stderr, "COMPIZ LOOP\n"); 750 //fprintf(stderr, "COMPIZ LOOP\n");
729 eventLoop(); 751 eventLoop();
752 eina_tiler_clear(tiler);
730 compiz_damage(); 753 compiz_damage();
731} 754}
732 755
@@ -768,8 +791,8 @@ compiz_move_begin(void *d EINA_UNUSED, E_Client *ec)
768 addWindowDamage(w); 791 addWindowDamage(w);
769 ecx = ec->client.x; 792 ecx = ec->client.x;
770 ecy = ec->client.y; 793 ecy = ec->client.y;
771 fprintf(stderr, "MOVE START: %d,%d\n", ecx, ecy); 794 //fprintf(stderr, "MOVE START: %d,%d\n", ecx, ecy);
772 fprintf(stderr, "**COMPIZ: %d,%d\n", w->attrib.x, w->attrib.y); 795 //fprintf(stderr, "**COMPIZ: %d,%d\n", w->attrib.x, w->attrib.y);
773} 796}
774 797
775static void 798static void
@@ -785,8 +808,8 @@ compiz_move_update(void *d EINA_UNUSED, E_Client *ec)
785 ecx = ec->client.x; 808 ecx = ec->client.x;
786 ecy = ec->client.y; 809 ecy = ec->client.y;
787 syncWindowPosition(w); 810 syncWindowPosition(w);
788 fprintf(stderr, "MOVE UPDATE: %d,%d\n", ec->client.x, ec->client.y); 811 //fprintf(stderr, "MOVE UPDATE: %d,%d\n", ec->client.x, ec->client.y);
789 fprintf(stderr, "**COMPIZ: %d,%d\n", w->attrib.x, w->attrib.y); 812 //fprintf(stderr, "**COMPIZ: %d,%d\n", w->attrib.x, w->attrib.y);
790} 813}
791 814
792static void 815static void
@@ -804,8 +827,37 @@ compiz_move_end(void *d EINA_UNUSED, E_Client *ec)
804 removeScreenGrab(w->screen, movegrab, NULL); 827 removeScreenGrab(w->screen, movegrab, NULL);
805 movegrab = -1; 828 movegrab = -1;
806 addWindowDamage(w); 829 addWindowDamage(w);
807 fprintf(stderr, "MOVE END: %d,%d\n", ec->client.x, ec->client.y); 830 if ((ec->x == ec->moveinfo.down.x) && (ec->y == ec->moveinfo.down.y))
808 fprintf(stderr, "**COMPIZ: %d,%d\n", w->attrib.x, w->attrib.y); 831 w->screen->windowUngrabNotify(w);
832 //fprintf(stderr, "MOVE END: %d,%d\n", ec->client.x, ec->client.y);
833 //fprintf(stderr, "**COMPIZ: %d,%d\n", w->attrib.x, w->attrib.y);
834}
835
836EINTERN void
837compiz_damage_mask(unsigned int mask)
838{
839 doclear = mask & COMP_SCREEN_DAMAGE_ALL_MASK;
840}
841
842static void
843win_hash_free(E_Client *ec)
844{
845 CompWindow *w;
846
847 w = eina_hash_set(clients, &ec, NULL);
848 evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_RESTACK, compiz_client_stack, ec);
849 evas_object_smart_callback_del_full(ec->frame, "damage", compiz_client_damage, w);
850 evas_object_smart_callback_del_full(ec->frame, "maximize_pre", compiz_client_maximize, w);
851 evas_object_smart_callback_del_full(ec->frame, "unmaximize_pre", compiz_client_maximize, w);
852 evas_object_smart_callback_del_full(ec->frame, "shading", compiz_client_shade, w);
853 evas_object_smart_callback_del_full(ec->frame, "shaded", compiz_client_shade, w);
854 evas_object_smart_callback_del_full(ec->frame, "unshading", compiz_client_shade, w);
855 evas_object_smart_callback_del_full(ec->frame, "unshaded", compiz_client_shade, w);
856 evas_object_smart_callback_del_full(ec->frame, "shade_done", compiz_client_shade, w);
857 evas_object_smart_callback_del_full(ec->frame, "frame_recalc_done", compiz_client_frame_calc, ec);
858 evas_object_smart_callback_del_full(ec->frame, "hiding", (void*)compiz_client_hide, ec);
859 evas_object_event_callback_del_full(ec->frame, EVAS_CALLBACK_HIDE, (void*)compiz_client_hide, ec);
860 e_object_unref(E_OBJECT(ec));
809} 861}
810 862
811static void 863static void
@@ -833,6 +885,24 @@ gl_fn_init(void)
833#undef GLFN 885#undef GLFN
834} 886}
835 887
888static Eina_Bool
889compiz_desk_show(void *data EINA_UNUSED, int t EINA_UNUSED, E_Event_Desk_Before_Show *ev)
890{
891 E_Desk *desk;
892 CompDisplay *d;
893 CompScreen *s;
894
895 desk = e_desk_current_get(ev->desk->zone);
896 for (d = core.displays; d; d = d->next)
897 for (s = d->screens; s; s = s->next)
898 {
899 if (s->screenNum != ev->desk->zone->num) continue;
900 moveScreenViewport(s, desk->x - ev->desk->x, desk->y - ev->desk->y, 1);
901 return ECORE_CALLBACK_RENEW;
902 }
903 return ECORE_CALLBACK_RENEW;
904}
905
836EINTERN void 906EINTERN void
837compiz_init(void) 907compiz_init(void)
838{ 908{
@@ -848,14 +918,18 @@ compiz_init(void)
848 clients = eina_hash_pointer_new(NULL); 918 clients = eina_hash_pointer_new(NULL);
849 textures = eina_hash_pointer_new(NULL); 919 textures = eina_hash_pointer_new(NULL);
850 wintextures = eina_hash_pointer_new(NULL); 920 wintextures = eina_hash_pointer_new(NULL);
921 tiler = eina_tiler_new(e_comp->w, e_comp->h);
851 //evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_PRE, (Evas_Event_Cb)compiz_render_pre, NULL); 922 //evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_PRE, (Evas_Event_Cb)compiz_render_pre, NULL);
852 E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE, compiz_mouse_move, NULL); 923 E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE, compiz_mouse_move, NULL);
853 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_ADD, compiz_client_add, NULL); 924 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_ADD, compiz_client_add, NULL);
854 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_REMOVE, compiz_client_del, NULL); 925 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_REMOVE, compiz_client_del, NULL);
855 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_SHOW, compiz_client_show, NULL); 926 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_SHOW, compiz_client_show, NULL);
856 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_HIDE, compiz_client_hide, NULL); 927 //E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_HIDE, compiz_client_hide, NULL);
857 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_MOVE, compiz_client_configure, NULL); 928 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_MOVE, compiz_client_configure, NULL);
858 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE, compiz_client_configure, NULL); 929 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE, compiz_client_configure, NULL);
930 E_LIST_HANDLER_APPEND(handlers, E_EVENT_DESK_BEFORE_SHOW, compiz_desk_show, NULL);
931 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_ICONIFY, compiz_client_iconify, NULL);
932 E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_UNICONIFY, compiz_client_iconify, NULL);
859 hooks = eina_list_append(hooks, e_client_hook_add(E_CLIENT_HOOK_MOVE_BEGIN, compiz_move_begin, NULL)); 933 hooks = eina_list_append(hooks, e_client_hook_add(E_CLIENT_HOOK_MOVE_BEGIN, compiz_move_begin, NULL));
860 hooks = eina_list_append(hooks, e_client_hook_add(E_CLIENT_HOOK_MOVE_UPDATE, compiz_move_update, NULL)); 934 hooks = eina_list_append(hooks, e_client_hook_add(E_CLIENT_HOOK_MOVE_UPDATE, compiz_move_update, NULL));
861 hooks = eina_list_append(hooks, e_client_hook_add(E_CLIENT_HOOK_MOVE_END, compiz_move_end, NULL)); 935 hooks = eina_list_append(hooks, e_client_hook_add(E_CLIENT_HOOK_MOVE_END, compiz_move_end, NULL));
@@ -875,6 +949,8 @@ compiz_shutdown(void)
875 E_FREE_FUNC(compiz_anim, ecore_animator_del); 949 E_FREE_FUNC(compiz_anim, ecore_animator_del);
876 E_FREE_FUNC(compiz_timer, ecore_timer_del); 950 E_FREE_FUNC(compiz_timer, ecore_timer_del);
877 compiz_fini(); 951 compiz_fini();
952 evas_gl_context_destroy(gl, glctx);
953 glctx = NULL;
878 E_FREE_FUNC(gl, evas_gl_free); 954 E_FREE_FUNC(gl, evas_gl_free);
879 E_FREE_FUNC(glcfg, evas_gl_config_free); 955 E_FREE_FUNC(glcfg, evas_gl_config_free);
880 e_comp->pre_render_cbs = eina_list_remove(e_comp->pre_render_cbs, compiz_gl_render); 956 e_comp->pre_render_cbs = eina_list_remove(e_comp->pre_render_cbs, compiz_gl_render);
@@ -883,5 +959,16 @@ compiz_shutdown(void)
883 eina_hash_free(clients); 959 eina_hash_free(clients);
884 eina_hash_free(textures); 960 eina_hash_free(textures);
885 eina_hash_free(wintextures); 961 eina_hash_free(wintextures);
962 while (eina_array_count(events))
963 free(eina_array_pop(events));
964 E_FREE_FUNC(tiler, eina_tiler_free);
965 E_FREE_FUNC(events, eina_array_free);
886 init = EINA_FALSE; 966 init = EINA_FALSE;
967 if (!stopping)
968 {
969 E_Action *a;
970
971 a = e_action_find("restart");
972 if ((a) && (a->func.go)) a->func.go(NULL, NULL);
973 }
887} 974}
diff --git a/src/e_mod_main.h b/src/e_mod_main.h
index bacec03..90ca95a 100644
--- a/src/e_mod_main.h
+++ b/src/e_mod_main.h
@@ -309,7 +309,7 @@ extern Mod *compiz_mod;
309extern Config *compiz_config; 309extern Config *compiz_config;
310extern Evas_GL *gl; 310extern Evas_GL *gl;
311extern Evas_GL_API *compiz_glapi; 311extern Evas_GL_API *compiz_glapi;
312 312extern Eina_Bool noclear;
313 313
314EINTERN void compiz_init(void); 314EINTERN void compiz_init(void);
315EINTERN void compiz_shutdown(void); 315EINTERN void compiz_shutdown(void);
@@ -323,6 +323,8 @@ EINTERN void compiz_texture_del(CompTexture *texture);
323EINTERN void compiz_texture_init(CompTexture *texture); 323EINTERN void compiz_texture_init(CompTexture *texture);
324EINTERN void compiz_texture_bind(CompTexture *texture); 324EINTERN void compiz_texture_bind(CompTexture *texture);
325EINTERN void compiz_texture_to_win(CompTexture *texture, CompWindow *win); 325EINTERN void compiz_texture_to_win(CompTexture *texture, CompWindow *win);
326EINTERN void compiz_texture_activate(CompTexture *texture, Eina_Bool set); 326EINTERN void compiz_texture_activate(CompTexture *texture, Eina_Bool set, Region region);
327EINTERN void compiz_texture_clear(CompTexture *texture); 327EINTERN void compiz_texture_clear(CompTexture *texture);
328
329EINTERN void compiz_damage_mask(unsigned int mask);
328#endif 330#endif
diff --git a/src/exports/core.c b/src/exports/core.c
index 1bf5061..40a2130 100644
--- a/src/exports/core.c
+++ b/src/exports/core.c
@@ -229,6 +229,11 @@ finiCore(void)
229 while ((p = popPlugin())) 229 while ((p = popPlugin()))
230 unloadPlugin(p); 230 unloadPlugin(p);
231 231
232 free(core.base.privates);
233 corePrivateIndices = NULL;
234 core.base.privates = NULL;
235 corePrivateLen = 0;
236
232 XDestroyRegion(core.outputRegion); 237 XDestroyRegion(core.outputRegion);
233 XDestroyRegion(core.tmpRegion); 238 XDestroyRegion(core.tmpRegion);
234} 239}
diff --git a/src/exports/display.c b/src/exports/display.c
index 281dd2b..d2dc9ea 100644
--- a/src/exports/display.c
+++ b/src/exports/display.c
@@ -1639,12 +1639,13 @@ eventLoop(void)
1639 1639
1640 mask = s->damageMask; 1640 mask = s->damageMask;
1641 s->damageMask = 0; 1641 s->damageMask = 0;
1642 compiz_damage_mask(mask);
1642 1643
1643 if (s->clearBuffers) 1644 //if (s->clearBuffers)
1644 { 1645 //{
1645 if (mask & COMP_SCREEN_DAMAGE_ALL_MASK) 1646 //if (mask & COMP_SCREEN_DAMAGE_ALL_MASK)
1646 compiz_glapi->glClear(GL_COLOR_BUFFER_BIT); 1647 //compiz_glapi->glClear(GL_COLOR_BUFFER_BIT);
1647 } 1648 //}
1648 1649
1649 if (s->opt[COMP_SCREEN_OPTION_FORCE_INDEPENDENT].value.b 1650 if (s->opt[COMP_SCREEN_OPTION_FORCE_INDEPENDENT].value.b
1650 || !s->hasOverlappingOutputs) 1651 || !s->hasOverlappingOutputs)
@@ -1727,24 +1728,6 @@ eventLoop(void)
1727 1728
1728 (*s->donePaintScreen)(s); 1729 (*s->donePaintScreen)(s);
1729 1730
1730 /* remove destroyed windows */
1731 while (s->pendingDestroys)
1732 {
1733 CompWindow *w;
1734
1735 for (w = s->windows; w; w = w->next)
1736 {
1737 if (w->destroyed)
1738 {
1739 addWindowDamage(w);
1740 removeWindow(w);
1741 break;
1742 }
1743 }
1744
1745 s->pendingDestroys--;
1746 }
1747
1748 s->idle = FALSE; 1731 s->idle = FALSE;
1749 } 1732 }
1750 } 1733 }
@@ -1763,6 +1746,23 @@ eventLoop(void)
1763 { 1746 {
1764 s->idle = TRUE; 1747 s->idle = TRUE;
1765 } 1748 }
1749 /* remove destroyed windows */
1750 while (s->pendingDestroys)
1751 {
1752 CompWindow *w;
1753
1754 for (w = s->windows; w; w = w->next)
1755 {
1756 if (w->destroyed)
1757 {
1758 addWindowDamage(w);
1759 removeWindow(w);
1760 break;
1761 }
1762 }
1763
1764 s->pendingDestroys--;
1765 }
1766 } 1766 }
1767 } 1767 }
1768 //else 1768 //else
@@ -2512,6 +2512,18 @@ addDisplay(const char *name)
2512 "No manageable screens found on display %s", 2512 "No manageable screens found on display %s",
2513 XDisplayName(name)); 2513 XDisplayName(name));
2514 return FALSE; 2514 return FALSE;
2515
2516 }
2517
2518 CompScreen *s;
2519 for (s = d->screens; s; s = s->next)
2520 {
2521 E_Zone *zone = eina_list_nth(e_comp->zones, s->screenNum);
2522
2523 s->x = zone->desk_x_current;
2524 s->y = zone->desk_y_current;
2525 s->hsize = zone->desk_x_count;
2526 s->vsize = zone->desk_y_count;
2515 } 2527 }
2516 2528
2517 //setAudibleBell (d, d->opt[COMP_DISPLAY_OPTION_AUDIBLE_BELL].value.b); 2529 //setAudibleBell (d, d->opt[COMP_DISPLAY_OPTION_AUDIBLE_BELL].value.b);
diff --git a/src/exports/event.c b/src/exports/event.c
index 9f8ac7a..dd4a186 100644
--- a/src/exports/event.c
+++ b/src/exports/event.c
@@ -23,6 +23,7 @@
23 * Author: David Reveman <davidr@novell.com> 23 * Author: David Reveman <davidr@novell.com>
24 */ 24 */
25 25
26#include "e_mod_main.h"
26#include <stdlib.h> 27#include <stdlib.h>
27#include <string.h> 28#include <string.h>
28 29
@@ -45,7 +46,7 @@ handleWindowDamageRect(CompWindow *w,
45 int height) 46 int height)
46{ 47{
47 REGION region; 48 REGION region;
48 Bool initial = FALSE; 49 Bool initial = FALSE, clear = TRUE;
49 50
50 if (!w->redirected || w->bindFailed) 51 if (!w->redirected || w->bindFailed)
51 return; 52 return;
@@ -70,8 +71,9 @@ handleWindowDamageRect(CompWindow *w,
70 71
71 region.rects = &region.extents; 72 region.rects = &region.extents;
72 region.numRects = region.size = 1; 73 region.numRects = region.size = 1;
73 74 noclear = 1;
74 damageScreenRegion(w->screen, &region); 75 damageScreenRegion(w->screen, &region);
76 noclear = 0;
75 } 77 }
76 78
77 if (initial) 79 if (initial)
@@ -81,6 +83,7 @@ handleWindowDamageRect(CompWindow *w,
81void 83void
82handleSyncAlarm(CompWindow *w) 84handleSyncAlarm(CompWindow *w)
83{ 85{
86 noclear = 1;
84 if (w->syncWait) 87 if (w->syncWait)
85 { 88 {
86 if (w->syncWaitHandle) 89 if (w->syncWaitHandle)
@@ -109,7 +112,6 @@ handleSyncAlarm(CompWindow *w)
109 rects[nDamage].width, 112 rects[nDamage].width,
110 rects[nDamage].height); 113 rects[nDamage].height);
111 } 114 }
112
113 w->nDamage = 0; 115 w->nDamage = 0;
114 } 116 }
115 else 117 else
@@ -119,6 +121,7 @@ handleSyncAlarm(CompWindow *w)
119 sendSyncRequest(w); 121 sendSyncRequest(w);
120 } 122 }
121 } 123 }
124 noclear = 0;
122} 125}
123 126
124static void 127static void
@@ -1228,6 +1231,7 @@ handleEvent(CompDisplay *d,
1228 CompScreen *s; 1231 CompScreen *s;
1229 CompWindow *w; 1232 CompWindow *w;
1230 1233
1234 noclear = 1;
1231 switch (event->type) 1235 switch (event->type)
1232 { 1236 {
1233 case ButtonPress: 1237 case ButtonPress:
@@ -1257,8 +1261,8 @@ handleEvent(CompDisplay *d,
1257 1261
1258 if (handleActionEvent(d, event)) 1262 if (handleActionEvent(d, event))
1259 { 1263 {
1260 if (!d->screens->maxGrab) 1264 //if (!d->screens->maxGrab)
1261 XAllowEvents(d->display, AsyncPointer, event->xbutton.time); 1265 //XAllowEvents(d->display, AsyncPointer, event->xbutton.time);
1262 1266
1263 return; 1267 return;
1264 } 1268 }
@@ -1425,11 +1429,11 @@ handleEvent(CompDisplay *d,
1425 /* This is the only case where a window is removed but not 1429 /* This is the only case where a window is removed but not
1426 destroyed. We must remove our event mask and all passive 1430 destroyed. We must remove our event mask and all passive
1427 grabs. */ 1431 grabs. */
1428 XSelectInput(d->display, w->id, NoEventMask); 1432 //XSelectInput(d->display, w->id, NoEventMask);
1429 XShapeSelectInput(d->display, w->id, NoEventMask); 1433 //XShapeSelectInput(d->display, w->id, NoEventMask);
1430 XUngrabButton(d->display, AnyButton, AnyModifier, w->id); 1434 //XUngrabButton(d->display, AnyButton, AnyModifier, w->id);
1431 1435
1432 moveInputFocusToOtherWindow(w); 1436 //moveInputFocusToOtherWindow(w);
1433 1437
1434 destroyWindow(w); 1438 destroyWindow(w);
1435 } 1439 }
@@ -2029,22 +2033,22 @@ handleEvent(CompDisplay *d,
2029 w = findWindowAtDisplay(d, event->xmaprequest.window); 2033 w = findWindowAtDisplay(d, event->xmaprequest.window);
2030 if (w) 2034 if (w)
2031 { 2035 {
2032 XWindowAttributes attr; 2036 //XWindowAttributes attr;
2033 Bool doMapProcessing = TRUE; 2037 Bool doMapProcessing = TRUE;
2034 2038
2035 /* We should check the override_redirect flag here, because the 2039 /* We should check the override_redirect flag here, because the
2036 client might have changed it while being unmapped. */ 2040 client might have changed it while being unmapped. */
2037 if (XGetWindowAttributes(d->display, w->id, &attr)) 2041 //if (XGetWindowAttributes(d->display, w->id, &attr))
2038 { 2042 //{
2039 if (w->attrib.override_redirect != attr.override_redirect) 2043 //if (w->attrib.override_redirect != attr.override_redirect)
2040 { 2044 //{
2041 w->attrib.override_redirect = attr.override_redirect; 2045 //w->attrib.override_redirect = attr.override_redirect;
2042 recalcWindowType(w); 2046 //recalcWindowType(w);
2043 recalcWindowActions(w); 2047 //recalcWindowActions(w);
2044 2048
2045 (*d->matchPropertyChanged)(d, w); 2049 //(*d->matchPropertyChanged)(d, w);
2046 } 2050 //}
2047 } 2051 //}
2048 2052
2049 if (w->state & CompWindowStateHiddenMask) 2053 if (w->state & CompWindowStateHiddenMask)
2050 if (!w->minimized && !w->inShowDesktopMode) 2054 if (!w->minimized && !w->inShowDesktopMode)
@@ -2123,15 +2127,15 @@ handleEvent(CompDisplay *d,
2123 if (!(w->state & CompWindowStateHiddenMask)) 2127 if (!(w->state & CompWindowStateHiddenMask))
2124 showWindow(w); 2128 showWindow(w);
2125 2129
2126 if (focus == CompFocusAllowed) 2130 //if (focus == CompFocusAllowed)
2127 moveInputFocusToWindow(w); 2131 //moveInputFocusToWindow(w);
2128 } 2132 }
2129 2133
2130 setWindowProp(d, w->id, d->winDesktopAtom, w->desktop); 2134 setWindowProp(d, w->id, d->winDesktopAtom, w->desktop);
2131 } 2135 }
2132 else 2136 else
2133 { 2137 {
2134 XMapWindow(d->display, event->xmaprequest.window); 2138 //XMapWindow(d->display, event->xmaprequest.window);
2135 } 2139 }
2136 break; 2140 break;
2137 2141
@@ -2214,9 +2218,9 @@ handleEvent(CompDisplay *d,
2214 2218
2215 if (w) 2219 if (w)
2216 configureXWindow(w, xwcm, &xwc); 2220 configureXWindow(w, xwcm, &xwc);
2217 else 2221 //else
2218 XConfigureWindow(d->display, event->xconfigurerequest.window, 2222 //XConfigureWindow(d->display, event->xconfigurerequest.window,
2219 xwcm, &xwc); 2223 //xwcm, &xwc);
2220 } 2224 }
2221 break; 2225 break;
2222 2226
@@ -2238,10 +2242,10 @@ handleEvent(CompDisplay *d,
2238 2242
2239 addToCurrentActiveWindowHistory(w->screen, w->id); 2243 addToCurrentActiveWindowHistory(w->screen, w->id);
2240 2244
2241 XChangeProperty(d->display, w->screen->root, 2245 //XChangeProperty(d->display, w->screen->root,
2242 d->winActiveAtom, 2246 //d->winActiveAtom,
2243 XA_WINDOW, 32, PropModeReplace, 2247 //XA_WINDOW, 32, PropModeReplace,
2244 (unsigned char *)&w->id, 1); 2248 //(unsigned char *)&w->id, 1);
2245 } 2249 }
2246 2250
2247 state &= ~CompWindowStateDemandsAttentionMask; 2251 state &= ~CompWindowStateDemandsAttentionMask;
@@ -2450,5 +2454,6 @@ handleEvent(CompDisplay *d,
2450 } 2454 }
2451 break; 2455 break;
2452 } 2456 }
2457 noclear = 0;
2453} 2458}
2454 2459
diff --git a/src/exports/main.c b/src/exports/main.c
index 8caa3a6..821af95 100644
--- a/src/exports/main.c
+++ b/src/exports/main.c
@@ -389,5 +389,6 @@ compiz_fini(void)
389 389
390 if (initialPlugins) 390 if (initialPlugins)
391 free(initialPlugins); 391 free(initialPlugins);
392 memset(&core, 0, sizeof(core));
392} 393}
393 394
diff --git a/src/exports/paint.c b/src/exports/paint.c
index bf1890b..274f956 100644
--- a/src/exports/paint.c
+++ b/src/exports/paint.c
@@ -30,6 +30,10 @@
30 30
31#include <compiz-core.h> 31#include <compiz-core.h>
32 32
33static Bool internaldraw = FALSE;
34static WindowPaintAttrib pendingAttrib;
35static CompTransform pendingTransform;
36
33ScreenPaintAttrib defaultScreenPaintAttrib = { 37ScreenPaintAttrib defaultScreenPaintAttrib = {
34 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -DEFAULT_Z_CAMERA 38 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -DEFAULT_Z_CAMERA
35}; 39};
@@ -309,6 +313,7 @@ paintOutputRegion(CompScreen *screen,
309 313
310 odMask = PAINT_WINDOW_OCCLUSION_DETECTION_MASK; 314 odMask = PAINT_WINDOW_OCCLUSION_DETECTION_MASK;
311 315
316 memcpy(&pendingAttrib, &w->paint, sizeof(pendingAttrib));
312 if ((screen->windowOffsetX != 0 || screen->windowOffsetY != 0) && 317 if ((screen->windowOffsetX != 0 || screen->windowOffsetY != 0) &&
313 !windowOnAllViewports(w)) 318 !windowOnAllViewports(w))
314 { 319 {
@@ -324,12 +329,14 @@ paintOutputRegion(CompScreen *screen,
324 XOffsetRegion(w->clip, -offX, -offY); 329 XOffsetRegion(w->clip, -offX, -offY);
325 330
326 odMask |= PAINT_WINDOW_WITH_OFFSET_MASK; 331 odMask |= PAINT_WINDOW_WITH_OFFSET_MASK;
332 memcpy(&pendingTransform, &vTransform, sizeof(pendingTransform));
327 status = (*screen->paintWindow)(w, &w->paint, &vTransform, 333 status = (*screen->paintWindow)(w, &w->paint, &vTransform,
328 tmpRegion, odMask); 334 tmpRegion, odMask);
329 } 335 }
330 else 336 else
331 { 337 {
332 withOffset = FALSE; 338 withOffset = FALSE;
339 pendingTransform = *transform;
333 status = (*screen->paintWindow)(w, &w->paint, transform, tmpRegion, 340 status = (*screen->paintWindow)(w, &w->paint, transform, tmpRegion,
334 odMask); 341 odMask);
335 } 342 }
@@ -737,6 +744,7 @@ addWindowGeometry(CompWindow *w,
737{ 744{
738 BoxRec full; 745 BoxRec full;
739 746
747 internaldraw = TRUE;
740 w->texUnits = nMatrix; 748 w->texUnits = nMatrix;
741 749
742 full = clip->extents; 750 full = clip->extents;
@@ -1218,7 +1226,10 @@ drawWindow(CompWindow *w,
1218 mask |= PAINT_WINDOW_BLEND_MASK; 1226 mask |= PAINT_WINDOW_BLEND_MASK;
1219 1227
1220 w->vCount = w->indexCount = 0; 1228 w->vCount = w->indexCount = 0;
1229 internaldraw = FALSE;
1221 (*w->screen->addWindowGeometry)(w, &w->matrix, 1, w->region, region); 1230 (*w->screen->addWindowGeometry)(w, &w->matrix, 1, w->region, region);
1231 if (w->indexCount || (w->id == 1) || (w->drawWindowGeometry != drawWindowGeometry) || (!internaldraw))
1232 compiz_glapi->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
1222 if (w->vCount) 1233 if (w->vCount)
1223 (*w->screen->drawWindowTexture)(w, w->texture, fragment, mask); 1234 (*w->screen->drawWindowTexture)(w, w->texture, fragment, mask);
1224 1235
@@ -1263,7 +1274,7 @@ paintWindow(CompWindow *w,
1263 return TRUE; 1274 return TRUE;
1264 1275
1265 compiz_texture_init(w->texture); 1276 compiz_texture_init(w->texture);
1266 compiz_texture_activate(w->texture, 1); 1277 compiz_texture_activate(w->texture, 1, region);
1267 initFragmentAttrib(&fragment, attrib); 1278 initFragmentAttrib(&fragment, attrib);
1268 1279
1269 //if (mask & PAINT_WINDOW_TRANSFORMED_MASK || 1280 //if (mask & PAINT_WINDOW_TRANSFORMED_MASK ||
@@ -1273,13 +1284,15 @@ paintWindow(CompWindow *w,
1273 compiz_glapi->glLoadMatrixf(transform->m); 1284 compiz_glapi->glLoadMatrixf(transform->m);
1274 } 1285 }
1275 1286
1287 if (memcmp(attrib, &pendingAttrib, sizeof(pendingAttrib)) || memcmp(transform, &pendingTransform, sizeof(pendingTransform)))
1288 compiz_glapi->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
1276 status = (*w->screen->drawWindow)(w, transform, &fragment, region, mask); 1289 status = (*w->screen->drawWindow)(w, transform, &fragment, region, mask);
1277 1290
1278 //if (mask & PAINT_WINDOW_TRANSFORMED_MASK || 1291 //if (mask & PAINT_WINDOW_TRANSFORMED_MASK ||
1279 //mask & PAINT_WINDOW_WITH_OFFSET_MASK) 1292 //mask & PAINT_WINDOW_WITH_OFFSET_MASK)
1280 compiz_glapi->glPopMatrix(); 1293 compiz_glapi->glPopMatrix();
1281 1294
1282 compiz_texture_activate(w->texture, 0); 1295 compiz_texture_activate(w->texture, 0, NULL);
1283 1296
1284 return status; 1297 return status;
1285} 1298}
diff --git a/src/exports/screen.c b/src/exports/screen.c
index 8bf3145..6c02aab 100644
--- a/src/exports/screen.c
+++ b/src/exports/screen.c
@@ -178,74 +178,74 @@ desktopHintEqual(CompScreen *s,
178static void 178static void
179setDesktopHints(CompScreen *s) 179setDesktopHints(CompScreen *s)
180{ 180{
181 CompDisplay *d = s->display; 181return;
182 unsigned long *data; 182 //CompDisplay *d = s->display;
183 int size, offset, hintSize, i; 183 //unsigned long *data;
184 184 //int size, offset, hintSize, i;
185 size = s->nDesktop * 2 + s->nDesktop * 2 + s->nDesktop * 4 + 1; 185 //size = s->nDesktop * 2 + s->nDesktop * 2 + s->nDesktop * 4 + 1;
186 186
187 data = malloc(sizeof (unsigned long) * size); 187 //data = malloc(sizeof (unsigned long) * size);
188 if (!data) 188 //if (!data)
189 return; 189 //return;
190 190
191 offset = 0; 191 //offset = 0;
192 hintSize = s->nDesktop * 2; 192 //hintSize = s->nDesktop * 2;
193 193
194 for (i = 0; i < s->nDesktop; i++) 194 //for (i = 0; i < s->nDesktop; i++)
195 { 195 //{
196 data[offset + i * 2 + 0] = s->x * s->width; 196 //data[offset + i * 2 + 0] = s->x * s->width;
197 data[offset + i * 2 + 1] = s->y * s->height; 197 //data[offset + i * 2 + 1] = s->y * s->height;
198 } 198 //}
199 199
200 if (!desktopHintEqual(s, data, size, offset, hintSize)) 200 //if (!desktopHintEqual(s, data, size, offset, hintSize))
201 XChangeProperty(d->display, s->root, d->desktopViewportAtom, 201 //XChangeProperty(d->display, s->root, d->desktopViewportAtom,
202 XA_CARDINAL, 32, PropModeReplace, 202 //XA_CARDINAL, 32, PropModeReplace,
203 (unsigned char *)&data[offset], hintSize); 203 //(unsigned char *)&data[offset], hintSize);
204 204
205 offset += hintSize; 205 //offset += hintSize;
206 206
207 for (i = 0; i < s->nDesktop; i++) 207 //for (i = 0; i < s->nDesktop; i++)
208 { 208 //{
209 data[offset + i * 2 + 0] = s->width * s->hsize; 209 //data[offset + i * 2 + 0] = s->width * s->hsize;
210 data[offset + i * 2 + 1] = s->height * s->vsize; 210 //data[offset + i * 2 + 1] = s->height * s->vsize;
211 } 211 //}
212 212
213 if (!desktopHintEqual(s, data, size, offset, hintSize)) 213 //if (!desktopHintEqual(s, data, size, offset, hintSize))
214 XChangeProperty(d->display, s->root, d->desktopGeometryAtom, 214 //XChangeProperty(d->display, s->root, d->desktopGeometryAtom,
215 XA_CARDINAL, 32, PropModeReplace, 215 //XA_CARDINAL, 32, PropModeReplace,
216 (unsigned char *)&data[offset], hintSize); 216 //(unsigned char *)&data[offset], hintSize);
217 217
218 offset += hintSize; 218 //offset += hintSize;
219 hintSize = s->nDesktop * 4; 219 //hintSize = s->nDesktop * 4;
220 220
221 for (i = 0; i < s->nDesktop; i++) 221 //for (i = 0; i < s->nDesktop; i++)
222 { 222 //{
223 data[offset + i * 4 + 0] = s->workArea.x; 223 //data[offset + i * 4 + 0] = s->workArea.x;
224 data[offset + i * 4 + 1] = s->workArea.y; 224 //data[offset + i * 4 + 1] = s->workArea.y;
225 data[offset + i * 4 + 2] = s->workArea.width; 225 //data[offset + i * 4 + 2] = s->workArea.width;
226 data[offset + i * 4 + 3] = s->workArea.height; 226 //data[offset + i * 4 + 3] = s->workArea.height;
227 } 227 //}
228 228
229 if (!desktopHintEqual(s, data, size, offset, hintSize)) 229 //if (!desktopHintEqual(s, data, size, offset, hintSize))
230 XChangeProperty(d->display, s->root, d->workareaAtom, 230 //XChangeProperty(d->display, s->root, d->workareaAtom,
231 XA_CARDINAL, 32, PropModeReplace, 231 //XA_CARDINAL, 32, PropModeReplace,
232 (unsigned char *)&data[offset], hintSize); 232 //(unsigned char *)&data[offset], hintSize);
233 233
234 offset += hintSize; 234 //offset += hintSize;
235 235
236 data[offset] = s->nDesktop; 236 //data[offset] = s->nDesktop;
237 hintSize = 1; 237 //hintSize = 1;
238 238
239 if (!desktopHintEqual(s, data, size, offset, hintSize)) 239 //if (!desktopHintEqual(s, data, size, offset, hintSize))
240 XChangeProperty(d->display, s->root, d->numberOfDesktopsAtom, 240 //XChangeProperty(d->display, s->root, d->numberOfDesktopsAtom,
241 XA_CARDINAL, 32, PropModeReplace, 241 //XA_CARDINAL, 32, PropModeReplace,
242 (unsigned char *)&data[offset], hintSize); 242 //(unsigned char *)&data[offset], hintSize);
243 243
244 if (s->desktopHintData) 244 //if (s->desktopHintData)
245 free(s->desktopHintData); 245 //free(s->desktopHintData);
246 246
247 s->desktopHintData = data; 247 //s->desktopHintData = data;
248 s->desktopHintSize = size; 248 //s->desktopHintSize = size;
249} 249}
250 250
251static void 251static void
diff --git a/src/exports/texture.c b/src/exports/texture.c
index 81d3473..e65636b 100644
--- a/src/exports/texture.c
+++ b/src/exports/texture.c
@@ -59,6 +59,7 @@ finiTexture(CompScreen *screen,
59 if (texture->name) 59 if (texture->name)
60 { 60 {
61 makeScreenCurrent(screen); 61 makeScreenCurrent(screen);
62 compiz_texture_activate(texture, 1, NULL);
62 releasePixmapFromTexture(screen, texture); 63 releasePixmapFromTexture(screen, texture);
63 compiz_glapi->glDeleteTextures(1, &texture->name); 64 compiz_glapi->glDeleteTextures(1, &texture->name);
64 } 65 }
diff --git a/src/exports/window.c b/src/exports/window.c
index bf16598..cb6d1d6 100644
--- a/src/exports/window.c
+++ b/src/exports/window.c
@@ -1497,7 +1497,7 @@ damageWindowOutputExtents(CompWindow *w)
1497{ 1497{
1498 if (w->screen->damageMask & COMP_SCREEN_DAMAGE_ALL_MASK) 1498 if (w->screen->damageMask & COMP_SCREEN_DAMAGE_ALL_MASK)
1499 return; 1499 return;
1500 1500 return;
1501 if (w->shaded || (w->attrib.map_state == IsViewable && w->damaged)) 1501 if (w->shaded || (w->attrib.map_state == IsViewable && w->damaged))
1502 { 1502 {
1503 BoxRec box; 1503 BoxRec box;
@@ -1557,13 +1557,6 @@ addWindowDamageRect(CompWindow *w,
1557 1557
1558 if (!(*w->screen->damageWindowRect)(w, FALSE, &region.extents)) 1558 if (!(*w->screen->damageWindowRect)(w, FALSE, &region.extents))
1559 { 1559 {
1560 E_Client *ec;
1561
1562 ec = compiz_win_to_client(w);
1563 e_comp_object_damage(ec->frame, region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2);
1564 e_comp_object_render_update_del(ec->frame);
1565 /* assume that any damages here are going to need a full re-render anyway */
1566 compiz_texture_clear(w->texture);
1567 region.extents.x1 += w->attrib.x + w->attrib.border_width; 1560 region.extents.x1 += w->attrib.x + w->attrib.border_width;
1568 region.extents.y1 += w->attrib.y + w->attrib.border_width; 1561 region.extents.y1 += w->attrib.y + w->attrib.border_width;
1569 region.extents.x2 += w->attrib.x + w->attrib.border_width; 1562 region.extents.x2 += w->attrib.x + w->attrib.border_width;
@@ -1595,10 +1588,9 @@ addWindowDamage(CompWindow *w)
1595 { 1588 {
1596 BoxRec box; 1589 BoxRec box;
1597 1590
1598 box.x1 = -w->output.left - w->attrib.border_width; 1591 box.x1 = box.y1 = 0;
1599 box.y1 = -w->output.top - w->attrib.border_width; 1592 box.x2 = w->width;
1600 box.x2 = w->width + w->output.right; 1593 box.y2 = w->height;
1601 box.y2 = w->height + w->output.bottom;
1602 1594
1603 addWindowDamageRect(w, &box); 1595 addWindowDamageRect(w, &box);
1604 } 1596 }