Merge lp:~smspillaz/compiz/ubuntu.fix_1047067 into lp:ubuntu/quantal/compiz

Proposed by Sam Spilsbury
Status: Work in progress
Proposed branch: lp:~smspillaz/compiz/ubuntu.fix_1047067
Merge into: lp:ubuntu/quantal/compiz
Diff against target: 7337 lines (+4170/-1166)
84 files modified
AUTHORS (+36/-16)
CMakeLists.txt (+0/-6)
VERSION (+1/-1)
cmake/CompizCommon.cmake (+1/-1)
cmake/CompizPlugin.cmake (+0/-3)
cmake/FindCompiz.cmake (+1/-4)
compizconfig/ccsm/ccm/Widgets.py (+1/-1)
compizconfig/ccsm/setup.py (+1/-1)
compizconfig/compizconfig-python/setup.py (+1/-1)
compizconfig/compizconfig-python/src/compizconfig.pyx (+0/-30)
compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml (+11/-11)
compizconfig/integration/gnome/include/ccs_gnome_integration_constants.h (+1/-1)
compizconfig/libcompizconfig/cmake/FindCompizConfig.cmake (+1/-1)
compizconfig/libcompizconfig/include/CMakeLists.txt (+1/-0)
compizconfig/libcompizconfig/src/CMakeLists.txt (+10/-1)
compizconfig/libcompizconfig/src/ccs_settings_upgrade_internal.c (+168/-0)
compizconfig/libcompizconfig/src/ccs_settings_upgrade_internal.h (+41/-0)
compizconfig/libcompizconfig/src/main.c (+184/-163)
compizconfig/libcompizconfig/tests/CMakeLists.txt (+13/-0)
compizconfig/libcompizconfig/tests/compizconfig_test_ccs_settings_upgrade_internal.cpp (+70/-0)
debian/changelog (+4/-1)
debian/patches/100_expo_layout.patch (+2903/-0)
debian/patches/series (+1/-0)
gtk/gnome/50-compiz-launchers.xml.in (+1/-1)
include/core/CMakeLists.txt (+0/-1)
include/core/serialization.h (+0/-158)
kde/window-decorator-kde4/CMakeLists.txt (+2/-0)
kde/window-decorator-kde4/main.cpp (+1/-1)
kde/window-decorator-kde4/window.cpp (+66/-0)
kde/window-decorator-kde4/window.h (+13/-0)
plugins/addhelper/src/addhelper.cpp (+0/-23)
plugins/addhelper/src/addhelper.h (+0/-23)
plugins/animation/animation.xml.in (+2/-2)
plugins/animation/include/animation/animation.h (+2/-2)
plugins/animation/include/animation/animeffect.h (+1/-1)
plugins/animation/src/animation.cpp (+22/-18)
plugins/animation/src/grid.cpp (+8/-11)
plugins/animation/src/options.cpp (+11/-4)
plugins/annotate/src/annotate.cpp (+1/-15)
plugins/annotate/src/annotate.h (+1/-18)
plugins/bench/src/bench.cpp (+0/-10)
plugins/bench/src/bench.h (+0/-2)
plugins/colorfilter/src/colorfilter.cpp (+0/-10)
plugins/colorfilter/src/colorfilter.h (+0/-20)
plugins/commands/commands.xml.in (+63/-63)
plugins/compiztoolbox/CMakeLists.txt (+1/-1)
plugins/ezoom/src/ezoom.cpp (+0/-29)
plugins/ezoom/src/ezoom.h (+0/-32)
plugins/firepaint/src/firepaint.cpp (+0/-43)
plugins/firepaint/src/firepaint.h (+0/-66)
plugins/group/src/group.h (+1/-24)
plugins/group/src/init.cpp (+0/-71)
plugins/imgsvg/CMakeLists.txt (+1/-1)
plugins/mag/src/mag.cpp (+0/-16)
plugins/mag/src/mag.h (+0/-14)
plugins/mblur/src/mblur.cpp (+0/-10)
plugins/mblur/src/mblur.h (+0/-10)
plugins/neg/src/neg.cpp (+0/-16)
plugins/neg/src/neg.h (+0/-11)
plugins/obs/src/obs.cpp (+0/-13)
plugins/obs/src/obs.h (+1/-11)
plugins/opacify/src/opacify.cpp (+0/-12)
plugins/opacify/src/opacify.h (+0/-11)
plugins/opengl/CMakeLists.txt (+6/-3)
plugins/opengl/DRIVERS (+54/-0)
plugins/opengl/src/fsregion/CMakeLists.txt (+7/-0)
plugins/opengl/src/fsregion/fsregion.cpp (+54/-0)
plugins/opengl/src/fsregion/fsregion.h (+57/-0)
plugins/opengl/src/fsregion/tests/CMakeLists.txt (+10/-0)
plugins/opengl/src/fsregion/tests/test-fsregion.cpp (+140/-0)
plugins/opengl/src/paint.cpp (+46/-23)
plugins/opengl/src/programcache.cpp (+2/-2)
plugins/opengl/src/vertexbuffer.cpp (+2/-2)
plugins/place/src/place.cpp (+9/-6)
plugins/resize/src/logic/src/resize-logic.cpp (+3/-0)
plugins/resize/src/logic/tests/test-logic.cpp (+52/-0)
plugins/showmouse/src/showmouse.cpp (+0/-40)
plugins/showmouse/src/showmouse.h (+0/-51)
plugins/showrepaint/src/showrepaint.cpp (+0/-8)
plugins/showrepaint/src/showrepaint.h (+0/-12)
plugins/water/src/water.cpp (+1/-1)
postinst/convert-files/compiz-profile-Default.convert (+1/-1)
postinst/convert-files/compiz-profile-active-Default.convert (+1/-1)
tests/manual/Unredirect.txt (+77/-0)
To merge this branch: bzr merge lp:~smspillaz/compiz/ubuntu.fix_1047067
Reviewer Review Type Date Requested Status
Timo Jyrinki Needs Fixing
Ubuntu branches Pending
Review via email: mp+123407@code.launchpad.net

Description of the change

Re-adds the workspace switcher layout and adds some tests to substantially new code.

To post a comment you must log in.
3294. By Sam Spilsbury

* debian/python-compizconfig.install
  - Install compizconfig-python.pc

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Added the patch plus changelog entry cleanly on top of 0.9.8.2 at lp:~timo-jyrinki/compiz/ubuntu.0982

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :
review: Disapprove
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Let's change the "superseded" to Needs Fixing, since I'm getting actually http://pastebin.ubuntu.com/1198693/ with the expo patch.

A new branch based off lp:ubuntu/compiz that now has this version of the patch could be good for a clean merge proposal.

review: Needs Fixing
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

I will continue tomorrow getting a better backtrace if possible.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Unmerged revisions

3294. By Sam Spilsbury

* debian/python-compizconfig.install
  - Install compizconfig-python.pc

3293. By Sam Spilsbury

Refactored out the code into separate modules, get it under test

3292. By Sam Spilsbury

Added test fixtures for modified expo plugin

3291. By Sam Spilsbury

Refactor out the window list generator

3290. By Sam Spilsbury

Fix whitespace

3289. By Sam Spilsbury

* debian/patches/100_expo_layout.patch
  - re-add the expo layout that used to be in precise (LP: #1047067)
  - add some testcases

3288. By Sam Spilsbury

Merge lp:compiz

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2012-05-16 17:40:13 +0000
3+++ AUTHORS 2012-09-09 12:57:20 +0000
4@@ -1,52 +1,63 @@
5 Adam Williamson <awilliam@redhat.com>
6 Adel Gadllah <adel.gadllah@gmail.com>
7+Alan Bell <alanbell@ubuntu.com>
8 Alan Griffiths <alan.griffiths@canonical.com>
9 Alan Griffiths <alan@octopull.co.uk>
10+Alexandros Frantzis <alexandros.frantzis@linaro.org>
11 Alyssa Hung <deciare@isisview.org>
12+Andrea Azzarone <aazarone@gmail.com>
13 Andrea Azzarone <azzaronea@gmail.com>
14 Bellegarde Cedric <gnumdk@gmail.com>
15 Bellegarde Cedric <gnumdk@puffy.homelinux.org>
16 Bryan Nguyen <bnguyen@nvidia.com>
17+Cedric <gnumdk@gmail.com>
18 C-F Language team <i18n@opencompositing.org>
19-Cedric <gnumdk@gmail.com>
20 Christopher Williams <christopherw@verizon.net>
21 Christopher Williams <crdlb@compiz-fusion.org>
22+compiz <compiz@opencompositing.org>
23 Compiz Fusion l10n team <i18n@opencompositing.org>
24-Dan Winship <danw@novell.com>
25-Dan Winship <danw@twelve-monkeys.boston.ximian.com>
26+Daniel d'Andrada <daniel.dandrada@canonical.com>
27 Daniel Lea <danlea@gmail.com>
28 Daniel Nylander <po@danielnylander.se>
29+Daniel van Vugt <daniel.van.vugt@canonical.com>
30 Daniel van Vugt <vanvugt@gmail.com>
31 Danny Baumann <daba@mobilrechner.localdomain>
32 Danny Baumann <daba@rechenknecht.peppercon.de>
33 Danny Baumann <dannybaumann@web.de>
34+Dan Winship <danw@novell.com>
35+Dan Winship <danw@twelve-monkeys.boston.ximian.com>
36 David Reveman <c99drn@cs.umu.se>
37 David Reveman <david@ion.(none)>
38 David Reveman <davidr@novell.com>
39 Dennis Kasprzyk <onestone@beryl-project.org>
40 Dennis Kasprzyk <onestone@compiz-fusion.org>
41 Dennis Kasprzyk <onestone@opencompositing.org>
42+Didier Roche <didier.roche@canonical.com>
43 Didier Roche <didrocks@ubuntu.com>
44 Diogo Ferreira <diogo@underdev.org>
45 Dominique Leuenberger <dimstar@opensuse.org>
46 Dominique Leuenberger <dominique@leuenberger.net>
47 Dominique Leuenberger <dominique@messiah.leuenberger.net>
48+dragoran <drago01@gmail.com>
49 Eduardo Gurgel Pinho <eduardo@mad4.Chagas>
50 Erkin Bahceci <erkinbah@gmail.com>
51 Gabor Kelemen <kelemeng@ubuntu.com>
52+gandalfn <gandalfn@club-internet.fr>
53 Gerd Kohlberger <lowfi@chello.at>
54 Guillaume <ixcemix@gmail.com>
55 Guillaume Seguin <guillaume@segu.in>
56+G. Uitslag <klapinklapin@gmail.com>
57 James Jones <jajones@jatest.nvidia.com>
58 Jason Smith <jason.smith@canonical.com>
59 Jay Catherwood <jay.catherwood@gmail.com>
60 Jeremy C. Reed <reed@reedmedia.net>
61 Jigish Gohil <cyberorg@opensuse.org name = Jigish Gohil>
62 Jigish Gohil <cyberorg@prime.cyberorg.info>
63+Joel Bosveld <joel.bosveld@gmail.com>
64 Joel Bosveld <Joel.Bosveld@gmail.com>
65-Joel Bosveld <joel.bosveld@gmail.com>
66 Julian Sikorski <lordzanon@poczta.onet.pl>
67 Jürgen Kreileder <jk@blackdown.de>
68+Keith Madill <sciso@hotmail.co.uk>
69 Kristian Hogsberg <krh@bitplanet.net>
70 Kristian Høgsberg <krh@redhat.com>
71 Kristian Lyngstol <kristian@beryl-project.org>
72@@ -54,11 +65,16 @@
73 Kristopher Ives <kris@leetbook2.(none)>
74 Kristopher Ives <kristopher.ives@gmail.com>
75 Lubos Lunak <llunak@novell.com>
76+Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
77+MC Return <mcr2010@mcr2010-HP-Compaq-dc7700-Convertible-Minitower>
78+MC Return <mc.return@gmx.net>
79 Michael Vogt <mvo@ubuntu.com>
80+mike@blueroot.co.uk <mike@blueroot.co.uk>
81 Mike Cook <mcook@novell.com>
82 Mike Dransfield <mike@blueroot.co.uk>
83 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@canonical.com>
84 Mirco Muller <macslow@bangang.de>
85+moppsy <moppsy@comcast.net>
86 Nicolas Delvaux <contact@nicolas-delvaux.org>
87 Nicolas Viennot <nicolas@viennot.biz>
88 Owen W. Taylor <otaylor@fishsoup.net>
89@@ -69,42 +85,46 @@
90 Quinn Storm <livinglatexkali@gmail.com>
91 Quinn Storm <quinn@quinn-laptop.(none)>
92 Randolph Chung <randolph@tausq.org>
93-Rob Taylor <rob.taylor@codethink.co.uk>
94+Renato Araujo Oliveira Filho <renato.filho@canonical.com>
95 Robert Ancell <robert.ancell@canonical.com>
96 Robert Carr <racarr@gorbie.(none)>
97 Robert Carr <robb@gorbachev.(none)>
98 Robert Noland <rnoland@rnoland-ibm.acs.internap.com>
99+Rob Taylor <rob.taylor@codethink.co.uk>
100+Rock <rockbuntu@mailinator.com>
101 Roi Cohen <racarr@gorbie.(none)>
102 Roi Cohen <roico.beryl@gmail.com>
103 Roland Baer <roland@Vista.(none)>
104 Roland Bar <roland@verifysoft.de>
105+Roland Bär <roland@verifysoft.de>
106 Roland Bär <roland@Vista.(none)>
107-Roland Bär <roland@verifysoft.de>
108 Sam <smspillaz@gmail.com>
109+Sam Spilsbury <sam.spilsbury@canonical.com>
110 Sam Spilsbury <Sam@XPS-SUSE.site>
111+Sam Spilsbury <smspillaz@gmail.com>
112 Sam Spilsbury <SmSpillaz@gmail.com>
113-Sam Spilsbury <sam.spilsbury@canonical.com>
114+Sam Spilsbury <smspillaz@smspillaz-desktop.(none)>
115 Sam Spilsbury <smspillaz@XPS-FEDORA.(none)>
116 Sam Spilsbury <smspillaz@XPS-U.(none)>
117-Sam Spilsbury <smspillaz@gmail.com>
118-Sam Spilsbury <smspillaz@smspillaz-desktop.(none)>
119 Scott Moreau <oreaus@gmail.com>
120+scott <scott@box1.localdomain>
121 Sebasian Billaudelle <stein@cream-project.org>
122+Sebastien Bacher <seb128@ubuntu.com>
123+smspillaz <sam.spilsbury@canonical.com>
124+Søren Sandmann <sandmann@redhat.com>
125 Steven Robertson <nihilismwow@gmail.com>
126 Stjepan Glavina <stjepang@gmail.com>
127-Søren Sandmann <sandmann@redhat.com>
128 Thierry Reding <thierry@gilfi.de>
129+Thomas Thurman <thomas.thurman@canonical.com>
130+Thomas Voß
131 Thomas Voss <thomas.voss@canonical.com>
132+Time Penhey <tim.penhey@canonical.com>
133+timo.jyrinki@canonical.com
134 Tim Penhey <tim.penhey@canonical.com>
135-Time Penhey <tim.penhey@canonical.com>
136 Tomas Carnecky <tom@dbservice.com>
137 Travis Watkins <amaranth@ubuntu.com>
138+Ugo Riboni <ugo.riboni@canonical.com>
139 Unity <unity@VB-U1010.(none)>
140 Ville Syrjala <syrjala@sci.fi>
141 Zack Rusin <zack@kde.org>
142-dragoran <drago01@gmail.com>
143-gandalfn <gandalfn@club-internet.fr>
144-mike@blueroot.co.uk <mike@blueroot.co.uk>
145-moppsy <moppsy@comcast.net>
146-scott <scott@box1.localdomain>
147 Δημήτρης (djdoo) <jimdusis@yahoo.gr>
148
149=== modified file 'CMakeLists.txt'
150--- CMakeLists.txt 2012-08-24 13:41:00 +0000
151+++ CMakeLists.txt 2012-09-09 12:57:20 +0000
152@@ -86,8 +86,6 @@
153 set (ALL_LINGUAS af ar bg bn bn_IN bs ca cs cy da de el en_GB en_US es eu et fi fr gl gu he hi hr hu id it ja ka km ko lo lt mk mr nb nl or pa pl pt pt_BR ro ru sk sl sr sv ta tr uk vi xh zh_CN zh_TW zu)
154 set (GETTEXT_PACKAGE compiz)
155
156-find_package (Boost 1.34.0 REQUIRED serialization)
157-
158 set (COMPIZ_REQUIRES
159 x11
160 xext
161@@ -112,12 +110,8 @@
162 compiz_pkg_check_modules (COMPIZ REQUIRED ${COMPIZ_REQUIRES})
163 compiz_pkg_check_modules (LIBDECORATION REQUIRED ${DECORATION_REQUIRES})
164
165-list (APPEND COMPIZ_LIBRARIES ${Boost_LIBRARIES})
166-
167 include (CompizDefaults)
168
169-set (COMPIZ_CFLAGS "${COMPIZ_CFLAGS} -I${Boost_INCLUDE_DIR}")
170-
171 set (_compiz_package_string "Compiz ${VERSION}")
172 set (_compiz_package "Compiz")
173
174
175=== modified file 'VERSION'
176--- VERSION 2012-08-23 04:26:34 +0000
177+++ VERSION 2012-09-09 12:57:20 +0000
178@@ -1,1 +1,1 @@
179-0.9.8.0
180+0.9.8.1
181
182=== modified file 'cmake/CompizCommon.cmake'
183--- cmake/CompizCommon.cmake 2012-08-22 01:21:08 +0000
184+++ cmake/CompizCommon.cmake 2012-09-09 12:57:20 +0000
185@@ -40,7 +40,7 @@
186 )
187
188 # Almost everything is a shared library now, so almost everything needs -fPIC
189-set (COMMON_FLAGS "-fPIC -Wall")
190+set (COMMON_FLAGS "-fPIC -Wall -Wl,-zdefs")
191
192 option (COMPIZ_DEPRECATED_WARNINGS "Warn about declarations marked deprecated" OFF)
193 if (NOT COMPIZ_DEPRECATED_WARNINGS)
194
195=== modified file 'cmake/CompizPlugin.cmake'
196--- cmake/CompizPlugin.cmake 2012-05-26 10:52:26 +0000
197+++ cmake/CompizPlugin.cmake 2012-09-09 12:57:20 +0000
198@@ -75,8 +75,6 @@
199
200 ### Set up core lib dependences so this in correctly imported into plugins
201
202-find_package (Boost 1.34.0 REQUIRED serialization)
203-
204 set (COMPIZ_REQUIRES
205 x11
206 xext
207@@ -94,7 +92,6 @@
208 )
209
210 compiz_pkg_check_modules (COMPIZ REQUIRED ${COMPIZ_REQUIRES})
211-
212 list (APPEND COMPIZ_LIBRARIES ${Boost_LIBRARIES})
213
214 # determinate installation directories
215
216=== modified file 'cmake/FindCompiz.cmake'
217--- cmake/FindCompiz.cmake 2012-08-21 10:11:51 +0000
218+++ cmake/FindCompiz.cmake 2012-09-09 12:57:20 +0000
219@@ -1,11 +1,8 @@
220-
221-
222-
223 ################################################################################
224 #
225 # FindCompiz
226 #
227-# This module finds Compiz (www.compiz.org). It uses the FindPkgConfig to
228+# This module finds Compiz (https://launchpad.net/compiz). It uses the FindPkgConfig to
229 # locate Compiz and adds the Compiz CMake module path to the CMake module path.
230 # It also loads the CompizDefaults that sets all variables to compile Compiz
231 # modules.
232
233=== modified file 'compizconfig/ccsm/ccm/Widgets.py'
234--- compizconfig/ccsm/ccm/Widgets.py 2011-02-12 18:24:14 +0000
235+++ compizconfig/ccsm/ccm/Widgets.py 2012-09-09 12:57:20 +0000
236@@ -1335,7 +1335,7 @@
237 if IconTheme.lookup_icon("ccsm", 64, 0):
238 icon = IconTheme.load_icon("ccsm", 64, 0)
239 self.set_logo (icon)
240- self.set_website ("http://www.compiz-fusion.org")
241+ self.set_website ("https://launchpad.net/compiz")
242
243 # Error dialog
244 #
245
246=== modified file 'compizconfig/ccsm/setup.py'
247--- compizconfig/ccsm/setup.py 2012-05-16 17:44:14 +0000
248+++ compizconfig/ccsm/setup.py 2012-09-09 12:57:20 +0000
249@@ -172,7 +172,7 @@
250 description = "CompizConfig Settings Manager",
251 author = "Patrick Niklaus",
252 author_email = "marex@opencompositing.org",
253- url = "http://www.compiz.org/",
254+ url = "https://launchpad.net/compiz",
255 license = "GPL",
256 data_files = data_files,
257 packages = ["ccm"],
258
259=== modified file 'compizconfig/compizconfig-python/setup.py'
260--- compizconfig/compizconfig-python/setup.py 2012-08-16 09:11:10 +0000
261+++ compizconfig/compizconfig-python/setup.py 2012-09-09 12:57:20 +0000
262@@ -134,7 +134,7 @@
263 name = "compizconfig-python",
264 version = version,
265 description = "CompizConfig Python",
266- url = "http://www.compiz.org/",
267+ url = "https://launchpad.net/compiz",
268 license = "GPL",
269 maintainer = "Guillaume Seguin",
270 maintainer_email = "guillaume@segu.in",
271
272=== modified file 'compizconfig/compizconfig-python/src/compizconfig.pyx'
273--- compizconfig/compizconfig-python/src/compizconfig.pyx 2012-08-22 05:31:22 +0000
274+++ compizconfig/compizconfig-python/src/compizconfig.pyx 2012-09-09 12:57:20 +0000
275@@ -383,36 +383,6 @@
276 return ccsSettingGetInfo ((<CCSSetting *> value.parent)).forList.listType
277 else:
278 return ccsSettingGetType ((<CCSSetting *> value.parent))
279-
280-cdef CCSStringList * ListToStringList (object list):
281- if len (list) <= 0:
282- return NULL
283-
284- cdef CCSStringList * listStart
285- cdef CCSStringList * stringList
286- cdef CCSStringList * prev
287- cdef CCSString * stringStart
288-
289- stringStart = <CCSString *> malloc (sizeof (CCSString))
290-
291- stringStart.value = strdup (list[0])
292- listStart = <CCSStringList *> malloc (sizeof (CCSStringList))
293- listStart.data = <CCSString *> stringStart
294- listStart.next = NULL
295- prev = listStart
296-
297- for l in list[1:]:
298- stringStart = <CCSString *> malloc (sizeof (CCSString))
299-
300- stringStart.value = <char *> strdup (l)
301-
302- stringList = <CCSStringList *> malloc (sizeof (CCSStringList))
303- stringList.data = stringStart
304- stringList.next = NULL
305- prev.next = stringList
306- prev = stringList
307-
308- return listStart
309
310 cdef object StringListToList (CCSList * stringList):
311 cdef CCSString * string
312
313=== modified file 'compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml'
314--- compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml 2012-08-22 09:15:24 +0000
315+++ compizconfig/integration/gnome/gsettings/org.compiz.integrated.gschema.xml 2012-09-09 12:57:20 +0000
316@@ -2,19 +2,19 @@
317 <schemalist>
318 <schema path="/org/compiz/integrated/" id="org.compiz.integrated">
319 <key type="b" name="display-all-workspaces">
320- <default>false</default>
321+ <default>true</default>
322 </key>
323 <key type="s" name="exec">
324- <default>""</default>
325+ <default>"gnome-terminal"</default>
326 </key>
327 <key type="s" name="command-window-screenshot">
328- <default>""</default>
329+ <default>"gnome-screenshot -w"</default>
330 </key>
331 <key type="s" name="command-screenshot">
332- <default>""</default>
333+ <default>"gnome-screenshot"</default>
334 </key>
335 <key type="s" name="command-terminal">
336- <default>""</default>
337+ <default>"gnome-terminal"</default>
338 </key>
339 <key type="as" name="run-command-12">
340 <default>["Disabled"]</default>
341@@ -89,22 +89,22 @@
342 <default>""</default>
343 </key>
344 <key type="as" name="run-command-terminal">
345- <default>["Disabled"]</default>
346+ <default>["&lt;Control&gt;&lt;Alt&gt;t"]</default>
347 </key>
348 <key type="as" name="run-command-window-screenshot">
349- <default>["Disabled"]</default>
350+ <default>["&lt;Alt&gt;Print"]</default>
351 </key>
352 <key type="as" name="run-command-screenshot">
353- <default>["Disabled"]</default>
354+ <default>["Print"]</default>
355 </key>
356 <key type="as" name="panel-main-menu">
357- <default>["Disabled"]</default>
358+ <default>["&lt;Alt&gt;F1"]</default>
359 </key>
360 <key type="as" name="panel-run-dialog">
361- <default>["Disabled"]</default>
362+ <default>["&lt;Alt&gt;F2"]</default>
363 </key>
364 <key type="as" name="show-hud">
365- <default>["Alt"]</default>
366+ <default>["&lt;Alt&gt;"]</default>
367 </key>
368 </schema>
369 </schemalist>
370
371=== modified file 'compizconfig/integration/gnome/include/ccs_gnome_integration_constants.h'
372--- compizconfig/integration/gnome/include/ccs_gnome_integration_constants.h 2012-08-22 09:15:24 +0000
373+++ compizconfig/integration/gnome/include/ccs_gnome_integration_constants.h 2012-09-09 12:57:20 +0000
374@@ -201,7 +201,7 @@
375 * C doesn't have a concept of "constants" setting
376 * the array size ...
377 */
378-#define CCS_GNOME_INTEGRATED_SETTINGS_LIST_SIZE 119
379+#define CCS_GNOME_INTEGRATED_SETTINGS_LIST_SIZE 120
380
381 typedef struct _CCSGNOMEIntegratedSettingsList
382 {
383
384=== modified file 'compizconfig/libcompizconfig/cmake/FindCompizConfig.cmake'
385--- compizconfig/libcompizconfig/cmake/FindCompizConfig.cmake 2010-04-23 12:43:51 +0000
386+++ compizconfig/libcompizconfig/cmake/FindCompizConfig.cmake 2012-09-09 12:57:20 +0000
387@@ -2,7 +2,7 @@
388 #
389 # FindCompizConfig
390 #
391-# This module finds LibCompizConfig (www.compiz.org). It uses FindPkgConfig to
392+# This module finds LibCompizConfig (https://launchpad.net/compiz). It uses FindPkgConfig to
393 # locate CompizConfig and adds the CompizConfig CMake module path to the CMake
394 # module path. It also loads the LibCompizConfigDefaults that sets all variables
395 # to compile Compiz modules.
396
397=== modified file 'compizconfig/libcompizconfig/include/CMakeLists.txt'
398--- compizconfig/libcompizconfig/include/CMakeLists.txt 2012-07-08 07:24:06 +0000
399+++ compizconfig/libcompizconfig/include/CMakeLists.txt 2012-09-09 12:57:20 +0000
400@@ -4,6 +4,7 @@
401 ccs-list.h
402 ccs-object.h
403 ccs-string.h
404+ ccs-setting-types.h
405 ccs.h
406 )
407
408
409=== modified file 'compizconfig/libcompizconfig/src/CMakeLists.txt'
410--- compizconfig/libcompizconfig/src/CMakeLists.txt 2012-07-26 23:11:25 +0000
411+++ compizconfig/libcompizconfig/src/CMakeLists.txt 2012-09-09 12:57:20 +0000
412@@ -51,6 +51,11 @@
413 endif (HAVE_INOTIFY)
414
415 add_library (
416+ ccs_settings_upgrade_internal STATIC
417+ ccs_settings_upgrade_internal.c
418+)
419+
420+add_library (
421 compizconfig SHARED
422 ${LIBCOMPIZCONFIG_FILES}
423 )
424@@ -65,7 +70,11 @@
425 )
426
427 target_link_libraries (
428- compizconfig ${LIBCOMPIZCONFIG_LIBRARIES} m
429+ compizconfig
430+ ${LIBCOMPIZCONFIG_LIBRARIES}
431+ m
432+ dl
433+ ccs_settings_upgrade_internal
434 )
435
436 #
437
438=== added file 'compizconfig/libcompizconfig/src/ccs_settings_upgrade_internal.c'
439--- compizconfig/libcompizconfig/src/ccs_settings_upgrade_internal.c 1970-01-01 00:00:00 +0000
440+++ compizconfig/libcompizconfig/src/ccs_settings_upgrade_internal.c 2012-09-09 12:57:20 +0000
441@@ -0,0 +1,168 @@
442+/*
443+ * Compiz configuration system library
444+ *
445+ * Copyright (C) 2012 Canonical Ltd.
446+ *
447+ * This library is free software; you can redistribute it and/or
448+ * modify it under the terms of the GNU Lesser General Public
449+ * License as published by the Free Software Foundation; either
450+ * version 2.1 of the License, or (at your option) any later version.
451+
452+ * This library is distributed in the hope that it will be useful,
453+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
454+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
455+ * Lesser General Public License for more details.
456+
457+ * You should have received a copy of the GNU Lesser General Public
458+ * License along with this library; if not, write to the Free Software
459+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
460+ *
461+ * Authored By:
462+ * Sam Spilsbury <sam.spilsbury@canonical.com>
463+ */
464+
465+#include "ccs_settings_upgrade_internal.h"
466+#include <string.h>
467+#include <errno.h>
468+#include <stdlib.h>
469+#include <stdio.h>
470+
471+typedef Bool (*CCSProcessTokenizedUpgradeFileFunc) (const char *name,
472+ int length,
473+ const char *tokenOne,
474+ const char *tokenTwo,
475+ const char *tokenThree,
476+ int foundNumber,
477+ void *userData);
478+
479+static Bool
480+isUpgrade (const char *name,
481+ int length,
482+ const char *tokenOne,
483+ const char *tokenTwo,
484+ const char *tokenThree,
485+ int foundNumber,
486+ void *userData)
487+{
488+ static const char *UPGRADE = "upgrade";
489+ static const unsigned int UPGRADE_STR_LEN = 7;
490+
491+ if (strncmp (tokenThree, UPGRADE, UPGRADE_STR_LEN))
492+ return FALSE;
493+
494+ return TRUE;
495+}
496+
497+typedef struct _FillDomainNumAndProfileData
498+{
499+ char **domain;
500+ char **profile;
501+ unsigned int *num;
502+} FillDomainNumAndProfileData;
503+
504+static int
505+fillDomainNumAndProfile (const char *name,
506+ int length,
507+ const char *tokenOne,
508+ const char *tokenTwo,
509+ const char *tokenThree,
510+ int foundNumber,
511+ void *userData)
512+{
513+ FillDomainNumAndProfileData *data = (FillDomainNumAndProfileData *) userData;
514+
515+ *data->domain = strndup (name, length - (strlen (tokenOne) + 1));
516+
517+ /* profile.n.upgrade */
518+ *data->profile = strndup (tokenOne, strlen (tokenOne) - (strlen (tokenTwo) + 1));
519+ *data->num = foundNumber;
520+
521+ return 1;
522+}
523+
524+static Bool
525+ccsDetokenizeUpgradeDomainAndExecuteUserFunc (const char *name,
526+ CCSProcessTokenizedUpgradeFileFunc func,
527+ void *userData)
528+{
529+ int length = strlen (name);
530+ const char *tok = name;
531+ Bool success = FALSE;
532+
533+ /* Keep removing domains and other bits
534+ * until we hit a number that we can parse */
535+ while (tok)
536+ {
537+ long int numTmp = 0;
538+ char *nexttok = strchr (tok, '.');
539+ char *nextnexttok = NULL;
540+ char *bit = NULL;
541+
542+ if (!nexttok)
543+ return FALSE;
544+
545+ nexttok++;
546+ nextnexttok = strchr (nexttok, '.');
547+
548+ if (!nextnexttok)
549+ return FALSE;
550+
551+ nextnexttok++;
552+ bit = strndup (nexttok, strlen (nexttok) - (strlen (nextnexttok) + 1));
553+
554+ if (sscanf (bit, "%ld", &numTmp) == 1)
555+ {
556+ if ((*func) (name,
557+ length,
558+ tok,
559+ nexttok,
560+ nextnexttok,
561+ numTmp,
562+ userData))
563+ success = TRUE;
564+ }
565+ else if (errno)
566+ perror ("sscanf");
567+
568+ tok = nexttok;
569+ free (bit);
570+
571+ if (success)
572+ return TRUE;
573+ }
574+
575+ return FALSE;
576+}
577+
578+Bool
579+ccsUpgradeGetDomainNumAndProfile (const char *name,
580+ char **domain,
581+ unsigned int *num,
582+ char **profile)
583+{
584+ FillDomainNumAndProfileData data =
585+ {
586+ domain,
587+ profile,
588+ num
589+ };
590+
591+ return ccsDetokenizeUpgradeDomainAndExecuteUserFunc (name, fillDomainNumAndProfile, (void *) &data);
592+}
593+
594+int
595+ccsUpgradeNameFilter (const char *name)
596+{
597+ Bool result = FALSE;
598+ int length = strlen (name);
599+
600+ if (length < 7)
601+ return 0;
602+
603+ result = ccsDetokenizeUpgradeDomainAndExecuteUserFunc (name, isUpgrade, NULL);
604+
605+ if (result)
606+ return 1;
607+
608+ return 0;
609+}
610
611=== added file 'compizconfig/libcompizconfig/src/ccs_settings_upgrade_internal.h'
612--- compizconfig/libcompizconfig/src/ccs_settings_upgrade_internal.h 1970-01-01 00:00:00 +0000
613+++ compizconfig/libcompizconfig/src/ccs_settings_upgrade_internal.h 2012-09-09 12:57:20 +0000
614@@ -0,0 +1,41 @@
615+/*
616+ * Compiz configuration system library
617+ *
618+ * Copyright (C) 2012 Canonical Ltd.
619+ *
620+ * This library is free software; you can redistribute it and/or
621+ * modify it under the terms of the GNU Lesser General Public
622+ * License as published by the Free Software Foundation; either
623+ * version 2.1 of the License, or (at your option) any later version.
624+
625+ * This library is distributed in the hope that it will be useful,
626+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
627+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
628+ * Lesser General Public License for more details.
629+
630+ * You should have received a copy of the GNU Lesser General Public
631+ * License along with this library; if not, write to the Free Software
632+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
633+ *
634+ * Authored By:
635+ * Sam Spilsbury <sam.spilsbury@canonical.com>
636+ */
637+#ifndef _COMPIZCONFIG_CCS_SETTINGS_UPGRADE_INTERNAL_H
638+#define _COMPIZCONFIG_CCS_SETTINGS_UPGRADE_INTERNAL_H
639+
640+#include "ccs-defs.h"
641+
642+COMPIZCONFIG_BEGIN_DECLS
643+
644+Bool
645+ccsUpgradeGetDomainNumAndProfile (const char *name,
646+ char **domain,
647+ unsigned int *num,
648+ char **profile);
649+
650+int
651+ccsUpgradeNameFilter (const char *name);
652+
653+COMPIZCONFIG_END_DECLS
654+
655+#endif
656
657=== modified file 'compizconfig/libcompizconfig/src/main.c'
658--- compizconfig/libcompizconfig/src/main.c 2012-08-17 07:33:02 +0000
659+++ compizconfig/libcompizconfig/src/main.c 2012-09-09 12:57:20 +0000
660@@ -38,6 +38,7 @@
661
662 #include "ccs-private.h"
663 #include "iniparser.h"
664+#include "ccs_settings_upgrade_internal.h"
665
666 static void * wrapRealloc (void *o, void *a , size_t b)
667 {
668@@ -1880,9 +1881,12 @@
669 }
670 case TypeList:
671 {
672- to->forList.listInfo = calloc (1, sizeof (CCSSettingInfo));
673-
674- copyInfo (from->forList.listInfo, to->forList.listInfo, from->forList.listType);
675+ if (from->forList.listInfo)
676+ {
677+ to->forList.listInfo = calloc (1, sizeof (CCSSettingInfo));
678+
679+ copyInfo (from->forList.listInfo, to->forList.listInfo, from->forList.listType);
680+ }
681
682 break;
683 }
684@@ -1936,18 +1940,26 @@
685 static void
686 copySetting (CCSSetting *from, CCSSetting *to)
687 {
688- memcpy (to, from, sizeof (CCSSetting));
689-
690- ccsObjectInit (from, &ccsDefaultObjectAllocator);
691-
692 /* Allocate a new private ptr for the new setting */
693 CCSSettingPrivate *ccsPrivate = calloc (1, sizeof (CCSSettingPrivate));
694
695 ccsObjectSetPrivate (to, (CCSPrivate *) ccsPrivate);
696
697+ unsigned int i = 0;
698+
699+ /* copy interfaces */
700+ for (; i < from->object.n_interfaces; ++i)
701+ ccsObjectAddInterface (to,
702+ from->object.interfaces[i],
703+ from->object.interface_types[i]);
704+
705 CCSSettingPrivate *fromPrivate = (CCSSettingPrivate *) ccsObjectGetPrivate (from);
706 CCSSettingPrivate *toPrivate = (CCSSettingPrivate *) ccsObjectGetPrivate (to);
707
708+ /* copy from fromPrivate to toPrivate for now, and replace all
709+ * fields that should be replaced */
710+ memcpy (toPrivate, fromPrivate, sizeof (CCSSettingPrivate));
711+
712 if (fromPrivate->name)
713 toPrivate->name = strdup (fromPrivate->name);
714 if (fromPrivate->shortDesc)
715@@ -1979,7 +1991,7 @@
716 toPrivate->defaultValue.parent = to;
717 toPrivate->privatePtr = NULL;
718
719- (to)->object.refcnt = 1;
720+ ccsSettingRef (to);
721 }
722
723 static void
724@@ -4595,9 +4607,11 @@
725 {
726 CCSSetting *tempSetting = (CCSSetting *) sl->data;
727 CCSSetting *setting;
728-
729- setting = ccsFindSetting (ccsSettingGetParent (tempSetting), ccsSettingGetName (tempSetting));
730-
731+ CCSPlugin *plugin = ccsSettingGetParent (tempSetting);
732+ const char *name = ccsSettingGetName (tempSetting);
733+
734+ setting = ccsFindSetting (plugin, name);
735+
736 if (setting)
737 {
738 if (ccsSettingGetType (setting) != TypeList)
739@@ -4658,8 +4672,10 @@
740 {
741 CCSSetting *tempSetting = (CCSSetting *) sl->data;
742 CCSSetting *setting;
743+ CCSPlugin *plugin = ccsSettingGetParent (tempSetting);
744+ const char *name = ccsSettingGetName (tempSetting);
745
746- setting = ccsFindSetting (ccsSettingGetParent (tempSetting), ccsSettingGetName (tempSetting));
747+ setting = ccsFindSetting (plugin, name);
748
749 if (setting)
750 {
751@@ -4715,8 +4731,10 @@
752 {
753 CCSSetting *tempSetting = (CCSSetting *) sl->data;
754 CCSSetting *setting;
755-
756- setting = ccsFindSetting (ccsSettingGetParent (tempSetting), ccsSettingGetName (tempSetting));
757+ CCSPlugin *plugin = ccsSettingGetParent (tempSetting);
758+ const char *name = ccsSettingGetName (tempSetting);
759+
760+ setting = ccsFindSetting (plugin, name);
761
762 if (setting)
763 {
764@@ -4760,161 +4778,84 @@
765 static int
766 upgradeNameFilter (const struct dirent *name)
767 {
768- int length = strlen (name->d_name);
769- char *uname, *tok;
770-
771- if (length < 7)
772- return 0;
773-
774- uname = tok = strdup (name->d_name);
775-
776- /* Keep removing domains and other bits
777- * until we hit a number that we can parse */
778- while (tok)
779- {
780- long int num = 0;
781- char *nexttok = strchr (tok, '.') + 1;
782- char *nextnexttok = strchr (nexttok, '.') + 1;
783- char *end;
784- char *bit = strndup (nexttok, strlen (nexttok) - (strlen (nextnexttok) + 1));
785-
786- /* FIXME: That means that the number can't be a zero */
787- errno = 0;
788- num = strtol (bit, &end, 10);
789-
790- if (!(errno != 0 && num == 0) &&
791- end != bit)
792- {
793- free (bit);
794-
795- /* Check if the next token after the number
796- * is .upgrade */
797-
798- if (strncmp (nextnexttok, "upgrade", 7))
799- return 0;
800- break;
801- }
802- else if (errno)
803- perror ("strtol");
804-
805- tok = nexttok;
806-
807- free (bit);
808- }
809-
810- free (uname);
811-
812- return 1;
813-}
814+ return ccsUpgradeNameFilter (name->d_name);
815+}
816+
817+void
818+ccsFreeUpgrade (CCSSettingsUpgrade *upgrade)
819+{
820+ if (upgrade->profile)
821+ free (upgrade->profile);
822+
823+ if (upgrade->domain)
824+ free (upgrade->domain);
825+
826+ if (upgrade->file)
827+ free (upgrade->file);
828+
829+ free (upgrade);
830+}
831
832 /*
833 * Process a filename into the properties
834 * for a settings upgrade
835 * eg
836- *
837+ *
838 * org.freedesktop.compiz.Default.01.upgrade
839- *
840+ *
841 * gives us:
842 * domain: org.freedesktop.compiz
843 * number: 1
844 * profile: Default
845- *
846+ *
847 */
848 CCSSettingsUpgrade *
849-ccsSettingsUpgradeNew (char *path, char *name)
850+ccsSettingsUpgradeNew (char *path, const char *name)
851 {
852 CCSSettingsUpgrade *upgrade = calloc (1, sizeof (CCSSettingsUpgrade));
853- int length = strlen (name);
854- char *uname, *tok;
855+ char *upgradeName = strdup (name);
856 unsigned int fnlen = strlen (path) + strlen (name) + 1;
857
858 upgrade->file = calloc (fnlen + 1, sizeof (char));
859 sprintf (upgrade->file, "%s/%s", path, name);
860
861- uname = tok = strdup (name);
862+ upgradeName = strdup (name);
863
864- /* Keep removing domains and other bits
865- * until we hit a number that we can parse */
866- while (tok)
867+ if (!ccsUpgradeGetDomainNumAndProfile (upgradeName,
868+ &upgrade->domain,
869+ &upgrade->num,
870+ &upgrade->profile))
871 {
872- long int num = 0;
873- char *nexttok = strchr (tok, '.') + 1;
874- char *nextnexttok = strchr (nexttok, '.') + 1;
875- char *end;
876- char *bit = strndup (nexttok, strlen (nexttok) - (strlen (nextnexttok) + 1));
877-
878- /* FIXME: That means that the number can't be a zero */
879- errno = 0;
880- num = strtol (bit, &end, 10);
881-
882- if (!(errno != 0 && num == 0) &&
883- end != bit)
884- {
885- upgrade->domain = strndup (uname, length - (strlen (tok) + 1));
886- upgrade->num = num;
887-
888- /* profile.n.upgrade */
889- upgrade->profile = strndup (tok, strlen (tok) - (strlen (nexttok) + 1));
890- free (bit);
891- break;
892- }
893- else if (errno)
894- perror ("strtol");
895-
896- tok = nexttok;
897-
898- free (bit);
899+ ccsFreeUpgrade (upgrade);
900+ upgrade = NULL;
901 }
902-
903- free (uname);
904-
905+
906+ free (upgradeName);
907+
908 return upgrade;
909 }
910
911-Bool
912-ccsCheckForSettingsUpgradeDefault (CCSContext *context)
913+static FILE *
914+ccsGetDoneSettingsUpgradeFile (const char *home)
915 {
916- struct dirent **nameList;
917- int nFile, i;
918- char *path = DATADIR "/compizconfig/upgrades/";
919 char *dupath = NULL;
920- FILE *completedUpgrades;
921+ FILE *completedUpgrades = NULL;
922+
923+ if (asprintf (&dupath, "%s/.config/compiz-1/compizconfig/done_upgrades", home) == -1)
924+ return NULL;
925+
926+ completedUpgrades = fopen (dupath, "a+");
927+ free (dupath);
928+
929+ return completedUpgrades;
930+}
931+
932+static char *
933+ccsReadCompletedUpgradesIntoString (FILE *completedUpgrades)
934+{
935 char *cuBuffer;
936 unsigned int cuSize;
937 size_t cuReadSize;
938- char *home = getenv ("HOME");
939-
940- if (!home)
941- return FALSE;
942-
943- if (asprintf (&dupath, "%s/.config/compiz-1/compizconfig/done_upgrades", home) == -1)
944- return FALSE;
945-
946- completedUpgrades = fopen (dupath, "a+");
947-
948- if (!path)
949- {
950- free (dupath);
951- fclose (completedUpgrades);
952- return FALSE;
953- }
954-
955- nFile = scandir (path, &nameList, upgradeNameFilter, alphasort);
956- if (nFile <= 0)
957- {
958- free (dupath);
959- fclose (completedUpgrades);
960- return FALSE;
961- }
962-
963- if (!completedUpgrades)
964- {
965- free (nameList);
966- free (dupath);
967- fclose (completedUpgrades);
968- ccsWarning ("Error opening done_upgrades");
969- return FALSE;
970- }
971
972 fseek (completedUpgrades, 0, SEEK_END);
973 cuSize = ftell (completedUpgrades);
974@@ -4928,38 +4869,118 @@
975
976 cuBuffer[cuSize] = '\0';
977
978+ return cuBuffer;
979+}
980+
981+static unsigned int
982+ccsGetUpgradeFilesForProcessing (const char *upgradePath,
983+ struct dirent ***passedNameList)
984+{
985+ struct dirent **nameList = NULL;
986+ unsigned int nFile = scandir (upgradePath, &nameList, upgradeNameFilter, alphasort);
987+
988+ if (nFile <= 0)
989+ return 0;
990+
991+ *passedNameList = nameList;
992+
993+ return nFile;
994+}
995+
996+static Bool
997+ccsShouldSkipUpgrade (const char *upgrade,
998+ const char *skipBuffer)
999+{
1000+ char *matched = strstr (skipBuffer, upgrade);
1001+
1002+ if (matched != NULL)
1003+ {
1004+ ccsDebug ("Skipping upgrade %s", upgrade);
1005+ return TRUE;
1006+ }
1007+
1008+ return FALSE;
1009+}
1010+
1011+static void
1012+ccsProcessUpgradeOnce (CCSContext *context,
1013+ CCSSettingsUpgrade *upgrade,
1014+ const char *upgradeName,
1015+ FILE *completedUpgrades)
1016+{
1017+ ccsDebug ("Processing upgrade %s\n profile: %s\n number: %i\n domain: %s",
1018+ upgradeName,
1019+ upgrade->profile,
1020+ upgrade->num,
1021+ upgrade->domain);
1022+
1023+ ccsProcessUpgrade (context, upgrade);
1024+ ccsWriteChangedSettings (context);
1025+ ccsWriteAutoSortedPluginList (context);
1026+ ccsDebug ("Completed upgrade %s", upgradeName);
1027+
1028+ fprintf (completedUpgrades, "%s\n", upgradeName);
1029+ ccsFreeUpgrade (upgrade);
1030+}
1031+
1032+Bool
1033+ccsCheckForSettingsUpgradeDefault (CCSContext *context)
1034+{
1035+ struct dirent **nameList = NULL;
1036+ int nFile, i;
1037+ char *path = DATADIR "/compizconfig/upgrades/";
1038+ FILE *completedUpgrades;
1039+ char *cuBuffer = NULL;
1040+ char *home = getenv ("HOME");
1041+
1042+ if (!home)
1043+ return FALSE;
1044+
1045+ completedUpgrades = ccsGetDoneSettingsUpgradeFile (home);
1046+
1047+ if (!completedUpgrades)
1048+ return FALSE;
1049+
1050+ cuBuffer = ccsReadCompletedUpgradesIntoString (completedUpgrades);
1051+
1052+ if (!cuBuffer)
1053+ {
1054+ fclose (completedUpgrades);
1055+ ccsWarning ("Error opening done_upgrades");
1056+ return FALSE;
1057+ }
1058+
1059+ nFile = ccsGetUpgradeFilesForProcessing (path, &nameList);
1060+
1061+ if (!nFile || !nameList)
1062+ {
1063+ free (cuBuffer);
1064+ fclose (completedUpgrades);
1065+ return FALSE;
1066+ }
1067+
1068 for (i = 0; i < nFile; i++)
1069 {
1070- char *matched = strstr (cuBuffer, nameList[i]->d_name);
1071- CCSSettingsUpgrade *upgrade;
1072-
1073- if (matched)
1074- {
1075- ccsDebug ("Skipping upgrade %s", nameList[i]->d_name);
1076+ CCSSettingsUpgrade *upgrade = NULL;
1077+ const char *upgradeName = nameList[i]->d_name;
1078+
1079+ if (ccsShouldSkipUpgrade (upgradeName,
1080+ cuBuffer))
1081 continue;
1082- }
1083-
1084- upgrade = ccsSettingsUpgradeNew (path, nameList[i]->d_name);
1085-
1086- ccsDebug ("Processing upgrade %s\nprofile: %s\nnumber: %i\ndomain: %s", nameList[i]->d_name, upgrade->profile, upgrade->num, upgrade->domain);
1087-
1088- ccsProcessUpgrade (context, upgrade);
1089- ccsWriteChangedSettings (context);
1090- ccsWriteAutoSortedPluginList (context);
1091- ccsDebug ("Completed upgrade %s", nameList[i]->d_name);
1092- fprintf (completedUpgrades, "%s\n", nameList[i]->d_name);
1093- free (upgrade->profile);
1094- free (upgrade->domain);
1095- free (upgrade->file);
1096- free (upgrade);
1097+
1098+ upgrade = ccsSettingsUpgradeNew (path, upgradeName);
1099+
1100+ ccsProcessUpgradeOnce (context, upgrade, upgradeName, completedUpgrades);
1101+
1102 free (nameList[i]);
1103 }
1104
1105- free (dupath);
1106 fclose (completedUpgrades);
1107 free (cuBuffer);
1108- free (nameList);
1109-
1110+
1111+ if (nameList != NULL)
1112+ free (nameList);
1113+
1114 return TRUE;
1115 }
1116
1117
1118=== modified file 'compizconfig/libcompizconfig/tests/CMakeLists.txt'
1119--- compizconfig/libcompizconfig/tests/CMakeLists.txt 2012-08-16 10:16:42 +0000
1120+++ compizconfig/libcompizconfig/tests/CMakeLists.txt 2012-09-09 12:57:20 +0000
1121@@ -2,6 +2,7 @@
1122 include_directories (${CMAKE_SOURCE_DIR}/include)
1123 include_directories (${CMAKE_SOURCE_DIR}/tests/shared)
1124 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../../mocks/libcompizconfig)
1125+include_directories (${CMAKE_CURRENT_SOURCE_DIR}/../src)
1126 include_directories (${CMAKE_SOURCE_DIR}/compizconfig/tests)
1127 link_directories (${CMAKE_INSTALL_PREFIX}/lib)
1128 link_directories (${CMAKE_CURRENT_BINARY_DIR}/../../mocks/libcompizconfig)
1129@@ -27,6 +28,9 @@
1130 add_executable (compizconfig_test_ccs_mock_backend_conformance
1131 ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig_test_ccs_mock_backend_conformance.cpp)
1132
1133+add_executable (compizconfig_test_ccs_upgrade_internal
1134+ ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig_test_ccs_settings_upgrade_internal.cpp)
1135+
1136 if (HAVE_PROTOBUF)
1137 set (LIBCOMPIZCONFIG_LIBRARIES
1138 ${LIBCOMPIZCONFIG_LIBRARIES}
1139@@ -98,8 +102,17 @@
1140 compizconfig_ccs_plugin_mock
1141 compizconfig_ccs_setting_mock)
1142
1143+target_link_libraries (compizconfig_test_ccs_upgrade_internal
1144+ ${GTEST_BOTH_LIBRARIES}
1145+ ${GMOCK_LIBRARY}
1146+ ${GMOCK_MAIN_LIBRARY}
1147+ ${CMAKE_THREAD_LIBS_INIT}
1148+ ccs_settings_upgrade_internal
1149+)
1150+
1151 compiz_discover_tests (compizconfig_test_ccs_object COVERAGE compizconfig)
1152 compiz_discover_tests (compizconfig_test_ccs_context COVERAGE compizconfig_ccs_context_mock)
1153 compiz_discover_tests (compizconfig_test_ccs_plugin COVERAGE compizconfig_ccs_plugin_mock)
1154 compiz_discover_tests (compizconfig_test_ccs_setting COVERAGE compizconfig_ccs_setting_mock)
1155 compiz_discover_tests (compizconfig_test_ccs_mock_backend_conformance COVERAGE compizconfig_ccs_backend_mock)
1156+compiz_discover_tests (compizconfig_test_ccs_upgrade_internal COVERAGE ccs_settings_upgrade_internal)
1157
1158=== added file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_settings_upgrade_internal.cpp'
1159--- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_settings_upgrade_internal.cpp 1970-01-01 00:00:00 +0000
1160+++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_settings_upgrade_internal.cpp 2012-09-09 12:57:20 +0000
1161@@ -0,0 +1,70 @@
1162+#include <gtest/gtest.h>
1163+#include <gmock/gmock.h>
1164+
1165+#include "ccs_settings_upgrade_internal.h"
1166+#include "gtest_shared_characterwrapper.h"
1167+
1168+using ::testing::IsNull;
1169+
1170+class CCSSettingsUpgradeInternalTest :
1171+ public ::testing::Test
1172+{
1173+};
1174+
1175+namespace
1176+{
1177+ static const std::string CCS_SETTINGS_UPGRADE_TEST_CORRECT_FILENAME = "org.compiz.general.1.upgrade";
1178+ static const std::string CCS_SETTINGS_UPGRADE_TEST_INCORRECT_FILENAME = "1.upgra";
1179+ static const std::string CCS_SETTINGS_UPGRADE_TEST_CORRECT_DOMAIN = "org.compiz";
1180+ static const std::string CCS_SETTINGS_UPGRADE_TEST_CORRECT_PROFILE = "general";
1181+ static const unsigned int CCS_SETTINGS_UPGRADE_TEST_CORRECT_NUM = 1;
1182+}
1183+
1184+MATCHER(BoolTrue, "Bool True") { if (arg) return true; else return false; }
1185+MATCHER(BoolFalse, "Bool False") { if (!arg) return true; else return false; }
1186+
1187+TEST_F (CCSSettingsUpgradeInternalTest, TestDetokenizeAndSetValues)
1188+{
1189+ char *profileName = NULL;
1190+ char *domainName = NULL;
1191+
1192+ unsigned int num;
1193+
1194+ EXPECT_THAT (ccsUpgradeGetDomainNumAndProfile (CCS_SETTINGS_UPGRADE_TEST_CORRECT_FILENAME.c_str (),
1195+ &domainName,
1196+ &num,
1197+ &profileName), BoolTrue ());
1198+
1199+ CharacterWrapper profileNameC (profileName);
1200+ CharacterWrapper domainNameC (domainName);
1201+
1202+ EXPECT_EQ (CCS_SETTINGS_UPGRADE_TEST_CORRECT_PROFILE, profileName);
1203+ EXPECT_EQ (CCS_SETTINGS_UPGRADE_TEST_CORRECT_DOMAIN, domainName);
1204+ EXPECT_EQ (num, CCS_SETTINGS_UPGRADE_TEST_CORRECT_NUM);
1205+}
1206+
1207+TEST_F (CCSSettingsUpgradeInternalTest, TestDetokenizeAndSetValuesReturnsFalseIfInvalid)
1208+{
1209+ char *profileName = NULL;
1210+ char *domainName = NULL;
1211+
1212+ unsigned int num;
1213+
1214+ EXPECT_THAT (ccsUpgradeGetDomainNumAndProfile (CCS_SETTINGS_UPGRADE_TEST_INCORRECT_FILENAME.c_str (),
1215+ &domainName,
1216+ &num,
1217+ &profileName), BoolFalse ());
1218+
1219+ EXPECT_THAT (profileName, IsNull ());
1220+ EXPECT_THAT (domainName, IsNull ());
1221+}
1222+
1223+TEST_F (CCSSettingsUpgradeInternalTest, TestDetokenizeAndReturnTrueForUpgradeFileName)
1224+{
1225+ EXPECT_THAT (ccsUpgradeNameFilter (CCS_SETTINGS_UPGRADE_TEST_CORRECT_FILENAME.c_str ()), BoolTrue ());
1226+}
1227+
1228+TEST_F (CCSSettingsUpgradeInternalTest, TestDetokenizeAndReturnFalseForNoUpgradeFileName)
1229+{
1230+ EXPECT_THAT (ccsUpgradeNameFilter (CCS_SETTINGS_UPGRADE_TEST_CORRECT_FILENAME.c_str ()), BoolTrue ());
1231+}
1232
1233=== modified file 'debian/changelog'
1234--- debian/changelog 2012-09-07 11:25:34 +0000
1235+++ debian/changelog 2012-09-09 12:57:20 +0000
1236@@ -1,9 +1,12 @@
1237 compiz (1:0.9.8.0-0ubuntu2) UNRELEASED; urgency=low
1238
1239+ * debian/patches/100_expo_layout.patch
1240+ - re-add the expo layout that used to be in precise (LP: #1047067)
1241+ - add some testcases
1242 * debian/python-compizconfig.install
1243 - Install compizconfig-python.pc
1244
1245- -- Sam Spilsbury <sam.spilsbury@canonical.com> Fri, 07 Sep 2012 17:08:53 +0800
1246+ -- Sam Spilsbury <sam.spilsbury@canonical.com> Fri, 07 Sep 2012 18:38:40 +0800
1247
1248 compiz (1:0.9.8.0-0ubuntu1) quantal-proposed; urgency=low
1249
1250
1251=== added file 'debian/patches/100_expo_layout.patch'
1252--- debian/patches/100_expo_layout.patch 1970-01-01 00:00:00 +0000
1253+++ debian/patches/100_expo_layout.patch 2012-09-09 12:57:20 +0000
1254@@ -0,0 +1,2903 @@
1255+Index: ubuntu/plugins/expo/expo.xml.in
1256+===================================================================
1257+--- ubuntu.orig/plugins/expo/expo.xml.in 2012-09-08 11:51:32.971327571 +0800
1258++++ ubuntu/plugins/expo/expo.xml.in 2012-09-08 11:51:33.103328227 +0800
1259+@@ -17,6 +17,7 @@
1260+ <plugin>wobbly</plugin>
1261+ <plugin>animation</plugin>
1262+ <plugin>wallpaper</plugin>
1263++ <plugin>imgpng</plugin>
1264+ </relation>
1265+ </deps>
1266+ <options>
1267+@@ -25,7 +26,7 @@
1268+ <option name="expo_key" type="key">
1269+ <_short>Expo key</_short>
1270+ <_long>Engage wall expo mode key binding</_long>
1271+- <default>&lt;Super&gt;e</default>
1272++ <default>&lt;Super&gt;s</default>
1273+ </option>
1274+ <option name="expo_button" type="button">
1275+ <_short>Expo button</_short>
1276+@@ -35,8 +36,6 @@
1277+ <option name="expo_edge" type="edge">
1278+ <_short>Expo edge</_short>
1279+ <_long>Engage wall expo mode edge binding</_long>
1280+- <default>
1281+- </default>
1282+ </option>
1283+ <option name="double_click_time" type="int">
1284+ <_short>Double click time</_short>
1285+@@ -79,7 +78,7 @@
1286+ <option name="zoom_time" type="float">
1287+ <_short>Zoom time</_short>
1288+ <_long>Duration of the zoomout animation</_long>
1289+- <default>0.5</default>
1290++ <default>0.3</default>
1291+ <min>0.1</min>
1292+ <max>5.0</max>
1293+ <precision>0.1</precision>
1294+@@ -130,10 +129,24 @@
1295+ <_name>Curve</_name>
1296+ </desc>
1297+ </option>
1298++ <option name="x_offset" type="int">
1299++ <_short>X Space</_short>
1300++ <_long> Left Side screen space of expo in pixels</_long>
1301++ <min>-1680</min>
1302++ <max>1680</max>
1303++ <default>64</default>
1304++ </option>
1305++ <option name="y_offset" type="int">
1306++ <_short>Y Space</_short>
1307++ <_long> Top Side screen space of expo in pixels</_long>
1308++ <min>-100</min>
1309++ <max>100</max>
1310++ <default>24</default>
1311++ </option>
1312+ <option name="distance" type="float">
1313+ <_short>Distance</_short>
1314+ <_long>Distance of the expo wall</_long>
1315+- <default>0.0</default>
1316++ <default>0.005</default>
1317+ <min>0.0</min>
1318+ <max>1.0</max>
1319+ <precision>0.01</precision>
1320+@@ -141,7 +154,7 @@
1321+ <option name="vp_distance" type="float">
1322+ <_short>Viewport distance</_short>
1323+ <_long>Distance between viewports</_long>
1324+- <default>0.10</default>
1325++ <default>0.2</default>
1326+ <min>0.0</min>
1327+ <max>1.0</max>
1328+ <precision>0.01</precision>
1329+@@ -192,7 +205,7 @@
1330+ <option name="vp_brightness" type="float">
1331+ <_short>Brightness</_short>
1332+ <_long>Inactive viewport brightness.</_long>
1333+- <default>75.0</default>
1334++ <default>40.0</default>
1335+ <min>0.0</min>
1336+ <max>100.0</max>
1337+ <precision>0.1</precision>
1338+@@ -200,18 +213,28 @@
1339+ <option name="vp_saturation" type="float">
1340+ <_short>Saturation</_short>
1341+ <_long>Inactive viewport saturation.</_long>
1342+- <default>100.0</default>
1343++ <default>40.0</default>
1344+ <min>0.0</min>
1345+ <max>100.0</max>
1346+ <precision>0.1</precision>
1347+ </option>
1348++ <option name="selected_color" type="color">
1349++ <_short>Selected Color</_short>
1350++ <_long>Color to use when highlighting the selected viewport</_long>
1351++ <default>
1352++ <red>0xfbfb</red>
1353++ <green>0x8b8b</green>
1354++ <blue>0x0</blue>
1355++ <alpha>0xffff</alpha>
1356++ </default>
1357++ </option>
1358+ </subgroup>
1359+ <subgroup>
1360+ <short>Reflection</short>
1361+ <option name="reflection" type="bool">
1362+ <_short>Reflection</_short>
1363+ <_long>Show a reflection of the viewports on the ground</_long>
1364+- <default>true</default>
1365++ <default>false</default>
1366+ </option>
1367+ <option name="ground_color1" type="color">
1368+ <_short>Ground color(near)</_short>
1369+@@ -244,7 +267,7 @@
1370+ <option name="scale_factor" type="float">
1371+ <_short>Reflection Scale</_short>
1372+ <_long>Scale factor of the expo wall reflection</_long>
1373+- <default>0.75</default>
1374++ <default>1.0</default>
1375+ <min>0.0</min>
1376+ <max>2.0</max>
1377+ <precision>0.01</precision>
1378+Index: ubuntu/plugins/expo/src/expo.cpp
1379+===================================================================
1380+--- ubuntu.orig/plugins/expo/src/expo.cpp 2012-09-08 11:51:02.279175377 +0800
1381++++ ubuntu/plugins/expo/src/expo.cpp 2012-09-08 15:18:15.744829608 +0800
1382+@@ -27,6 +27,8 @@
1383+
1384+ #include "expo.h"
1385+ #include "click-threshold.h"
1386++#include "wall-offset.h"
1387++#include "windows-on-viewport.h"
1388+ #include <math.h>
1389+ #ifndef USE_GLES
1390+ #include <GL/glu.h>
1391+@@ -73,11 +75,10 @@
1392+
1393+ if (dndState == DnDDuring || dndState == DnDStart)
1394+ {
1395+- if (dndWindow)
1396++ if (dndWindows.size ())
1397+ finishWindowMovement ();
1398+
1399+ dndState = DnDNone;
1400+- dndWindow = NULL;
1401+
1402+ action->setState (action->state () & CompAction::StateInitButton);
1403+ cScreen->damageScreen ();
1404+@@ -113,7 +114,6 @@
1405+ clickTime = 0;
1406+
1407+ dndState = DnDNone;
1408+- dndWindow = NULL;
1409+
1410+ selectedVp = screen->vp ();
1411+ lastSelectedVp = screen->vp ();
1412+@@ -156,8 +156,8 @@
1413+ else
1414+ vpUpdateMode = VPUpdateMouseOver;
1415+
1416+- dndState = DnDNone;
1417+- dndWindow = NULL;
1418++ dndState = DnDNone;
1419++ dndWindows.clear ();
1420+
1421+ screen->removeAction (&optionGetDndButton ());
1422+ screen->removeAction (&optionGetExitButton ());
1423+@@ -202,6 +202,8 @@
1424+ if (!expoMode)
1425+ return false;
1426+
1427++ lastSelectedVp = selectedVp;
1428++
1429+ newX = selectedVp.x () + 1;
1430+ newY = selectedVp.y ();
1431+
1432+@@ -225,7 +227,7 @@
1433+ CompAction::State state,
1434+ CompOption::Vector& options)
1435+ {
1436+- int newX, newY;
1437++ unsigned int newX, newY;
1438+ Window xid = CompOption::getIntOptionNamed (options, "root", 0);
1439+ if (xid != screen->root ())
1440+ return false;
1441+@@ -272,53 +274,39 @@
1442+ void
1443+ ExpoScreen::finishWindowMovement ()
1444+ {
1445+- dndWindow->syncPosition ();
1446+- dndWindow->ungrabNotify ();
1447+-
1448+- screen->moveViewport (screen->vp ().x () - selectedVp.x (),
1449+- screen->vp ().y () - selectedVp.y (), true);
1450+-
1451+- /* update saved window attributes in case we moved the
1452+- window to a new viewport */
1453+- if (dndWindow->saveMask () & CWX)
1454+- {
1455+- dndWindow->saveWc ().x = dndWindow->saveWc ().x % screen->width ();
1456+- if (dndWindow->saveWc ().x < 0)
1457+- dndWindow->saveWc ().x += screen->width ();
1458+- }
1459+- if (dndWindow->saveMask () & CWY)
1460++ foreach (CompWindow *dndWindow, dndWindows)
1461+ {
1462+- dndWindow->saveWc ().y = dndWindow->saveWc ().y % screen->height ();
1463+- if (dndWindow->saveWc ().y < 0)
1464+- dndWindow->saveWc ().y += screen->height ();
1465+- }
1466+-
1467+- /* update window attibutes to make sure a moved maximized window
1468+- is properly snapped to the work area */
1469+- if (dndWindow->state () & MAXIMIZE_STATE)
1470+- dndWindow->updateAttributes (CompStackingUpdateModeNone);
1471+-
1472+-#if 0 /* FIXME: obsolete in the meantime? */
1473+- {
1474+- int lastOutput;
1475+- int centerX, centerY;
1476++ if (dndWindow->grabbed ())
1477++ {
1478++ dndWindow->syncPosition ();
1479++ dndWindow->ungrabNotify ();
1480+
1481+- /* make sure we snap to the correct output */
1482+- lastOutput = s->currentOutputDev;
1483+- centerX = (WIN_X (w) + WIN_W (w) / 2) % s->width;
1484+- if (centerX < 0)
1485+- centerX += s->width;
1486+- centerY = (WIN_Y (w) + WIN_H (w) / 2) % s->height;
1487+- if (centerY < 0)
1488+- centerY += s->height;
1489++ screen->updateGrab (grabIndex, None);
1490+
1491+- s->currentOutputDev = outputDeviceForPoint (s, centerX, centerY);
1492++ screen->moveViewport (screen->vp ().x () - selectedVp.x (),
1493++ screen->vp ().y () - selectedVp.y (), true);
1494+
1495+- updateWindowAttributes (w, CompStackingUpdateModeNone);
1496++ /* update saved window attributes in case we moved the
1497++ window to a new viewport */
1498++ if (dndWindow->saveMask () & CWX)
1499++ {
1500++ dndWindow->saveWc ().x = dndWindow->saveWc ().x % screen->width ();
1501++ if (dndWindow->saveWc ().x < 0)
1502++ dndWindow->saveWc ().x += screen->width ();
1503++ }
1504++ if (dndWindow->saveMask () & CWY)
1505++ {
1506++ dndWindow->saveWc ().y = dndWindow->saveWc ().y % screen->height ();
1507++ if (dndWindow->saveWc ().y < 0)
1508++ dndWindow->saveWc ().y += screen->height ();
1509++ }
1510+
1511+- s->currentOutputDev = lastOutput;
1512++ /* update window attibutes to make sure a moved maximized window
1513++ is properly snapped to the work area */
1514++ if (dndWindow->state () & MAXIMIZE_STATE)
1515++ dndWindow->updateAttributes (CompStackingUpdateModeNone);
1516++ }
1517+ }
1518+-#endif
1519+ }
1520+
1521+ void
1522+@@ -402,6 +390,80 @@
1523+ screen->handleEvent (event);
1524+ }
1525+
1526++bool
1527++ExpoWindow::dragged () const
1528++{
1529++ ExpoScreen *es = ExpoScreen::get (screen);
1530++
1531++ return std::find (es->dndWindows.begin (), es->dndWindows.end (), window) != es->dndWindows.end ();
1532++}
1533++
1534++const compiz::window::Geometry &
1535++ExpoWindow::absoluteGeometry () const
1536++{
1537++ const compiz::window::Geometry &relativeGeometry (window->geometry ());
1538++ mAbsoluteGeometry.set ((screen->vp ().x () * screen->width ()) + relativeGeometry.x (),
1539++ (screen->vp ().y () * screen->height ()) + relativeGeometry.y (),
1540++ relativeGeometry.width (),
1541++ relativeGeometry.height (),
1542++ relativeGeometry.border ());
1543++
1544++ return mAbsoluteGeometry;
1545++}
1546++
1547++bool
1548++ExpoWindow::isDesktopOrDock () const
1549++{
1550++ return window->type () == CompWindowTypeDesktopMask ||
1551++ window->type () == CompWindowTypeDockMask;
1552++}
1553++
1554++namespace cei = compiz::expo::impl;
1555++
1556++cei::CompizClientListGenerator::CompizClientListGenerator (CompScreen *screen) :
1557++ mScreen (screen),
1558++ mClientList (&mScreen->clientList (true)),
1559++ mClientListIterator (mClientList->begin ())
1560++{
1561++}
1562++
1563++compiz::expo::ViewportMemberWindow *
1564++cei::CompizClientListGenerator::nextClient ()
1565++{
1566++ if (mClientListIterator == mClientList->end ())
1567++ return NULL;
1568++
1569++ compiz::expo::ViewportMemberWindow *vpMemberWindow = ExpoWindow::get (*mClientListIterator);
1570++
1571++ ++mClientListIterator;
1572++
1573++ return vpMemberWindow;
1574++}
1575++
1576++bool
1577++ExpoScreen::windowsOnVp (compiz::expo::ClientListGenerator &clientList,
1578++ CompPoint &p,
1579++ const CompPoint &unprojectedCursor,
1580++ const CompSize &screenSize,
1581++ CompScreen *screen)
1582++{
1583++ return false;
1584++}
1585++
1586++namespace
1587++{
1588++ void fillInNewViewportActivityData (unsigned int vpCount,
1589++ std::vector <float> &vpActivity)
1590++ {
1591++ if (vpActivity.size () < vpCount)
1592++ {
1593++ vpActivity.resize (vpCount);
1594++ foreach (float& activity, vpActivity)
1595++ activity = 1.0f;
1596++ }
1597++ }
1598++}
1599++
1600+ void
1601+ ExpoScreen::preparePaint (int msSinceLastPaint)
1602+ {
1603+@@ -412,33 +474,42 @@
1604+ else
1605+ expoCam = MAX (0.0, expoCam - val);
1606+
1607+- if (expoCam)
1608++ if (dndState == DnDDuring)
1609+ {
1610+- unsigned int i, j, vp;
1611+- unsigned int vpCount = screen->vpSize ().width () *
1612+- screen->vpSize ().height ();
1613++ foreach (CompWindow *w, dndWindows)
1614++ ExpoWindow::get (w)->dndOpacity = MIN (1.0, ExpoWindow::get (w)->dndOpacity + val);
1615++ }
1616++ else if (dndState == DnDNone)
1617++ {
1618++ CompWindowList::iterator it = dndWindows.begin ();
1619+
1620+- if (vpActivity.size () < vpCount)
1621++ while (it != dndWindows.end ())
1622+ {
1623+- vpActivity.resize (vpCount);
1624+- foreach (float& activity, vpActivity)
1625+- activity = 1.0f;
1626+- }
1627++ ExpoWindow::get ((*it))->dndOpacity = MAX (0.0, ExpoWindow::get ((*it))->dndOpacity - val);
1628+
1629+- for (i = 0; i < (unsigned int) screen->vpSize ().width (); i++)
1630+- {
1631+- for (j = 0; j < (unsigned int) screen->vpSize ().height (); j++)
1632++ if (ExpoWindow::get ((*it))->dndOpacity <= 0.0f)
1633+ {
1634+- vp = (j * screen->vpSize ().width ()) + i;
1635+-
1636+- if (CompPoint (i, j) == selectedVp)
1637+- vpActivity[vp] = MIN (1.0, vpActivity[vp] + val);
1638+- else
1639+- vpActivity[vp] = MAX (0.0, vpActivity[vp] - val);
1640++ dndWindows.erase (it);
1641++ it = dndWindows.begin ();
1642+ }
1643++ else
1644++ it++;
1645+ }
1646++ }
1647+
1648+- for (i = 0; i < 360; i++)
1649++ if (expoCam)
1650++ {
1651++ unsigned int vpCount = compiz::expo::countViewports (screen->vpSize ());
1652++
1653++ fillInNewViewportActivityData (vpCount, vpActivity);
1654++
1655++ for (unsigned int i = 0; i < vpCount; i++)
1656++ if (vpActive[i])
1657++ vpActivity[i] = MIN (1.0, vpActivity[i] + val);
1658++ else
1659++ vpActivity[i] = MAX (0.0, vpActivity[i] - val);
1660++
1661++ for (int i = 0; i < 360; i++)
1662+ {
1663+ float fi = (float) i;
1664+
1665+@@ -509,6 +580,31 @@
1666+ cScreen->paint (outputs, mask);
1667+ }
1668+
1669++namespace
1670++{
1671++ void updateViewportActiveStates (CompScreen *screen)
1672++ {
1673++ ExpoScreen *es = ExpoScreen::get (screen);
1674++
1675++ unsigned int vpCount = compiz::expo::countViewports (screen->vpSize ());
1676++ fillInNewViewportActivityData (vpCount, es->vpActivity);
1677++
1678++ for (int i = 0; i < screen->vpSize ().width (); i++)
1679++ {
1680++ for (int j = 0; j < screen->vpSize ().height (); j++)
1681++ {
1682++ compiz::expo::impl::CompizClientListGenerator clientList (screen);
1683++
1684++ compiz::expo::activeViewportsForMembers (clientList,
1685++ es->newCursor,
1686++ screen->vpSize (),
1687++ *screen,
1688++ es->vpActive);
1689++ }
1690++ }
1691++ }
1692++}
1693++
1694+ void
1695+ ExpoScreen::donePaint ()
1696+ {
1697+@@ -539,6 +635,11 @@
1698+ foreach (float& vp, vpActivity)
1699+ if (vp != 0.0 && vp != 1.0)
1700+ cScreen->damageScreen ();
1701++
1702++ foreach (CompWindow *w, dndWindows)
1703++ if (ExpoWindow::get (w)->dndOpacity != 0.0f &&
1704++ ExpoWindow::get (w)->dndOpacity != 1.0f)
1705++ cScreen->damageScreen ();
1706+ }
1707+
1708+ if (grabIndex && expoCam <= 0.0f && !expoMode)
1709+@@ -553,10 +654,25 @@
1710+ switch (dndState) {
1711+ case DnDDuring:
1712+ {
1713+- if (dndWindow)
1714+- dndWindow->move (newCursor.x () - prevCursor.x (),
1715+- newCursor.y () - prevCursor.y (),
1716+- optionGetExpoImmediateMove ());
1717++ if (dndWindows.size ())
1718++ {
1719++ foreach (CompWindow *dndWindow, dndWindows)
1720++ {
1721++ if (dndWindow->grabbed ())
1722++ {
1723++ ExpoWindow *ew = ExpoWindow::get (dndWindow);
1724++
1725++ /* No need to update twice */
1726++ dndWindow->moveNotifySetEnabled (ew, false);
1727++ dndWindow->move (newCursor.x () - prevCursor.x (),
1728++ newCursor.y () - prevCursor.y (),
1729++ optionGetExpoImmediateMove ());
1730++ dndWindow->moveNotifySetEnabled (ew, true);
1731++
1732++ updateViewportActiveStates (screen);
1733++ }
1734++ }
1735++ }
1736+
1737+ prevCursor = newCursor;
1738+ cScreen->damageScreen ();
1739+@@ -621,13 +737,13 @@
1740+ break;
1741+
1742+ dndState = DnDDuring;
1743+- dndWindow = w;
1744++ dndWindows.push_back (w);
1745+
1746+ w->grabNotify (nx, ny, 0,
1747+ CompWindowGrabMoveMask |
1748+ CompWindowGrabButtonMask);
1749+
1750+- screen->updateGrab (grabIndex, dragCursor);
1751++ screen->updateGrab (grabIndex, mMoveCursor);
1752+
1753+ w->raise ();
1754+ w->moveInputFocusTo ();
1755+@@ -762,6 +878,124 @@
1756+ }
1757+
1758+ void
1759++ExpoScreen::paintViewport (const GLScreenPaintAttrib& attrib,
1760++ const GLMatrix& transform,
1761++ const CompRegion& region,
1762++ CompOutput *output,
1763++ unsigned int mask,
1764++ CompPoint vpPos,
1765++ GLVector &vpCamPos,
1766++ bool reflection)
1767++{
1768++ GLMatrix sTransform (transform);
1769++ GLMatrix sTransform2, sTransform3;
1770++ float sx = (float) screen->width () / output->width ();
1771++ float sy = (float) screen->height () / output->height ();
1772++ float vpp;
1773++ float progress = sigmoidProgress (expoCam);
1774++ unsigned int vp;
1775++ CompPoint vpSize (screen->vpSize ().width (), screen->vpSize ().height ());
1776++
1777++ const float gapY = optionGetVpDistance () * 0.1f * expoCam;
1778++ const float gapX = optionGetVpDistance () * 0.1f * screen->height () /
1779++ screen->width () * expoCam;
1780++
1781++ /* not sure this will work with different resolutions */
1782++ sTransform.translate (0.0, MAX (0, vpPos.y ()) * -(sy + gapY), 0.0f);
1783++
1784++ sTransform2 = sTransform;
1785++
1786++ /* not sure this will work with different resolutions */
1787++ if (optionGetDeform () != DeformCurve)
1788++ sTransform2.translate (MAX (0, vpPos.x ()) * (sx + gapX), 0.0f, 0.0);
1789++
1790++
1791++ if (optionGetExpoAnimation () == ExpoAnimationVortex)
1792++ sTransform2.rotate (360 * expoCam,
1793++ 0.0f, 1.0f, 2.0f * expoCam);
1794++
1795++ sTransform3 = sTransform2;
1796++
1797++ sTransform3.translate (output->x () / output->width (),
1798++ -output->y () / output->height (), 0.0);
1799++
1800++ cScreen->setWindowPaintOffset ((screen->vp ().x () - vpPos.x ()) *
1801++ screen->width (),
1802++ (screen->vp ().y () - vpPos.y ()) *
1803++ screen->height ());
1804++
1805++ vp = (vpPos.y () * vpSize.x ()) + vpPos.x ();
1806++
1807++ vpp = (expoCam * vpActivity[vp]) + (1 - expoCam);
1808++ vpp = sigmoidProgress (vpp);
1809++
1810++ vpBrightness = vpp + ((1.0 - vpp) *
1811++ optionGetVpBrightness () / 100.0);
1812++ vpSaturation = vpp + ((1.0 - vpp) *
1813++ optionGetVpSaturation () / 100.0);
1814++
1815++ paintingVp = vpPos;
1816++
1817++ if (optionGetDeform () == DeformCurve)
1818++ {
1819++ float rotateX;
1820++
1821++ sTransform3.translate (-vpCamPos[GLVector::x], 0.0f,
1822++ curveDistance - DEFAULT_Z_CAMERA);
1823++
1824++ rotateX = -vpPos.x () + interpolate (((float) vpSize.x () / 2.0) - 0.5,
1825++ screen->vp ().x (), progress);
1826++
1827++ sTransform3.rotate (curveAngle * rotateX, 0.0, 1.0, 0.0);
1828++
1829++ sTransform3.translate (vpCamPos[GLVector::x], 0.0f,
1830++ DEFAULT_Z_CAMERA - curveDistance);
1831++ }
1832++
1833++ if (paintingDndWindow)
1834++ cScreen->getWindowPaintListSetEnabled (this, true);
1835++ gScreen->glPaintTransformedOutput (attrib, sTransform3,
1836++ screen->region (), output,
1837++ mask);
1838++
1839++ if (paintingDndWindow)
1840++ cScreen->getWindowPaintListSetEnabled (this, false);
1841++
1842++ if (!reflection && !paintingDndWindow)
1843++ {
1844++ int cursor[2] = { pointerX, pointerY };
1845++
1846++ invertTransformedVertex (attrib, sTransform3,
1847++ output, cursor);
1848++
1849++ if ((cursor[0] > 0) && (cursor[0] < (int) screen->width ()) &&
1850++ (cursor[1] > 0) && (cursor[1] < (int) screen->height ()))
1851++ {
1852++ newCursor.setX (vpPos.x () * screen->width () + cursor[0]);
1853++ newCursor.setY (vpPos.y () * screen->height () + cursor[1]);
1854++
1855++ if (anyClick || dndState != DnDNone)
1856++ {
1857++ /* Used to save last viewport interaction was in */
1858++ selectedVp = vpPos;
1859++ anyClick = false;
1860++ }
1861++ }
1862++ }
1863++
1864++ /* Calculate the current viewport size */
1865++ int tl[2] = { 0, 0 };
1866++ int br[2] = { screen->width (), screen->height () };
1867++
1868++ invertTransformedVertex (attrib, sTransform3, output, tl);
1869++ invertTransformedVertex (attrib, sTransform3, output, br);
1870++
1871++ viewport_size = CompSize (br[0] - tl[0], br[1] - tl[1]);
1872++
1873++ cScreen->setWindowPaintOffset (0, 0);
1874++}
1875++
1876++void
1877+ ExpoScreen::paintWall (const GLScreenPaintAttrib& attrib,
1878+ const GLMatrix& transform,
1879+ const CompRegion& region,
1880+@@ -772,13 +1006,11 @@
1881+ GLfloat vertexData[12];
1882+ GLushort colorData[16];
1883+ GLMatrix sTransformW, sTransform (transform);
1884+- int i, j, vp;
1885+ GLenum oldFilter = gScreen->textureFilter ();
1886+-
1887+- float sx = (float) screen->width () / output->width ();
1888+- float sy = (float) screen->height () / output->height ();
1889++ float sx = (float) screen->width () / output->width ();
1890++ float sy = (float) screen->height () / output->height ();
1891+ float biasZ;
1892+- float oScale, rotation = 0.0f, progress, vpp;
1893++ float oScale, rotation = 0.0f, progress;
1894+ float aspectX = 1.0f, aspectY = 1.0f;
1895+ GLVector cam;
1896+ CompPoint vpSize (screen->vpSize ().width (), screen->vpSize ().height ());
1897+@@ -910,9 +1142,24 @@
1898+ sTransform.rotate (rotation, 0.0f, 1.0f, 0.0f);
1899+ sTransform.scale (aspectX, aspectY, 1.0);
1900+
1901++ CompPoint offsetInScreenCoords (optionGetXOffset (),
1902++ optionGetYOffset ());
1903++ float offsetInWorldCoordX, offsetInWorldCoordY, worldScaleFactorX, worldScaleFactorY;
1904++
1905++ compiz::expo::calculateWallOffset (*output,
1906++ offsetInScreenCoords,
1907++ vpSize,
1908++ *screen,
1909++ offsetInWorldCoordX,
1910++ offsetInWorldCoordY,
1911++ worldScaleFactorX,
1912++ worldScaleFactorY,
1913++ sigmoidProgress (expoCam));
1914++
1915+ /* translate expo to center */
1916+- sTransform.translate (vpSize.x () * sx * -0.5,
1917+- vpSize.y () * sy * 0.5, 0.0f);
1918++ sTransform.translate (vpSize.x () * sx * -0.5 + offsetInWorldCoordX,
1919++ vpSize.y () * sy * 0.5 - offsetInWorldCoordY, 0.0f);
1920++ sTransform.scale (worldScaleFactorX, worldScaleFactorY, 1.0f);
1921+
1922+ if (optionGetDeform () == DeformCurve)
1923+ sTransform.translate ((vpSize.x () - 1) * sx * 0.5, 0.0, 0.0);
1924+@@ -936,90 +1183,29 @@
1925+
1926+ expoActive = true;
1927+
1928+- for (j = 0; j < vpSize.y (); j++)
1929+- {
1930+- GLMatrix sTransform2 (sTransform), sTransform3;
1931+-
1932+- for (i = 0; i < vpSize.x (); i++)
1933+- {
1934+- if (optionGetExpoAnimation () == ExpoAnimationVortex)
1935+- sTransform2.rotate (360 * expoCam,
1936+- 0.0f, 1.0f, 2.0f * expoCam);
1937+-
1938+- sTransform3 = sTransform2;
1939+-
1940+- sTransform3.translate (output->x () / output->width (),
1941+- -output->y () / output->height (), 0.0);
1942+-
1943+- cScreen->setWindowPaintOffset ((screen->vp ().x () - i) *
1944+- screen->width (),
1945+- (screen->vp ().y () - j) *
1946+- screen->height ());
1947+-
1948+- vp = (j * vpSize.x ()) + i;
1949+-
1950+- vpp = (expoCam * vpActivity[vp]) + (1 - expoCam);
1951+- vpp = sigmoidProgress (vpp);
1952+-
1953+- vpBrightness = vpp + ((1.0 - vpp) *
1954+- optionGetVpBrightness () / 100.0);
1955+- vpSaturation = vpp + ((1.0 - vpp) *
1956+- optionGetVpSaturation () / 100.0);
1957++ for (int j = 0; j < screen->vpSize ().height (); j++)
1958++ for (int i = 0; i < screen->vpSize().width (); i++)
1959++ paintViewport (attrib, sTransform, region, output, mask, CompPoint (i, j), vpCamPos, reflection);
1960+
1961+- paintingVp.set (i, j);
1962++ paintingDndWindow = true;
1963+
1964+- if (optionGetDeform () == DeformCurve)
1965+- {
1966+- float rotateX;
1967+-
1968+- sTransform3.translate (-vpCamPos[GLVector::x], 0.0f,
1969+- curveDistance - DEFAULT_Z_CAMERA);
1970+-
1971+- rotateX = -i + interpolate (((float) vpSize.x () / 2.0) - 0.5,
1972+- screen->vp ().x (), progress);
1973+-
1974+- sTransform3.rotate (curveAngle * rotateX, 0.0, 1.0, 0.0);
1975+-
1976+- sTransform3.translate (vpCamPos[GLVector::x], 0.0f,
1977+- DEFAULT_Z_CAMERA - curveDistance);
1978+- }
1979+-
1980+- gScreen->glPaintTransformedOutput (attrib, sTransform3,
1981+- screen->region (), output,
1982+- mask);
1983+-
1984+- if (!reflection)
1985+- {
1986+- int cursor[2] = { pointerX, pointerY };
1987++ foreach (CompWindow *dndWindow, dndWindows)
1988++ {
1989++ CompPoint vp;
1990+
1991+- invertTransformedVertex (attrib, sTransform3,
1992+- output, cursor);
1993++ screen->viewportForGeometry (dndWindow->geometry (), vp);
1994+
1995+- if ((cursor[0] > 0) && (cursor[0] < (int) screen->width ()) &&
1996+- (cursor[1] > 0) && (cursor[1] < (int) screen->height ()))
1997+- {
1998+- newCursor.setX (i * screen->width () + cursor[0]);
1999+- newCursor.setY (j * screen->height () + cursor[1]);
2000++ while (vp.x () < 0)
2001++ vp.setX (screen->vpSize ().width () + vp.x ());
2002+
2003+- if (anyClick || dndState != DnDNone)
2004+- {
2005+- /* Used to save last viewport interaction was in */
2006+- lastSelectedVp = selectedVp;
2007+- selectedVp.set (i, j);
2008+- anyClick = false;
2009+- }
2010+- }
2011+- }
2012++ while (vp.y () < 0)
2013++ vp.setY (screen->vpSize ().height () + vp.y ());
2014+
2015+- /* not sure this will work with different resolutions */
2016+- if (optionGetDeform () != DeformCurve)
2017+- sTransform2.translate (sx + gapX, 0.0f, 0.0);
2018+- }
2019+-
2020+- /* not sure this will work with different resolutions */
2021+- sTransform.translate (0.0, -(sy + gapY), 0.0f);
2022++ paintViewport (attrib, sTransform, infiniteRegion, output, mask, vp, vpCamPos, reflection);
2023+ }
2024+
2025++ paintingDndWindow = false;
2026++
2027+ // glNormal3f (0.0, 0.0, -1.0);
2028+
2029+ if (reflection)
2030+@@ -1187,12 +1373,16 @@
2031+
2032+ expoActive = false;
2033+
2034+- cScreen->setWindowPaintOffset (0, 0);
2035+-
2036+ gScreen->glPaintTransformedOutputSetCurrentIndex (glPaintTransformedOutputIndex);
2037+ gScreen->setTextureFilter (oldFilter);
2038+ }
2039+
2040++const CompWindowList &
2041++ExpoScreen::getWindowPaintList ()
2042++{
2043++ return dndWindows;
2044++}
2045++
2046+ bool
2047+ ExpoScreen::glPaintOutput (const GLScreenPaintAttrib& attrib,
2048+ const GLMatrix& transform,
2049+@@ -1243,10 +1433,15 @@
2050+
2051+ bool
2052+ ExpoWindow::glDraw (const GLMatrix& transform,
2053+- const GLWindowPaintAttrib &attrib,
2054++ const GLWindowPaintAttrib &attrib,
2055+ const CompRegion& region,
2056+ unsigned int mask)
2057+ {
2058++ GLMatrix wTransform (transform);
2059++ CompPoint vp;
2060++
2061++ screen->viewportForGeometry (window->geometry (), vp);
2062++
2063+ if (eScreen->expoCam == 0.0f)
2064+ return gWindow->glDraw (transform, attrib, region, mask);
2065+
2066+@@ -1275,8 +1470,11 @@
2067+ }
2068+ }
2069+
2070+- eAttrib.brightness = attrib.brightness * eScreen->vpBrightness;
2071+- eAttrib.saturation = attrib.saturation * eScreen->vpSaturation;
2072++ if ((vp == eScreen->paintingVp || window->onAllViewports ()) && !eScreen->paintingDndWindow)
2073++ {
2074++ eAttrib.brightness = attrib.brightness * eScreen->vpBrightness;
2075++ eAttrib.saturation = attrib.saturation * eScreen->vpSaturation;
2076++ }
2077+ }
2078+ else
2079+ {
2080+@@ -1287,7 +1485,79 @@
2081+ (1 - sigmoidProgress (eScreen->expoCam));
2082+ }
2083+
2084+- return gWindow->glDraw (transform, eAttrib, region, mask);
2085++ bool status = gWindow->glDraw (transform, eAttrib, region, mask);
2086++
2087++ if (window->type () & CompWindowTypeDesktopMask)
2088++ {
2089++ /* We want to set the geometry of the polka dots to the window
2090++ * region */
2091++ CompRegion reg = CompRegion (0, 0, window->width (), window->height ());
2092++
2093++ foreach(GLTexture * tex, eScreen->polkadots_texture)
2094++ {
2095++ GLTexture::MatrixList matl;
2096++ GLTexture::Matrix mat = tex->matrix();
2097++ CompRegion paintRegion(region);
2098++
2099++ float xScale = screen->width () / (float) eScreen->viewport_size.width ();
2100++ float yScale = screen->height () / (float) eScreen->viewport_size.height ();
2101++
2102++ mat.xx *= xScale;
2103++ mat.yy *= yScale;
2104++
2105++ /* Not sure what this does, but it is necessary
2106++ * (adjusts for scale?) */
2107++ mat.x0 -= mat.xx * reg.boundingRect().x1();
2108++ mat.y0 -= mat.yy * reg.boundingRect().y1();
2109++
2110++ matl.push_back(mat);
2111++
2112++ if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
2113++ paintRegion = infiniteRegion;
2114++
2115++ /* Now allow plugins to mess with the geometry of our
2116++ * dim (so we get a nice render for things like
2117++ * wobbly etc etc */
2118++ gWindow->vertexBuffer ()->begin ();
2119++ gWindow->glAddGeometry (matl, reg, paintRegion);
2120++ if (gWindow->vertexBuffer ()->end ())
2121++ {
2122++ unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex ();
2123++ eAttrib.opacity = attrib.opacity * (((1.0 - eScreen->vpBrightness) + (1.0 - eScreen->vpSaturation) / 2.0));
2124++ /* Texture rendering set-up */
2125++ //eScreen->gScreen->setTexEnvMode(GL_MODULATE);
2126++ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
2127++ /* Draw the dim texture with all of it's modified
2128++ * geometry glory */
2129++ gWindow->glDrawTextureSetCurrentIndex (MAXSHORT);
2130++ gWindow->glDrawTexture (tex, transform, eAttrib, mask |
2131++ PAINT_WINDOW_BLEND_MASK |
2132++ PAINT_WINDOW_TRANSLUCENT_MASK |
2133++ PAINT_WINDOW_TRANSFORMED_MASK);
2134++ gWindow->glDrawTextureSetCurrentIndex (glDrawTextureIndex);
2135++ /* Texture rendering tear-down */
2136++ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
2137++ eScreen->gScreen->setTexEnvMode (GL_REPLACE);
2138++ }
2139++ }
2140++
2141++ /* Paint the outline */
2142++ if (mGlowQuads && eScreen->paintingVp == eScreen->selectedVp)
2143++ {
2144++ if (region.numRects ())
2145++ {
2146++ /* reset geometry and paint */
2147++ gWindow->vertexBuffer ()->begin ();
2148++ gWindow->vertexBuffer ()->end ();
2149++
2150++ paintGlow (transform, attrib, infiniteRegion, mask);
2151++ }
2152++ }
2153++
2154++ }
2155++
2156++ return status;
2157++
2158+ }
2159+
2160+ #define EXPO_GRID_SIZE 100
2161+@@ -1425,11 +1695,17 @@
2162+ const CompRegion& region,
2163+ unsigned int mask)
2164+ {
2165++ GLMatrix wTransform (transform);
2166++ GLWindowPaintAttrib wAttrib (attrib);
2167++ CompRegion clip (region);
2168++
2169+ if (eScreen->expoActive)
2170+ {
2171+ float opacity = 1.0;
2172+ bool hide;
2173+ bool zoomAnim;
2174++ CompPoint vp;
2175++ screen->viewportForGeometry (window->geometry (), vp);
2176+
2177+ zoomAnim = eScreen->optionGetExpoAnimation () ==
2178+ ExpoScreen::ExpoAnimationZoom;
2179+@@ -1458,9 +1734,47 @@
2180+
2181+ if (opacity <= 0)
2182+ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
2183++ else
2184++ wAttrib.opacity = wAttrib.opacity * opacity;
2185++
2186++ /* Stretch maximized windows a little so that you don't
2187++ * have an awkward gap */
2188++
2189++ if (window->state () & MAXIMIZE_STATE &&
2190++ !window->border ().top)
2191++ {
2192++ CompOutput *o = &screen->outputDevs ()[screen->outputDeviceForGeometry(window->geometry())];
2193++ float yS = 1.0 + ((o->height () / (float) window->height ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
2194++ float xS = 1.0 + ((o->width () / (float) window->width ()) - 1.0f) * sigmoidProgress (eScreen->expoCam);
2195++ wTransform.translate (window->x () + window->width (),
2196++ window->y () + window->height (),
2197++ 0.0f);
2198++ wTransform.scale (xS, yS, 1.0f);
2199++ wTransform.translate (-(window->x () + window->width ()),
2200++ -(window->y () + window->height ()),
2201++ 0.0f);
2202++
2203++ if (eScreen->paintingVp != vp)
2204++ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
2205++
2206++ mask |= PAINT_WINDOW_TRANSFORMED_MASK;
2207++ }
2208++
2209++ if (std::find (eScreen->dndWindows.begin(), eScreen->dndWindows.end (), window) != eScreen->dndWindows.end ())
2210++ {
2211++ if (!eScreen->paintingDndWindow)
2212++ {
2213++ mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
2214++ }
2215++ else
2216++ {
2217++ mask |= PAINT_WINDOW_TRANSFORMED_MASK;
2218++ clip = infiniteRegion;
2219++ }
2220++ }
2221+ }
2222+
2223+- return gWindow->glPaint (attrib, transform, region, mask);
2224++ return gWindow->glPaint (wAttrib, wTransform, clip, mask);
2225+ }
2226+
2227+ bool
2228+@@ -1489,7 +1803,7 @@
2229+ expoActive (false),
2230+ expoMode (false),
2231+ dndState (DnDNone),
2232+- dndWindow (NULL),
2233++ dndWindows (0),
2234+ origVp (s->vp ()),
2235+ selectedVp (s->vp ()),
2236+ lastSelectedVp (s->vp ()),
2237+@@ -1497,14 +1811,21 @@
2238+ clickTime (0),
2239+ doubleClick (false),
2240+ vpNormals (360 * 3),
2241+- grabIndex (0)
2242+-{
2243++ grabIndex (0),
2244++ paintingDndWindow (false),
2245++ mGlowTextureProperties (&glowTextureProperties)
2246++{
2247++ CompString fname;
2248++ CompString pname = "expo";
2249++ CompSize size;
2250++
2251++
2252+ leftKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Left"));
2253+ rightKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Right"));
2254+ upKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Up"));
2255+ downKey = XKeysymToKeycode (s->dpy (), XStringToKeysym ("Down"));
2256+
2257+- dragCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
2258++ mMoveCursor = XCreateFontCursor (screen->dpy (), XC_fleur);
2259+
2260+ EXPOINITBIND (ExpoKey, doExpo);
2261+ EXPOTERMBIND (ExpoKey, termExpo);
2262+@@ -1522,12 +1843,58 @@
2263+ ScreenInterface::setHandler (screen, false);
2264+ CompositeScreenInterface::setHandler (cScreen, false);
2265+ GLScreenInterface::setHandler (gScreen, false);
2266++
2267++ outline_texture = GLTexture::imageDataToTexture (mGlowTextureProperties->textureData,
2268++ CompSize (mGlowTextureProperties->textureSize,
2269++ mGlowTextureProperties->textureSize),
2270++ GL_RGBA, GL_UNSIGNED_BYTE);
2271++ fname = "texture_tile.png";
2272++ polkadots_texture = GLTexture::readImageToTexture (fname, pname, polkadots_texture_size);
2273++
2274++ if (polkadots_texture.empty ())
2275++ compLogMessage ("expo", CompLogLevelWarn, "failed to bind image to texture");
2276++ else
2277++ {
2278++ foreach (GLTexture *tex, polkadots_texture)
2279++ {
2280++ tex->enable (GLTexture::Good);
2281++ glTexParameteri (tex->target (), GL_TEXTURE_WRAP_S, GL_REPEAT);
2282++ glTexParameteri (tex->target (), GL_TEXTURE_WRAP_T, GL_REPEAT);
2283++ tex->disable ();
2284++ }
2285++ }
2286+ }
2287+
2288+ ExpoScreen::~ExpoScreen ()
2289+ {
2290+- if (dragCursor != None)
2291+- XFreeCursor (screen->dpy (), dragCursor);
2292++ if (mMoveCursor)
2293++ XFreeCursor (screen->dpy (), mMoveCursor);
2294++}
2295++
2296++void
2297++ExpoWindow::moveNotify (int dx, int dy, bool immediate)
2298++{
2299++ window->moveNotify (dx, dy, immediate);
2300++
2301++ if (!ExpoScreen::get (screen)->expoActive)
2302++ return;
2303++
2304++ updateViewportActiveStates (screen);
2305++}
2306++
2307++void
2308++ExpoWindow::resizeNotify(int dx, int dy, int dw, int dh)
2309++{
2310++ window->resizeNotify (dx, dy, dw, dh);
2311++
2312++ /* mGlowQuads contains positional info, so we need to recalc that */
2313++ if (mGlowQuads)
2314++ {
2315++ /* FIXME: we need to find a more multitexture friendly way
2316++ * of doing this */
2317++ GLTexture::Matrix tMat = eScreen->outline_texture.at (0)->matrix ();
2318++ computeGlowQuads (&tMat);
2319++ }
2320+ }
2321+
2322+ ExpoWindow::ExpoWindow (CompWindow *w) :
2323+@@ -1535,10 +1902,28 @@
2324+ window (w),
2325+ cWindow (CompositeWindow::get (w)),
2326+ gWindow (GLWindow::get (w)),
2327+- eScreen (ExpoScreen::get (screen))
2328++ eScreen (ExpoScreen::get (screen)),
2329++ dndOpacity (0.0f),
2330++ mGlowQuads (NULL)
2331+ {
2332+ CompositeWindowInterface::setHandler (cWindow, false);
2333+ GLWindowInterface::setHandler (gWindow, false);
2334++ WindowInterface::setHandler (window, true);
2335++
2336++ if (window->type () & CompWindowTypeDesktopMask)
2337++ {
2338++ foreach (GLTexture *tex, eScreen->outline_texture)
2339++ {
2340++ GLTexture::Matrix mat = tex->matrix ();
2341++ computeGlowQuads (&mat);
2342++ }
2343++ }
2344++}
2345++
2346++ExpoWindow::~ExpoWindow ()
2347++{
2348++ eScreen->dndWindows.remove (window);
2349++ computeGlowQuads (NULL);
2350+ }
2351+
2352+ bool
2353+Index: ubuntu/plugins/expo/src/expo.h
2354+===================================================================
2355+--- ubuntu.orig/plugins/expo/src/expo.h 2012-09-08 11:51:02.279175377 +0800
2356++++ ubuntu/plugins/expo/src/expo.h 2012-09-08 14:07:47.219861486 +0800
2357+@@ -30,6 +30,44 @@
2358+ #include <opengl/opengl.h>
2359+
2360+ #include "expo_options.h"
2361++#include "glow.h"
2362++#include "viewport-member-window.h"
2363++#include "client-list-generator.h"
2364++
2365++#define WIN_REAL_X(w) (w->x () - w->border ().left)
2366++#define WIN_REAL_Y(w) (w->y () - w->border ().top)
2367++#define WIN_REAL_WIDTH(w) (w->width () + 2 * w->geometry ().border () + \
2368++ w->border ().left + w->border ().right)
2369++#define WIN_REAL_HEIGHT(w) (w->height () + 2 * w->geometry ().border () + \
2370++ w->border ().top + w->border ().bottom)
2371++
2372++namespace compiz
2373++{
2374++ namespace expo
2375++ {
2376++ namespace impl
2377++ {
2378++ namespace ce = compiz::expo;
2379++
2380++ class CompizClientListGenerator :
2381++ public ce::ClientListGenerator
2382++ {
2383++ public:
2384++
2385++ CompizClientListGenerator (CompScreen *screen);
2386++
2387++ void refreshClientList ();
2388++ ViewportMemberWindow * nextClient ();
2389++
2390++ private:
2391++
2392++ CompScreen *mScreen;
2393++ const CompWindowVector *mClientList;
2394++ CompWindowVector::const_iterator mClientListIterator;
2395++ };
2396++ }
2397++ }
2398++}
2399+
2400+ class ExpoScreen :
2401+ public ScreenInterface,
2402+@@ -51,8 +89,10 @@
2403+ bool glPaintOutput (const GLScreenPaintAttrib&, const GLMatrix&,
2404+ const CompRegion&, CompOutput *, unsigned int);
2405+ void glPaintTransformedOutput (const GLScreenPaintAttrib&,
2406+- const GLMatrix&, const CompRegion&,
2407+- CompOutput *, unsigned int);
2408++ const GLMatrix&, const CompRegion&,
2409++ CompOutput*, unsigned int);
2410++
2411++ const CompWindowList & getWindowPaintList ();
2412+
2413+ bool dndInit (CompAction *, CompAction::State, CompOption::Vector&);
2414+ bool dndFini (CompAction *, CompAction::State, CompOption::Vector&);
2415+@@ -62,6 +102,8 @@
2416+ bool nextVp (CompAction *, CompAction::State, CompOption::Vector&);
2417+ bool prevVp (CompAction *, CompAction::State, CompOption::Vector&);
2418+
2419++ CompPoint currentViewport ();
2420++
2421+ typedef enum {
2422+ DnDNone,
2423+ DnDDuring,
2424+@@ -82,7 +124,7 @@
2425+ bool expoMode;
2426+
2427+ DnDState dndState;
2428+- CompWindow *dndWindow;
2429++ CompWindowList dndWindows;
2430+
2431+ CompPoint prevCursor;
2432+ CompPoint newCursor;
2433+@@ -94,6 +136,7 @@
2434+ CompPoint paintingVp;
2435+
2436+ std::vector<float> vpActivity;
2437++ std::vector<bool> vpActive;
2438+ float vpBrightness;
2439+ float vpSaturation;
2440+
2441+@@ -113,6 +156,17 @@
2442+
2443+ CompScreen::GrabHandle grabIndex;
2444+
2445++ GLTexture::List polkadots_texture;
2446++ CompSize polkadots_texture_size;
2447++ CompSize viewport_size;
2448++
2449++ GLTexture::List outline_texture;
2450++ CompSize outline_texture_size;
2451++
2452++ bool paintingDndWindow;
2453++
2454++ const GlowTextureProperties *mGlowTextureProperties;
2455++
2456+ private:
2457+ void moveFocusViewport (int, int);
2458+ void finishWindowMovement ();
2459+@@ -123,24 +177,45 @@
2460+ void paintWall (const GLScreenPaintAttrib&, const GLMatrix&,
2461+ const CompRegion&, CompOutput *, unsigned int, bool);
2462+
2463++ void paintViewport (const GLScreenPaintAttrib& attrib,
2464++ const GLMatrix& transform,
2465++ const CompRegion& region,
2466++ CompOutput *output,
2467++ unsigned int mask,
2468++ CompPoint vpPos,
2469++ GLVector &vpCamPos,
2470++ bool reflection);
2471++
2472++ bool windowsOnVp (compiz::expo::ClientListGenerator &clientList,
2473++ CompPoint &p,
2474++ const CompPoint &unprojectedCursor,
2475++ const CompSize &screenSize,
2476++ CompScreen *screen);
2477++
2478+ KeyCode leftKey;
2479+ KeyCode rightKey;
2480+ KeyCode upKey;
2481+ KeyCode downKey;
2482+
2483+- Cursor dragCursor;
2484++ Cursor mMoveCursor;
2485+ };
2486+
2487+ class ExpoWindow :
2488++ public compiz::expo::ViewportMemberWindow,
2489+ public CompositeWindowInterface,
2490+ public GLWindowInterface,
2491++ public WindowInterface,
2492+ public PluginClassHandler<ExpoWindow, CompWindow>
2493+ {
2494+ public:
2495+ ExpoWindow (CompWindow *);
2496++ ~ExpoWindow ();
2497+
2498+ bool damageRect (bool, const CompRect&);
2499+
2500++ void resizeNotify (int dx, int dy, int dw, int dh);
2501++ void moveNotify (int dx, int dy, bool immediate);
2502++
2503+ bool glDraw (const GLMatrix&, const GLWindowPaintAttrib&,
2504+ const CompRegion&, unsigned int);
2505+ bool glPaint (const GLWindowPaintAttrib&, const GLMatrix&,
2506+@@ -150,11 +225,31 @@
2507+ unsigned int, unsigned int);
2508+ void glDrawTexture (GLTexture*, const GLMatrix&,
2509+ const GLWindowPaintAttrib&, unsigned int);
2510++ void
2511++ paintGlow (const GLMatrix &transform,
2512++ const GLWindowPaintAttrib &attrib,
2513++ const CompRegion &paintRegion,
2514++ unsigned int mask);
2515++
2516++ void
2517++ computeGlowQuads (GLTexture::Matrix *matrix);
2518+
2519+ CompWindow *window;
2520+ CompositeWindow *cWindow;
2521+ GLWindow *gWindow;
2522+ ExpoScreen *eScreen;
2523++
2524++ float dndOpacity;
2525++
2526++ GlowQuad *mGlowQuads;
2527++
2528++ private:
2529++
2530++ bool isDesktopOrDock () const;
2531++ bool dragged () const;
2532++ const compiz::window::Geometry & absoluteGeometry () const;
2533++
2534++ mutable compiz::window::Geometry mAbsoluteGeometry;
2535+ };
2536+
2537+ class ExpoPluginVTable :
2538+Index: ubuntu/plugins/expo/src/glow.cpp
2539+===================================================================
2540+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2541++++ ubuntu/plugins/expo/src/glow.cpp 2012-09-08 11:51:33.107328243 +0800
2542+@@ -0,0 +1,429 @@
2543++/**
2544++ *
2545++ * Compiz group plugin
2546++ *
2547++ * glow.cpp
2548++ *
2549++ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
2550++ * Danny Baumann, Sam Spilsbury
2551++ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
2552++ * Roi Cohen <roico.beryl@gmail.com>
2553++ * Danny Baumann <maniac@opencompositing.org>
2554++ * Sam Spilsbury <smspillaz@gmail.com>
2555++ *
2556++ *
2557++ * This program is free software; you can redistribute it and/or
2558++ * modify it under the terms of the GNU General Public License
2559++ * as published by the Free Software Foundation; either version 2
2560++ * of the License, or (at your option) any later version.
2561++ *
2562++ * This program is distributed in the hope that it will be useful,
2563++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2564++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2565++ * GNU General Public License for more details.
2566++ *
2567++ **/
2568++
2569++#include "expo.h"
2570++#include "group_glow.h"
2571++
2572++const GlowTextureProperties glowTextureProperties = {
2573++ /* GlowTextureRectangular */
2574++ glowTexRect, 32, 21
2575++};
2576++
2577++/*
2578++ * GroupWindow::paintGlow
2579++ *
2580++ * Takes our glow texture, stretches the appropriate positions in the glow texture,
2581++ * adds those geometries (so plugins like wobby and deform this texture correctly)
2582++ * and then draws the glow texture with this geometry (plugins like wobbly and friends
2583++ * will automatically deform the texture based on our set geometry)
2584++ */
2585++
2586++void
2587++ExpoWindow::paintGlow (const GLMatrix &transform,
2588++ const GLWindowPaintAttrib &attrib,
2589++ const CompRegion &paintRegion,
2590++ unsigned int mask)
2591++{
2592++ CompRegion reg;
2593++ int i;
2594++ GLushort colorData[4];
2595++ const GLushort *selColorData = ExpoScreen::get (screen)->optionGetSelectedColor ();
2596++ float alpha = (float) selColorData[3] / 65535.0f;
2597++
2598++ /* Premultiply color */
2599++ colorData[0] = selColorData[0] * alpha;
2600++ colorData[1] = selColorData[1] * alpha;
2601++ colorData[2] = selColorData[2] * alpha;
2602++ colorData[3] = selColorData[3];
2603++
2604++ gWindow->vertexBuffer ()->begin ();
2605++
2606++ /* There are 8 glow parts of the glow texture which we wish to paint
2607++ * separately with different transformations
2608++ */
2609++ for (i = 0; i < NUM_GLOWQUADS; i++)
2610++ {
2611++ /* Using precalculated quads here */
2612++ reg = CompRegion (mGlowQuads[i].mBox);
2613++
2614++ if (reg.boundingRect ().x1 () < reg.boundingRect ().x2 () &&
2615++ reg.boundingRect ().y1 () < reg.boundingRect ().y2 ())
2616++ {
2617++ GLTexture::MatrixList matl;
2618++ reg = CompRegion (reg.boundingRect ().x1 (),
2619++ reg.boundingRect ().y1 (),
2620++ reg.boundingRect ().width (),
2621++ reg.boundingRect ().height ());
2622++
2623++ matl.push_back (mGlowQuads[i].mMatrix);
2624++ /* Add color data for all 6 vertices of the quad */
2625++ for (int n = 0; n < 6; n++)
2626++ gWindow->vertexBuffer ()->addColors (1, colorData);
2627++ gWindow->glAddGeometry (matl, reg, paintRegion);
2628++ }
2629++ }
2630++
2631++ if (gWindow->vertexBuffer ()->end ())
2632++ {
2633++ //GLScreen::get (screen)->setTexEnvMode (GL_MODULATE);
2634++ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2635++
2636++ /* we use PAINT_WINDOW_TRANSFORMED_MASK here to force
2637++ the usage of a good texture filter */
2638++ foreach (GLTexture *tex, ExpoScreen::get (screen)->outline_texture)
2639++ {
2640++ gWindow->glDrawTexture (tex, transform, attrib, mask |
2641++ PAINT_WINDOW_BLEND_MASK |
2642++ PAINT_WINDOW_TRANSLUCENT_MASK |
2643++ PAINT_WINDOW_TRANSFORMED_MASK);
2644++ }
2645++
2646++ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
2647++ GLScreen::get (screen)->setTexEnvMode (GL_REPLACE);
2648++ }
2649++}
2650++
2651++/*
2652++ * ExpoWindow::computeGlowQuads
2653++ *
2654++ * This function computures the matrix transformation required for each
2655++ * part of the glow texture which we wish to stretch to some rectangular
2656++ * dimentions
2657++ *
2658++ * There are eight quads different parts of the texture which we wish to
2659++ * paint here, the 4 sides and four corners, eg:
2660++ *
2661++ * ------------------
2662++ * | 1 | 4 | 6 |
2663++ * ------------- ------------------
2664++ * | 1 | 4 | 6 | | | | |
2665++ * ------------- | | | |
2666++ * | 2 | n | 7 | -> | 2 | n | 7 |
2667++ * ------------- | | | |
2668++ * | 3 | 5 | 8 | | | | |
2669++ * ------------- ------------------
2670++ * | 3 | 5 | 8 |
2671++ * ------------------
2672++ *
2673++ * In this example here, 2, 4, 5 and 7 are stretched, and the matrices for
2674++ * each quad rect adjusted accordingly for it's size compared to the original
2675++ * texture size.
2676++ *
2677++ * When we are adjusting the matrices here, the initial size of each corner has
2678++ * a size of of "1.0f", so according to 2x2 matrix rules,
2679++ * the scale factor is the inverse of the size of the glow (which explains
2680++ * while you will see here that matrix->xx is (1 / glowSize)
2681++ * where glowSize is the size the user specifies they want their glow to extend.
2682++ * (likewise, matrix->yy is adjusted similarly for corners and for top/bottom)
2683++ *
2684++ * matrix->x0 and matrix->y0 here are set to be the top left edge of the rect
2685++ * adjusted by the matrix scale factor (matrix->xx and matrix->yy)
2686++ *
2687++ */
2688++void
2689++ExpoWindow::computeGlowQuads (GLTexture::Matrix *matrix)
2690++{
2691++ CompRect *box;
2692++ int x1, x2, y1, y2;
2693++ GLTexture::Matrix *quadMatrix;
2694++ int glowSize, glowOffset;
2695++ CompWindow *w = window;
2696++
2697++ /* Passing NULL to this function frees the glow quads
2698++ * (so the window is not painted with glow) */
2699++
2700++ if (matrix)
2701++ {
2702++ if (!mGlowQuads)
2703++ mGlowQuads = new GlowQuad[NUM_GLOWQUADS];
2704++ if (!mGlowQuads)
2705++ return;
2706++ }
2707++ else
2708++ {
2709++ if (mGlowQuads)
2710++ {
2711++ delete[] mGlowQuads;
2712++ mGlowQuads = NULL;
2713++ }
2714++ return;
2715++ }
2716++
2717++ glowSize = 48;
2718++ glowOffset = (glowSize * ExpoScreen::get (screen)->mGlowTextureProperties->glowOffset /
2719++ ExpoScreen::get (screen)->mGlowTextureProperties->textureSize) + 1;
2720++
2721++ /* Top left corner */
2722++ box = &mGlowQuads[GLOWQUAD_TOPLEFT].mBox;
2723++ mGlowQuads[GLOWQUAD_TOPLEFT].mMatrix = *matrix;
2724++ quadMatrix = &mGlowQuads[GLOWQUAD_TOPLEFT].mMatrix;
2725++
2726++ /* Set the desired rect dimentions
2727++ * for the part of the glow we are painting */
2728++
2729++ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
2730++ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
2731++
2732++ /* 2x2 Matrix here, adjust both x and y scale factors
2733++ * and the x and y position
2734++ *
2735++ * Scaling both parts of the texture in a positive direction
2736++ * here (left to right top to bottom)
2737++ *
2738++ * The base position (x0 and y0) here requires us to move backwards
2739++ * on the x and y dimentions by the calculated rect dimentions
2740++ * multiplied by the scale factors
2741++ */
2742++
2743++ quadMatrix->xx = 1.0f / glowSize;
2744++ quadMatrix->yy = 1.0f / (glowSize);
2745++ quadMatrix->x0 = -(x1 * quadMatrix->xx);
2746++ quadMatrix->y0 = -(y1 * quadMatrix->yy);
2747++
2748++ x2 = MIN (WIN_REAL_X (w) + glowOffset,
2749++ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
2750++ y2 = MIN (WIN_REAL_Y (w) + glowOffset,
2751++ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
2752++
2753++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
2754++
2755++ /* Top right corner */
2756++ box = &mGlowQuads[GLOWQUAD_TOPRIGHT].mBox;
2757++ mGlowQuads[GLOWQUAD_TOPRIGHT].mMatrix = *matrix;
2758++ quadMatrix = &mGlowQuads[GLOWQUAD_TOPRIGHT].mMatrix;
2759++
2760++ /* Set the desired rect dimentions
2761++ * for the part of the glow we are painting */
2762++
2763++ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
2764++ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
2765++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
2766++
2767++ /* 2x2 Matrix here, adjust both x and y scale factors
2768++ * and the x and y position
2769++ *
2770++ * Scaling the y part of the texture in a positive direction
2771++ * and the x part in a negative direction here
2772++ * (right to left top to bottom)
2773++ *
2774++ * The base position (x0 and y0) here requires us to move backwards
2775++ * on the y dimention and forwards on x by the calculated rect dimentions
2776++ * multiplied by the scale factors (since we are moving forward on x we
2777++ * need the inverse of that which is 1 - x1 * xx
2778++ */
2779++
2780++ quadMatrix->xx = -1.0f / glowSize;
2781++ quadMatrix->yy = 1.0f / glowSize;
2782++ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
2783++ quadMatrix->y0 = -(y1 * quadMatrix->yy);
2784++
2785++ x1 = MAX (WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset,
2786++ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
2787++ y2 = MIN (WIN_REAL_Y (w) + glowOffset,
2788++ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
2789++
2790++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
2791++
2792++ /* Bottom left corner */
2793++ box = &mGlowQuads[GLOWQUAD_BOTTOMLEFT].mBox;
2794++ mGlowQuads[GLOWQUAD_BOTTOMLEFT].mMatrix = *matrix;
2795++ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOMLEFT].mMatrix;
2796++
2797++ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
2798++ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
2799++ x2 = WIN_REAL_X (w) + glowOffset;
2800++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
2801++
2802++ /* 2x2 Matrix here, adjust both x and y scale factors
2803++ * and the x and y position
2804++ *
2805++ * Scaling the x part of the texture in a positive direction
2806++ * and the y part in a negative direction here
2807++ * (left to right bottom to top)
2808++ *
2809++ * The base position (x0 and y0) here requires us to move backwards
2810++ * on the x dimention and forwards on y by the calculated rect dimentions
2811++ * multiplied by the scale factors (since we are moving forward on x we
2812++ * need the inverse of that which is 1 - y1 * yy
2813++ */
2814++
2815++ quadMatrix->xx = 1.0f / glowSize;
2816++ quadMatrix->yy = -1.0f / glowSize;
2817++ quadMatrix->x0 = -(x1 * quadMatrix->xx);
2818++ quadMatrix->y0 = 1.0f - (y1 * quadMatrix->yy);
2819++
2820++ y1 = MAX (WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset,
2821++ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
2822++ x2 = MIN (WIN_REAL_X (w) + glowOffset,
2823++ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
2824++
2825++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
2826++
2827++ /* Bottom right corner */
2828++ box = &mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mBox;
2829++ mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mMatrix = *matrix;
2830++ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOMRIGHT].mMatrix;
2831++
2832++ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
2833++ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
2834++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
2835++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
2836++
2837++ /* 2x2 Matrix here, adjust both x and y scale factors
2838++ * and the x and y position
2839++ *
2840++ * Scaling the both parts of the texture in a negative direction
2841++ * (right to left bottom to top)
2842++ *
2843++ * The base position (x0 and y0) here requires us to move forwards
2844++ * on both dimentions by the calculated rect dimentions
2845++ * multiplied by the scale factors
2846++ */
2847++
2848++ quadMatrix->xx = -1.0f / glowSize;
2849++ quadMatrix->yy = -1.0f / glowSize;
2850++ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
2851++ quadMatrix->y0 = 1.0 - (y1 * quadMatrix->yy);
2852++
2853++ x1 = MAX (WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset,
2854++ WIN_REAL_X (w) + (WIN_REAL_WIDTH (w) / 2));
2855++ y1 = MAX (WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset,
2856++ WIN_REAL_Y (w) + (WIN_REAL_HEIGHT (w) / 2));
2857++
2858++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
2859++
2860++ /* Top edge */
2861++ box = &mGlowQuads[GLOWQUAD_TOP].mBox;
2862++ mGlowQuads[GLOWQUAD_TOP].mMatrix = *matrix;
2863++ quadMatrix = &mGlowQuads[GLOWQUAD_TOP].mMatrix;
2864++
2865++ x1 = WIN_REAL_X (w) + glowOffset;
2866++ y1 = WIN_REAL_Y (w) - glowSize + glowOffset;
2867++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
2868++ y2 = WIN_REAL_Y (w) + glowOffset;
2869++
2870++ /* 2x2 Matrix here, adjust both x and y scale factors
2871++ * and the x and y position
2872++ *
2873++ * No need to scale the x part of the texture here, but we
2874++ * are scaling on the y part in a positive direciton
2875++ *
2876++ * The base position (y0) here requires us to move backwards
2877++ * on the x dimention and forwards on y by the calculated rect dimentions
2878++ * multiplied by the scale factors
2879++ */
2880++
2881++ quadMatrix->xx = 0.0f;
2882++ quadMatrix->yy = 1.0f / glowSize;
2883++ quadMatrix->x0 = 1.0;
2884++ quadMatrix->y0 = -(y1 * quadMatrix->yy);
2885++
2886++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
2887++
2888++ /* Bottom edge */
2889++ box = &mGlowQuads[GLOWQUAD_BOTTOM].mBox;
2890++ mGlowQuads[GLOWQUAD_BOTTOM].mMatrix = *matrix;
2891++ quadMatrix = &mGlowQuads[GLOWQUAD_BOTTOM].mMatrix;
2892++
2893++ x1 = WIN_REAL_X (w) + glowOffset;
2894++ y1 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
2895++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
2896++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) + glowSize - glowOffset;
2897++
2898++ /* 2x2 Matrix here, adjust both x and y scale factors
2899++ * and the x and y position
2900++ *
2901++ * No need to scale the x part of the texture here, but we
2902++ * are scaling on the y part in a negative direciton
2903++ *
2904++ * The base position (y0) here requires us to move forwards
2905++ * on y by the calculated rect dimentions
2906++ * multiplied by the scale factors
2907++ */
2908++
2909++ quadMatrix->xx = 0.0f;
2910++ quadMatrix->yy = -1.0f / glowSize;
2911++ quadMatrix->x0 = 1.0;
2912++ quadMatrix->y0 = 1.0 - (y1 * quadMatrix->yy);
2913++
2914++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
2915++
2916++ /* Left edge */
2917++ box = &mGlowQuads[GLOWQUAD_LEFT].mBox;
2918++ mGlowQuads[GLOWQUAD_LEFT].mMatrix = *matrix;
2919++ quadMatrix = &mGlowQuads[GLOWQUAD_LEFT].mMatrix;
2920++
2921++ x1 = WIN_REAL_X (w) - glowSize + glowOffset;
2922++ y1 = WIN_REAL_Y (w) + glowOffset;
2923++ x2 = WIN_REAL_X (w) + glowOffset;
2924++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
2925++
2926++ /* 2x2 Matrix here, adjust both x and y scale factors
2927++ * and the x and y position
2928++ *
2929++ * No need to scale the y part of the texture here, but we
2930++ * are scaling on the x part in a positive direciton
2931++ *
2932++ * The base position (x0) here requires us to move backwards
2933++ * on x by the calculated rect dimentions
2934++ * multiplied by the scale factors
2935++ */
2936++
2937++ quadMatrix->xx = 1.0f / glowSize;
2938++ quadMatrix->yy = 0.0f;
2939++ quadMatrix->x0 = -(x1 * quadMatrix->xx);
2940++ quadMatrix->y0 = 1.0;
2941++
2942++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
2943++
2944++ /* Right edge */
2945++ box = &mGlowQuads[GLOWQUAD_RIGHT].mBox;
2946++ mGlowQuads[GLOWQUAD_RIGHT].mMatrix = *matrix;
2947++ quadMatrix = &mGlowQuads[GLOWQUAD_RIGHT].mMatrix;
2948++
2949++ x1 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) - glowOffset;
2950++ y1 = WIN_REAL_Y (w) + glowOffset;
2951++ x2 = WIN_REAL_X (w) + WIN_REAL_WIDTH (w) + glowSize - glowOffset;
2952++ y2 = WIN_REAL_Y (w) + WIN_REAL_HEIGHT (w) - glowOffset;
2953++
2954++ /* 2x2 Matrix here, adjust both x and y scale factors
2955++ * and the x and y position
2956++ *
2957++ * No need to scale the y part of the texture here, but we
2958++ * are scaling on the x part in a negative direciton
2959++ *
2960++ * The base position (x0) here requires us to move forwards
2961++ * on x by the calculated rect dimentions
2962++ * multiplied by the scale factors
2963++ */
2964++
2965++ quadMatrix->xx = -1.0f / glowSize;
2966++ quadMatrix->yy = 0.0f;
2967++ quadMatrix->x0 = 1.0 - (x1 * quadMatrix->xx);
2968++ quadMatrix->y0 = 1.0;
2969++
2970++ *box = CompRect (x1, y1, x2 - x1, y2 - y1);
2971++}
2972+Index: ubuntu/plugins/expo/src/glow.h
2973+===================================================================
2974+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
2975++++ ubuntu/plugins/expo/src/glow.h 2012-09-08 11:51:33.107328243 +0800
2976+@@ -0,0 +1,66 @@
2977++/**
2978++ *
2979++ * Compiz group plugin
2980++ *
2981++ * glow.h
2982++ *
2983++ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
2984++ * Danny Baumann, Sam Spilsbury
2985++ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
2986++ * Roi Cohen <roico.beryl@gmail.com>
2987++ * Danny Baumann <maniac@opencompositing.org>
2988++ * Sam Spilsbury <smspillaz@gmail.com>
2989++ *
2990++ *
2991++ * This program is free software; you can redistribute it and/or
2992++ * modify it under the terms of the GNU General Public License
2993++ * as published by the Free Software Foundation; either version 2
2994++ * of the License, or (at your option) any later version.
2995++ *
2996++ * This program is distributed in the hope that it will be useful,
2997++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2998++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2999++ * GNU General Public License for more details.
3000++ *
3001++ **/
3002++
3003++#ifndef _EXPO_GLOW_H
3004++#define _EXPO_GLOW_H
3005++
3006++#define GLOWQUAD_TOPLEFT 0
3007++#define GLOWQUAD_TOPRIGHT 1
3008++#define GLOWQUAD_BOTTOMLEFT 2
3009++#define GLOWQUAD_BOTTOMRIGHT 3
3010++#define GLOWQUAD_TOP 4
3011++#define GLOWQUAD_BOTTOM 5
3012++#define GLOWQUAD_LEFT 6
3013++#define GLOWQUAD_RIGHT 7
3014++#define NUM_GLOWQUADS 8
3015++
3016++/* Represents a particular glow texture, so here
3017++ * we have hardcoded in the texture data, the offset
3018++ * and the size of the texture
3019++ */
3020++
3021++typedef struct _GlowTextureProperties {
3022++ char *textureData;
3023++ int textureSize;
3024++ int glowOffset;
3025++} GlowTextureProperties;
3026++
3027++/* Each glow quad contains a 2x2 scale + positional matrix
3028++ * (the 3rd column is not used since that is for matrix skew
3029++ * operations which we do not care about)
3030++ * and also a CompRect which describes the size and position of
3031++ * the quad on the glow
3032++ */
3033++
3034++class GlowQuad {
3035++ public:
3036++ CompRect mBox;
3037++ GLTexture::Matrix mMatrix;
3038++};
3039++
3040++extern const GlowTextureProperties glowTextureProperties;
3041++
3042++#endif
3043+Index: ubuntu/plugins/expo/src/group_glow.h
3044+===================================================================
3045+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3046++++ ubuntu/plugins/expo/src/group_glow.h 2012-09-08 11:51:33.107328243 +0800
3047+@@ -0,0 +1,197 @@
3048++#ifndef _GROUP_GLOWTEX_H
3049++#define _GROUP_GLOWTEX_H
3050++
3051++/**
3052++ *
3053++ * Compiz group plugin
3054++ *
3055++ * group_glow.h
3056++ *
3057++ * Copyright : (C) 2006-2010 by Patrick Niklaus, Roi Cohen,
3058++ * Danny Baumann, Sam Spilsbury
3059++ * Authors: Patrick Niklaus <patrick.niklaus@googlemail.com>
3060++ * Roi Cohen <roico.beryl@gmail.com>
3061++ * Danny Baumann <maniac@opencompositing.org>
3062++ * Sam Spilsbury <smspillaz@gmail.com>
3063++ *
3064++ *
3065++ * This program is free software; you can redistribute it and/or
3066++ * modify it under the terms of the GNU General Public License
3067++ * as published by the Free Software Foundation; either version 2
3068++ * of the License, or (at your option) any later version.
3069++ *
3070++ * This program is distributed in the hope that it will be useful,
3071++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3072++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3073++ * GNU General Public License for more details.
3074++ *
3075++ **/
3076++
3077++/*
3078++ * glowTex
3079++ */
3080++
3081++static char glowTexRect[4097] = {
3082++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3083++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3084++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377"
3085++ "\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
3086++ "\377\6\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3087++ "\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\6\377\377"
3088++ "\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377"
3089++ "\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\6"
3090++ "\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377\14\377\377\377"
3091++ "\14\377\377\377\14\377\377\377\14\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3092++ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\6\377\377\377\14"
3093++ "\377\377\377\14\377\377\377\22\377\377\377\22\377\377\377\22\377\377\377"
3094++ "\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377"
3095++ "\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377\27\377\377\377"
3096++ "\35\377\377\377\35\377\377\377\35\377\377\377\35\377\377\377\35\377\377\377"
3097++ "\35\377\377\377\35\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
3098++ "\377\6\377\377\377\6\377\377\377\14\377\377\377\22\377\377\377\27\377\377"
3099++ "\377\27\377\377\377\35\377\377\377#\377\377\377'\377\377\377'\377\377\377"
3100++ "+\377\377\377+\377\377\377+\377\377\377+\377\377\377+\377\377\377+\377\377"
3101++ "\377+\377\377\377+\377\377\377+\377\377\3771\377\377\3771\377\377\3771\377"
3102++ "\377\3771\377\377\3771\377\377\3771\377\377\3771\0\0\0\0\0\0\0\0\0\0\0\0"
3103++ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\22\377\377\377"
3104++ "\27\377\377\377\35\377\377\377#\377\377\377+\377\377\3771\377\377\3776\377"
3105++ "\377\377<\377\377\377>\377\377\377C\377\377\377I\377\377\377I\377\377\377"
3106++ "I\377\377\377I\377\377\377I\377\377\377I\377\377\377I\377\377\377I\377\377"
3107++ "\377L\377\377\377L\377\377\377L\377\377\377L\377\377\377L\377\377\377L\377"
3108++ "\377\377L\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
3109++ "\377\377\22\377\377\377\27\377\377\377#\377\377\377+\377\377\3776\377\377"
3110++ "\377C\377\377\377L\377\377\377U\377\377\377]\377\377\377`\377\377\377d\377"
3111++ "\377\377h\377\377\377k\377\377\377k\377\377\377k\377\377\377k\377\377\377"
3112++ "k\377\377\377k\377\377\377k\377\377\377p\377\377\377p\377\377\377p\377\377"
3113++ "\377p\377\377\377p\377\377\377p\377\377\377p\0\0\0\0\0\0\0\0\0\0\0\0\377"
3114++ "\377\377\6\377\377\377\14\377\377\377\22\314\314\314\35\377\377\377'\377"
3115++ "\377\3771\377\377\377>\357\357\357P\377\377\377]\363\363\363k\365\365\365"
3116++ "v\365\365\365|\377\377\377\202\367\367\367\210\367\367\367\214\367\367\367"
3117++ "\216\367\367\367\221\367\367\367\221\367\367\367\221\367\367\367\221\367"
3118++ "\367\367\221\367\367\367\221\367\367\367\224\367\367\367\224\367\367\367"
3119++ "\224\367\367\367\224\367\367\367\224\367\367\367\224\367\367\367\224\0\0"
3120++ "\0\0\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\22\377\377\377\27\377"
3121++ "\377\377'\377\377\3776\377\377\377I\377\377\377Y\377\377\377k\376\376\376"
3122++ "y\377\377\377\210\377\377\377\224\377\377\377\235\377\377\377\245\377\377"
3123++ "\377\253\377\377\377\255\377\377\377\262\377\377\377\262\377\377\377\263"
3124++ "\377\377\377\263\377\377\377\263\377\377\377\263\377\377\377\263\377\377"
3125++ "\377\266\377\377\377\266\377\377\377\266\377\377\377\266\377\377\377\266"
3126++ "\377\377\377\266\377\377\377\266\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
3127++ "\14\377\377\377\27\377\377\377#\377\377\3771\377\377\377I\377\377\377]\377"
3128++ "\377\377r\377\377\377\205\377\377\377\231\377\377\377\247\377\377\377\263"
3129++ "\377\377\377\275\377\377\377\304\377\377\377\310\377\377\377\313\377\377"
3130++ "\377\316\377\377\377\320\377\377\377\320\377\377\377\320\377\377\377\320"
3131++ "\377\377\377\320\377\377\377\320\377\377\377\322\377\377\377\322\377\377"
3132++ "\377\322\377\377\377\322\377\377\377\322\377\377\377\322\377\377\377\322"
3133++ "\0\0\0\0\377\377\377\6\377\377\377\6\377\377\377\22\377\377\377\35\377\377"
3134++ "\377+\377\377\377>\377\377\377Y\377\377\377r\377\377\377\210\376\376\376"
3135++ "\237\377\377\377\262\377\377\377\302\377\377\377\313\377\377\377\324\377"
3136++ "\377\377\332\376\376\376\336\377\377\377\341\377\377\377\342\377\377\377"
3137++ "\344\377\377\377\344\377\377\377\344\377\377\377\344\377\377\377\344\377"
3138++ "\377\377\344\377\377\377\345\377\377\377\345\377\377\377\345\377\377\377"
3139++ "\345\377\377\377\345\377\377\377\345\377\377\377\345\0\0\0\0\377\377\377"
3140++ "\6\377\377\377\14\377\377\377\27\377\377\377#\377\377\3776\377\377\377P\377"
3141++ "\377\377k\377\377\377\205\376\376\376\237\372\372\372\266\377\377\377\307"
3142++ "\373\373\373\325\373\373\373\337\374\374\374\345\374\374\374\352\374\374"
3143++ "\374\355\374\374\374\357\374\374\374\360\374\374\374\361\374\374\374\361"
3144++ "\374\374\374\362\374\374\374\362\374\374\374\362\374\374\374\362\374\374"
3145++ "\374\362\374\374\374\362\374\374\374\362\374\374\374\362\374\374\374\362"
3146++ "\374\374\374\362\374\374\374\362\0\0\0\0\377\377\377\6\377\377\377\14\377"
3147++ "\377\377\35\377\377\377+\377\377\377C\377\377\377]\377\377\377|\377\377\377"
3148++ "\231\377\377\377\263\377\377\377\307\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3149++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3150++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
3151++ "\377\377\6\377\377\377\22\324\324\324#\377\377\3771\377\377\377L\363\363"
3152++ "\363k\377\377\377\210\377\377\377\247\377\377\377\302\377\377\377\325\0\0"
3153++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3154++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3155++ "\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\22\377\377"
3156++ "\377#\377\377\377<\377\377\377U\377\377\377v\377\377\377\226\377\377\377"
3157++ "\263\377\377\377\315\377\377\377\337\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3158++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3159++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377"
3160++ "\6\377\377\377\14\377\377\377\27\377\377\377'\377\377\377>\377\377\377]\377"
3161++ "\377\377|\370\370\370\237\377\377\377\275\373\373\373\325\377\377\377\345"
3162++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3163++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3164++ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\27\377"
3165++ "\377\377+\377\377\377C\377\377\377`\377\377\377\202\377\377\377\247\377\377"
3166++ "\377\304\377\377\377\332\377\377\377\352\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3167++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3168++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
3169++ "\377\6\377\377\377\14\377\377\377\27\377\377\377+\377\377\377C\377\377\377"
3170++ "d\377\377\377\210\377\377\377\253\377\377\377\310\376\376\376\336\374\374"
3171++ "\374\355\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3172++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3173++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377"
3174++ "\35\377\377\377+\377\377\377I\377\377\377h\377\377\377\214\377\377\377\260"
3175++ "\377\377\377\313\374\374\374\342\374\374\374\357\0\0\0\0\0\0\0\0\0\0\0\0"
3176++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3177++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3178++ "\377\377\377\6\377\377\377\14\377\377\377\35\342\342\3421\377\377\377I\377"
3179++ "\377\377k\377\377\377\216\377\377\377\262\377\377\377\316\374\374\374\344"
3180++ "\377\377\377\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3181++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3182++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
3183++ "\377\377\35\377\377\3771\377\377\377L\377\377\377k\377\377\377\221\377\377"
3184++ "\377\263\377\377\377\320\377\377\377\344\377\377\377\361\0\0\0\0\0\0\0\0"
3185++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3186++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3187++ "\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377"
3188++ "\377L\377\377\377k\377\377\377\221\377\377\377\263\377\377\377\320\377\377"
3189++ "\377\344\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3190++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3191++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
3192++ "\14\377\377\377\35\377\377\3771\377\377\377L\364\364\364p\377\377\377\221"
3193++ "\372\372\372\266\377\377\377\320\374\374\374\345\377\377\377\362\0\0\0\0"
3194++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3195++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3196++ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\377"
3197++ "1\377\377\377L\377\377\377p\377\377\377\221\377\377\377\266\373\373\373\322"
3198++ "\377\377\377\345\377\377\377\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3199++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3200++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377"
3201++ "\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377p\377\377"
3202++ "\377\221\377\377\377\266\373\373\373\322\377\377\377\345\377\377\377\362"
3203++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3204++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3205++ "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377"
3206++ "\377\3771\377\377\377L\377\377\377p\377\377\377\221\377\377\377\266\373\373"
3207++ "\373\322\377\377\377\345\377\377\377\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3208++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3209++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377"
3210++ "\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377"
3211++ "p\367\367\367\224\377\377\377\266\377\377\377\322\377\377\377\345\374\374"
3212++ "\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3213++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3214++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377"
3215++ "\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224\377\377\377\266"
3216++ "\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0"
3217++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3218++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3219++ "\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377\377L\377"
3220++ "\377\377p\367\367\367\224\377\377\377\266\377\377\377\322\377\377\377\345"
3221++ "\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3222++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3223++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377"
3224++ "\377\377\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224\377\377"
3225++ "\377\266\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0"
3226++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3227++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3228++ "\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\3771\377\377"
3229++ "\377L\377\377\377p\367\367\367\224\377\377\377\266\377\377\377\322\377\377"
3230++ "\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3231++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3232++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377"
3233++ "\14\377\377\377\35\377\377\3771\377\377\377L\377\377\377p\367\367\367\224"
3234++ "\377\377\377\266\377\377\377\322\377\377\377\345\374\374\374\362\0\0\0\0"
3235++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3236++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3237++ "\0\0\0\0\0\0\0\0\377\377\377\6\377\377\377\14\377\377\377\35\377\377\377"
3238++ "1\377\377\377L\377\377\377p\367\367\367\224\377\377\377\266\377\377\377\322"
3239++ "\377\377\377\345\374\374\374\362\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3240++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
3241++ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
3242++};
3243++
3244++#endif
3245+Index: ubuntu/plugins/expo/src/wall_offset/CMakeLists.txt
3246+===================================================================
3247+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3248++++ ubuntu/plugins/expo/src/wall_offset/CMakeLists.txt 2012-09-08 14:56:23.698323512 +0800
3249+@@ -0,0 +1,33 @@
3250++include_directories (
3251++ ${CMAKE_CURRENT_SOURCE_DIR}/include
3252++ ${CMAKE_CURRENT_SOURCE_DIR}/src
3253++ ${Boost_INCLUDE_DIRS}
3254++ ${GLIBMM_INCLUDE_DIRS}
3255++)
3256++
3257++link_directories (${GLIBMM_LIBRARY_DIRS} ${COMPIZ_LIBRARY_DIRS})
3258++
3259++set (
3260++ PRIVATE_HEADERS
3261++ ${CMAKE_CURRENT_SOURCE_DIR}/include/wall-offset.h
3262++)
3263++
3264++set (
3265++ SRCS
3266++ ${CMAKE_CURRENT_SOURCE_DIR}/src/wall-offset.cpp
3267++)
3268++
3269++add_library (
3270++ compiz_expo_wall_offset STATIC
3271++ ${SRCS}
3272++ ${PRIVATE_HEADERS}
3273++)
3274++
3275++if (COMPIZ_BUILD_TESTING)
3276++ add_subdirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
3277++endif (COMPIZ_BUILD_TESTING)
3278++
3279++target_link_libraries (
3280++ compiz_expo_wall_offset
3281++ compiz_core
3282++)
3283+Index: ubuntu/plugins/expo/src/wall_offset/include/wall-offset.h
3284+===================================================================
3285+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3286++++ ubuntu/plugins/expo/src/wall_offset/include/wall-offset.h 2012-09-08 11:51:33.107328243 +0800
3287+@@ -0,0 +1,43 @@
3288++/**
3289++ * Copyright © 2012 Canonical Ltd.
3290++ *
3291++ * Authors:
3292++ * Sam Spilsbury <sam.spilsbury@canonical.com>
3293++ *
3294++ * This program is free software; you can redistribute it and/or
3295++ * modify it under the terms of the GNU General Public License
3296++ * as published by the Free Software Foundation; either version 2
3297++ * of the License, or (at your option) any later version.
3298++ *
3299++ * This program is distributed in the hope that it will be useful,
3300++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3301++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3302++ * GNU General Public License for more details.
3303++ *
3304++ **/
3305++
3306++#ifndef _COMPIZ_EXPO_WALL_OFFSET_H
3307++#define _COMPIZ_EXPO_WALL_OFFSET_H
3308++
3309++#include <core/point.h>
3310++#include <core/size.h>
3311++#include <core/rect.h>
3312++
3313++namespace compiz
3314++{
3315++ namespace expo
3316++ {
3317++ void
3318++ calculateWallOffset (const CompRect &output,
3319++ const CompPoint &offsetInScreenCoords,
3320++ const CompPoint &vpSize,
3321++ const CompSize &screenSize,
3322++ float &offsetInWorldX,
3323++ float &offsetInWorldY,
3324++ float &worldScaleFactorX,
3325++ float &worldScaleFactorY,
3326++ float animationProgress);
3327++ }
3328++}
3329++
3330++#endif
3331+Index: ubuntu/plugins/expo/src/wall_offset/src/wall-offset.cpp
3332+===================================================================
3333+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3334++++ ubuntu/plugins/expo/src/wall_offset/src/wall-offset.cpp 2012-09-08 16:54:24.033432999 +0800
3335+@@ -0,0 +1,55 @@
3336++/**
3337++ * Copyright © 2012 Canonical Ltd.
3338++ *
3339++ * Authors:
3340++ * Sam Spilsbury <sam.spilsbury@canonical.com>
3341++ *
3342++ * This program is free software; you can redistribute it and/or
3343++ * modify it under the terms of the GNU General Public License
3344++ * as published by the Free Software Foundation; either version 2
3345++ * of the License, or (at your option) any later version.
3346++ *
3347++ * This program is distributed in the hope that it will be useful,
3348++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3349++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3350++ * GNU General Public License for more details.
3351++ *
3352++ **/
3353++#include "wall-offset.h"
3354++
3355++namespace compiz
3356++{
3357++ namespace expo
3358++ {
3359++ void
3360++ calculateWallOffset (const CompRect &output,
3361++ const CompPoint &offsetInScreenCoords,
3362++ const CompPoint &vpSize,
3363++ const CompSize &screenSize,
3364++ float &offsetInWorldX,
3365++ float &offsetInWorldY,
3366++ float &worldScaleFactorX,
3367++ float &worldScaleFactorY,
3368++ float animationProgress)
3369++ {
3370++ const float sx = screenSize.width () / static_cast <float> (output.width ());
3371++ const float sy = screenSize.height () / static_cast <float> (output.height ());
3372++ offsetInWorldX = 0.0;
3373++ offsetInWorldY = 0.0;
3374++ worldScaleFactorX = 1.0f;
3375++ worldScaleFactorY = 1.0f;
3376++
3377++ if (output.left () == 0)
3378++ {
3379++ offsetInWorldX = ((vpSize.x () * sx) / ((float) output.width ()) * (offsetInScreenCoords.x ()) * animationProgress);
3380++ worldScaleFactorX = 1.0f - ((float) (offsetInScreenCoords.x ()) / (float) (output.width ())) * animationProgress;
3381++ }
3382++
3383++ if (output.top () == 0)
3384++ {
3385++ offsetInWorldY = ((vpSize.y () * sy) / ((float) output.height ()) * (offsetInScreenCoords.y ()) * animationProgress);
3386++ worldScaleFactorY = 1.0f - ((float) (offsetInScreenCoords.y ()) / (float) output.height ()) * animationProgress;
3387++ }
3388++ }
3389++ }
3390++}
3391+Index: ubuntu/plugins/expo/src/wall_offset/tests/CMakeLists.txt
3392+===================================================================
3393+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3394++++ ubuntu/plugins/expo/src/wall_offset/tests/CMakeLists.txt 2012-09-08 11:51:33.107328243 +0800
3395+@@ -0,0 +1,19 @@
3396++if (NOT GTEST_FOUND)
3397++ message ("Google Test not found - cannot build tests!")
3398++ set (COMPIZ_BUILD_TESTING OFF)
3399++endif (NOT GTEST_FOUND)
3400++
3401++include_directories (${GTEST_INCLUDE_DIRS})
3402++
3403++link_directories (${COMPIZ_LIBRARY_DIRS})
3404++
3405++add_executable (compiz_test_expo_wall_offset
3406++ ${CMAKE_CURRENT_SOURCE_DIR}/test-expo-wall-offset.cpp)
3407++
3408++target_link_libraries (compiz_test_expo_wall_offset
3409++ compiz_expo_wall_offset
3410++ ${GTEST_BOTH_LIBRARIES}
3411++ ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
3412++ )
3413++
3414++compiz_discover_tests (compiz_test_expo_wall_offset COVERAGE compiz_expo_wall_offset)
3415+Index: ubuntu/plugins/expo/src/wall_offset/tests/test-expo-wall-offset.cpp
3416+===================================================================
3417+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3418++++ ubuntu/plugins/expo/src/wall_offset/tests/test-expo-wall-offset.cpp 2012-09-08 17:25:18.714629857 +0800
3419+@@ -0,0 +1,263 @@
3420++/*
3421++ * Copyright © 2012 Canonical Ltd.
3422++ *
3423++ * Permission to use, copy, modify, distribute, and sell this software
3424++ * and its documentation for any purpose is hereby granted without
3425++ * fee, provided that the above copyright notice appear in all copies
3426++ * and that both that copyright notice and this permission notice
3427++ * appear in supporting documentation, and that the name of
3428++ * Canonical Ltd. not be used in advertising or publicity pertaining to
3429++ * distribution of the software without specific, written prior permission.
3430++ * Canonical Ltd. makes no representations about the suitability of this
3431++ * software for any purpose. It is provided "as is" without express or
3432++ * implied warranty.
3433++ *
3434++ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
3435++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
3436++ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
3437++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
3438++ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
3439++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
3440++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3441++ *
3442++ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
3443++ */
3444++#include <tr1/tuple>
3445++#include <gtest/gtest.h>
3446++#include "wall-offset.h"
3447++
3448++using ::testing::WithParamInterface;
3449++using ::testing::ValuesIn;
3450++using ::testing::Combine;
3451++using ::testing::Range;
3452++
3453++class ExpoWallOffsetTest :
3454++ public ::testing::Test
3455++{
3456++ protected:
3457++
3458++ float offsetInWorldX;
3459++ float offsetInWorldY;
3460++ float worldScaleFactorX;
3461++ float worldScaleFactorY;
3462++};
3463++
3464++namespace
3465++{
3466++ const unsigned int nAnimationsBegin = 0;
3467++ const unsigned int nAnimationSteps = 20;
3468++
3469++ struct OffsetAnimationParameters
3470++ {
3471++ float offsetInWorldX;
3472++ float offsetInWorldY;
3473++ float worldScaleFactorX;
3474++ float worldScaleFactorY;
3475++ };
3476++
3477++ struct OffsetParameters
3478++ {
3479++ float offsetX;
3480++ float offsetY;
3481++ int vpSizeWidth;
3482++ int vpSizeHeight;
3483++ int screenWidth;
3484++ int screenHeight;
3485++ int outputWidth;
3486++ int outputHeight;
3487++ OffsetAnimationParameters animationParameters[20];
3488++ };
3489++
3490++ const OffsetParameters testingOffsetParameters[] =
3491++ {
3492++ {
3493++ 0,
3494++ 0,
3495++ 1,
3496++ 1,
3497++ 100,
3498++ 100,
3499++ 100,
3500++ 100,
3501++ {
3502++ { 0, 0, 1.0, 1.0 },
3503++ { 0, 0, 1.0, 1.0 },
3504++ { 0, 0, 1.0, 1.0 },
3505++ { 0, 0, 1.0, 1.0 },
3506++ { 0, 0, 1.0, 1.0 },
3507++ { 0, 0, 1.0, 1.0 },
3508++ { 0, 0, 1.0, 1.0 },
3509++ { 0, 0, 1.0, 1.0 },
3510++ { 0, 0, 1.0, 1.0 },
3511++ { 0, 0, 1.0, 1.0 },
3512++ { 0, 0, 1.0, 1.0 },
3513++ { 0, 0, 1.0, 1.0 },
3514++ { 0, 0, 1.0, 1.0 },
3515++ { 0, 0, 1.0, 1.0 },
3516++ { 0, 0, 1.0, 1.0 },
3517++ { 0, 0, 1.0, 1.0 },
3518++ { 0, 0, 1.0, 1.0 },
3519++ { 0, 0, 1.0, 1.0 },
3520++ { 0, 0, 1.0, 1.0 },
3521++ { 0, 0, 1.0, 1.0 }
3522++ }
3523++ },
3524++ /* Monitor 1280x800, Screen: 1280x800, Viewport Layout: 2x2, Offset: 32, 24 */
3525++ {
3526++ 32,
3527++ 24,
3528++ 2,
3529++ 2,
3530++ 1280,
3531++ 800,
3532++ 1280,
3533++ 800,
3534++ {
3535++ { 0, 0, 1, 1 },
3536++ { 0.0025000001769512892, 0.0011718750465661287, 0.99874997138977051, 0.99906247854232788 },
3537++ { 0.0050000003539025784, 0.0023437500931322575, 0.99750000238418579, 0.99812501668930054 },
3538++ { 0.0075000002980232239, 0.0035156251396983862, 0.9962499737739563, 0.99718749523162842 },
3539++ { 0.010000000707805157, 0.0046875001862645149, 0.99500000476837158, 0.9962499737739563 },
3540++ { 0.012500000186264515, 0.005859375, 0.99374997615814209, 0.99531251192092896 },
3541++ { 0.015000000596046448, 0.0070312502793967724, 0.99250000715255737, 0.99437499046325684 },
3542++ { 0.017500000074505806, 0.0082031246274709702, 0.99124997854232788, 0.99343752861022949 },
3543++ { 0.020000001415610313, 0.0093750003725290298, 0.99000000953674316, 0.99250000715255737 },
3544++ { 0.022499999031424522, 0.01054687425494194, 0.98874998092651367, 0.99156248569488525 },
3545++ { 0.02500000037252903, 0.01171875, 0.98750001192092896, 0.99062502384185791 },
3546++ { 0.027500001713633537, 0.01289062574505806, 0.98624998331069946, 0.98968750238418579 },
3547++ { 0.030000001192092896, 0.014062500558793545, 0.98500001430511475, 0.98874998092651367 },
3548++ { 0.032499998807907104, 0.015234374441206455, 0.98374998569488525, 0.98781251907348633 },
3549++ { 0.035000000149011612, 0.01640624925494194, 0.98250001668930054, 0.98687499761581421 },
3550++ { 0.037500001490116119, 0.017578125, 0.98124998807907104, 0.98593747615814209 },
3551++ { 0.040000002831220627, 0.01875000074505806, 0.98000001907348633, 0.98500001430511475 },
3552++ { 0.042500000447034836, 0.019921876490116119, 0.97874999046325684, 0.98406249284744263 },
3553++ { 0.044999998062849045, 0.021093748509883881, 0.97750002145767212, 0.98312497138977051 },
3554++ { 0.047499999403953552, 0.02226562425494194, 0.97624999284744263, 0.98218750953674316 }
3555++ }
3556++ },
3557++ /* Monitor 1280x1024, Screen: 2560x1024, Viewport Layout: 2x2, Offset: 32, 24 */
3558++ {
3559++ 32,
3560++ 24,
3561++ 2,
3562++ 2,
3563++ 2560,
3564++ 1024,
3565++ 1280,
3566++ 1024,
3567++ {
3568++ { 0, 0, 1, 1 },
3569++ { 0.0050000003539025784, 0.001500000013038516, 0.99874997138977051, 0.99906247854232788 },
3570++ { 0.010000000707805157, 0.0030000000260770321, 0.99750000238418579, 0.99812501668930054 },
3571++ { 0.015000000596046448, 0.0045000002719461918, 0.9962499737739563, 0.99718749523162842 },
3572++ { 0.020000001415610313, 0.0060000000521540642, 0.99500000476837158, 0.9962499737739563 },
3573++ { 0.02500000037252903, 0.0074999998323619366, 0.99374997615814209, 0.99531251192092896 },
3574++ { 0.030000001192092896, 0.0090000005438923836, 0.99250000715255737, 0.99437499046325684 },
3575++ { 0.035000000149011612, 0.010499999858438969, 0.99124997854232788, 0.99343752861022949 },
3576++ { 0.040000002831220627, 0.012000000104308128, 0.99000000953674316, 0.99250000715255737 },
3577++ { 0.044999998062849045, 0.013499999418854713, 0.98874998092651367, 0.99156248569488525 },
3578++ { 0.05000000074505806, 0.014999999664723873, 0.98750001192092896, 0.99062502384185791 },
3579++ { 0.055000003427267075, 0.016499999910593033, 0.98624998331069946, 0.98968750238418579 },
3580++ { 0.060000002384185791, 0.018000001087784767, 0.98500001430511475, 0.98874998092651367 },
3581++ { 0.064999997615814209, 0.019499998539686203, 0.98374998569488525, 0.98781251907348633 },
3582++ { 0.070000000298023224, 0.020999999716877937, 0.98250001668930054, 0.98687499761581421 },
3583++ { 0.075000002980232239, 0.022499999031424522, 0.98124998807907104, 0.98593747615814209 },
3584++ { 0.080000005662441254, 0.024000000208616257, 0.98000001907348633, 0.98500001430511475 },
3585++ { 0.085000000894069672, 0.025499999523162842, 0.97874999046325684, 0.98406249284744263 },
3586++ { 0.08999999612569809, 0.026999998837709427, 0.97750002145767212, 0.98312497138977051 },
3587++ { 0.094999998807907104, 0.028499998152256012, 0.97624999284744263, 0.98218750953674316 }
3588++ }
3589++ },
3590++ };
3591++
3592++ typedef std::tr1::tuple <OffsetParameters, unsigned int> AnimParam;
3593++}
3594++
3595++class ExpoWallOffsetTestAnimations :
3596++ public ExpoWallOffsetTest,
3597++ public ::testing::WithParamInterface <AnimParam>
3598++{
3599++ public:
3600++
3601++ void
3602++ RecordProperty (const char *name, float value)
3603++ {
3604++ ::testing::Message message;
3605++ message << value;
3606++ Test::RecordProperty (name, message.GetString ().c_str ());
3607++ }
3608++};
3609++
3610++TEST_P (ExpoWallOffsetTestAnimations, TestAnimationValues)
3611++{
3612++ const OffsetParameters &offset (std::tr1::get <0> (GetParam ()));
3613++ const unsigned int &index (std::tr1::get <1> (GetParam ()));
3614++
3615++ RecordProperty ("outputWidth", offset.outputWidth);
3616++ RecordProperty ("outputHeight", offset.outputHeight);
3617++ RecordProperty ("screenWidth", offset.screenWidth);
3618++ RecordProperty ("screenHeight", offset.screenHeight);
3619++ RecordProperty ("offsetX", offset.offsetX);
3620++ RecordProperty ("offsetY", offset.offsetY);
3621++
3622++ RecordProperty ("expected.offsetInWorldX", offset.animationParameters[index].offsetInWorldX);
3623++ RecordProperty ("expected.offsetInWorldY", offset.animationParameters[index].offsetInWorldY);
3624++ RecordProperty ("expected.worldScaleFactorX", offset.animationParameters[index].worldScaleFactorX);
3625++ RecordProperty ("expected.worldScaleFactorY", offset.animationParameters[index].worldScaleFactorY);
3626++
3627++ compiz::expo::calculateWallOffset (CompRect (0,
3628++ 0,
3629++ offset.outputWidth,
3630++ offset.outputWidth),
3631++ CompPoint (offset.offsetX,
3632++ offset.offsetY),
3633++ CompPoint (offset.vpSizeWidth,
3634++ offset.vpSizeHeight),
3635++ CompSize (offset.screenWidth,
3636++ offset.screenHeight),
3637++ offsetInWorldX,
3638++ offsetInWorldY,
3639++ worldScaleFactorX,
3640++ worldScaleFactorY,
3641++ index / static_cast <float> (nAnimationSteps));
3642++
3643++ RecordProperty ("offsetInWorldX", offsetInWorldX);
3644++ RecordProperty ("offsetInWorldY", offsetInWorldY);
3645++ RecordProperty ("worldScaleFactorX", worldScaleFactorX);
3646++ RecordProperty ("worldScaleFactorY", worldScaleFactorY);
3647++
3648++ EXPECT_EQ (offsetInWorldX, offset.animationParameters[index].offsetInWorldX);
3649++ EXPECT_EQ (offsetInWorldY, offset.animationParameters[index].offsetInWorldY);
3650++ EXPECT_EQ (worldScaleFactorX, offset.animationParameters[index].worldScaleFactorX);
3651++ EXPECT_EQ (worldScaleFactorY, offset.animationParameters[index].worldScaleFactorY);
3652++}
3653++
3654++TEST_F (ExpoWallOffsetTest, TestNoOffsetIfOutputIsNotOrigin)
3655++{
3656++ compiz::expo::calculateWallOffset (CompRect (1,
3657++ 1,
3658++ 100,
3659++ 100),
3660++ CompPoint (100,
3661++ 100),
3662++ CompPoint (1,
3663++ 1),
3664++ CompSize (100,
3665++ 100),
3666++ offsetInWorldX,
3667++ offsetInWorldY,
3668++ worldScaleFactorX,
3669++ worldScaleFactorY,
3670++ 1.0);
3671++
3672++ EXPECT_EQ (offsetInWorldX, 0.0f);
3673++ EXPECT_EQ (offsetInWorldY, 0.0f);
3674++ EXPECT_EQ (worldScaleFactorX, 1.0f);
3675++ EXPECT_EQ (worldScaleFactorY, 1.0f);
3676++}
3677++
3678++INSTANTIATE_TEST_CASE_P (ExpoAnimationOffsetTest,
3679++ ExpoWallOffsetTestAnimations,
3680++ Combine (ValuesIn (testingOffsetParameters),
3681++ Range (nAnimationsBegin,
3682++ nAnimationSteps)));
3683+Index: ubuntu/plugins/expo/CMakeLists.txt
3684+===================================================================
3685+--- ubuntu.orig/plugins/expo/CMakeLists.txt 2012-09-08 11:51:02.279175377 +0800
3686++++ ubuntu/plugins/expo/CMakeLists.txt 2012-09-08 11:51:33.107328243 +0800
3687+@@ -1,7 +1,16 @@
3688+ find_package (Compiz REQUIRED)
3689+ include (CompizPlugin)
3690+
3691++set (COMPIZ_EXPO_PLUGIN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
3692++
3693+ add_subdirectory (src/click_threshold)
3694+ include_directories (src/click_threshold/include)
3695++add_subdirectory (src/wall_offset)
3696++include_directories (src/wall_offset/include)
3697++add_subdirectory (src/windows_on_viewport)
3698++include_directories (src/windows_on_viewport/include)
3699+
3700+-compiz_plugin (expo PLUGINDEPS composite opengl LIBRARIES compiz_expo_click_threshold)
3701++compiz_plugin (expo PLUGINDEPS composite opengl LIBRARIES
3702++ compiz_expo_click_threshold
3703++ compiz_expo_wall_offset
3704++ compiz_expo_windows_on_viewport)
3705+Index: ubuntu/plugins/expo/src/windows_on_viewport/CMakeLists.txt
3706+===================================================================
3707+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3708++++ ubuntu/plugins/expo/src/windows_on_viewport/CMakeLists.txt 2012-09-08 11:51:33.107328243 +0800
3709+@@ -0,0 +1,36 @@
3710++include_directories (
3711++ ${CMAKE_CURRENT_SOURCE_DIR}/include
3712++ ${CMAKE_CURRENT_SOURCE_DIR}/src
3713++ ${COMPIZ_INCLUDE_DIRS}
3714++ ${COMPIZ_EXPO_PLUGIN_SOURCE_DIR}
3715++ ${Boost_INCLUDE_DIRS}
3716++ ${GLIBMM_INCLUDE_DIRS}
3717++)
3718++
3719++link_directories (${GLIBMM_LIBRARY_DIRS} ${COMPIZ_LIBRARY_DIRS})
3720++
3721++set (
3722++ PRIVATE_HEADERS
3723++ ${CMAKE_CURRENT_SOURCE_DIR}/include/windows-on-viewport.h
3724++)
3725++
3726++set (
3727++ SRCS
3728++ ${CMAKE_CURRENT_SOURCE_DIR}/src/windows-on-viewport.cpp
3729++)
3730++
3731++add_library (
3732++ compiz_expo_windows_on_viewport STATIC
3733++ ${SRCS}
3734++ ${PRIVATE_HEADERS}
3735++)
3736++
3737++if (COMPIZ_BUILD_TESTING)
3738++ add_subdirectory ( ${CMAKE_CURRENT_SOURCE_DIR}/tests )
3739++endif (COMPIZ_BUILD_TESTING)
3740++
3741++target_link_libraries (
3742++ compiz_expo_windows_on_viewport
3743++ compiz_window_geometry
3744++ compiz_core
3745++)
3746+Index: ubuntu/plugins/expo/src/windows_on_viewport/include/windows-on-viewport.h
3747+===================================================================
3748+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3749++++ ubuntu/plugins/expo/src/windows_on_viewport/include/windows-on-viewport.h 2012-09-08 15:17:24.196573992 +0800
3750+@@ -0,0 +1,40 @@
3751++/**
3752++ * Copyright © 2012 Canonical Ltd.
3753++ *
3754++ * Authors:
3755++ * Sam Spilsbury <sam.spilsbury@canonical.com>
3756++ *
3757++ * This program is free software; you can redistribute it and/or
3758++ * modify it under the terms of the GNU General Public License
3759++ * as published by the Free Software Foundation; either version 2
3760++ * of the License, or (at your option) any later version.
3761++ *
3762++ * This program is distributed in the hope that it will be useful,
3763++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3764++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3765++ * GNU General Public License for more details.
3766++ *
3767++ **/
3768++#ifndef _COMPIZ_EXPO_WINDOWS_ON_VIEWPORT_H
3769++#define _COMPIZ_EXPO_WINDOWS_ON_VIEWPORT_H
3770++
3771++#include <core/point.h>
3772++#include <core/size.h>
3773++#include <core/rect.h>
3774++#include "client-list-generator.h"
3775++
3776++namespace compiz
3777++{
3778++ namespace expo
3779++ {
3780++ unsigned int countViewports (const CompSize &vpSize);
3781++
3782++ void activeViewportsForMembers (compiz::expo::ClientListGenerator &clientList,
3783++ const CompPoint &cursor,
3784++ const CompSize &vpSize,
3785++ const CompSize &screenSize,
3786++ std::vector <bool> &viewportActiveStates);
3787++ }
3788++}
3789++
3790++#endif
3791+Index: ubuntu/plugins/expo/src/windows_on_viewport/src/windows-on-viewport.cpp
3792+===================================================================
3793+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3794++++ ubuntu/plugins/expo/src/windows_on_viewport/src/windows-on-viewport.cpp 2012-09-08 15:19:23.513165649 +0800
3795+@@ -0,0 +1,80 @@
3796++/**
3797++ * Copyright © 2012 Canonical Ltd.
3798++ *
3799++ * Authors:
3800++ * Sam Spilsbury <sam.spilsbury@canonical.com>
3801++ *
3802++ * This program is free software; you can redistribute it and/or
3803++ * modify it under the terms of the GNU General Public License
3804++ * as published by the Free Software Foundation; either version 2
3805++ * of the License, or (at your option) any later version.
3806++ *
3807++ * This program is distributed in the hope that it will be useful,
3808++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3809++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3810++ * GNU General Public License for more details.
3811++ *
3812++ **/
3813++#include <cstdio>
3814++#include <algorithm>
3815++#include "windows-on-viewport.h"
3816++#include "viewport-member-window.h"
3817++
3818++namespace compiz
3819++{
3820++ namespace expo
3821++ {
3822++ unsigned int countViewports (const CompSize &vpSize)
3823++ {
3824++ return vpSize.width () * vpSize.height ();
3825++ }
3826++
3827++ void fillInNewViewportActiveData (unsigned int vpCount,
3828++ std::vector <bool> &vpActive)
3829++ {
3830++ if (vpActive.size () < vpCount)
3831++ {
3832++ unsigned int last = vpActive.size () - 1;
3833++ vpActive.resize (vpCount);
3834++ for (unsigned int i = last; i < vpActive.size (); i++)
3835++ vpActive[i] = false;
3836++ }
3837++ }
3838++
3839++ void activeViewportsForMembers (compiz::expo::ClientListGenerator &clientList,
3840++ const CompPoint &cursor,
3841++ const CompSize &vpSize,
3842++ const CompSize &screenSize,
3843++ std::vector <bool> &viewportActiveStates)
3844++ {
3845++ compiz::expo::ViewportMemberWindow *vpMemberWindow = clientList.nextClient ();
3846++
3847++ fillInNewViewportActiveData (countViewports (vpSize), viewportActiveStates);
3848++ std::fill_n (viewportActiveStates.begin (), viewportActiveStates.size (), false);
3849++
3850++ while (vpMemberWindow)
3851++ {
3852++ if (!vpMemberWindow->isDesktopOrDock ())
3853++ {
3854++ CompPoint viewport;
3855++
3856++ /* If this is a dragged window, use the cursor position */
3857++ if (vpMemberWindow->dragged ())
3858++ viewport.set (cursor.x () / screenSize.width (),
3859++ cursor.y () / screenSize.height ());
3860++ else
3861++ {
3862++ const compiz::window::Geometry &geom = vpMemberWindow->absoluteGeometry ();
3863++ viewport.set (geom.centerX () / screenSize.width (),
3864++ geom.centerY () / screenSize.height ());
3865++ }
3866++
3867++ unsigned int vpIndex = vpSize.width () * viewport.y () + viewport.x ();
3868++ viewportActiveStates[vpIndex] = true;
3869++ }
3870++
3871++ vpMemberWindow = clientList.nextClient ();
3872++ }
3873++ }
3874++ }
3875++}
3876+Index: ubuntu/plugins/expo/src/windows_on_viewport/tests/CMakeLists.txt
3877+===================================================================
3878+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3879++++ ubuntu/plugins/expo/src/windows_on_viewport/tests/CMakeLists.txt 2012-09-08 15:06:24.481302659 +0800
3880+@@ -0,0 +1,22 @@
3881++if (NOT GTEST_FOUND)
3882++ message ("Google Test not found - cannot build tests!")
3883++ set (COMPIZ_BUILD_TESTING OFF)
3884++endif (NOT GTEST_FOUND)
3885++
3886++include_directories (${GTEST_INCLUDE_DIRS})
3887++include_directories (${CMAKE_EXPO_PLUGIN_SOURCE_DIR})
3888++
3889++link_directories (${COMPIZ_LIBRARY_DIRS})
3890++
3891++add_executable (compiz_test_expo_windows_on_viewport
3892++ ${CMAKE_CURRENT_SOURCE_DIR}/test-windows-on-viewport.cpp)
3893++
3894++target_link_libraries (compiz_test_expo_windows_on_viewport
3895++ compiz_expo_windows_on_viewport
3896++ ${GTEST_BOTH_LIBRARIES}
3897++ ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
3898++ ${GMOCK_LIBRARY}
3899++ ${GMOCK_MAIN_LIBRARY}
3900++ )
3901++
3902++compiz_discover_tests (compiz_test_expo_windows_on_viewport COVERAGE compiz_expo_windows_on_viewport)
3903+Index: ubuntu/plugins/expo/src/windows_on_viewport/tests/test-windows-on-viewport.cpp
3904+===================================================================
3905+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
3906++++ ubuntu/plugins/expo/src/windows_on_viewport/tests/test-windows-on-viewport.cpp 2012-09-08 15:30:17.600409104 +0800
3907+@@ -0,0 +1,149 @@
3908++/*
3909++ * Copyright © 2012 Canonical Ltd.
3910++ *
3911++ * Permission to use, copy, modify, distribute, and sell this software
3912++ * and its documentation for any purpose is hereby granted without
3913++ * fee, provided that the above copyright notice appear in all copies
3914++ * and that both that copyright notice and this permission notice
3915++ * appear in supporting documentation, and that the name of
3916++ * Canonical Ltd. not be used in advertising or publicity pertaining to
3917++ * distribution of the software without specific, written prior permission.
3918++ * Canonical Ltd. makes no representations about the suitability of this
3919++ * software for any purpose. It is provided "as is" without express or
3920++ * implied warranty.
3921++ *
3922++ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
3923++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
3924++ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
3925++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
3926++ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
3927++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
3928++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3929++ *
3930++ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
3931++ */
3932++#include <gtest/gtest.h>
3933++#include <gmock/gmock.h>
3934++#include "windows-on-viewport.h"
3935++#include "client-list-generator.h"
3936++#include "viewport-member-window.h"
3937++
3938++using ::testing::InSequence;
3939++using ::testing::Return;
3940++using ::testing::ReturnNull;
3941++using ::testing::ReturnRef;
3942++
3943++namespace
3944++{
3945++ namespace ce = compiz::expo;
3946++
3947++ class MockViewportMemberWindow :
3948++ public ce::ViewportMemberWindow
3949++ {
3950++ public:
3951++
3952++ MOCK_CONST_METHOD0 (absoluteGeometry, const compiz::window::Geometry & ());
3953++ MOCK_CONST_METHOD0 (isDesktopOrDock, bool ());
3954++ MOCK_CONST_METHOD0 (dragged, bool ());
3955++ };
3956++
3957++ class MockClientListGenerator :
3958++ public ce::ClientListGenerator
3959++ {
3960++ public:
3961++
3962++ MOCK_METHOD0 (nextClient, ce::ViewportMemberWindow * ());
3963++ };
3964++}
3965++
3966++class ExpoWindowsOnViewportTest :
3967++ public ::testing::Test
3968++{
3969++ protected:
3970++
3971++ MockClientListGenerator mockClientListGenerator;
3972++ std::vector <bool> activeStates;
3973++};
3974++
3975++namespace
3976++{
3977++ const CompSize vpSize (2, 2);
3978++ const CompSize screenSize (1000, 1000);
3979++}
3980++
3981++TEST_F (ExpoWindowsOnViewportTest, TestNoDocksMakeViewportsActive)
3982++{
3983++ MockViewportMemberWindow mockViewportMembers[1];
3984++ InSequence s;
3985++
3986++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (Return (&mockViewportMembers[0]));
3987++ EXPECT_CALL (mockViewportMembers[0], isDesktopOrDock ()).WillOnce (Return (true));
3988++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (ReturnNull ());
3989++
3990++ compiz::expo::activeViewportsForMembers (mockClientListGenerator,
3991++ CompPoint (1, 1),
3992++ vpSize,
3993++ screenSize,
3994++ activeStates);
3995++
3996++ ASSERT_EQ (activeStates.size (), vpSize.width () * vpSize.height ());
3997++ EXPECT_EQ (activeStates[0], false);
3998++ EXPECT_EQ (activeStates[1], false);
3999++ EXPECT_EQ (activeStates[2], false);
4000++ EXPECT_EQ (activeStates[3], false);
4001++}
4002++
4003++TEST_F (ExpoWindowsOnViewportTest, TestGrabbedWindowUsesCursorPosition)
4004++{
4005++ MockViewportMemberWindow mockViewportMembers[1];
4006++ InSequence s;
4007++
4008++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (Return (&mockViewportMembers[0]));
4009++ EXPECT_CALL (mockViewportMembers[0], isDesktopOrDock ()).WillOnce (Return (false));
4010++ EXPECT_CALL (mockViewportMembers[0], dragged ()).WillOnce (Return (true));
4011++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (ReturnNull ());
4012++
4013++ compiz::expo::activeViewportsForMembers (mockClientListGenerator,
4014++ CompPoint (screenSize.width () * 1.5,
4015++ screenSize.height () * 1.5),
4016++ vpSize,
4017++ screenSize,
4018++ activeStates);
4019++
4020++ ASSERT_EQ (activeStates.size (), vpSize.width () * vpSize.height ());
4021++ EXPECT_EQ (activeStates[0], false);
4022++ EXPECT_EQ (activeStates[1], false);
4023++ EXPECT_EQ (activeStates[2], false);
4024++ EXPECT_EQ (activeStates[3], true); // 2,2 has the cursor of a dragged window
4025++}
4026++
4027++TEST_F (ExpoWindowsOnViewportTest, TestUngrabbedWindowUsesGeometry)
4028++{
4029++ MockViewportMemberWindow mockViewportMembers[1];
4030++ InSequence s;
4031++
4032++ compiz::window::Geometry vpMemberGeometry1 (screenSize.width () * 1.1,
4033++ screenSize.height () * 1.1,
4034++ screenSize.width () / 2,
4035++ screenSize.height () / 2,
4036++ 0);
4037++
4038++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (Return (&mockViewportMembers[0]));
4039++ EXPECT_CALL (mockViewportMembers[0], isDesktopOrDock ()).WillOnce (Return (false));
4040++ EXPECT_CALL (mockViewportMembers[0], dragged ()).WillOnce (Return (false));
4041++ EXPECT_CALL (mockViewportMembers[0], absoluteGeometry ()).WillOnce (ReturnRef (vpMemberGeometry1));
4042++ EXPECT_CALL (mockClientListGenerator, nextClient ()).WillOnce (ReturnNull ());
4043++
4044++ compiz::expo::activeViewportsForMembers (mockClientListGenerator,
4045++ CompPoint (screenSize.width () * 1.5,
4046++ screenSize.height () * 1.5),
4047++ vpSize,
4048++ screenSize,
4049++ activeStates);
4050++
4051++ ASSERT_EQ (activeStates.size (), vpSize.width () * vpSize.height ());
4052++ EXPECT_EQ (activeStates[0], false);
4053++ EXPECT_EQ (activeStates[1], false);
4054++ EXPECT_EQ (activeStates[2], false);
4055++ EXPECT_EQ (activeStates[3], true); // 2,2 has a window on it
4056++}
4057+Index: ubuntu/plugins/expo/src/client-list-generator.h
4058+===================================================================
4059+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4060++++ ubuntu/plugins/expo/src/client-list-generator.h 2012-09-08 11:51:33.111328267 +0800
4061+@@ -0,0 +1,45 @@
4062++/*
4063++ * Copyright © 2012 Canonical Ltd.
4064++ *
4065++ * Permission to use, copy, modify, distribute, and sell this software
4066++ * and its documentation for any purpose is hereby granted without
4067++ * fee, provided that the above copyright notice appear in all copies
4068++ * and that both that copyright notice and this permission notice
4069++ * appear in supporting documentation, and that the name of
4070++ * Canonical Ltd. not be used in advertising or publicity pertaining to
4071++ * distribution of the software without specific, written prior permission.
4072++ * Canonical Ltd. makes no representations about the suitability of this
4073++ * software for any purpose. It is provided "as is" without express or
4074++ * implied warranty.
4075++ *
4076++ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
4077++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
4078++ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
4079++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
4080++ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
4081++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
4082++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4083++ *
4084++ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
4085++ */
4086++#ifndef _COMPIZ_EXPO_CLIENT_LIST_GENERATOR_H
4087++#define _COMPIZ_EXPO_CLIENT_LIST_GENERATOR_H
4088++
4089++namespace compiz
4090++{
4091++ namespace expo
4092++ {
4093++ class ViewportMemberWindow;
4094++
4095++ class ClientListGenerator
4096++ {
4097++ public:
4098++
4099++ virtual ~ClientListGenerator () {};
4100++ virtual ViewportMemberWindow * nextClient () = 0;
4101++ };
4102++ }
4103++}
4104++#endif
4105++
4106++
4107+Index: ubuntu/plugins/expo/src/viewport-member-window.h
4108+===================================================================
4109+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
4110++++ ubuntu/plugins/expo/src/viewport-member-window.h 2012-09-08 13:58:19.753047547 +0800
4111+@@ -0,0 +1,46 @@
4112++/*
4113++ * Copyright © 2012 Canonical Ltd.
4114++ *
4115++ * Permission to use, copy, modify, distribute, and sell this software
4116++ * and its documentation for any purpose is hereby granted without
4117++ * fee, provided that the above copyright notice appear in all copies
4118++ * and that both that copyright notice and this permission notice
4119++ * appear in supporting documentation, and that the name of
4120++ * Canonical Ltd. not be used in advertising or publicity pertaining to
4121++ * distribution of the software without specific, written prior permission.
4122++ * Canonical Ltd. makes no representations about the suitability of this
4123++ * software for any purpose. It is provided "as is" without express or
4124++ * implied warranty.
4125++ *
4126++ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
4127++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
4128++ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
4129++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
4130++ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
4131++ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
4132++ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4133++ *
4134++ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
4135++ */
4136++#ifndef _COMPIZ_EXPO_VIEWPORT_MEMBER_WINDOW_H
4137++#define _COMPIZ_EXPO_VIEWPORT_MEMBER_WINDOW_H
4138++
4139++#include <core/windowgeometry.h>
4140++
4141++namespace compiz
4142++{
4143++ namespace expo
4144++ {
4145++ class ViewportMemberWindow
4146++ {
4147++ public:
4148++
4149++ virtual ~ViewportMemberWindow () {};
4150++ virtual const compiz::window::Geometry & absoluteGeometry () const = 0;
4151++ virtual bool dragged () const = 0;
4152++ virtual bool isDesktopOrDock () const = 0;
4153++ };
4154++ }
4155++}
4156++
4157++#endif
4158
4159=== modified file 'debian/patches/series'
4160--- debian/patches/series 2012-06-19 11:22:48 +0000
4161+++ debian/patches/series 2012-09-09 12:57:20 +0000
4162@@ -6,3 +6,4 @@
4163 ccsm_add_first_run_warning.patch
4164 ccsm_disable_unity_checkbox.patch
4165 99_valid_ccsm_desktop_file.patch
4166+100_expo_layout.patch
4167
4168=== modified file 'gtk/gnome/50-compiz-launchers.xml.in'
4169--- gtk/gnome/50-compiz-launchers.xml.in 2012-08-15 14:09:32 +0000
4170+++ gtk/gnome/50-compiz-launchers.xml.in 2012-09-09 12:57:20 +0000
4171@@ -1,6 +1,6 @@
4172 <?xml version="1.0" encoding="UTF-8"?>
4173 <KeyListEntries schema="org.compiz.integrated" wm_name="Compiz" group="system" _name="Launchers" package="compiz">
4174
4175- <KeyListEntry name="exec" _description="Launch Terminal"/>
4176+ <KeyListEntry name="run-command-terminal" _description="Launch Terminal"/>
4177
4178 </KeyListEntries>
4179
4180=== modified file 'include/core/CMakeLists.txt'
4181--- include/core/CMakeLists.txt 2012-05-21 06:43:20 +0000
4182+++ include/core/CMakeLists.txt 2012-09-09 12:57:20 +0000
4183@@ -13,7 +13,6 @@
4184 propertywriter.h
4185 privateunion.h
4186 screen.h
4187- serialization.h
4188 session.h
4189 size.h
4190 string.h
4191
4192=== removed file 'include/core/serialization.h'
4193--- include/core/serialization.h 2010-10-01 13:42:31 +0000
4194+++ include/core/serialization.h 1970-01-01 00:00:00 +0000
4195@@ -1,158 +0,0 @@
4196-/*
4197- * Copyright © 2010 Sam Spilsbury
4198- *
4199- * Permission to use, copy, modify, distribute, and sell this software
4200- * and its documentation for any purpose is hereby granted without
4201- * fee, provided that the above copyright notice appear in all copies
4202- * and that both that copyright notice and this permission notice
4203- * appear in supporting documentation, and that the name of
4204- * Dennis Kasprzyk not be used in advertising or publicity pertaining to
4205- * distribution of the software without specific, written prior permission.
4206- * Dennis Kasprzyk makes no representations about the suitability of this
4207- * software for any purpose. It is provided "as is" without express or
4208- * implied warranty.
4209- *
4210- * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
4211- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
4212- * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
4213- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
4214- * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
4215- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
4216- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4217- *
4218- * Authors: Sam Spilsbury <smspillaz@gmail.com>
4219- */
4220-
4221-#ifndef _COMPSERIALIZATION_H
4222-#define _COMPSERIALIZATION_H
4223-
4224-#include <core/core.h>
4225-#include <core/timer.h>
4226-#include <core/propertywriter.h>
4227-
4228-#include <typeinfo>
4229-#include <boost/preprocessor/cat.hpp>
4230-
4231-#include <boost/archive/text_iarchive.hpp>
4232-#include <boost/archive/text_oarchive.hpp>
4233-
4234-#include <boost/serialization/export.hpp>
4235-
4236-#include <boost/serialization/list.hpp>
4237-#include <boost/serialization/vector.hpp>
4238-
4239-#include <sstream>
4240-#include <fstream>
4241-
4242-
4243-template <class T>
4244-class PluginStateWriter
4245-{
4246- private:
4247- PropertyWriter mPw;
4248- Window mResource;
4249- T *mClassPtr;
4250- CompTimer mTimeout;
4251-
4252- friend class boost::serialization::access;
4253-
4254- bool
4255- checkTimeout ()
4256- {
4257- if (!screen->shouldSerializePlugins ())
4258- return false;
4259-
4260- CompOption::Vector atomTemplate = mPw.readProperty (mResource);
4261-
4262- if (atomTemplate.empty ())
4263- return false;
4264-
4265- if (!(atomTemplate.at (0).value ().type () == CompOption::TypeString))
4266- return false;
4267-
4268- std::istringstream iss (atomTemplate.at (0).value ().s ());
4269- boost::archive::text_iarchive ia (iss);
4270-
4271- ia >> *this;
4272-
4273- postLoad ();
4274-
4275- /* No need to store this data in XServer anymore, get rid of it */
4276-
4277- mPw.deleteProperty (mResource);
4278-
4279- return false;
4280- };
4281-
4282- public:
4283-
4284- template <class Archive>
4285- void serialize (Archive &ar, const unsigned int version)
4286- {
4287- ar & *mClassPtr;;
4288- };
4289-
4290- virtual void postLoad () {};
4291-
4292- /* Classes get destroyed in the order of:
4293- * derived -> this. Because variables might
4294- * have thier destructors called, we provide
4295- * a method to intercept this process
4296- * and immediately serialize data such that it
4297- * won't be unintentionally destroyed before the
4298- * base CompPluginStateWriter destructor gets called
4299- */
4300-
4301- void writeSerializedData ()
4302- {
4303- if (!screen->shouldSerializePlugins ())
4304- return;
4305-
4306- CompOption::Vector atomTemplate = mPw.getReadTemplate ();
4307- std::string str;
4308- std::ostringstream oss (str);
4309- boost::archive::text_oarchive oa (oss);
4310-
4311- /* Nothing was initially read from the property, which probably means that
4312- * shouldSerializePlugins was turned on in between plugin load and unload
4313- * so don't attempt to do anything here */
4314- if (!atomTemplate.size ())
4315- return;
4316-
4317- oa << *this;
4318-
4319- CompOption::Value v (oss.str ().c_str ());
4320- atomTemplate.at (0).set (v);
4321-
4322- mPw.updateProperty (mResource, atomTemplate, XA_STRING);
4323- }
4324-
4325- PluginStateWriter (T *instance,
4326- Window xid) :
4327- mResource (xid),
4328- mClassPtr (instance)
4329- {
4330- if (screen->shouldSerializePlugins ())
4331-
4332- {
4333- CompString atomName = compPrintf ("_COMPIZ_%s_STATE",
4334- typeid (T).name ());
4335- CompOption::Vector o;
4336-
4337- o.resize (1);
4338- o.at (0).setName ("data", CompOption::TypeString);
4339-
4340- mPw = PropertyWriter (atomName, o);
4341-
4342- mTimeout.setCallback (boost::bind (&PluginStateWriter::checkTimeout,
4343- this));
4344- mTimeout.setTimes (0, 0);
4345- mTimeout.start ();
4346- }
4347- }
4348-
4349- virtual ~PluginStateWriter () {};
4350-
4351-};
4352-
4353-#endif
4354
4355=== modified file 'kde/window-decorator-kde4/CMakeLists.txt'
4356--- kde/window-decorator-kde4/CMakeLists.txt 2012-05-24 00:55:17 +0000
4357+++ kde/window-decorator-kde4/CMakeLists.txt 2012-09-09 12:57:20 +0000
4358@@ -13,6 +13,8 @@
4359 include(FindPkgConfig)
4360 include(MacroLibrary)
4361
4362+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
4363+
4364 add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
4365
4366 qt4_add_dbus_adaptor (kwd4_SRCS org.kde.KWin.xml decorator.h KWD::Decorator kwinadaptor)
4367
4368=== modified file 'kde/window-decorator-kde4/main.cpp'
4369--- kde/window-decorator-kde4/main.cpp 2010-08-20 15:29:13 +0000
4370+++ kde/window-decorator-kde4/main.cpp 2012-09-09 12:57:20 +0000
4371@@ -53,7 +53,7 @@
4372 options.add ("blur <type>", ki18n ("Blur type (none,titlebar,all)"), "none");
4373 KAboutData about("kde-window-decorator", "kwin", ki18n ("KDE Window Decorator"),
4374 "0.0.1", KLocalizedString(), KAboutData::License_GPL,
4375- KLocalizedString(), KLocalizedString(), "http://www.compiz.org",
4376+ KLocalizedString(), KLocalizedString(), "https://launchpad.net/compiz",
4377 "dev@lists.compiz-fusion.org");
4378 KCmdLineArgs::init (argc, argv,
4379 "kde-window-decorator",
4380
4381=== modified file 'kde/window-decorator-kde4/window.cpp'
4382--- kde/window-decorator-kde4/window.cpp 2012-07-30 11:49:07 +0000
4383+++ kde/window-decorator-kde4/window.cpp 2012-09-09 12:57:20 +0000
4384@@ -346,12 +346,72 @@
4385 return icon;
4386 }
4387
4388+QIcon
4389+KWD::Window::icon (int idx) const
4390+{
4391+ return icon ();
4392+}
4393+
4394 QString
4395 KWD::Window::caption (void) const
4396 {
4397 return mName;
4398 }
4399
4400+QString
4401+KWD::Window::caption (int idx) const
4402+{
4403+ return caption ();
4404+}
4405+
4406+int
4407+KWD::Window::tabCount () const
4408+{
4409+ return 0;
4410+}
4411+
4412+long
4413+KWD::Window::tabId (int idx) const
4414+{
4415+ return 0;
4416+}
4417+
4418+long
4419+KWD::Window::currentTabId () const
4420+{
4421+ return 0;
4422+}
4423+
4424+void
4425+KWD::Window::setCurrentTab (long id)
4426+{
4427+}
4428+
4429+void
4430+KWD::Window::tab_A_before_B (long A, long B)
4431+{
4432+}
4433+
4434+void
4435+KWD::Window::tab_A_behind_B (long A, long B)
4436+{
4437+}
4438+
4439+void
4440+KWD::Window::untab (long id, const QRect& newGeom)
4441+{
4442+}
4443+
4444+void
4445+KWD::Window::closeTab (long id)
4446+{
4447+}
4448+
4449+void
4450+KWD::Window::closeTabGroup ()
4451+{
4452+}
4453+
4454 /* TODO: We should use libtaskmanager, which is part of kdebase to create
4455 the window menu instead but the headers for that library are currently
4456 not installed. If kdebase could install those headers, we wouldn't have
4457@@ -483,6 +543,12 @@
4458 }
4459
4460 void
4461+KWD::Window::showWindowMenu (const QPoint &pos, long id)
4462+{
4463+ showWindowMenu (pos);
4464+}
4465+
4466+void
4467 KWD::Window::showWindowMenu (const QRect &pos)
4468 {
4469 showWindowMenu (pos.bottomLeft ());
4470
4471=== modified file 'kde/window-decorator-kde4/window.h'
4472--- kde/window-decorator-kde4/window.h 2011-05-08 13:46:51 +0000
4473+++ kde/window-decorator-kde4/window.h 2012-09-09 12:57:20 +0000
4474@@ -85,10 +85,13 @@
4475 virtual NET::WindowType
4476 windowType (unsigned long supported_types) const;
4477 virtual QIcon icon (void) const;
4478+ virtual QIcon icon (int idx) const;
4479 virtual QString caption (void) const;
4480+ virtual QString caption (int idx) const;
4481 virtual void processMousePressEvent (QMouseEvent *);
4482 virtual void showWindowMenu (const QRect &);
4483 virtual void showWindowMenu (const QPoint &);
4484+ virtual void showWindowMenu (const QPoint &, long int id);
4485 virtual void performWindowOperation (WindowOperation);
4486 virtual void setMask (const QRegion &, int);
4487 virtual bool isPreview (void) const;
4488@@ -133,6 +136,16 @@
4489 buttonToWindowOperation(Qt::MouseButtons button);
4490 #endif
4491
4492+ long tabId (int idx) const;
4493+ long currentTabId () const;
4494+ void setCurrentTab (long id);
4495+ void tab_A_before_B (long A, long B);
4496+ void tab_A_behind_B (long A, long B);
4497+ void untab (long id, const QRect& newGeom);
4498+ void closeTab (long id);
4499+ void closeTabGroup ();
4500+ int tabCount () const;
4501+
4502 void handleActiveChange (void);
4503 void updateFrame (WId frame);
4504 void updateWindowGeometry (void);
4505
4506=== modified file 'plugins/addhelper/src/addhelper.cpp'
4507--- plugins/addhelper/src/addhelper.cpp 2010-07-01 05:49:38 +0000
4508+++ plugins/addhelper/src/addhelper.cpp 2012-09-09 12:57:20 +0000
4509@@ -191,16 +191,8 @@
4510 }
4511 }
4512
4513-void
4514-AddWindow::postLoad ()
4515-{
4516- if (dim)
4517- gWindow->glPaintSetEnabled (this, true);
4518-}
4519-
4520 AddWindow::AddWindow (CompWindow *window) :
4521 PluginClassHandler <AddWindow, CompWindow> (window),
4522- PluginStateWriter <AddWindow> (this, window->id ()),
4523 window (window),
4524 cWindow (CompositeWindow::get (window)),
4525 gWindow (GLWindow::get (window)),
4526@@ -218,22 +210,12 @@
4527
4528 AddWindow::~AddWindow ()
4529 {
4530- writeSerializedData ();
4531-
4532 if (dim)
4533 cWindow->addDamage ();
4534 }
4535
4536-void
4537-AddScreen::postLoad ()
4538-{
4539- if (isToggle)
4540- screen->handleEventSetEnabled (this, true);
4541-}
4542-
4543 AddScreen::AddScreen (CompScreen *screen) :
4544 PluginClassHandler <AddScreen, CompScreen> (screen),
4545- PluginStateWriter <AddScreen> (this, screen->root ()),
4546 cScreen (CompositeScreen::get (screen)),
4547 opacity ((optionGetOpacity () * 0xffff) / 100),
4548 brightness ((optionGetBrightness () * 0xffff) / 100),
4549@@ -254,11 +236,6 @@
4550 optionSetOnoninitNotify (boost::bind (&AddScreen::optionChanged, this, _1,
4551 _2));
4552 }
4553-
4554-AddScreen::~AddScreen ()
4555-{
4556- writeSerializedData ();
4557-}
4558
4559 bool
4560 AddPluginVTable::init ()
4561
4562=== modified file 'plugins/addhelper/src/addhelper.h'
4563--- plugins/addhelper/src/addhelper.h 2010-06-12 07:52:30 +0000
4564+++ plugins/addhelper/src/addhelper.h 2012-09-09 12:57:20 +0000
4565@@ -27,7 +27,6 @@
4566 */
4567
4568 #include <core/core.h>
4569-#include <core/serialization.h>
4570 #include <composite/composite.h>
4571 #include <opengl/opengl.h>
4572
4573@@ -36,13 +35,11 @@
4574
4575 class AddScreen :
4576 public PluginClassHandler <AddScreen, CompScreen>,
4577- public PluginStateWriter <AddScreen>,
4578 public ScreenInterface,
4579 public AddhelperOptions
4580 {
4581 public:
4582 AddScreen (CompScreen *screen);
4583- ~AddScreen ();
4584
4585 CompositeScreen *cScreen;
4586
4587@@ -51,17 +48,6 @@
4588 GLushort saturation;
4589
4590 bool isToggle;
4591-
4592- template <class Archive>
4593- void serialize (Archive &ar, const unsigned int version)
4594- {
4595- ar & isToggle;
4596- ar & opacity;
4597- ar & brightness;
4598- ar & saturation;
4599- };
4600-
4601- void postLoad ();
4602
4603 void
4604 handleEvent (XEvent *event);
4605@@ -83,7 +69,6 @@
4606
4607 class AddWindow :
4608 public PluginClassHandler <AddWindow, CompWindow>,
4609- public PluginStateWriter <AddWindow>,
4610 public GLWindowInterface
4611 {
4612 public:
4613@@ -95,14 +80,6 @@
4614 GLWindow *gWindow;
4615
4616 bool dim;
4617-
4618- template <class Archive>
4619- void serialize (Archive &ar, const unsigned int version)
4620- {
4621- ar & dim;
4622- };
4623-
4624- void postLoad ();
4625
4626 bool
4627 glPaint (const GLWindowPaintAttrib &,
4628
4629=== modified file 'plugins/animation/animation.xml.in'
4630--- plugins/animation/animation.xml.in 2012-08-22 01:21:08 +0000
4631+++ plugins/animation/animation.xml.in 2012-09-09 12:57:20 +0000
4632@@ -214,12 +214,12 @@
4633 </group>
4634
4635 <group>
4636- <_short>UnMinimize Animation</_short>
4637+ <_short>Unminimize Animation</_short>
4638
4639 <subgroup>
4640 <_short>Animation Selection</_short>
4641 <option name="unminimize_effects" type="list">
4642- <_short>UnMinimize Effect</_short>
4643+ <_short>Unminimize Effect</_short>
4644 <_long>The animation effect shown when unminimizing a window.</_long>
4645 <type>string</type>
4646 <extensible/>
4647
4648=== modified file 'plugins/animation/include/animation/animation.h'
4649--- plugins/animation/include/animation/animation.h 2012-08-22 01:21:08 +0000
4650+++ plugins/animation/include/animation/animation.h 2012-09-09 12:57:20 +0000
4651@@ -11,9 +11,9 @@
4652 WindowEventOpen = 0,
4653 WindowEventClose,
4654 WindowEventMinimize,
4655+ WindowEventUnminimize,
4656 WindowEventShade,
4657 WindowEventUnshade,
4658- WindowEventUnminimize,
4659 WindowEventFocus,
4660 WindowEventNum,
4661 WindowEventNone
4662@@ -24,8 +24,8 @@
4663 AnimEventOpen = 0,
4664 AnimEventClose,
4665 AnimEventMinimize,
4666+ AnimEventUnminimize,
4667 AnimEventShade,
4668- AnimEventUnMinimize,
4669 AnimEventFocus,
4670 AnimEventNum
4671 } AnimEvent;
4672
4673=== modified file 'plugins/animation/include/animation/animeffect.h'
4674--- plugins/animation/include/animation/animeffect.h 2012-08-22 01:21:08 +0000
4675+++ plugins/animation/include/animation/animeffect.h 2012-09-09 12:57:20 +0000
4676@@ -20,7 +20,7 @@
4677 bool close;
4678 bool minimize;
4679 bool shade;
4680- bool unMinimize;
4681+ bool unminimize;
4682 bool focus;
4683 };
4684
4685
4686=== modified file 'plugins/animation/src/animation.cpp'
4687--- plugins/animation/src/animation.cpp 2012-08-22 01:21:08 +0000
4688+++ plugins/animation/src/animation.cpp 2012-09-09 12:57:20 +0000
4689@@ -106,15 +106,15 @@
4690 #define FAKE_ICON_SIZE 4
4691
4692 const char *eventNames[AnimEventNum] =
4693-{"Open", "Close", "Minimize", "Shade", "UnMinimize", "Focus"};
4694+{"Open", "Close", "Minimize", "Unminimize", "Shade", "Focus"};
4695
4696 int chosenEffectOptionIds[AnimEventNum] =
4697 {
4698 AnimationOptions::OpenEffects,
4699 AnimationOptions::CloseEffects,
4700 AnimationOptions::MinimizeEffects,
4701+ AnimationOptions::UnminimizeEffects,
4702 AnimationOptions::ShadeEffects,
4703- AnimationOptions::UnminimizeEffects,
4704 AnimationOptions::FocusEffects,
4705 };
4706
4707@@ -123,8 +123,8 @@
4708 AnimationOptions::OpenRandomEffects,
4709 AnimationOptions::CloseRandomEffects,
4710 AnimationOptions::MinimizeRandomEffects,
4711+ AnimationOptions::UnminimizeRandomEffects,
4712 AnimationOptions::ShadeRandomEffects,
4713- AnimationOptions::UnminimizeRandomEffects,
4714 -1
4715 };
4716
4717@@ -133,8 +133,8 @@
4718 AnimationOptions::OpenOptions,
4719 AnimationOptions::CloseOptions,
4720 AnimationOptions::MinimizeOptions,
4721+ AnimationOptions::UnminimizeOptions,
4722 AnimationOptions::ShadeOptions,
4723- AnimationOptions::UnminimizeOptions,
4724 AnimationOptions::FocusOptions
4725 };
4726
4727@@ -143,8 +143,8 @@
4728 AnimationOptions::OpenMatches,
4729 AnimationOptions::CloseMatches,
4730 AnimationOptions::MinimizeMatches,
4731+ AnimationOptions::UnminimizeMatches,
4732 AnimationOptions::ShadeMatches,
4733- AnimationOptions::UnminimizeMatches,
4734 AnimationOptions::FocusMatches
4735 };
4736
4737@@ -153,8 +153,8 @@
4738 AnimationOptions::OpenDurations,
4739 AnimationOptions::CloseDurations,
4740 AnimationOptions::MinimizeDurations,
4741+ AnimationOptions::UnminimizeDurations,
4742 AnimationOptions::ShadeDurations,
4743- AnimationOptions::UnminimizeDurations,
4744 AnimationOptions::FocusDurations
4745 };
4746
4747@@ -551,7 +551,7 @@
4748 }
4749
4750 // Assumes events in the metadata are in
4751-// [Open, Close, Minimize, Shade, UnMinimize, Focus] order
4752+// [Open, Close, Minimize, Unminimize, Shade, Focus] order
4753 // and effects among those are in alphabetical order
4754 // but with "(Event) None" first and "(Event) Random" last.
4755 AnimEffect
4756@@ -2231,7 +2231,7 @@
4757
4758 int duration = 200;
4759 AnimEffect chosenEffect =
4760- getMatchingAnimSelection (w, AnimEventUnMinimize, &duration);
4761+ getMatchingAnimSelection (w, AnimEventUnminimize, &duration);
4762
4763 aw->mNewState = NormalState;
4764
4765@@ -2265,7 +2265,7 @@
4766 if (startingNew)
4767 {
4768 AnimEffect effectToBePlayed =
4769- getActualEffect (chosenEffect, AnimEventUnMinimize);
4770+ getActualEffect (chosenEffect, AnimEventUnminimize);
4771
4772 // handle empty random effect list
4773 if (effectToBePlayed == AnimEffectNone)
4774@@ -2511,7 +2511,7 @@
4775 {
4776 AnimEffectUsedFor usedFor;
4777 usedFor.open = usedFor.close = usedFor.minimize =
4778- usedFor.shade = usedFor.unMinimize = usedFor.focus = true;
4779+ usedFor.shade = usedFor.unminimize = usedFor.focus = true;
4780 return usedFor;
4781 }
4782
4783@@ -2519,7 +2519,7 @@
4784 {
4785 AnimEffectUsedFor usedFor;
4786 usedFor.open = usedFor.close = usedFor.minimize =
4787- usedFor.shade = usedFor.unMinimize = usedFor.focus = true;
4788+ usedFor.shade = usedFor.unminimize = usedFor.focus = true;
4789 return usedFor;
4790 }
4791
4792@@ -2529,8 +2529,8 @@
4793 case AnimEventOpen: open = false; break;
4794 case AnimEventClose: close = false; break;
4795 case AnimEventMinimize: minimize = false; break;
4796+ case AnimEventUnminimize: unminimize = false; break;
4797 case AnimEventShade: shade = false; break;
4798- case AnimEventUnMinimize: unMinimize = false; break;
4799 case AnimEventFocus: focus = false; break;
4800 default: break;
4801 }
4802@@ -2543,8 +2543,8 @@
4803 case AnimEventOpen: open = true; break;
4804 case AnimEventClose: close = true; break;
4805 case AnimEventMinimize: minimize = true; break;
4806+ case AnimEventUnminimize: unminimize = true; break;
4807 case AnimEventShade: shade = true; break;
4808- case AnimEventUnMinimize: unMinimize = true; break;
4809 case AnimEventFocus: focus = true; break;
4810 default: break;
4811 }
4812@@ -2562,8 +2562,8 @@
4813 usedForEvents[AnimEventOpen] = usedFor.open;
4814 usedForEvents[AnimEventClose] = usedFor.close;
4815 usedForEvents[AnimEventMinimize] = usedFor.minimize;
4816+ usedForEvents[AnimEventUnminimize] = usedFor.unminimize;
4817 usedForEvents[AnimEventShade] = usedFor.shade;
4818- usedForEvents[AnimEventUnMinimize] = usedFor.unMinimize;
4819 usedForEvents[AnimEventFocus] = usedFor.focus;
4820 }
4821
4822@@ -2646,24 +2646,28 @@
4823 optionSetOpenMatchesNotify (MATCHES_BIND);
4824 optionSetCloseMatchesNotify (MATCHES_BIND);
4825 optionSetMinimizeMatchesNotify (MATCHES_BIND);
4826+ optionSetUnminimizeMatchesNotify (MATCHES_BIND);
4827 optionSetFocusMatchesNotify (MATCHES_BIND);
4828 optionSetShadeMatchesNotify (MATCHES_BIND);
4829
4830 optionSetOpenOptionsNotify (OPTIONS_BIND);
4831 optionSetCloseOptionsNotify (OPTIONS_BIND);
4832 optionSetMinimizeOptionsNotify (OPTIONS_BIND);
4833+ optionSetUnminimizeOptionsNotify (OPTIONS_BIND);
4834 optionSetFocusOptionsNotify (OPTIONS_BIND);
4835 optionSetShadeOptionsNotify (OPTIONS_BIND);
4836
4837 optionSetOpenEffectsNotify (EFFECTS_BIND);
4838 optionSetCloseEffectsNotify (EFFECTS_BIND);
4839 optionSetMinimizeEffectsNotify (EFFECTS_BIND);
4840+ optionSetUnminimizeEffectsNotify (EFFECTS_BIND);
4841 optionSetFocusEffectsNotify (EFFECTS_BIND);
4842 optionSetShadeEffectsNotify (EFFECTS_BIND);
4843
4844 optionSetOpenRandomEffectsNotify (RANDOM_EFFECTS_BIND);
4845 optionSetCloseRandomEffectsNotify (RANDOM_EFFECTS_BIND);
4846 optionSetMinimizeRandomEffectsNotify (RANDOM_EFFECTS_BIND);
4847+ optionSetUnminimizeRandomEffectsNotify (RANDOM_EFFECTS_BIND);
4848 optionSetShadeRandomEffectsNotify (RANDOM_EFFECTS_BIND);
4849
4850 ScreenInterface::setHandler (::screen);
4851@@ -2837,15 +2841,15 @@
4852 mPAScreen->initiateMinimizeAnim (this);
4853 mEventNotOpenClose = true;
4854 break;
4855- case CompWindowNotifyShade:
4856- mPAScreen->initiateShadeAnim (this);
4857- mEventNotOpenClose = true;
4858- break;
4859 case CompWindowNotifyLeaveShowDesktopMode:
4860 case CompWindowNotifyUnminimize:
4861 mPAScreen->initiateUnminimizeAnim (this);
4862 mEventNotOpenClose = true;
4863 break;
4864+ case CompWindowNotifyShade:
4865+ mPAScreen->initiateShadeAnim (this);
4866+ mEventNotOpenClose = true;
4867+ break;
4868 case CompWindowNotifyUnshade:
4869 if (mNowShaded &&
4870 mCurAnimation &&
4871
4872=== modified file 'plugins/animation/src/grid.cpp'
4873--- plugins/animation/src/grid.cpp 2012-08-14 06:33:22 +0000
4874+++ plugins/animation/src/grid.cpp 2012-09-09 12:57:20 +0000
4875@@ -221,12 +221,8 @@
4876 {
4877
4878 GLfloat *v, *vMax;
4879- int y1, x2, y2;
4880 float winContentsY, winContentsHeight;
4881- float deformedX, deformedY;
4882- float deformedZ = 0;
4883 int vSize;
4884- float gridW, gridH;
4885 bool notUsing3dCoords = !using3D ();
4886
4887 if (region.isEmpty ()) // nothing to do
4888@@ -255,11 +251,12 @@
4889
4890 // Indentation kept to provide a clean diff with the old code, for now...
4891 {
4892- y1 = outRect.y1 ();
4893- x2 = outRect.x2 ();
4894- y2 = outRect.y2 ();
4895+ int y1 = outRect.y1 ();
4896+ int x2 = outRect.x2 ();
4897+ int y2 = outRect.y2 ();
4898
4899- gridW = (float)owidth / (mGridWidth - 1);
4900+ float gridW = (float)owidth / (mGridWidth - 1);
4901+ float gridH;
4902
4903 if (mCurWindowEvent == WindowEventShade ||
4904 mCurWindowEvent == WindowEventUnshade)
4905@@ -384,9 +381,9 @@
4906 inxRest * objToBottomLeftPos.z () +
4907 inx * objToBottomRightPos.z ());
4908
4909- deformedX = inyRest * hor1x + iny * hor2x;
4910- deformedY = inyRest * hor1y + iny * hor2y;
4911- deformedZ = inyRest * hor1z + iny * hor2z;
4912+ float deformedX = inyRest * hor1x + iny * hor2x;
4913+ float deformedY = inyRest * hor1y + iny * hor2y;
4914+ float deformedZ = inyRest * hor1z + iny * hor2z;
4915
4916 v[0] = deformedX;
4917 v[1] = deformedY;
4918
4919=== modified file 'plugins/animation/src/options.cpp'
4920--- plugins/animation/src/options.cpp 2010-10-23 15:41:33 +0000
4921+++ plugins/animation/src/options.cpp 2012-09-09 12:57:20 +0000
4922@@ -34,7 +34,7 @@
4923 AnimEventOpen,
4924 AnimEventClose,
4925 AnimEventMinimize,
4926- AnimEventMinimize,
4927+ AnimEventUnminimize,
4928 AnimEventShade,
4929 AnimEventShade,
4930 AnimEventFocus
4931@@ -60,6 +60,11 @@
4932 case AnimationOptions::MinimizeRandomEffects:
4933 return AnimEventMinimize;
4934
4935+ case AnimationOptions::UnminimizeOptions:
4936+ case AnimationOptions::UnminimizeEffects:
4937+ case AnimationOptions::UnminimizeRandomEffects:
4938+ return AnimEventUnminimize;
4939+
4940 case AnimationOptions::FocusOptions:
4941 case AnimationOptions::FocusEffects:
4942 return AnimEventFocus;
4943@@ -111,9 +116,11 @@
4944 PrivateAnimScreen::getOptionSetForSelectedRow (PrivateAnimWindow *aw,
4945 Animation *anim)
4946 {
4947- return (&mEventOptionSets[win2AnimEventMap
4948- [anim->curWindowEvent ()]].
4949- sets[(unsigned) aw->curAnimSelectionRow ()]);
4950+ const AnimEvent event = win2AnimEventMap[anim->curWindowEvent ()];
4951+ OptionSets &eventOptionSets = mEventOptionSets[event];
4952+ OptionSet *setSelectedForRow = &eventOptionSets.sets[(unsigned int) aw->curAnimSelectionRow ()];
4953+
4954+ return setSelectedForRow;
4955 }
4956
4957 void
4958
4959=== modified file 'plugins/annotate/src/annotate.cpp'
4960--- plugins/annotate/src/annotate.cpp 2012-08-06 01:36:00 +0000
4961+++ plugins/annotate/src/annotate.cpp 2012-09-09 12:57:20 +0000
4962@@ -980,20 +980,8 @@
4963 screen->handleEvent (event);
4964 }
4965
4966-void
4967-AnnoScreen::postLoad ()
4968-{
4969- if (content)
4970- {
4971- cairoContext ();
4972-
4973- gScreen->glPaintOutputSetEnabled (this, true);
4974- }
4975-}
4976-
4977 AnnoScreen::AnnoScreen (CompScreen *screen) :
4978 PluginClassHandler <AnnoScreen, CompScreen> (screen),
4979- PluginStateWriter <AnnoScreen> (this, screen->root ()),
4980 cScreen (CompositeScreen::get (screen)),
4981 gScreen (GLScreen::get (screen)),
4982 grabIndex (0),
4983@@ -1034,9 +1022,7 @@
4984 }
4985
4986 AnnoScreen::~AnnoScreen ()
4987-{
4988- writeSerializedData ();
4989-
4990+{
4991 if (cairo)
4992 cairo_destroy (cairo);
4993 if (surface)
4994
4995=== modified file 'plugins/annotate/src/annotate.h'
4996--- plugins/annotate/src/annotate.h 2012-01-31 17:01:32 +0000
4997+++ plugins/annotate/src/annotate.h 2012-09-09 12:57:20 +0000
4998@@ -26,8 +26,6 @@
4999 #include "annotate_options.h"
5000 #include <composite/composite.h>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: