Merge lp:~smspillaz/unity/4.0-deps into lp:unity

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~smspillaz/unity/4.0-deps
Merge into: lp:unity
Diff against target: 3355 lines (+2619/-73) (has conflicts)
41 files modified
AUTHORS (+3/-0)
CMakeLists.txt (+5/-0)
ChangeLog (+390/-0)
manual-tests/QuicklistOnExpo.txt (+14/-0)
manual-tests/ReadMe.txt (+47/-0)
manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json (+22/-0)
manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json (+44/-0)
manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json (+23/-0)
manual-tests/custom-dash-home/custom-dash-home.txt (+46/-0)
manual-tests/launcher.txt (+11/-0)
plugins/unityshell/src/DashController.cpp (+5/-0)
plugins/unityshell/src/DashView.cpp (+5/-0)
plugins/unityshell/src/DashView.h (+6/-0)
plugins/unityshell/src/FilterBar.cpp (+6/-0)
plugins/unityshell/src/FilterExpanderLabel.cpp (+14/-1)
plugins/unityshell/src/FilterGenreWidget.cpp (+4/-0)
plugins/unityshell/src/GeisAdapter.cpp (+1/-1)
plugins/unityshell/src/IMTextEntry.cpp (+15/-0)
plugins/unityshell/src/JSONParser.cpp (+13/-0)
plugins/unityshell/src/JSONParser.h (+4/-0)
plugins/unityshell/src/LauncherIcon.cpp (+3/-0)
plugins/unityshell/src/LensView.cpp (+7/-0)
plugins/unityshell/src/PanelTray.cpp (+4/-0)
plugins/unityshell/src/PanelView.cpp (+8/-0)
plugins/unityshell/src/PlacesHomeView.cpp (+237/-59)
plugins/unityshell/src/PlacesHomeView.h (+4/-0)
plugins/unityshell/src/ResultViewGrid.cpp (+31/-2)
plugins/unityshell/src/ScreenEffectFramebufferObject.cpp (+237/-0)
plugins/unityshell/src/ScreenEffectFramebufferObject.h (+87/-0)
plugins/unityshell/src/SwitcherModel.cpp (+7/-0)
plugins/unityshell/src/comptransientfor.cpp (+6/-1)
plugins/unityshell/src/transientfor.cpp (+12/-4)
plugins/unityshell/src/unityshell.cpp (+90/-4)
plugins/unityshell/src/unityshell.h (+12/-1)
tests/CMakeLists.txt (+438/-0)
tests/GLFuncLoader.cpp (+51/-0)
tests/GLFuncLoader.h (+33/-0)
tests/TestScreenEffectFramebufferObject.cpp (+671/-0)
tests/test-get-transients/CMakeLists.txt (+1/-0)
tests/test-input-remover/CMakeLists.txt (+1/-0)
tests/test-minimize-window-handler/CMakeLists.txt (+1/-0)
Text conflict in CMakeLists.txt
Conflict adding file manual-tests.  Moved existing file to manual-tests.moved.
Text conflict in plugins/unityshell/src/DashController.cpp
Text conflict in plugins/unityshell/src/DashView.cpp
Text conflict in plugins/unityshell/src/DashView.h
Text conflict in plugins/unityshell/src/FilterBar.cpp
Text conflict in plugins/unityshell/src/FilterExpanderLabel.cpp
Text conflict in plugins/unityshell/src/FilterGenreWidget.cpp
Text conflict in plugins/unityshell/src/IMTextEntry.cpp
Text conflict in plugins/unityshell/src/LauncherIcon.cpp
Text conflict in plugins/unityshell/src/LensView.cpp
Text conflict in plugins/unityshell/src/PanelTray.cpp
Text conflict in plugins/unityshell/src/PanelView.cpp
Text conflict in plugins/unityshell/src/PlacesHomeView.cpp
Text conflict in plugins/unityshell/src/ResultViewGrid.cpp
Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.h
Text conflict in plugins/unityshell/src/SwitcherModel.cpp
Text conflict in plugins/unityshell/src/unityshell.cpp
Text conflict in plugins/unityshell/src/unityshell.h
Text conflict in tests/CMakeLists.txt
To merge this branch: bzr merge lp:~smspillaz/unity/4.0-deps
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+87744@code.launchpad.net

This proposal has been superseded by a proposal from 2012-01-06.

Description of the change

  Also add a dependency on libunity-core for the window handling tests and
  the glfuncloader dlopen loader since link_libraries forces those to be linked
  against libunity-core and since link_libraries doesn't care about target
  dependencies, there is a build race where libunity-core isn't built in time
  for those targets to be (erroneously) linked to.

  The real solution is to kill the call to link_libraries.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2011-09-29 16:08:42 +0000
+++ AUTHORS 2012-01-06 13:12:27 +0000
@@ -17,6 +17,7 @@
17 Jani Monoses <jani@ubuntu.com>17 Jani Monoses <jani@ubuntu.com>
18 Jason Smith <jason.smith@canonical.com>18 Jason Smith <jason.smith@canonical.com>
19 jassmith@gmail.com19 jassmith@gmail.com
20 Jay Ó Broin <ismise@lavabit.com>
20 Jay Taoko <jay.taoko@canonical.com>21 Jay Taoko <jay.taoko@canonical.com>
21 Loïc Molinari <loic.molinari@canonical.com>22 Loïc Molinari <loic.molinari@canonical.com>
22 Marco Biscaro <marcobiscaro2112@gmail.com>23 Marco Biscaro <marcobiscaro2112@gmail.com>
@@ -26,6 +27,7 @@
26 Marco Trevisan (Treviño) <mail@3v1n0.net>27 Marco Trevisan (Treviño) <mail@3v1n0.net>
27 Marius Gedminas <marius@gedmin.as>28 Marius Gedminas <marius@gedmin.as>
28 Michael Terry <mike@mterry.name>29 Michael Terry <mike@mterry.name>
30 Michal Hruby <michal.mhr@gmail.com>
29 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@gmail.com>31 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@gmail.com>
30 Mirco Müller <mirco.mueller@ubuntu.com>32 Mirco Müller <mirco.mueller@ubuntu.com>
31 Mitsuya Shibata33 Mitsuya Shibata
@@ -42,3 +44,4 @@
42 Ted Gould <ted@gould.cx>44 Ted Gould <ted@gould.cx>
43 Tim Penhey <tim.penhey@canonical.com>45 Tim Penhey <tim.penhey@canonical.com>
44 Ubuntu <ubuntu@netbook>46 Ubuntu <ubuntu@netbook>
47 Zaid Yeganeh <zaid.yeganeh@gmail.com>
4548
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2011-12-14 17:17:34 +0000
+++ CMakeLists.txt 2012-01-06 13:12:27 +0000
@@ -7,8 +7,13 @@
7# Base bits7# Base bits
8#8#
9set (PROJECT_NAME "unity")9set (PROJECT_NAME "unity")
10<<<<<<< TREE
10set (UNITY_MAJOR 5)11set (UNITY_MAJOR 5)
11set (UNITY_MINOR 0)12set (UNITY_MINOR 0)
13=======
14set (UNITY_MAJOR 4)
15set (UNITY_MINOR 28)
16>>>>>>> MERGE-SOURCE
12set (UNITY_MICRO 0)17set (UNITY_MICRO 0)
13set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")18set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")
14set (UNITY_API_VERSION "5.0")19set (UNITY_API_VERSION "5.0")
1520
=== modified file 'ChangeLog'
--- ChangeLog 2011-10-04 12:16:15 +0000
+++ ChangeLog 2012-01-06 13:12:27 +0000
@@ -1,3 +1,393 @@
12011-12-15 Mirco Müller <mirco.mueller@canonical.com>
2
3 4.26.0 release with backported fixes (from trunk), please consult "bzr log" for authors of individual patches
4 * (LP #863114): cannot raise window from panel after minimize
5 * (LP #865890): compiz crashed with SIGSEGV in nux::BaseWindow::GetInputWindowId()
6 * back out a horizontal margin that breaks sizing in some cases
7 * raise input windows from nux unconditionally on alt-tab and showing of the dash using compiz
8 * (LP #832151): properly unref'ing tray the FilterTrayCallback should not be called again
9 * (LP #834630): add an out-of-bounds check to the DetailXids vector
10 * (LP #856205): backported from unity trunk
11 * (LP #873100): clicking on panel when dash is open no longer causes maximized window to raise (backported r1751)
12 * (LP #860805): get focus on dash by pressing the super key first time after login (backported r1759)
13 * (LP #850623, LP #849611): don't segfault in geis_configuration_get_value() (backported r1728)
14
152011-10-12 Neil Jagdish Patel <neil.patel@canonical.com>
16
17 Fix tests for FilterMultirangeWidget
18
192011-10-12 Zaid Yeganeh <zaid.yeganeh@gmail.com>
20
21 Lens range widgets do not function correctly
22
232011-10-07 Zaid Yeganeh <zaid.yeganeh@gmail.com>
24
25 [UnityCore] Fixed the mouse interactions with the multi range filter
26
27 modified:
28 UnityCore/MultiRangeFilter.cpp
29
302011-10-12 Jay Ó Broin <ismise@lavabit.com>
31
32 Clicking blank space on top panel doesn't raise maximized window to front
33
342011-10-10 Jay Ó Broin <ismise@lavabit.com>
35
36 Add handler to raise maximized window on left-click on panel (LP: #864708)
37
382011-10-12 Brandon Schaefer <schbra02@evergreen.edu>
39
40 When the ibus was active and you pressed down it would move the focus to the result grid. Now when the ibus is active it keeps the focus when your press down/up
41
422011-10-11 Brandon Schaefer <brandontschaefer@gmail.com>
43
44 Now pressing the ddown key with ibus works
45
462011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
47
48 Bug #869196: unity panel menus don't stay open when clicked on second monitor with different geometry
49
502011-10-11 Robert Carr <robert.carr@canonical.com>
51
52 Always check return value of XGetWindowProperty otherwise we sometimes free a random chunk of memory
53
542011-10-11 Robert Carr <robert.carr@canonical.com>
55
56 Minimum height of multi range filter should be the same as for Genre buttons (32)
57
582011-10-11 Robert Carr <robert.carr@canonical.com>
59
60 Merge lp:~robertcarr/unity/filtertweaks
61
622011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
63
64 Merge lp:~smspillaz/unity/unity.fix_870430
65
662011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
67
68 Use correct memory management and temporarily disable focus handlers when passing
69 the showdesktop wrap chain to core.
70
71 Core checks for whether or not the window is allowed focus, for minimized windows
72 we set this to true because plugins such as scale need to check this value
73 to determine if a window should be added to their display lists. However, core
74 will set the "in showdesktop mode" value to true if the window is allowed to have
75 focus and wasn't already in showdesktop mode by the time the wrap chain is passed,
76 but the window is already hidden, so it shouldn't be allowed to be included in the
77 showdesktop list, so disable focus handlers such that CompWindow::focus will
78 return false
79
802011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
81
82 Bug #870844: Double-click on the dash top panel is taken effect on the window underneith
83
842011-10-12 Marco Trevisan (Treviño) <mail@3v1n0.net>
85
86 Leak fix
87
882011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
89
90 PanelService: Code spacing fix
91
922011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
93
94 PanelService: entry2geometry_hash free the keys as well.
95
962011-10-12 Sam Spilsbury <sam.spilsbury@canonical.com>
97
98 Merge lp:~smspillaz/unity/unity.fix_843958 (lp:unity r1714)
99
1002011-10-11 Sam Spilsbury <sam.spilsbury@canonical.com>
101
102 Merge lp:~smspillaz/unity/unity.fix_870430 (lp:unity r1709)
103
1042011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
105
106 Bug #869196: unity panel menus don't stay open when clicked on second monitor with different geometry
107
1082011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
109
110 PanelService: reset the use_event variable on menu-hidden
111
112 This fixes the bug which caused the menus to re-close when opening one
113 after that the previous one has been closed using the "ESC" button.
114
1152011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
116
117 PanelView: Sync geometries on panel window destruction
118
119 This clears the indicators and menus entries geometries cached
120 in unity panel service.
121
1222011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
123
124 PanelView: always sync geometries for indicators.
125
126 Don't sync menus only if they aren't available in the current panel window
127 for the given monitor.
128
1292011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
130
131 PanelView: When syncing geometries send a different panel name for each panel window
132
133 Thanks to the new unity-panel-service code, this finally fixes bug #869196
134 for unity.
135
1362011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
137
138 PanelService: Order the entries geometry per-panel to fix multi-monitor issues
139
140 The entries geometries now are related to their parent panel, so every panel window
141 that is built now can define the geometries of his own entries.
142 This allows to redefine the get_entry_at function to make the event_filter function
143 to work correctly also when we're in a multi-screen environment not cause the indicator
144 menus to close on non-primary monitors.
145
146 This is the needed base to fix bug #869196
147
1482011-10-11 Neil Jagdish Patel <neil.patel@canonical.com>
149
150 Bug #870844: Double-click on the dash top panel is taken effect on the window underneith
151
1522011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
153
154 PanelMenuView: don't react to middle-click when the dash is opened.
155
1562011-10-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
157
158 PanelMenuView: don't react to double-click when the dash is opened.
159
160 Fixes bug #870844
161
1622011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
163
164 Bug #841750: Dash - horizental divider line in between categories incorrectly drawn
165
1662011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
167
168 Bug #814610: FFe: Since showing devices in Nautilus is removed, there is no way to format an usb stick
169
1702011-09-24 Andrea Azzarone <azzaronea@gmail.com>
171
172 Add a "Format..." quicklist item to device icons (LP bug# 814610).
173
1742011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
175
176 Bug #862849: F10 opens a random menu item when it should open the first one [regression]
177
1782011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
179
180 Bug #839480: Dash - When the Dash is open and there is a maximised app in the background, the top bar background should not disappear
181
1822011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
183
184 Bug #869109: compiz crashed with SIGSEGV in nux::ROProperty<std::string>::operator std::string()
185
1862011-10-10 Robert Carr <racarr@canonical.com>
187
188 Minimum height of multi range filter should be the same as for Genre buttons (32)
189
1902011-10-10 Robert Carr <racarr@canonical.com>
191
192 Always check return value of XGetWindowProperty otherwise we sometimes free a random chunk of memory
193
1942011-10-10 Robert Carr <racarr@canonical.com>
195
196 Merge lp:~robertcarr/unity/filtertweaks
197
1982011-10-10 Robert Carr <racarr@canonical.com>
199
200 Fix button opacity
201
2022011-10-10 Robert Carr <racarr@canonical.com>
203
204 Fix all button positioning and right margin
205
2062011-10-10 Robert Carr <racarr@canonical.com>
207
208 Fix all button shape
209
2102011-10-10 Robert Carr <racarr@canonical.com>
211
212 Filter Genre widget buttons are too big, fix to match mockup
213
2142011-10-10 Robert Carr <racarr@canonical.com>
215
216 Fix some spacing in filter bar. work against 863246
217
2182011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
219
220 Bug #841750: Dash - horizental divider line in between categories incorrectly drawn
221
2222011-10-10 Mirco Müller <mirco.mueller@ubuntu.com>
223
224 Fixed additional issues (opacity, margin) added to LP: #841750
225
2262011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
227
228 Bug #862849: F10 opens a random menu item when it should open the first one [regression]
229
2302011-10-07 Andrea Azzarone <azzaronea@gmail.com>
231
232 F10 should open the first menu.
233
2342011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
235
236 Bug #839480: Dash - When the Dash is open and there is a maximised app in the background, the top bar background should not disappear
237
2382011-10-07 Mirco Müller <mirco.mueller@ubuntu.com>
239
240 Don't replace top-bar when dash is opened and there's a maximized window. Fix LP: #839480
241
2422011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
243
244 Bug #869109: compiz crashed with SIGSEGV in nux::ROProperty<std::string>::operator std::string()
245
2462011-10-07 Gord Allott <gord.allott@canonical.com>
247
248 fixes issues with clicking when you don't actually move the mouse, but the UI moves underneith it
249
2502011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
251
252 [merge] trunk
253
2542011-10-10 Neil Jagdish Patel <neil.patel@canonical.com>
255
256 ibus character selection window not drawn
257
2582011-10-09 Brandon Schaefer <brandontschaefer@gmail.com>
259
260 Fixed the preedit_cursor_
261
2622011-10-07 Brandon Schaefer <brandontschaefer@gmail.com>
263
264 Fixed ibus window and text disappearing. Also the preedit text is now highlighted, like it usually is else where
265
2662011-10-10 Sam Spilsbury <sam.spilsbury@canonical.com>
267
268 Merge lp:~smspillaz/unity/unity.fix_864758
269
2702011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
271
272 Remove old minimized window handlers from the handler list and null check
273 the transient for windows that we read, since compiz may have already removed
274 them.
275
276 Fixes LP #864758
277
2782011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
279
280 Merge lp:~smspillaz/unity/unity.fix_868930
281
2822011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
283
284 Use a temporary
285
2862011-10-06 Sam Spilsbury <sam.spilsbury@canonical.com>
287
288 Do automaximization on placement which only happens once when the window
289 is mapped after it is created, rather than on reparenting which may happen
290 if the window is withdrawn.
291
292 Fixes LP #868930
293
2942011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
295
296 Merge lp:~smspillaz/unity/unity.fix_867959
297
2982011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
299
300 Fix space
301
3022011-10-06 Sam Spilsbury <sam.spilsbury@canonical.com>
303
304 Check for hidden windows rather than minimized ones to cover the
305 show-desktop case
306
3072011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
308
309 Merge lp:~smspillaz/unity/unity.fix_854595
310
3112011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
312
313 Cast correctly
314
3152011-10-07 Sam Spilsbury <sam.spilsbury@canonical.com>
316
317 Use an enum
318
3192011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
320
321 Only force unminimize windows for the launcher case
322
3232011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
324
325 Always unminimize initially minimized windows when a launcher icon is
326 activated since they are inaccessible elsewhere
327
328 Fix LP #854595
329
3302011-10-06 Jay Taoko <jay.taoko@canonical.com>
331
332 Resize the _gradient_texture (in PanelMenuView::Draw) if needed
333
334 Fix: bug #863068
335 Fix: bug #868293
336 Fix: bug #869028
337
3382011-10-06 Alejandro Piñeiro <apinheiro@igalia.com>
339
340 Fix bug 843280
341
3422011-10-05 Alejandro Piñeiro <apinheiro@igalia.com>
343
344 Avoid a shadowed variable
345
3462011-10-05 Alejandro Piñeiro <apinheiro@igalia.com>
347
348 a11y: Solves bug 843280
349
3502011-10-05 Alex Launi <alex.launi@canonical.com>
351
352 merge fix for GetState crash
353
3542011-10-03 Alex Launi <alex.launi@canonical.com>
355
356 Remove introspection implementations on PanelMenuView to avoid crash
357
3582011-10-03 Alex Launi <alex.launi@canonical.com>
359
360 merge trunk
361
3622011-10-05 Michal Hruby <michal.mhr@gmail.com>
363
364 Merge lp:~mhr3/unity/bug-865482
365
3662011-10-05 Michal Hruby <michal.mhr@gmail.com>
367
368 Merge lp:~mhr3/unity/bug-865482
369
3702011-10-04 Michal Hruby <michal.mhr@gmail.com>
371
372 Fix bug #865482
373
3742011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
375
376 Merge lp:~smspillaz/unity/unity.fix_868185
377
3782011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
379
380 Merge lp:~smspillaz/untiy/unity.fix_868185
381
3822011-10-05 Sam Spilsbury <sam.spilsbury@canonical.com>
383
384 Fix LP#868185 . Fall through the map case when determining whether or
385 not to hook the minimize function in core
386
3872011-10-04 Neil Jagdish Patel <neil.patel@canonical.com>
388
389 Release\ 4.22.0
390
12011-10-04 Neil Jagdish Patel <neil.patel@canonical.com>3912011-10-04 Neil Jagdish Patel <neil.patel@canonical.com>
2392
3 Add -lm393 Add -lm
4394
=== added directory 'manual-tests'
=== renamed directory 'manual-tests' => 'manual-tests.moved'
=== added file 'manual-tests/QuicklistOnExpo.txt'
--- manual-tests/QuicklistOnExpo.txt 1970-01-01 00:00:00 +0000
+++ manual-tests/QuicklistOnExpo.txt 2012-01-06 13:12:27 +0000
@@ -0,0 +1,14 @@
1Test Quicklist while on Expo
2============================
3
4This test shows how the launcher quicklists work when the expo plugin is activated.
5
6#. Start with a clear screen
7#. Press Super+S or select the workspace switcher on the launcher
8#. When the workspace switcher is running, right-click over a launcher icon
9
10Outcome
11 The expo should terminate, and the quicklist should be shown once the
12 workspace switcher has been closed.
13 Clicking over a quicklist item should work as expected and clicking outside
14 that quicklist, should close it.
015
=== added file 'manual-tests/ReadMe.txt'
--- manual-tests/ReadMe.txt 1970-01-01 00:00:00 +0000
+++ manual-tests/ReadMe.txt 2012-01-06 13:12:27 +0000
@@ -0,0 +1,47 @@
1==============
2Manual Testing
3==============
4
5Outline
6-------
7Sometimes it is not possible to easily make an automated test for some
8use-cases. However just because something isn't easily tested automatically
9doesn't mean that there isn't value in creating a test for it, just that the
10test needs to be executed by a person until it is converted into an automated
11test.
12
13
14Format
15------
16Manual tests take the format of text files in this directory (the manual-test
17one). These files are formatted using `reStructured Text`_. A very
18comprehensive `quick reference`_ is available.
19
20.. _reStructured Text: http://en.wikipedia.org/wiki/ReStructuredText
21.. _quick reference: http://docutils.sourceforge.net/docs/user/rst/quickref.html
22
23Tests have a header, steps to follow, and an expected outcome, as demonstrated
24by the following example:
25
26There can be multiple tests in a single file, but they should all be related,
27and the filename should indicate the tests it contains.
28
29
30Test Dash
31---------
32This test shows that the dash appears when the super key is pushed.
33
34#. Start with a clear screen
35#. Press the <super> key
36
37Outcome
38 The dash appears, and focus is in the search box. The icons on the laucher
39 are desaturated except for the ubuntu button at the top. The icons in the
40 panel go white.
41
42
43Directory Structure
44-------------------
45It is expected that as we grow a number of manual tests, we will use
46directories to organise them.
47
048
=== added directory 'manual-tests/custom-dash-home'
=== added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json'
--- manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json 1970-01-01 00:00:00 +0000
+++ manual-tests/custom-dash-home/HomeShortcutsCustomized-4-entries.json 2012-01-06 13:12:27 +0000
@@ -0,0 +1,22 @@
1{
2 "shortcut1": {
3 "source": "/usr/share/applications/ubuntu-software-center.desktop",
4 "name": "Software Center",
5 "name[fr]": "Logithèque",
6 "icon": "/usr/share/icons/Humanity/places/64/start-here.svg"
7 },
8 "shortcut2": {
9 "source": "music.lens",
10 "filter": "genre:rock",
11 "name": "Rock Music"
12 },
13 "shortcut3": {
14 "source": "files.lens",
15 "filter": "type:videos",
16 "name": "Vidéos",
17 "icon": "/usr/share/icons/Humanity/actions/64/help-about.svg"
18 },
19 "shortcut4": {
20 "source": "transmission-gtk.desktop"
21 }
22}
023
=== added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json'
--- manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json 1970-01-01 00:00:00 +0000
+++ manual-tests/custom-dash-home/HomeShortcutsCustomized-8-entries.json 2012-01-06 13:12:27 +0000
@@ -0,0 +1,44 @@
1{
2 "shortcut1": {
3 "source": "/usr/share/applications/ubuntu-software-center.desktop",
4 "name": "Software Center",
5 "name[fr]": "Logithèque",
6 "icon": "/usr/share/icons/Humanity/places/64/start-here.svg"
7 },
8 "shortcut2": {
9 "source": "music.lens",
10 "filter": "genre:rock",
11 "name": "Rock Music"
12 },
13 "shortcut3": {
14 "source": "files.lens",
15 "filter": "type:videos",
16 "name": "Vidéos",
17 "icon": "/usr/share/icons/Humanity/actions/64/help-about.svg"
18 },
19 "shortcut4": {
20 "source": "transmission-gtk.desktop"
21 },
22 "shortcut5": {
23 "source": "/usr/share/applications/eog.desktop",
24 "name": "Eye Of Gnome",
25 "name[de]": "Auge des Zwergs",
26 "icon": "/usr/share/icons/hicolor/scalable/apps/eog.svg"
27 },
28 "shortcut6": {
29 "source": "/usr/share/applications/jockey-gtk.desktop",
30 "name": "Jockey",
31 "name[de]": "Jockey",
32 "icon": "/usr/share/icons/hicolor/scalable/apps/jockey.svg"
33 },
34 "shortcut7": {
35 "source": "/usr/share/applications/gwibber.desktop",
36 "name": "gwibber",
37 "icon": "/usr/share/icons/hicolor/scalable/apps/gwibber.svg"
38 },
39 "shortcut8": {
40 "source": "/usr/share/applications/giggle.desktop",
41 "name": "Giggle",
42 "icon": "/usr/share/icons/hicolor/scalable/apps/giggle.svg"
43 }
44}
045
=== added file 'manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json'
--- manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json 1970-01-01 00:00:00 +0000
+++ manual-tests/custom-dash-home/HomeShortcutsCustomized-broken.json 2012-01-06 13:12:27 +0000
@@ -0,0 +1,23 @@
1this is some intentional garbage with lots of errors
2{
3 "shortcut1": {
4 "source": "/usr/share/applications/ubuntu-software-center.desktop",
5 "name": "Software Center",
6 "name[fr]": "Logithèque",
7 "icn": "/usr/share/icons/Humanity/places/64/start-here.svg"
8 },
9 "shortcut2": {
10 "sorce": "music.lens",
11 "filter": "genre:rock",
12 "name": "Rock Music"
13 },
14 "shortcut3": {
15 "source": "files.lens",
16 "filter": "type:videos",
17 "name": "Vidéos",
18 "icon": "/usr/share/icons/Humanity/actions/64/hep-about.svg"
19 },
20 "shortcut12": {
21 "source": "transmission-gtk.destop"
22 }
23}
024
=== added file 'manual-tests/custom-dash-home/custom-dash-home.txt'
--- manual-tests/custom-dash-home/custom-dash-home.txt 1970-01-01 00:00:00 +0000
+++ manual-tests/custom-dash-home/custom-dash-home.txt 2012-01-06 13:12:27 +0000
@@ -0,0 +1,46 @@
1Manual tests for the 'dash custom home screen' functionality
2============================================================
3
4How to test
5-----------
6
7To test the functionality, create the folder $HOME/.config/unity/, and copy the
8three files HomeShortcutsCustomized*.json there.
9
10Then for each of them repeat the following steps:
11
12 cd $HOME/.config/unity/
13 rm HomeShortcutsCustomized.json
14 ln -s $FILE HomeShortcutsCustomized.json # replace $FILE with the json file being considered
15 # restart unity
16 # open the dash
17 # check the visual appearance against the expected results detailed below
18
19
20Expected results
21----------------
22
23With 'HomeShortcutsCustomized-4-entries.json', the home screen of the dash
24contains 4 icons that fill the first row. The second row is empty.
25Those icons are:
26 - "Software Center": launches the Ubuntu Software Center, the icon is the
27 Ubuntu Circle Of Friends, and if you are running with a French locale the
28 name is localized to "Logithèque".
29 - "Rock Music": opens the music lens with the genre filter set to "Rock".
30 - "Vidéos": opens the files lens with the type filter set to "videos", the icon
31 is a yellow star.
32 - "Transmission BitTorrent Client": launches transmission-gtk.
33
34With 'HomeShortcutsCustomized-8-entries.json', the home screen of the dash
35contains 8 icons that fill the two rows. The first row contains the exact same
36icons as 'HomeShortcutsCustomized-4-entries.json' (see details above). The icons
37on the second row are:
38 - "Eye Of Gnome": launches eog, if you are running with a German locale the
39 name is localized to "Auge des Zwergs".
40 - "Jockey": launches jockey-gtk.
41 - "gwibber": launches gwibber.
42 - "Giggle": this icon appears only if giggle is installed, it launches giggle.
43
44With 'HomeShortcutsCustomized-broken.json', the home screen of the dash contains
45the default icons because the file fails to be parsed.
46
047
=== added file 'manual-tests/launcher.txt'
--- manual-tests/launcher.txt 1970-01-01 00:00:00 +0000
+++ manual-tests/launcher.txt 2012-01-06 13:12:27 +0000
@@ -0,0 +1,11 @@
1Test Dash Key Focus
2-------------------
3This test shows that the search bar in the dash gets key focus when using the super key to start the dash on start up.
4
5#. Start on a fresh login
6#. Press the <super> key
7#. Wait for dash to appear
8#. Type "hello"
9
10Outcome
11 The dash will appear, and "hello" will be in the search box.
012
=== modified file 'plugins/unityshell/src/BackgroundEffectHelper.h'
=== modified file 'plugins/unityshell/src/BamfLauncherIcon.cpp'
=== modified file 'plugins/unityshell/src/DashController.cpp'
--- plugins/unityshell/src/DashController.cpp 2011-12-08 01:23:11 +0000
+++ plugins/unityshell/src/DashController.cpp 2012-01-06 13:12:27 +0000
@@ -131,8 +131,13 @@
131 SetupDashView();131 SetupDashView();
132 Relayout();132 Relayout();
133 ensure_id_ = 0;133 ensure_id_ = 0;
134<<<<<<< TREE
134135
135 on_realize.emit();136 on_realize.emit();
137=======
138
139 on_realize.emit ();
140>>>>>>> MERGE-SOURCE
136}141}
137142
138nux::BaseWindow* Controller::window() const143nux::BaseWindow* Controller::window() const
139144
=== modified file 'plugins/unityshell/src/DashController.h'
=== modified file 'plugins/unityshell/src/DashSearchBar.cpp'
=== modified file 'plugins/unityshell/src/DashView.cpp'
--- plugins/unityshell/src/DashView.cpp 2011-12-16 21:27:09 +0000
+++ plugins/unityshell/src/DashView.cpp 2012-01-06 13:12:27 +0000
@@ -705,9 +705,14 @@
705705
706void DashView::OnSearchFinished(Lens::Hints const& hints)706void DashView::OnSearchFinished(Lens::Hints const& hints)
707{707{
708<<<<<<< TREE
708 std::string search_string = search_bar_->search_string;709 std::string search_string = search_bar_->search_string;
709 if (active_lens_view_ && active_lens_view_->search_string == search_string)710 if (active_lens_view_ && active_lens_view_->search_string == search_string)
710 {711 {
712=======
713 if (search_bar_->search_string == search_string)
714 {
715>>>>>>> MERGE-SOURCE
711 search_bar_->SearchFinished();716 search_bar_->SearchFinished();
712 search_in_progress_ = false;717 search_in_progress_ = false;
713 if (activate_on_finish_)718 if (activate_on_finish_)
714719
=== modified file 'plugins/unityshell/src/DashView.h'
--- plugins/unityshell/src/DashView.h 2011-12-14 16:18:41 +0000
+++ plugins/unityshell/src/DashView.h 2012-01-06 13:12:27 +0000
@@ -132,10 +132,16 @@
132 nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_shine_texture_;132 nux::ObjectPtr <nux::IOpenGLBaseTexture> bg_shine_texture_;
133133
134 std::string last_activated_uri_;134 std::string last_activated_uri_;
135<<<<<<< TREE
135 // we're passing this back to g_* functions, so we'll keep the g* type136 // we're passing this back to g_* functions, so we'll keep the g* type
136 guint searching_timeout_id_;137 guint searching_timeout_id_;
137 bool search_in_progress_;138 bool search_in_progress_;
138 bool activate_on_finish_;139 bool activate_on_finish_;
140=======
141 guint searching_timeout_id_;
142 bool search_in_progress_;
143 bool activate_on_finish_;
144>>>>>>> MERGE-SOURCE
139145
140 bool visible_;146 bool visible_;
141};147};
142148
=== modified file 'plugins/unityshell/src/FilterBar.cpp'
--- plugins/unityshell/src/FilterBar.cpp 2011-10-19 16:28:06 +0000
+++ plugins/unityshell/src/FilterBar.cpp 2012-01-06 13:12:27 +0000
@@ -44,8 +44,14 @@
44 }44 }
4545
46 void FilterBar::Init () {46 void FilterBar::Init () {
47<<<<<<< TREE
47 nux::LinearLayout *layout = new nux::VLayout (NUX_TRACKER_LOCATION);48 nux::LinearLayout *layout = new nux::VLayout (NUX_TRACKER_LOCATION);
48 layout->SetSpaceBetweenChildren(12);49 layout->SetSpaceBetweenChildren(12);
50=======
51 nux::Layout *layout = new nux::VLayout (NUX_TRACKER_LOCATION);
52 layout->SetVerticalInternalMargin(12);
53 layout->SetVerticalExternalMargin(0);
54>>>>>>> MERGE-SOURCE
49 SetLayout (layout);55 SetLayout (layout);
50 }56 }
5157
5258
=== modified file 'plugins/unityshell/src/FilterExpanderLabel.cpp'
--- plugins/unityshell/src/FilterExpanderLabel.cpp 2011-10-25 19:37:13 +0000
+++ plugins/unityshell/src/FilterExpanderLabel.cpp 2012-01-06 13:12:27 +0000
@@ -26,7 +26,11 @@
2626
27#include "FilterBasicButton.h"27#include "FilterBasicButton.h"
28#include "FilterExpanderLabel.h"28#include "FilterExpanderLabel.h"
29<<<<<<< TREE
29#include "DashStyle.h"30#include "DashStyle.h"
31=======
32#include "PlacesStyle.h"
33>>>>>>> MERGE-SOURCE
3034
31namespace unity {35namespace unity {
3236
@@ -74,9 +78,11 @@
7478
75 void FilterExpanderLabel::BuildLayout ()79 void FilterExpanderLabel::BuildLayout ()
76 {80 {
81 PlacesStyle *style = PlacesStyle::GetDefault();
82
77 layout_ = new nux::VLayout(NUX_TRACKER_LOCATION);83 layout_ = new nux::VLayout(NUX_TRACKER_LOCATION);
78 top_bar_layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);84 top_bar_layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
7985
80 cairo_label_ = new nux::StaticText(label_.c_str(), NUX_TRACKER_LOCATION);86 cairo_label_ = new nux::StaticText(label_.c_str(), NUX_TRACKER_LOCATION);
81 cairo_label_->SetFontName("Ubuntu 10");87 cairo_label_->SetFontName("Ubuntu 10");
82 cairo_label_->SetTextColor(nux::Color(1.0f, 1.0f, 1.0f, 1.0f));88 cairo_label_->SetTextColor(nux::Color(1.0f, 1.0f, 1.0f, 1.0f));
@@ -91,11 +97,18 @@
9197
92 top_bar_layout_->AddView (cairo_label_, 1, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);98 top_bar_layout_->AddView (cairo_label_, 1, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL);
93 top_bar_layout_->AddSpace(1, 1);99 top_bar_layout_->AddSpace(1, 1);
100
101 top_bar_layout_->SetMaximumWidth((style->GetTileWidth() -12)*2+10);
94102
103<<<<<<< TREE
95 top_bar_layout_->SetMaximumWidth((dash::Style::Instance().GetTileWidth() -12)*2+10);104 top_bar_layout_->SetMaximumWidth((dash::Style::Instance().GetTileWidth() -12)*2+10);
96105
97 layout_->AddLayout (top_bar_layout_, 0, nux::MINOR_POSITION_LEFT);106 layout_->AddLayout (top_bar_layout_, 0, nux::MINOR_POSITION_LEFT);
98 layout_->SetVerticalInternalMargin(0);107 layout_->SetVerticalInternalMargin(0);
108=======
109 layout_->AddLayout (top_bar_layout_, 0, nux::MINOR_POSITION_LEFT);
110 layout_->SetVerticalInternalMargin(0);
111>>>>>>> MERGE-SOURCE
99112
100 SetLayout(layout_);113 SetLayout(layout_);
101114
102115
=== modified file 'plugins/unityshell/src/FilterGenreWidget.cpp'
--- plugins/unityshell/src/FilterGenreWidget.cpp 2011-10-25 16:32:49 +0000
+++ plugins/unityshell/src/FilterGenreWidget.cpp 2012-01-06 13:12:27 +0000
@@ -58,7 +58,11 @@
58 genre_layout_->SetSpaceBetweenChildren (10, 12);58 genre_layout_->SetSpaceBetweenChildren (10, 12);
59 genre_layout_->SetTopAndBottomPadding (12);59 genre_layout_->SetTopAndBottomPadding (12);
60 genre_layout_->EnablePartialVisibility (false);60 genre_layout_->EnablePartialVisibility (false);
61<<<<<<< TREE
61 genre_layout_->SetChildrenSize (dash::Style::Instance().GetTileWidth() - 12, 32);62 genre_layout_->SetChildrenSize (dash::Style::Instance().GetTileWidth() - 12, 32);
63=======
64 genre_layout_->SetChildrenSize (style->GetTileWidth() - 12, 32);
65>>>>>>> MERGE-SOURCE
6266
63 SetRightHandView(all_button_);67 SetRightHandView(all_button_);
64 SetContents(genre_layout_);68 SetContents(genre_layout_);
6569
=== modified file 'plugins/unityshell/src/FilterMultiRangeButton.cpp'
=== modified file 'plugins/unityshell/src/GeisAdapter.cpp'
--- plugins/unityshell/src/GeisAdapter.cpp 2011-12-22 17:52:55 +0000
+++ plugins/unityshell/src/GeisAdapter.cpp 2012-01-06 13:12:27 +0000
@@ -469,7 +469,7 @@
469 GEIS_XCB_FULL_WINDOW,469 GEIS_XCB_FULL_WINDOW,
470 &xcb_win_info470 &xcb_win_info
471 };471 };
472 GeisInstance instance;472 GeisInstance instance = nullptr;
473473
474 status = geis_init(&win_info, &instance);474 status = geis_init(&win_info, &instance);
475 if (status != GEIS_STATUS_SUCCESS)475 if (status != GEIS_STATUS_SUCCESS)
476476
=== modified file 'plugins/unityshell/src/IMTextEntry.cpp'
--- plugins/unityshell/src/IMTextEntry.cpp 2011-12-10 06:41:53 +0000
+++ plugins/unityshell/src/IMTextEntry.cpp 2012-01-06 13:12:27 +0000
@@ -263,12 +263,21 @@
263263
264 LOG_DEBUG(logger) << "Preedit changed: " << preedit;264 LOG_DEBUG(logger) << "Preedit changed: " << preedit;
265265
266<<<<<<< TREE
266 preedit_ = preedit.Str();267 preedit_ = preedit.Str();
268=======
269 _preedit = preedit.Str();
270>>>>>>> MERGE-SOURCE
267271
268 if (strlen(preedit.Str().c_str())) {272 if (strlen(preedit.Str().c_str())) {
269 preedit_cursor_ = preedit.Str().length();273 preedit_cursor_ = preedit.Str().length();
274<<<<<<< TREE
270 QueueRefresh(true, true);275 QueueRefresh(true, true);
271 sigTextChanged.emit(this);276 sigTextChanged.emit(this);
277=======
278 QueueRefresh(true, true);
279 sigTextChanged.emit(this);
280>>>>>>> MERGE-SOURCE
272 UpdateCursorLocation();281 UpdateCursorLocation();
273 }282 }
274}283}
@@ -286,9 +295,15 @@
286 ResetPreedit();295 ResetPreedit();
287 gtk_im_context_reset(im_context_);296 gtk_im_context_reset(im_context_);
288297
298<<<<<<< TREE
289 QueueRefresh(true, true);299 QueueRefresh(true, true);
290 sigTextChanged.emit(this);300 sigTextChanged.emit(this);
291 301
302=======
303 QueueRefresh(true, true);
304 sigTextChanged.emit(this);
305
306>>>>>>> MERGE-SOURCE
292 LOG_DEBUG(logger) << "Preedit ended";307 LOG_DEBUG(logger) << "Preedit ended";
293}308}
294309
295310
=== modified file 'plugins/unityshell/src/JSONParser.cpp'
--- plugins/unityshell/src/JSONParser.cpp 2011-09-15 04:28:49 +0000
+++ plugins/unityshell/src/JSONParser.cpp 2012-01-06 13:12:27 +0000
@@ -145,6 +145,19 @@
145 values[i] = json_array_get_double_element(array, i);145 values[i] = json_array_get_double_element(array, i);
146}146}
147147
148void Parser::ReadString(std::string const& node_name,
149 std::string const& member_name,
150 std::string& value) const
151{
152 JsonObject* object = GetNodeObject(node_name);
153
154 if (!object)
155 return;
156
157 if (json_object_has_member(object, member_name.c_str()))
158 value = json_object_get_string_member(object, member_name.c_str());
159}
160
148void Parser::ReadColor(std::string const& node_name,161void Parser::ReadColor(std::string const& node_name,
149 std::string const& member_name,162 std::string const& member_name,
150 std::string const& opacity_name,163 std::string const& opacity_name,
151164
=== modified file 'plugins/unityshell/src/JSONParser.h'
--- plugins/unityshell/src/JSONParser.h 2011-09-15 04:28:49 +0000
+++ plugins/unityshell/src/JSONParser.h 2012-01-06 13:12:27 +0000
@@ -58,6 +58,10 @@
58 std::string const& member_name,58 std::string const& member_name,
59 std::vector<double>& values) const;59 std::vector<double>& values) const;
6060
61 void ReadString(std::string const& node_name,
62 std::string const& member_name,
63 std::string& value) const;
64
61 void ReadColor(std::string const& node_name,65 void ReadColor(std::string const& node_name,
62 std::string const& member_name,66 std::string const& member_name,
63 std::string const& opacity_name,67 std::string const& opacity_name,
6468
=== modified file 'plugins/unityshell/src/LauncherIcon.cpp'
--- plugins/unityshell/src/LauncherIcon.cpp 2012-01-03 15:41:37 +0000
+++ plugins/unityshell/src/LauncherIcon.cpp 2012-01-06 13:12:27 +0000
@@ -549,8 +549,11 @@
549549
550 for (auto menu_item : menus)550 for (auto menu_item : menus)
551 {551 {
552<<<<<<< TREE
552 QuicklistMenuItem* ql_item;553 QuicklistMenuItem* ql_item;
553554
555=======
556>>>>>>> MERGE-SOURCE
554 const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);557 const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);
555 const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);558 const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);
556 gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE);559 gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE);
557560
=== modified file 'plugins/unityshell/src/LauncherIcon.h'
=== modified file 'plugins/unityshell/src/LensView.cpp'
--- plugins/unityshell/src/LensView.cpp 2011-12-14 16:18:41 +0000
+++ plugins/unityshell/src/LensView.cpp 2012-01-06 13:12:27 +0000
@@ -144,8 +144,15 @@
144void LensView::SetupViews()144void LensView::SetupViews()
145{145{
146 layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);146 layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
147<<<<<<< TREE
147 148
148 layout_->SetHorizontalExternalMargin(8);149 layout_->SetHorizontalExternalMargin(8);
150=======
151
152 // Breaks the sizing of the whole dash causing some colums to be clipped from result view.
153 // look in to this for P.
154 // layout_->SetHorizontalExternalMargin(8);
155>>>>>>> MERGE-SOURCE
149156
150 scroll_view_ = new LensScrollView(new PlacesVScrollBar(NUX_TRACKER_LOCATION),157 scroll_view_ = new LensScrollView(new PlacesVScrollBar(NUX_TRACKER_LOCATION),
151 NUX_TRACKER_LOCATION);158 NUX_TRACKER_LOCATION);
152159
=== modified file 'plugins/unityshell/src/PanelIndicatorsView.cpp'
=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
=== modified file 'plugins/unityshell/src/PanelMenuView.h'
=== modified file 'plugins/unityshell/src/PanelTray.cpp'
--- plugins/unityshell/src/PanelTray.cpp 2011-12-14 20:04:23 +0000
+++ plugins/unityshell/src/PanelTray.cpp 2012-01-06 13:12:27 +0000
@@ -95,7 +95,11 @@
95 if (_tray)95 if (_tray)
96 {96 {
97 g_signal_handler_disconnect(na_tray_get_manager(_tray), _tray_icon_added_id);97 g_signal_handler_disconnect(na_tray_get_manager(_tray), _tray_icon_added_id);
98<<<<<<< TREE
98 g_object_unref (_tray);99 g_object_unref (_tray);
100=======
101 g_object_unref(_tray);
102>>>>>>> MERGE-SOURCE
99 _tray = NULL;103 _tray = NULL;
100 }104 }
101105
102106
=== modified file 'plugins/unityshell/src/PanelView.cpp'
--- plugins/unityshell/src/PanelView.cpp 2012-01-06 04:53:09 +0000
+++ plugins/unityshell/src/PanelView.cpp 2012-01-06 13:12:27 +0000
@@ -138,6 +138,11 @@
138{138{
139 if (_track_menu_pointer_id)139 if (_track_menu_pointer_id)
140 g_source_remove(_track_menu_pointer_id);140 g_source_remove(_track_menu_pointer_id);
141<<<<<<< TREE
142=======
143
144 _style->UnReference();
145>>>>>>> MERGE-SOURCE
141 UBusServer *ubus = ubus_server_get_default();146 UBusServer *ubus = ubus_server_get_default();
142 ubus_server_unregister_interest(ubus, _handle_bg_color_update);147 ubus_server_unregister_interest(ubus, _handle_bg_color_update);
143 ubus_server_unregister_interest(ubus, _handle_dash_hidden);148 ubus_server_unregister_interest(ubus, _handle_dash_hidden);
@@ -152,6 +157,9 @@
152 indicator::EntryLocationMap locations;157 indicator::EntryLocationMap locations;
153 _remote->SyncGeometries(GetName() + boost::lexical_cast<std::string>(_monitor), locations);158 _remote->SyncGeometries(GetName() + boost::lexical_cast<std::string>(_monitor), locations);
154159
160 indicator::EntryLocationMap locations;
161 _remote->SyncGeometries(GetName() + boost::lexical_cast<std::string>(_monitor), locations);
162
155 delete _bg_layer;163 delete _bg_layer;
156}164}
157165
158166
=== modified file 'plugins/unityshell/src/PlacesGroup.cpp'
=== modified file 'plugins/unityshell/src/PlacesHomeView.cpp'
--- plugins/unityshell/src/PlacesHomeView.cpp 2011-12-14 20:04:23 +0000
+++ plugins/unityshell/src/PlacesHomeView.cpp 2012-01-06 13:12:27 +0000
@@ -38,17 +38,30 @@
38#include "UBusMessages.h"38#include "UBusMessages.h"
3939
40#include "PlacesHomeView.h"40#include "PlacesHomeView.h"
41<<<<<<< TREE
42=======
43
44#include "JSONParser.h"
45>>>>>>> MERGE-SOURCE
41#include "PlacesSimpleTile.h"46#include "PlacesSimpleTile.h"
4247
43#include "DashStyle.h"48#include "DashStyle.h"
44#include <UnityCore/GLibWrapper.h>49#include <UnityCore/GLibWrapper.h>
45#include <UnityCore/Variant.h>50#include <UnityCore/Variant.h>
4651
52#include <sstream>
47#include <string>53#include <string>
48#include <vector>54#include <vector>
4955
56#include <boost/algorithm/string.hpp>
57
50#define DELTA_DOUBLE_REQUEST 50000000058#define DELTA_DOUBLE_REQUEST 500000000
5159
60namespace
61{
62 const std::string custom_shortcuts_file = "/unity/HomeShortcutsCustomized.json";
63}
64
52namespace unity65namespace unity
53{66{
5467
@@ -135,7 +148,9 @@
135148
136 expanded.connect(sigc::mem_fun(this, &PlacesHomeView::Refresh));149 expanded.connect(sigc::mem_fun(this, &PlacesHomeView::Refresh));
137150
138 Refresh();151 // Wait for the asynchronous loading of the lenses to complete
152 // before refreshing the view for the first time.
153 _lenses.lenses_loaded.connect(sigc::bind(sigc::mem_fun(this, &PlacesHomeView::Refresh), (PlacesGroup*) NULL));
139}154}
140155
141PlacesHomeView::~PlacesHomeView()156PlacesHomeView::~PlacesHomeView()
@@ -161,64 +176,227 @@
161176
162 _layout->Clear();177 _layout->Clear();
163178
164 // Media Apps179 // The following code path allows one to replace the default dash home screen
165 markup = g_strdup_printf(temp, _("Media Apps"));180 // with a custom home screen, the contents of which are described in a JSON
166 shortcut = new Shortcut(PKGDATADIR"/find_media_apps.png",181 // file. The file is looked for in the following locations in decreasing order
167 markup,182 // of priority:
168 icon_size);183 // - $XDG_CONFIG_HOME/unity/ (defaults to $HOME/.config/unity/)
169 shortcut->_id = TYPE_PLACE;184 // - $DIR/unity/ for $DIR in $XDG_CONFIG_DIRS
170 shortcut->_place_id = g_strdup("applications.lens?filter_type=media");185 // The syntax of the file is as follows:
171 shortcut->_place_section = 9;186 // ==========================================================================
172 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);187 // {
173 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));188 // "shortcut1": {
174 g_free(markup);189 // "source": $source,
175190 // "name": $name,
176 // Internet Apps191 // "name[fr]": $name_in_french,
177 markup = g_strdup_printf(temp, _("Internet Apps"));192 // […]
178 shortcut = new Shortcut(PKGDATADIR"/find_internet_apps.png",193 // "icon": $icon
179 markup,194 // },
180 icon_size);195 // "shortcut2": {
181 shortcut->_id = TYPE_PLACE;196 // […]
182 shortcut->_place_id = g_strdup("applications.lens?filter_type=internet");197 // },
183 shortcut->_place_section = 8;198 // […]
184 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);199 // }
185 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));200 // ==========================================================================
186 g_free(markup);201 // The source attribute may either be a desktop file (full path or just its
187202 // basename if it is located in a standard directory), or a lens file
188 // More Apps203 // (basename only). This attribute is mandatory.
189 markup = g_strdup_printf(temp, _("More Apps"));204 // The 'name' attribute is optional. If present, it will override the default
190 shortcut = new Shortcut(PKGDATADIR"/find_more_apps.png",205 // display name as advertised by the desktop file or by the lens. The name can
191 markup,206 // be localized in several languages using the square brackets suffix
192 icon_size);207 // notation, in which case the locale matching the system’s will be used,
193 shortcut->_id = TYPE_PLACE;208 // defaulting to the untranslated 'name' attribute if necessary.
194 shortcut->_place_id = g_strdup("applications.lens");209 // The 'icon' attribute is optional. If present, it will override the default
195 shortcut->_place_section = 0;210 // icon as advertised by the desktop file or by the lens. It should be a full
196 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);211 // path name.
197 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));212 // If the source is a lens, the optional 'filter' attribute allows specifying
198 g_free(markup);213 // a filter in the form "$name:$value", e.g. "type:videos" for the files lens.
199214 // If the source is a lens, the optional 'section' attribute allows specifying
200 // Find Files215 // a section number (an integer starting at index 0).
201 markup = g_strdup_printf(temp, _("Find Files"));216
202 shortcut = new Shortcut(PKGDATADIR"/find_files.png",217 std::string customShortcuts;
203 markup,218 std::ostringstream file;
204 icon_size);219 // Look for a custom shortcuts file in the user’s home directory first.
205 shortcut->_id = TYPE_PLACE;220 file << g_get_user_config_dir() << custom_shortcuts_file;
206 shortcut->_place_id = g_strdup("files.lens");221 if (g_file_test(file.str().c_str(), G_FILE_TEST_EXISTS))
207 shortcut->_place_section = 0;222 {
208 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);223 customShortcuts = file.str();
209 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));224 }
210 g_free(markup);225 else
211226 {
212 // Browser227 // Fall back on the standard XDG directories.
213 CreateShortcutFromMime("x-scheme-handler/http", _("Browse the Web"), _browser_alternatives);228 gchar** config = (gchar**) g_get_system_config_dirs();
214229 for (gint i = 0; config[i]; ++i)
215 // Photos230 {
216 // FIXME: Need to figure out the default231 std::ostringstream file;
217 CreateShortcutFromExec("shotwell", _("View Photos"), _photo_alternatives);232 file << config[i] << custom_shortcuts_file;
218233 if (g_file_test(file.str().c_str(), G_FILE_TEST_EXISTS))
219 CreateShortcutFromMime("x-scheme-handler/mailto", _("Check Email"), _email_alternatives);234 {
220235 customShortcuts = file.str();
221 CreateShortcutFromMime("audio/x-vorbis+ogg", _("Listen to Music"), _music_alternatives);236 break;
237 }
238 }
239 }
240 json::Parser parser;
241 if ((customShortcuts == "") || !parser.Open(customShortcuts))
242 {
243 // Media Apps
244 markup = g_strdup_printf(temp, _("Media Apps"));
245 shortcut = new Shortcut(PKGDATADIR"/find_media_apps.png",
246 markup,
247 icon_size);
248 shortcut->_id = TYPE_PLACE;
249 shortcut->_place_id = g_strdup("applications.lens?filter_type=media");
250 shortcut->_place_section = 9;
251 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
252 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
253 g_free(markup);
254
255 // Internet Apps
256 markup = g_strdup_printf(temp, _("Internet Apps"));
257 shortcut = new Shortcut(PKGDATADIR"/find_internet_apps.png",
258 markup,
259 icon_size);
260 shortcut->_id = TYPE_PLACE;
261 shortcut->_place_id = g_strdup("applications.lens?filter_type=internet");
262 shortcut->_place_section = 8;
263 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
264 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
265 g_free(markup);
266
267 // More Apps
268 markup = g_strdup_printf(temp, _("More Apps"));
269 shortcut = new Shortcut(PKGDATADIR"/find_more_apps.png",
270 markup,
271 icon_size);
272 shortcut->_id = TYPE_PLACE;
273 shortcut->_place_id = g_strdup("applications.lens");
274 shortcut->_place_section = 0;
275 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
276 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
277 g_free(markup);
278
279 // Find Files
280 markup = g_strdup_printf(temp, _("Find Files"));
281 shortcut = new Shortcut(PKGDATADIR"/find_files.png",
282 markup,
283 icon_size);
284 shortcut->_id = TYPE_PLACE;
285 shortcut->_place_id = g_strdup("files.lens");
286 shortcut->_place_section = 0;
287 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
288 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
289 g_free(markup);
290
291 // Browser
292 CreateShortcutFromMime("x-scheme-handler/http", _("Browse the Web"), _browser_alternatives);
293
294 // Photos
295 // FIXME: Need to figure out the default
296 CreateShortcutFromExec("shotwell", _("View Photos"), _photo_alternatives);
297
298 CreateShortcutFromMime("x-scheme-handler/mailto", _("Check Email"), _email_alternatives);
299
300 CreateShortcutFromMime("audio/x-vorbis+ogg", _("Listen to Music"), _music_alternatives);
301 }
302 else
303 {
304 // The custom shortcuts file can contain up to 8 shortcuts.
305 for (int i = 0; i < 8; ++i)
306 {
307 std::ostringstream oss;
308 oss << "shortcut" << (i + 1);
309 std::string slot = oss.str();
310 std::string source;
311 parser.ReadString(slot, "source", source);
312 if (source != "")
313 {
314 std::string icon;
315 parser.ReadString(slot, "icon", icon);
316
317 std::string name;
318 gchar** languages = (gchar**) g_get_language_names();
319 for (gint i = 0; languages[i]; ++i)
320 {
321 std::ostringstream key;
322 key << "name[" << languages[i] << "]";
323 parser.ReadString(slot, key.str(), name);
324 if (name != "")
325 break;
326 }
327 if (name == "")
328 {
329 parser.ReadString(slot, "name", name);
330 }
331
332 if (boost::iends_with(source, ".desktop"))
333 {
334 GDesktopAppInfo* info = NULL;
335 if (boost::istarts_with(source, "/"))
336 info = g_desktop_app_info_new_from_filename(source.c_str());
337 else
338 info = g_desktop_app_info_new(source.c_str());
339 if (G_IS_DESKTOP_APP_INFO(info))
340 {
341 if (name == "")
342 name = g_app_info_get_display_name(G_APP_INFO(info));
343 if (icon == "")
344 {
345 gchar* cicon = g_icon_to_string(g_app_info_get_icon(G_APP_INFO(info)));
346 icon = cicon;
347 g_free(cicon);
348 }
349 gchar* exec = g_strdup(g_app_info_get_executable(G_APP_INFO(info)));
350 markup = g_strdup_printf(temp, name.c_str());
351 shortcut = new Shortcut(icon.c_str(), markup, style->GetHomeTileIconSize());
352 shortcut->_id = TYPE_EXEC;
353 shortcut->_exec = exec;
354 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
355 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
356 g_free(markup);
357 g_object_unref(info);
358 }
359 }
360 else if (boost::iends_with(source, ".lens"))
361 {
362 unity::dash::Lens::Ptr lens = _lenses.GetLens(source);
363 if (lens)
364 {
365 if (name == "")
366 name = lens->name;
367 if (icon == "")
368 icon = lens->icon_hint;
369 }
370 std::string filter;
371 parser.ReadString(slot, "filter", filter);
372 int section = -1;
373 parser.ReadInt(slot, "section", section);
374 markup = g_strdup_printf(temp, name.c_str());
375 shortcut = new Shortcut(icon.c_str(), markup, style->GetHomeTileIconSize());
376 shortcut->_id = TYPE_PLACE;
377 if (filter != "")
378 {
379 std::vector<std::string> filter_key_value;
380 boost::split(filter_key_value, filter, boost::is_any_of(":"));
381 if (filter_key_value.size() == 2)
382 shortcut->_place_id = g_strdup_printf("%s?filter_%s=%s",
383 source.c_str(),
384 filter_key_value[0].c_str(),
385 filter_key_value[1].c_str());
386 else
387 shortcut->_place_id = g_strdup(source.c_str());
388 }
389 else
390 shortcut->_place_id = g_strdup(source.c_str());
391 if (section != -1)
392 shortcut->_place_section = section;
393 _layout->AddView(shortcut, 1, nux::eLeft, nux::eFull);
394 shortcut->sigClick.connect(sigc::mem_fun(this, &PlacesHomeView::OnShortcutClicked));
395 g_free(markup);
396 }
397 }
398 }
399 }
222400
223 SetExpanded(true);401 SetExpanded(true);
224 SetCounts(8, 8);402 SetCounts(8, 8);
225403
=== modified file 'plugins/unityshell/src/PlacesHomeView.h'
--- plugins/unityshell/src/PlacesHomeView.h 2011-12-14 20:04:23 +0000
+++ plugins/unityshell/src/PlacesHomeView.h 2012-01-06 13:12:27 +0000
@@ -29,6 +29,8 @@
2929
30#include <Nux/GridHLayout.h>30#include <Nux/GridHLayout.h>
3131
32#include <UnityCore/FilesystemLenses.h>
33
32#include "PlacesTile.h"34#include "PlacesTile.h"
33#include "PlacesGroup.h"35#include "PlacesGroup.h"
3436
@@ -66,6 +68,8 @@
66 std::vector<std::string> _music_alternatives;68 std::vector<std::string> _music_alternatives;
6769
68 guint _ubus_handle;70 guint _ubus_handle;
71
72 unity::dash::FilesystemLenses _lenses;
69};73};
7074
71}75}
7276
=== modified file 'plugins/unityshell/src/ResultViewGrid.cpp'
--- plugins/unityshell/src/ResultViewGrid.cpp 2012-01-02 21:39:28 +0000
+++ plugins/unityshell/src/ResultViewGrid.cpp 2012-01-06 13:12:27 +0000
@@ -82,8 +82,20 @@
82 {82 {
83 last_mouse_down_x_ = x;83 last_mouse_down_x_ = x;
84 last_mouse_down_y_ = y;84 last_mouse_down_y_ = y;
85 uint index = GetIndexAtPosition(x, y);85<<<<<<< TREE
86 mouse_over_index_ = index;86 uint index = GetIndexAtPosition(x, y);
87 mouse_over_index_ = index;
88=======
89 uint index = GetIndexAtPosition(x, y);
90 mouse_over_index_ = index;
91 if (index >= 0 && index < results_.size())
92 {
93 // we got a click on a button so activate it
94 Result result = results_[index];
95 selected_index_ = index;
96 focused_uri_ = result.uri;
97 }
98>>>>>>> MERGE-SOURCE
87 });99 });
88100
89 mouse_leave.connect([&](int x, int y, unsigned long mouse_state, unsigned long button_state)101 mouse_leave.connect([&](int x, int y, unsigned long mouse_state, unsigned long button_state)
@@ -495,9 +507,26 @@
495 {507 {
496 if (selected_index_ < 0)508 if (selected_index_ < 0)
497 {509 {
510<<<<<<< TREE
511=======
512 if (mouse_over_index_ >= 0 && mouse_over_index_ < static_cast<int>(results_.size()))
513 {
514 // to hack around nux, nux sends the keynavfocuschange event before
515 // mouse clicks, so when mouse click happens we have already scrolled away
516 // because the keynav focus changed
517 focused_uri_ = results_[mouse_over_index_].uri;
518 selected_index_ = mouse_over_index_;
519 }
520 else
521 {
522>>>>>>> MERGE-SOURCE
498 focused_uri_ = results_.front().uri;523 focused_uri_ = results_.front().uri;
499 selected_index_ = 0;524 selected_index_ = 0;
500 }525 }
526<<<<<<< TREE
527=======
528
529>>>>>>> MERGE-SOURCE
501530
502 int items_per_row = GetItemsPerRow();531 int items_per_row = GetItemsPerRow();
503 int focused_x = (renderer_->width + horizontal_spacing) * (selected_index_ % items_per_row);532 int focused_x = (renderer_->width + horizontal_spacing) * (selected_index_ % items_per_row);
504533
=== modified file 'plugins/unityshell/src/ResultViewGrid.h'
=== modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.cpp'
--- plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-01-05 02:47:09 +0000
+++ plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-01-06 13:12:27 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-2// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/* Compiz unity plugin3/* Compiz unity plugin
3 * unity.h4 * unity.h
@@ -232,3 +233,239 @@
232 if (mFBTexture)233 if (mFBTexture)
233 glDeleteTextures (1, &mFBTexture);234 glDeleteTextures (1, &mFBTexture);
234}235}
236=======
237// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
238/* Compiz unity plugin
239 * unity.h
240 *
241 * Copyright (c) 2010-11 Canonical Ltd.
242 *
243 * This program is free software; you can redistribute it and/or
244 * modify it under the terms of the GNU General Public License
245 * as published by the Free Software Foundation; either version 3
246 * of the License, or (at your option) any later version.
247 *
248 * This program is distributed in the hope that it will be useful,
249 * but WITHOUT ANY WARRANTY; without even the implied warranty of
250 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
251 * GNU General Public License for more details.
252 *
253 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
254 */
255
256#include "ScreenEffectFramebufferObject.h"
257#include "BackgroundEffectHelper.h"
258#include <NuxCore/Logger.h>
259#include <dlfcn.h>
260
261namespace
262{
263 nux::logging::Logger logger ("unity.screeneffectframebufferobject");
264}
265
266void ScreenEffectFramebufferObject::paint (const nux::Geometry &output)
267{
268 /* Draw the bit of the relevant framebuffer for each output */
269
270 glPushAttrib (GL_VIEWPORT_BIT);
271 glViewport (0, mScreenSize.height - (output.y + output.height), mScreenSize.width, mScreenSize.height);
272
273 if (mFBTexture)
274 {
275 glEnable (GL_TEXTURE_2D);
276 activeTexture (GL_TEXTURE0_ARB);
277 glBindTexture (GL_TEXTURE_2D, mFBTexture);
278 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
279 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
280
281 glPushAttrib (GL_SCISSOR_BIT);
282 glEnable (GL_SCISSOR_TEST);
283
284 glScissor (output.x, mScreenSize.height - (output.y + output.height),
285 output.width, output.height);
286
287 /* FIXME: This needs to be GL_TRIANGLE_STRIP */
288 glBegin (GL_QUADS);
289 glTexCoord2f (0, 1);
290 glVertex2i (mGeometry.x, mGeometry.y);
291 glTexCoord2f (0, 0);
292 glVertex2i (mGeometry.x, mGeometry.y + mGeometry.height);
293 glTexCoord2f (1, 0);
294 glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y + mGeometry.height);
295 glTexCoord2f (1, 1);
296 glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y);
297 glEnd ();
298
299 activeTexture (GL_TEXTURE0_ARB);
300 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
301 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
302 glBindTexture (GL_TEXTURE_2D, 0);
303 glDisable (GL_TEXTURE_2D);
304 glPopAttrib ();
305 }
306 glPopAttrib ();
307}
308
309void ScreenEffectFramebufferObject::onScreenSizeChanged(const nux::Geometry& screenSize)
310{
311 mScreenSize = screenSize;
312}
313
314
315void ScreenEffectFramebufferObject::unbind ()
316{
317 if (!mBoundCnt)
318 return;
319
320 mBoundCnt--;
321
322 (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, 0);
323
324 glDrawBuffer (GL_BACK);
325 glReadBuffer (GL_BACK);
326
327 /* Matches the viewport set we did in ::bind () */
328 glPopAttrib ();
329
330}
331
332bool ScreenEffectFramebufferObject::status ()
333{
334 return mFboStatus;
335}
336
337void ScreenEffectFramebufferObject::bind (const nux::Geometry &output)
338{
339 if (!BackgroundEffectHelper::HasDirtyHelpers())
340 return;
341
342 /* Clear the error bit */
343 glGetError ();
344
345 if (!mFBTexture)
346 {
347 glGenTextures (1, &mFBTexture);
348
349 glBindTexture (GL_TEXTURE_2D, mFBTexture);
350 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
351 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
352 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
353 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
354 glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, mGeometry.width, mGeometry.height, 0, GL_BGRA,
355#if IMAGE_BYTE_ORDER == MSBFirst
356 GL_UNSIGNED_INT_8_8_8_8_REV,
357#else
358 GL_UNSIGNED_BYTE,
359#endif
360 NULL);
361
362 glBindTexture (GL_TEXTURE_2D, 0);
363
364 if (glGetError () != GL_NO_ERROR)
365 {
366 mFboHandle = 0;
367 mFboStatus = false;
368 return;
369 }
370 }
371
372 (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, mFboHandle);
373
374 (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
375 GL_TEXTURE_2D, mFBTexture, 0);
376
377 (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
378 GL_TEXTURE_2D, 0, 0);
379
380 /* Ensure that a framebuffer is actually available */
381 if (!mFboStatus)
382 {
383 GLint status = (*checkFramebufferStatus) (GL_DRAW_FRAMEBUFFER);
384
385 if (status != GL_FRAMEBUFFER_COMPLETE)
386 {
387 switch (status)
388 {
389 case GL_FRAMEBUFFER_UNDEFINED:
390 LOG_WARN (logger) << "no window";
391 break;
392 case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
393 LOG_WARN (logger) << "attachment incomplete";
394 break;
395 case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
396 LOG_WARN (logger) << "no buffers attached to fbo";
397 break;
398 case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
399 LOG_WARN (logger) << "some attachment in glDrawBuffers doesn't exist in FBO";
400 break;
401 case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
402 LOG_WARN (logger) << "some attachment in glReadBuffers doesn't exist in FBO";
403 break;
404 case GL_FRAMEBUFFER_UNSUPPORTED:
405 LOG_WARN (logger) << "unsupported internal format";
406 break;
407 case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
408 LOG_WARN (logger) << "different levels of sampling for each attachment";
409 break;
410 case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
411 LOG_WARN (logger) << "number of layers is different";
412 break;
413 default:
414 LOG_WARN (logger) << "unable to bind the framebuffer for an unknown reason";
415 break;
416 }
417
418 bindFramebuffer (GL_FRAMEBUFFER_EXT, 0);
419 deleteFramebuffers (1, &mFboHandle);
420
421 glDrawBuffer (GL_BACK);
422 glReadBuffer (GL_BACK);
423
424 mFboHandle = 0;
425
426 mFboStatus = false;
427 }
428 else
429 mFboStatus = true;
430 }
431
432 if (mFboStatus)
433 {
434 glPushAttrib (GL_VIEWPORT_BIT);
435
436 glViewport (output.x,
437 mScreenSize.height - (output.y + output.height),
438 output.width,
439 output.height);
440 }
441
442 mBoundCnt++;
443}
444
445
446ScreenEffectFramebufferObject::ScreenEffectFramebufferObject (GLXGetProcAddressProc p, const nux::Geometry &geom)
447 : getProcAddressGLX (p)
448 , mFboStatus (false)
449 , mFBTexture (0)
450 , mGeometry (geom)
451 , mBoundCnt (0)
452 , mScreenSize (geom)
453{
454 activeTexture = (GLActiveTextureProc) (*getProcAddressGLX) ((GLubyte *) "glActiveTexture");
455 genFramebuffers = (GLGenFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glGenFramebuffersEXT");
456 deleteFramebuffers = (GLDeleteFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glDeleteFramebuffersEXT");
457 bindFramebuffer = (GLBindFramebufferProc) (*getProcAddressGLX) ((GLubyte *)"glBindFramebufferEXT");
458 checkFramebufferStatus = (GLCheckFramebufferStatusProc) (*getProcAddressGLX) ((GLubyte *) "glCheckFramebufferStatusEXT");
459 framebufferTexture2D = (GLFramebufferTexture2DProc) (*getProcAddressGLX) ((GLubyte *) "glFramebufferTexture2DEXT");
460
461 (*genFramebuffers) (1, &mFboHandle);
462}
463
464ScreenEffectFramebufferObject::~ScreenEffectFramebufferObject ()
465{
466 (*deleteFramebuffers) (1, &mFboHandle);
467
468 if (mFBTexture)
469 glDeleteTextures (1, &mFBTexture);
470}
471>>>>>>> MERGE-SOURCE
235472
=== modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.h'
--- plugins/unityshell/src/ScreenEffectFramebufferObject.h 2011-12-16 09:46:35 +0000
+++ plugins/unityshell/src/ScreenEffectFramebufferObject.h 2012-01-06 13:12:27 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-2// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/* Compiz unity plugin3/* Compiz unity plugin
3 * unity.h4 * unity.h
@@ -85,3 +86,89 @@
85} // namespace unity86} // namespace unity
8687
87#endif88#endif
89=======
90// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
91/* Compiz unity plugin
92 * unity.h
93 *
94 * Copyright (c) 2010-11 Canonical Ltd.
95 *
96 * This program is free software; you can redistribute it and/or
97 * modify it under the terms of the GNU General Public License
98 * as published by the Free Software Foundation; either version 3
99 * of the License, or (at your option) any later version.
100 *
101 * This program is distributed in the hope that it will be useful,
102 * but WITHOUT ANY WARRANTY; without even the implied warranty of
103 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
104 * GNU General Public License for more details.
105 *
106 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
107 */
108
109#ifndef UNITY_SCREENEFFECT_FRAMEBUFFER_H
110#define UNITY_SCREENEFFECT_FRAMEBUFFER_H
111
112#include <Nux/Nux.h>
113
114class ScreenEffectFramebufferObject
115{
116public:
117
118 typedef boost::shared_ptr <ScreenEffectFramebufferObject> Ptr;
119 typedef void (*FuncPtr) (void);
120 typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
121
122 ScreenEffectFramebufferObject (GLXGetProcAddressProc, const nux::Geometry &geom);
123 ~ScreenEffectFramebufferObject ();
124
125public:
126
127 void bind (const nux::Geometry &geom);
128 void unbind ();
129
130 bool status ();
131 void paint (const nux::Geometry &geom);
132 bool bound () { return mBoundCnt > 0; }
133
134 GLuint texture () { return mFBTexture; }
135
136 void onScreenSizeChanged (const nux::Geometry &screenSize);
137
138private:
139
140 FuncPtr getProcAddr (const std::string &);
141
142 typedef void (*GLActiveTextureProc) (GLenum texture);
143 typedef void (*GLGenFramebuffersProc) (GLsizei n,
144 GLuint *framebuffers);
145 typedef void (*GLDeleteFramebuffersProc) (GLsizei n,
146 GLuint *framebuffers);
147 typedef void (*GLBindFramebufferProc) (GLenum target,
148 GLuint framebuffer);
149 typedef GLenum (*GLCheckFramebufferStatusProc) (GLenum target);
150 typedef void (*GLFramebufferTexture2DProc) (GLenum target,
151 GLenum attachment,
152 GLenum textarget,
153 GLuint texture,
154 GLint level);
155
156 GLXGetProcAddressProc getProcAddressGLX;
157 GLActiveTextureProc activeTexture;
158 GLGenFramebuffersProc genFramebuffers;
159 GLDeleteFramebuffersProc deleteFramebuffers;
160 GLBindFramebufferProc bindFramebuffer;
161 GLCheckFramebufferStatusProc checkFramebufferStatus;
162 GLFramebufferTexture2DProc framebufferTexture2D;
163 /* compiz fbo handle that goes through to nux */
164 GLuint mFboHandle; // actual handle to the framebuffer_ext
165 bool mFboStatus; // did the framebuffer texture bind succeed
166 GLuint mFBTexture;
167 nux::Geometry mGeometry;
168 unsigned int mBoundCnt;
169
170 nux::Geometry mScreenSize;
171};
172
173#endif
174>>>>>>> MERGE-SOURCE
88175
=== modified file 'plugins/unityshell/src/SwitcherController.cpp'
=== modified file 'plugins/unityshell/src/SwitcherController.h'
=== modified file 'plugins/unityshell/src/SwitcherModel.cpp'
--- plugins/unityshell/src/SwitcherModel.cpp 2011-12-08 01:23:11 +0000
+++ plugins/unityshell/src/SwitcherModel.cpp 2012-01-06 13:12:27 +0000
@@ -173,10 +173,17 @@
173{173{
174 if (!detail_selection || DetailXids ().empty())174 if (!detail_selection || DetailXids ().empty())
175 return 0;175 return 0;
176<<<<<<< TREE
176177
177 if (detail_selection_index > DetailXids().size() - 1)178 if (detail_selection_index > DetailXids().size() - 1)
178 return 0;179 return 0;
179 180
181=======
182
183 if (detail_selection_index >= DetailXids().size())
184 return 0;
185
186>>>>>>> MERGE-SOURCE
180 return DetailXids()[detail_selection_index];187 return DetailXids()[detail_selection_index];
181}188}
182189
183190
=== modified file 'plugins/unityshell/src/WindowManager.cpp'
=== modified file 'plugins/unityshell/src/comptransientfor.cpp'
--- plugins/unityshell/src/comptransientfor.cpp 2011-08-23 14:47:38 +0000
+++ plugins/unityshell/src/comptransientfor.cpp 2012-01-06 13:12:27 +0000
@@ -55,13 +55,18 @@
55bool55bool
56compiz::CompTransientForReader::isTransientFor (unsigned int ancestor)56compiz::CompTransientForReader::isTransientFor (unsigned int ancestor)
57{57{
58 if (!ancestor ||
59 !priv->mWindow->id ())
60 return false;
61
58 return priv->mWindow->transientFor () == ancestor;62 return priv->mWindow->transientFor () == ancestor;
59}63}
6064
61bool65bool
62compiz::CompTransientForReader::isGroupTransientFor (unsigned int clientLeader)66compiz::CompTransientForReader::isGroupTransientFor (unsigned int clientLeader)
63{67{
64 if (!clientLeader)68 if (!clientLeader ||
69 !priv->mWindow->id ())
65 return false;70 return false;
6671
67 if (priv->mWindow->transientFor () == None || priv->mWindow->transientFor () == screen->root ())72 if (priv->mWindow->transientFor () == None || priv->mWindow->transientFor () == screen->root ())
6873
=== modified file 'plugins/unityshell/src/transientfor.cpp'
--- plugins/unityshell/src/transientfor.cpp 2011-08-26 10:37:35 +0000
+++ plugins/unityshell/src/transientfor.cpp 2012-01-06 13:12:27 +0000
@@ -51,9 +51,9 @@
51 {51 {
52 if (actualType == XA_WINDOW && actualFormat == 32 && nLeft == 0 && nItems == 1)52 if (actualType == XA_WINDOW && actualFormat == 32 && nLeft == 0 && nItems == 1)
53 {53 {
54 Window *data = (Window *) prop;54 Window *data = (Window *) prop;
5555
56 serverAncestor = *data;56 serverAncestor = *data;
57 }57 }
5858
59 XFree (prop);59 XFree (prop);
@@ -65,6 +65,10 @@
65bool65bool
66compiz::X11TransientForReader::isTransientFor (unsigned int ancestor)66compiz::X11TransientForReader::isTransientFor (unsigned int ancestor)
67{67{
68 if (!ancestor ||
69 !priv->mXid)
70 return false;
71
68 return ancestor == getAncestor ();72 return ancestor == getAncestor ();
69}73}
7074
@@ -80,14 +84,18 @@
80 std::vector<std::string> strings;84 std::vector<std::string> strings;
81 std::list<Atom> atoms;85 std::list<Atom> atoms;
8286
87 if (!clientLeader ||
88 !priv->mXid)
89 return false;
90
83 if (XGetWindowProperty (priv->mDpy, priv->mXid, wmClientLeader, 0L, 2L, false,91 if (XGetWindowProperty (priv->mDpy, priv->mXid, wmClientLeader, 0L, 2L, false,
84 XA_WINDOW, &actualType, &actualFormat, &nItems, &nLeft, (unsigned char **)&prop) == Success)92 XA_WINDOW, &actualType, &actualFormat, &nItems, &nLeft, (unsigned char **)&prop) == Success)
85 {93 {
86 if (actualType == XA_WINDOW && actualFormat == 32 && nLeft == 0 && nItems == 1)94 if (actualType == XA_WINDOW && actualFormat == 32 && nLeft == 0 && nItems == 1)
87 {95 {
88 Window *data = (Window *) prop;96 Window *data = (Window *) prop;
8997
90 serverClientLeader = *data;98 serverClientLeader = *data;
91 }99 }
92100
93 XFree (prop);101 XFree (prop);
94102
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-01-06 04:53:09 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-01-06 13:12:27 +0000
@@ -569,6 +569,7 @@
569void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transform, unsigned int mask)569void UnityScreen::paintDisplay(const CompRegion& region, const GLMatrix& transform, unsigned int mask)
570{570{
571 CompOutput *output = _last_output;571 CompOutput *output = _last_output;
572<<<<<<< TREE
572 Window tray_xid = panel_controller_->GetTrayXid ();573 Window tray_xid = panel_controller_->GetTrayXid ();
573574
574 bool was_bound = _fbo->bound ();575 bool was_bound = _fbo->bound ();
@@ -577,6 +578,16 @@
577 /* Draw the bit of the relevant framebuffer for each output */578 /* Draw the bit of the relevant framebuffer for each output */
578579
579 if (was_bound)580 if (was_bound)
581=======
582 Window tray_xid = panelController->GetTrayXid ();
583
584 bool was_bound = _fbo->bound ();
585 _fbo->unbind ();
586
587 /* Draw the bit of the relevant framebuffer for each output */
588
589 if (was_bound)
590>>>>>>> MERGE-SOURCE
580 {591 {
581 GLMatrix sTransform;592 GLMatrix sTransform;
582 sTransform.toScreenSpace (&screen->fullscreenOutput (), -DEFAULT_Z_CAMERA);593 sTransform.toScreenSpace (&screen->fullscreenOutput (), -DEFAULT_Z_CAMERA);
@@ -730,6 +741,7 @@
730741
731void UnityScreen::leaveShowDesktopMode (CompWindow *w)742void UnityScreen::leaveShowDesktopMode (CompWindow *w)
732{743{
744<<<<<<< TREE
733 /* Where a window is inhibiting, only allow the window745 /* Where a window is inhibiting, only allow the window
734 * that is inhibiting the leave show desktop to actually746 * that is inhibiting the leave show desktop to actually
735 * fade in again - all other windows should remain faded out */747 * fade in again - all other windows should remain faded out */
@@ -761,6 +773,22 @@
761 }773 }
762 }774 }
763 }775 }
776=======
777 for (CompWindow *cw : screen->windows ())
778 {
779 if (cw->inShowDesktopMode ())
780 {
781 UnityWindow::get (cw)->leaveShowDesktop ();
782 // the animation plugin does strange things here ...
783 // if this notification is sent
784 //cw->windowNotify (CompWindowNotifyLeaveShowDesktopMode);
785 }
786 }
787
788 PluginAdapter::Default()->OnLeaveDesktop();
789
790 screen->leaveShowDesktopMode (w);
791>>>>>>> MERGE-SOURCE
764}792}
765793
766void UnityWindow::enterShowDesktop ()794void UnityWindow::enterShowDesktop ()
@@ -1409,11 +1437,16 @@
1409 screen->outputDevs()[device].y1() + 100,1437 screen->outputDevs()[device].y1() + 100,
1410 screen->outputDevs()[device].width() - 200,1438 screen->outputDevs()[device].width() - 200,
1411 screen->outputDevs()[device].height() - 200));1439 screen->outputDevs()[device].height() - 200));
1440<<<<<<< TREE
14121441
1413 switcher::ShowMode show_mode = optionGetAltTabBiasViewport() ? switcher::ShowMode::CURRENT_VIEWPORT : switcher::ShowMode::ALL;1442 switcher::ShowMode show_mode = optionGetAltTabBiasViewport() ? switcher::ShowMode::CURRENT_VIEWPORT : switcher::ShowMode::ALL;
14141443
1415 RaiseInputWindows();1444 RaiseInputWindows();
1416 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);1445 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);
1446=======
1447 switcherController->Show(SwitcherController::ALL, SwitcherController::FOCUS_ORDER, false, results);
1448 RaiseInputWindows();
1449>>>>>>> MERGE-SOURCE
1417 return true;1450 return true;
1418}1451}
14191452
@@ -2198,15 +2231,27 @@
21982231
2199void UnityScreen::Relayout()2232void UnityScreen::Relayout()
2200{2233{
2201 nux::Geometry geometry (0, 0, screen->width (), screen->height ());2234<<<<<<< TREE
2235 nux::Geometry geometry (0, 0, screen->width (), screen->height ());
2236=======
2237 GdkRectangle rect;
2238 nux::Geometry lCurGeom;
2239 int panel_height = 24;
2240 nux::Geometry geometry (0, 0, screen->width (), screen->height ());
2241>>>>>>> MERGE-SOURCE
22022242
2203 if (!needsRelayout)2243 if (!needsRelayout)
2204 return;2244 return;
22052245
2206 if (GL::fbo)2246 if (GL::fbo)
2207 {2247 {
2248<<<<<<< TREE
2208 uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));2249 uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
2209 uScreen->_fbo->onScreenSizeChanged (geometry);2250 uScreen->_fbo->onScreenSizeChanged (geometry);
2251=======
2252 uScreen->_fbo.reset (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
2253 uScreen->_fbo->onScreenSizeChanged (geometry);
2254>>>>>>> MERGE-SOURCE
2210 }2255 }
22112256
2212 UScreen *uscreen = UScreen::GetDefault();2257 UScreen *uscreen = UScreen::GetDefault();
@@ -2268,9 +2313,15 @@
2268 {2313 {
2269 if (w->resName() == "onboard")2314 if (w->resName() == "onboard")
2270 {2315 {
2316<<<<<<< TREE
2271 Window xid = dash_controller_->window()->GetInputWindowId();2317 Window xid = dash_controller_->window()->GetInputWindowId();
2272 XSetTransientForHint (screen->dpy(), w->id(), xid);2318 XSetTransientForHint (screen->dpy(), w->id(), xid);
2273 w->raise ();2319 w->raise ();
2320=======
2321 Window xid = dashController->window()->GetInputWindowId();
2322 XSetTransientForHint (screen->dpy(), w->id(), xid);
2323 w->raise ();
2324>>>>>>> MERGE-SOURCE
2274 }2325 }
2275 }2326 }
2276}2327}
@@ -2303,6 +2354,7 @@
2303 LOG_INFO(logger) << "initLauncher-Panel " << timer.ElapsedSeconds() << "s";2354 LOG_INFO(logger) << "initLauncher-Panel " << timer.ElapsedSeconds() << "s";
23042355
2305 /* Setup Places */2356 /* Setup Places */
2357<<<<<<< TREE
2306 dash_controller_.reset(new dash::Controller());2358 dash_controller_.reset(new dash::Controller());
2307 dash_controller_->on_realize.connect(sigc::mem_fun(this, &UnityScreen::OnDashRealized));2359 dash_controller_->on_realize.connect(sigc::mem_fun(this, &UnityScreen::OnDashRealized));
23082360
@@ -2315,6 +2367,29 @@
2315 ScheduleRelayout(0);2367 ScheduleRelayout(0);
23162368
2317 OnLauncherHiddenChanged();2369 OnLauncherHiddenChanged();
2370=======
2371 self->dashController = DashController::Ptr(new DashController());
2372 self->dashController->on_realize.connect (sigc::mem_fun (self, &UnityScreen::OnDashRealized));
2373
2374 /* FIXME: this should not be manual, should be managed with a
2375 show/hide callback like in GAIL
2376 if (unity_a11y_initialized() == TRUE)
2377 {
2378 AtkObject* atk_obj = NULL;
2379
2380 atk_obj = unity_util_accessible_add_window(self->placesController->GetWindow());
2381
2382 atk_object_set_name(atk_obj, _("Places"));
2383 }
2384 */
2385
2386 self->launcher->SetHideMode(Launcher::LAUNCHER_HIDE_DODGE_WINDOWS);
2387 self->launcher->SetLaunchAnimation(Launcher::LAUNCH_ANIMATION_PULSE);
2388 self->launcher->SetUrgentAnimation(Launcher::URGENT_ANIMATION_WIGGLE);
2389 self->ScheduleRelayout(0);
2390
2391 self->OnLauncherHiddenChanged();
2392>>>>>>> MERGE-SOURCE
2318}2393}
23192394
2320/* Window init */2395/* Window init */
@@ -2351,6 +2426,7 @@
23512426
2352 if (window->state () & CompWindowStateFullscreenMask)2427 if (window->state () & CompWindowStateFullscreenMask)
2353 UnityScreen::get (screen)->fullscreen_windows_.push_back(window);2428 UnityScreen::get (screen)->fullscreen_windows_.push_back(window);
2429<<<<<<< TREE
23542430
2355 /* We might be starting up so make sure that2431 /* We might be starting up so make sure that
2356 * we don't deref the dashcontroller that doesnt2432 * we don't deref the dashcontroller that doesnt
@@ -2358,6 +2434,15 @@
2358 dash::Controller::Ptr dp = UnityScreen::get(screen)->dash_controller_;2434 dash::Controller::Ptr dp = UnityScreen::get(screen)->dash_controller_;
23592435
2360 if (dp)2436 if (dp)
2437=======
2438
2439 /* We might be starting up so make sure that
2440 * we don't deref the dashcontroller that doesnt
2441 * exist */
2442 DashController::Ptr dp = UnityScreen::get (screen)->dashController;
2443
2444 if (dp)
2445>>>>>>> MERGE-SOURCE
2361 {2446 {
2362 nux::BaseWindow* w = dp->window ();2447 nux::BaseWindow* w = dp->window ();
23632448
@@ -2380,7 +2465,7 @@
23802465
2381 UnityShowdesktopHandler::animating_windows.remove (window);2466 UnityShowdesktopHandler::animating_windows.remove (window);
23822467
2383 if (mMinimizeHandler)2468 if (mMinimizeHandler && !window->destroyed ())
2384 {2469 {
2385 unminimize ();2470 unminimize ();
2386 window->focusSetEnabled (this, false);2471 window->focusSetEnabled (this, false);
@@ -2388,9 +2473,10 @@
2388 window->unminimizeSetEnabled (this, false);2473 window->unminimizeSetEnabled (this, false);
2389 window->minimizedSetEnabled (this, false);2474 window->minimizedSetEnabled (this, false);
2390 window->minimize ();2475 window->minimize ();
2391
2392 mMinimizeHandler.reset ();
2393 }2476 }
2477
2478 mMinimizeHandler.reset ();
2479
2394 if (mShowdesktopHandler)2480 if (mShowdesktopHandler)
2395 delete mShowdesktopHandler;2481 delete mShowdesktopHandler;
2396 2482
23972483
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2012-01-06 04:53:09 +0000
+++ plugins/unityshell/src/unityshell.h 2012-01-06 13:12:27 +0000
@@ -47,15 +47,26 @@
47#include "DebugDBusInterface.h"47#include "DebugDBusInterface.h"
48#include "SwitcherController.h"48#include "SwitcherController.h"
49#include "UBusWrapper.h"49#include "UBusWrapper.h"
50#include "ScreenEffectFramebufferObject.h"50<<<<<<< TREE
51#include "ScreenEffectFramebufferObject.h"
52=======
53#include <Nux/WindowThread.h>
54#include <sigc++/sigc++.h>
55#include <boost/shared_ptr.hpp>
56#include "ScreenEffectFramebufferObject.h"
57>>>>>>> MERGE-SOURCE
5158
52#include "compizminimizedwindowhandler.h"59#include "compizminimizedwindowhandler.h"
60<<<<<<< TREE
53#include "BGHash.h"61#include "BGHash.h"
54#include <compiztoolbox/compiztoolbox.h>62#include <compiztoolbox/compiztoolbox.h>
55#include <dlfcn.h>63#include <dlfcn.h>
5664
57namespace unity65namespace unity
58{66{
67=======
68#include <dlfcn.h>
69>>>>>>> MERGE-SOURCE
5970
60class UnityShowdesktopHandler71class UnityShowdesktopHandler
61{72{
6273
=== modified file 'services/panel-service.c'
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2011-12-22 06:27:26 +0000
+++ tests/CMakeLists.txt 2012-01-06 13:12:27 +0000
@@ -71,6 +71,444 @@
71 )71 )
72add_dependencies (test-unit unity-core-${UNITY_API_VERSION})72add_dependencies (test-unit unity-core-${UNITY_API_VERSION})
7373
74<<<<<<< TREE
75=======
76#
77# Standalone tests
78#
79add_executable (standalone-dash
80 standalone_dash.cpp
81 ${UNITY_SRC}/BackgroundEffectHelper.cpp
82 ${UNITY_SRC}/BackgroundEffectHelper.h
83 ${UNITY_SRC}/BGHash.cpp
84 ${UNITY_SRC}/BGHash.h
85 ${UNITY_SRC}/DashSearchBar.cpp
86 ${UNITY_SRC}/DashSearchBar.h
87 ${UNITY_SRC}/DashSearchBarSpinner.cpp
88 ${UNITY_SRC}/DashSearchBarSpinner.h
89 ${UNITY_SRC}/FilterExpanderLabel.cpp
90 ${UNITY_SRC}/FilterFactory.cpp
91 ${UNITY_SRC}/FilterBasicButton.cpp
92 ${UNITY_SRC}/FilterRatingsButton.cpp
93 ${UNITY_SRC}/FilterRatingsWidget.cpp
94 ${UNITY_SRC}/FilterMultiRangeWidget.cpp
95 ${UNITY_SRC}/FilterMultiRangeButton.cpp
96 ${UNITY_SRC}/FilterGenreButton.cpp
97 ${UNITY_SRC}/FilterGenreWidget.cpp
98 ${UNITY_SRC}/FilterBar.cpp
99 ${UNITY_SRC}/FontSettings.cpp
100 ${UNITY_SRC}/FontSettings.h
101 ${UNITY_SRC}/IMTextEntry.cpp
102 ${UNITY_SRC}/IMTextEntry.h
103 ${UNITY_SRC}/PlacesHomeView.cpp
104 ${UNITY_SRC}/PlacesHomeView.h
105 ${UNITY_SRC}/PlacesGroup.cpp
106 ${UNITY_SRC}/PlacesGroup.h
107 ${UNITY_SRC}/DashSettings.cpp
108 ${UNITY_SRC}/DashSettings.h
109 ${UNITY_SRC}/PlacesStyle.cpp
110 ${UNITY_SRC}/PlacesStyle.h
111 ${UNITY_SRC}/PlacesTile.cpp
112 ${UNITY_SRC}/PlacesTile.h
113 ${UNITY_SRC}/PlacesSimpleTile.cpp
114 ${UNITY_SRC}/PlacesSimpleTile.h
115 ${UNITY_SRC}/PlacesVScrollBar.cpp
116 ${UNITY_SRC}/PlacesVScrollBar.h
117 ${UNITY_SRC}/DashView.cpp
118 ${UNITY_SRC}/DashView.h
119 ${UNITY_SRC}/HomeView.cpp
120 ${UNITY_SRC}/HomeView.h
121 ${UNITY_SRC}/DashStyle.cpp
122 ${UNITY_SRC}/IconLoader.cpp
123 ${UNITY_SRC}/IconLoader.h
124 ${UNITY_SRC}/IconTexture.cpp
125 ${UNITY_SRC}/IconTexture.h
126 ${UNITY_SRC}/Introspectable.cpp
127 ${UNITY_SRC}/Introspectable.h
128 ${UNITY_SRC}/JSONParser.cpp
129 ${UNITY_SRC}/LensBar.cpp
130 ${UNITY_SRC}/LensBar.h
131 ${UNITY_SRC}/LensBarIcon.cpp
132 ${UNITY_SRC}/LensBarIcon.h
133 ${UNITY_SRC}/LensView.cpp
134 ${UNITY_SRC}/LensView.h
135 ${UNITY_SRC}/PreviewApplications.cpp
136 ${UNITY_SRC}/PreviewBase.cpp
137 ${UNITY_SRC}/PreviewBasicButton.cpp
138 ${UNITY_SRC}/ResultView.cpp
139 ${UNITY_SRC}/ResultViewGrid.cpp
140 ${UNITY_SRC}/ResultRenderer.cpp
141 ${UNITY_SRC}/ResultRendererTile.cpp
142 ${UNITY_SRC}/ResultRendererHorizontalTile.cpp
143 ${UNITY_SRC}/TextureCache.h
144 ${UNITY_SRC}/TextureCache.cpp
145 ${UNITY_SRC}/Timer.cpp
146 ${UNITY_SRC}/Timer.h
147 ${UNITY_SRC}/StaticCairoText.cpp
148 ${UNITY_SRC}/StaticCairoText.h
149 ${UNITY_SRC}/UBusMessages.h
150 ${UNITY_SRC}/UBusWrapper.cpp
151 ${UNITY_SRC}/UBusWrapper.h
152 ${UNITY_SRC}/ubus-server.cpp
153 ${UNITY_SRC}/ubus-server.h
154 ${UNITY_SRC}/UScreen.cpp
155 ${UNITY_SRC}/UScreen.h
156 )
157add_dependencies (standalone-dash unity-core-${UNITY_API_VERSION})
158
159
160#
161# Please use "standalone-$foo" naming convention for standalone tests
162#
163add_executable (test-panel
164 TestPanel.cpp
165 ${UNITY_SRC}/Animator.cpp
166 ${UNITY_SRC}/Animator.h
167 ${UNITY_SRC}/BackgroundEffectHelper.cpp
168 ${UNITY_SRC}/BackgroundEffectHelper.h
169 ${UNITY_SRC}/DashSettings.cpp
170 ${UNITY_SRC}/DashSettings.h
171 ${UNITY_SRC}/PanelStyle.cpp
172 ${UNITY_SRC}/PanelStyle.h
173 ${UNITY_SRC}/PanelView.cpp
174 ${UNITY_SRC}/PanelView.h
175 ${UNITY_SRC}/PanelIndicatorsView.cpp
176 ${UNITY_SRC}/PanelIndicatorsView.h
177 ${UNITY_SRC}/PanelIndicatorEntryView.cpp
178 ${UNITY_SRC}/PanelIndicatorEntryView.h
179 ${UNITY_SRC}/PanelTitlebarGrabAreaView.h
180 ${UNITY_SRC}/PanelTitlebarGrabAreaView.cpp
181 ${UNITY_SRC}/PanelTray.cpp
182 ${UNITY_SRC}/PanelTray.h
183 ${UNITY_SRC}/Introspectable.cpp
184 ${UNITY_SRC}/Introspectable.h
185 ${UNITY_SRC}/PanelMenuView.cpp
186 ${UNITY_SRC}/PanelMenuView.h
187 ${UNITY_SRC}/Timer.cpp
188 ${UNITY_SRC}/Timer.h
189 ${UNITY_SRC}/StaticCairoText.cpp
190 ${UNITY_SRC}/StaticCairoText.h
191 ${UNITY_SRC}/WindowButtons.cpp
192 ${UNITY_SRC}/WindowButtons.h
193 ${UNITY_SRC}/WindowManager.cpp
194 ${UNITY_SRC}/WindowManager.h
195 ${UNITY_SRC}/UScreen.cpp
196 ${UNITY_SRC}/UScreen.h
197 ${UNITY_SRC}/ubus-server.cpp
198 ${UNITY_SRC}/ubus-server.h
199 )
200add_dependencies (test-panel unity-core-${UNITY_API_VERSION})
201
202add_executable (test-switcher
203 TestSwitcher.cpp
204 ${UNITY_SRC}/AbstractLauncherIcon.h
205 ${UNITY_SRC}/AbstractIconRenderer.h
206 ${UNITY_SRC}/SwitcherController.cpp
207 ${UNITY_SRC}/SwitcherController.h
208 ${UNITY_SRC}/SwitcherModel.cpp
209 ${UNITY_SRC}/SwitcherModel.h
210 ${UNITY_SRC}/SwitcherView.cpp
211 ${UNITY_SRC}/SwitcherView.h
212 ${UNITY_SRC}/LayoutSystem.h
213 ${UNITY_SRC}/LayoutSystem.cpp
214 ${UNITY_SRC}/WindowManager.h
215 ${UNITY_SRC}/WindowManager.cpp
216 ${UNITY_SRC}/IconRenderer.cpp
217 ${UNITY_SRC}/IconRenderer.h
218 ${UNITY_SRC}/MockLauncherIcon.h
219 ${UNITY_SRC}/BackgroundEffectHelper.h
220 ${UNITY_SRC}/BackgroundEffectHelper.cpp
221 ${UNITY_SRC}/StaticCairoText.cpp
222 ${UNITY_SRC}/StaticCairoText.h
223 ${UNITY_SRC}/UBusMessages.h
224 ${UNITY_SRC}/ubus-server.cpp
225 ${UNITY_SRC}/ubus-server.h
226 )
227add_dependencies (test-switcher unity-core-${UNITY_API_VERSION})
228
229add_executable (test-launcher
230 TestLauncher.cpp
231 ${UNITY_SRC}/AbstractLauncherIcon.h
232 ${UNITY_SRC}/AbstractIconRenderer.h
233 ${UNITY_SRC}/LauncherIcon.cpp
234 ${UNITY_SRC}/LauncherIcon.h
235 ${UNITY_SRC}/SimpleLauncherIcon.cpp
236 ${UNITY_SRC}/SimpleLauncherIcon.h
237 ${UNITY_SRC}/BamfLauncherIcon.cpp
238 ${UNITY_SRC}/BamfLauncherIcon.h
239 ${UNITY_SRC}/BFBLauncherIcon.cpp
240 ${UNITY_SRC}/BFBLauncherIcon.h
241 ${UNITY_SRC}/SpacerLauncherIcon.cpp
242 ${UNITY_SRC}/SpacerLauncherIcon.h
243 ${UNITY_SRC}/DndData.cpp
244 ${UNITY_SRC}/DndData.h
245 ${UNITY_SRC}/TrashLauncherIcon.cpp
246 ${UNITY_SRC}/TrashLauncherIcon.h
247 ${UNITY_SRC}/DNDCollectionWindow.cpp
248 ${UNITY_SRC}/DNDCollectionWindow.h
249 ${UNITY_SRC}/DeviceLauncherIcon.cpp
250 ${UNITY_SRC}/DeviceLauncherIcon.h
251 ${UNITY_SRC}/DeviceLauncherSection.cpp
252 ${UNITY_SRC}/DeviceLauncherSection.h
253 ${UNITY_SRC}/DevicesSettings.cpp
254 ${UNITY_SRC}/DevicesSettings.h
255 ${UNITY_SRC}/FavoriteStore.cpp
256 ${UNITY_SRC}/FavoriteStore.h
257 ${UNITY_SRC}/FavoriteStoreGSettings.cpp
258 ${UNITY_SRC}/FavoriteStoreGSettings.h
259 ${UNITY_SRC}/LauncherEntryRemoteModel.cpp
260 ${UNITY_SRC}/LauncherEntryRemoteModel.h
261 ${UNITY_SRC}/LauncherEntryRemote.cpp
262 ${UNITY_SRC}/LauncherEntryRemote.h
263 ${UNITY_SRC}/LauncherController.cpp
264 ${UNITY_SRC}/LauncherController.h
265 ${UNITY_SRC}/LauncherModel.cpp
266 ${UNITY_SRC}/LauncherModel.h
267 ${UNITY_SRC}/Launcher.cpp
268 ${UNITY_SRC}/Launcher.h
269 ${UNITY_SRC}/LauncherHideMachine.cpp
270 ${UNITY_SRC}/LauncherHideMachine.h
271 ${UNITY_SRC}/LauncherHoverMachine.cpp
272 ${UNITY_SRC}/LauncherHoverMachine.h
273 ${UNITY_SRC}/LauncherDragWindow.cpp
274 ${UNITY_SRC}/LauncherDragWindow.h
275 ${UNITY_SRC}/GeisAdapter.cpp
276 ${UNITY_SRC}/GeisAdapter.h
277 ${UNITY_SRC}/WindowManager.h
278 ${UNITY_SRC}/WindowManager.cpp
279 ${UNITY_SRC}/IconRenderer.cpp
280 ${UNITY_SRC}/IconRenderer.h
281 ${UNITY_SRC}/Tooltip.cpp
282 ${UNITY_SRC}/Tooltip.h
283 ${UNITY_SRC}/BackgroundEffectHelper.h
284 ${UNITY_SRC}/BackgroundEffectHelper.cpp
285 ${UNITY_SRC}/StaticCairoText.cpp
286 ${UNITY_SRC}/StaticCairoText.h
287 ${UNITY_SRC}/Introspectable.cpp
288 ${UNITY_SRC}/Introspectable.h
289 ${UNITY_SRC}/QuicklistMenuItem.cpp
290 ${UNITY_SRC}/QuicklistMenuItem.h
291 ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
292 ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
293 ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
294 ${UNITY_SRC}/QuicklistMenuItemLabel.h
295 ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
296 ${UNITY_SRC}/QuicklistMenuItemRadio.h
297 ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
298 ${UNITY_SRC}/QuicklistMenuItemSeparator.h
299 ${UNITY_SRC}/QuicklistView.cpp
300 ${UNITY_SRC}/QuicklistView.h
301 ${UNITY_SRC}/QuicklistManager.cpp
302 ${UNITY_SRC}/QuicklistManager.h
303 ${UNITY_SRC}/UBusMessages.h
304 ${UNITY_SRC}/UBusWrapper.cpp
305 ${UNITY_SRC}/UBusWrapper.h
306 ${UNITY_SRC}/ubus-server.cpp
307 ${UNITY_SRC}/ubus-server.h
308 )
309add_dependencies (test-launcher unity-core-${UNITY_API_VERSION})
310
311add_executable (test-keyutil
312 TestKeyboardUtil.cpp
313 ${UNITY_SRC}/KeyboardUtil.h
314 ${UNITY_SRC}/KeyboardUtil.cpp
315 )
316add_dependencies (test-keyutil unity-core-${UNITY_API_VERSION})
317
318add_executable (test-quicklist
319 ui/TestQuicklist.cpp
320 ui/EventFaker.cpp
321 ui/EventFaker.h
322 ${UNITY_SRC}/Introspectable.cpp
323 ${UNITY_SRC}/Introspectable.h
324 ${UNITY_SRC}/QuicklistMenuItem.cpp
325 ${UNITY_SRC}/QuicklistMenuItem.h
326 ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
327 ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
328 ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
329 ${UNITY_SRC}/QuicklistMenuItemLabel.h
330 ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
331 ${UNITY_SRC}/QuicklistMenuItemRadio.h
332 ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
333 ${UNITY_SRC}/QuicklistMenuItemSeparator.h
334 ${UNITY_SRC}/QuicklistView.cpp
335 ${UNITY_SRC}/QuicklistView.h
336 ${UNITY_SRC}/ubus-server.cpp
337 ${UNITY_SRC}/ubus-server.h
338 )
339add_dependencies (test-quicklist unity-core-${UNITY_API_VERSION})
340
341add_executable (test-quicklist-visuals
342 ui/TestQuicklistVisuals.cpp
343 ui/EventFaker.cpp
344 ui/EventFaker.h
345 ${UNITY_SRC}/Introspectable.cpp
346 ${UNITY_SRC}/Introspectable.h
347 ${UNITY_SRC}/QuicklistMenuItem.cpp
348 ${UNITY_SRC}/QuicklistMenuItem.h
349 ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
350 ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
351 ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
352 ${UNITY_SRC}/QuicklistMenuItemLabel.h
353 ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
354 ${UNITY_SRC}/QuicklistMenuItemRadio.h
355 ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
356 ${UNITY_SRC}/QuicklistMenuItemSeparator.h
357 ${UNITY_SRC}/QuicklistView.cpp
358 ${UNITY_SRC}/QuicklistView.h
359 ${UNITY_SRC}/ubus-server.cpp
360 ${UNITY_SRC}/ubus-server.h
361 )
362add_dependencies (test-quicklist-visuals unity-core-${UNITY_API_VERSION})
363
364add_executable (test-filters
365 TestFilters.cpp
366 ${UNITY_SRC}/FilterExpanderLabel.cpp
367 ${UNITY_SRC}/FilterBasicButton.cpp
368 ${UNITY_SRC}/FilterRatingsButton.cpp
369 ${UNITY_SRC}/FilterRatingsWidget.cpp
370 ${UNITY_SRC}/FilterGenreButton.cpp
371 ${UNITY_SRC}/FilterGenreWidget.cpp
372 ${UNITY_SRC}/FilterMultiRangeButton.cpp
373 ${UNITY_SRC}/FilterMultiRangeWidget.cpp
374 ${UNITY_SRC}/DashStyle.cpp
375 ${UNITY_SRC}/JSONParser.cpp
376 ${UNITY_SRC}/PlacesStyle.cpp
377 ${UNITY_SRC}/PlacesStyle.h
378 )
379add_dependencies(test-filters unity-core-${UNITY_API_VERSION})
380
381add_executable (test-filter-bar
382 TestFilterBar.cpp
383 ${UNITY_SRC}/FilterExpanderLabel.cpp
384 ${UNITY_SRC}/FilterFactory.cpp
385 ${UNITY_SRC}/FilterBasicButton.cpp
386 ${UNITY_SRC}/FilterRatingsButton.cpp
387 ${UNITY_SRC}/FilterRatingsWidget.cpp
388 ${UNITY_SRC}/FilterMultiRangeWidget.cpp
389 ${UNITY_SRC}/FilterMultiRangeButton.cpp
390 ${UNITY_SRC}/FilterGenreButton.cpp
391 ${UNITY_SRC}/FilterGenreWidget.cpp
392 ${UNITY_SRC}/FilterBar.cpp
393 ${UNITY_SRC}/DashStyle.cpp
394 ${UNITY_SRC}/JSONParser.cpp
395 ${UNITY_SRC}/PlacesStyle.cpp
396 ${UNITY_SRC}/PlacesStyle.h
397 )
398add_dependencies(test-filter-bar unity-core-${UNITY_API_VERSION})
399
400add_executable (test-preview-applicaiton
401 TestPreviewApplications.cpp
402 ${UNITY_SRC}/PreviewApplications.cpp
403 ${UNITY_SRC}/PreviewBase.cpp
404 ${UNITY_SRC}/PreviewBasicButton.cpp
405 ${UNITY_SRC}/IconTexture.cpp
406 ${UNITY_SRC}/IconLoader.cpp
407 ${UNITY_SRC}/Introspectable.cpp
408 ${UNITY_SRC}/StaticCairoText.cpp
409 ${UNITY_SRC}/TextureCache.cpp
410 ${UNITY_SRC}/DashStyle.cpp
411 ${UNITY_SRC}/JSONParser.cpp
412 ${UNITY_SRC}/Timer.cpp
413 )
414add_dependencies(test-preview-applicaiton unity-core-${UNITY_API_VERSION})
415
416add_executable (test-preview-generic
417 TestPreviewGeneric.cpp
418 ${UNITY_SRC}/PreviewGeneric.cpp
419 ${UNITY_SRC}/PreviewBase.cpp
420 ${UNITY_SRC}/PreviewBasicButton.cpp
421 ${UNITY_SRC}/IconTexture.cpp
422 ${UNITY_SRC}/IconLoader.cpp
423 ${UNITY_SRC}/Introspectable.cpp
424 ${UNITY_SRC}/StaticCairoText.cpp
425 ${UNITY_SRC}/TextureCache.cpp
426 ${UNITY_SRC}/DashStyle.cpp
427 ${UNITY_SRC}/JSONParser.cpp
428 ${UNITY_SRC}/Timer.cpp
429 )
430add_dependencies(test-preview-generic unity-core-${UNITY_API_VERSION})
431
432add_executable (test-preview-music
433 TestPreviewMusic.cpp
434 ${UNITY_SRC}/PreviewBase.cpp
435 ${UNITY_SRC}/PreviewBasicButton.cpp
436 ${UNITY_SRC}/PreviewMusic.cpp
437 ${UNITY_SRC}/PreviewMusicTrack.cpp
438 ${UNITY_SRC}/PreviewMusicTrackWidget.cpp
439 ${UNITY_SRC}/IconTexture.cpp
440 ${UNITY_SRC}/IconLoader.cpp
441 ${UNITY_SRC}/Introspectable.cpp
442 ${UNITY_SRC}/StaticCairoText.cpp
443 ${UNITY_SRC}/TextureCache.cpp
444 ${UNITY_SRC}/DashStyle.cpp
445 ${UNITY_SRC}/JSONParser.cpp
446 ${UNITY_SRC}/Timer.cpp
447 )
448add_dependencies(test-preview-music unity-core-${UNITY_API_VERSION})
449
450add_executable (test-result-view
451 TestResultView.cpp
452 ${UNITY_SRC}/PlacesStyle.cpp
453 ${UNITY_SRC}/PlacesStyle.h
454 ${UNITY_SRC}/PreviewApplications.cpp
455 ${UNITY_SRC}/PreviewBase.cpp
456 ${UNITY_SRC}/PreviewBasicButton.cpp
457 ${UNITY_SRC}/ResultView.cpp
458 ${UNITY_SRC}/ResultViewGrid.cpp
459 ${UNITY_SRC}/ResultRenderer.cpp
460 ${UNITY_SRC}/ResultRendererTile.cpp
461 ${UNITY_SRC}/ResultRendererHorizontalTile.cpp
462 ${UNITY_SRC}/IconTexture.cpp
463 ${UNITY_SRC}/IconLoader.cpp
464 ${UNITY_SRC}/Introspectable.cpp
465 ${UNITY_SRC}/StaticCairoText.cpp
466 ${UNITY_SRC}/TextureCache.cpp
467 ${UNITY_SRC}/Timer.cpp
468 ${UNITY_SRC}/DashStyle.cpp
469 ${UNITY_SRC}/JSONParser.cpp
470 ${UNITY_SRC}/UBusMessages.h
471 ${UNITY_SRC}/UBusWrapper.cpp
472 ${UNITY_SRC}/UBusWrapper.h
473 ${UNITY_SRC}/ubus-server.cpp
474 ${UNITY_SRC}/ubus-server.h
475 )
476add_dependencies(test-result-view unity-core-${UNITY_API_VERSION})
477
478add_executable (test-dash-style
479 TestDashStyle.cpp
480 ${UNITY_SRC}/DashStyle.cpp
481 ${UNITY_SRC}/DashStyle.h
482 ${UNITY_SRC}/JSONParser.cpp
483 ${PLACES_COMMON_SOURCE}
484 )
485add_dependencies (test-dash-style unity-core-${UNITY_API_VERSION})
486
487add_executable (test-bg-hash
488 TestBGHash.cpp
489 ${UNITY_SRC}/BGHash.cpp
490 ${UNITY_SRC}/BGHash.h
491 ${UNITY_SRC}/ubus-server.cpp
492 ${UNITY_SRC}/ubus-server.h
493 )
494add_dependencies (test-bg-hash unity-core-${UNITY_API_VERSION})
495
496find_package (OpenGL)
497
498include_directories (${OPENGL_gl_INCDIRS})
499add_library (glfuncloader SHARED
500 ${CMAKE_CURRENT_SOURCE_DIR}/GLFuncLoader.cpp)
501add_dependencies (glfuncloader unity-core-${UNITY_API_VERSION})
502target_link_libraries (glfuncloader dl ${OPENGL_gl_LIBRARY})
503add_executable (screen-effect-fbo
504 TestScreenEffectFramebufferObject.cpp
505 ${UNITY_SRC}/ScreenEffectFramebufferObject.cpp
506 ${UNITY_SRC}/BackgroundEffectHelper.cpp)
507
508target_link_libraries (screen-effect-fbo glfuncloader ${OPENGL_gl_LIBRARY})
509add_dependencies (screen-effect-fbo unity-core-${UNITY_API_VERSION})
510
511>>>>>>> MERGE-SOURCE
74add_subdirectory (test-input-remover)512add_subdirectory (test-input-remover)
75add_subdirectory (test-minimize-window-handler)513add_subdirectory (test-minimize-window-handler)
76add_subdirectory (test-get-transients)514add_subdirectory (test-get-transients)
77515
=== added file 'tests/GLFuncLoader.cpp'
--- tests/GLFuncLoader.cpp 1970-01-01 00:00:00 +0000
+++ tests/GLFuncLoader.cpp 2012-01-06 13:12:27 +0000
@@ -0,0 +1,51 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/* Compiz unity plugin
3 * unity.h
4 *
5 * Copyright (c) 2010-11 Canonical Ltd.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
18 */
19
20#include "GLFuncLoader.h"
21#include <dlfcn.h>
22
23unity::GLLoader::FuncPtr unity::GLLoader::getProcAddr(const std::string &name)
24{
25 static void *dlhand = NULL;
26 FuncPtr funcPtr = NULL;
27
28 glGetError ();
29
30 if (!funcPtr)
31 {
32 if (!dlhand)
33 dlhand = dlopen ("libglfuncloader.so", RTLD_LAZY);
34
35 char *error = dlerror ();
36
37 if (dlhand)
38 {
39 dlerror ();
40 funcPtr = (FuncPtr) dlsym (dlhand, name.c_str ());
41
42 error = dlerror ();
43 if (error != NULL)
44 funcPtr = NULL;
45 }
46 }
47
48 return funcPtr;
49}
50
51
052
=== added file 'tests/GLFuncLoader.h'
--- tests/GLFuncLoader.h 1970-01-01 00:00:00 +0000
+++ tests/GLFuncLoader.h 2012-01-06 13:12:27 +0000
@@ -0,0 +1,33 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/* Compiz unity plugin
3 * unity.h
4 *
5 * Copyright (c) 2010-11 Canonical Ltd.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
18 */
19
20#include <string>
21#include <GL/gl.h>
22#include <GL/glx.h>
23
24namespace unity
25{
26namespace GLLoader
27{
28typedef void (*FuncPtr) (void);
29typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
30
31FuncPtr getProcAddr(const std::string &name);
32}
33}
034
=== added file 'tests/TestScreenEffectFramebufferObject.cpp'
--- tests/TestScreenEffectFramebufferObject.cpp 1970-01-01 00:00:00 +0000
+++ tests/TestScreenEffectFramebufferObject.cpp 2012-01-06 13:12:27 +0000
@@ -0,0 +1,671 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/* Compiz unity plugin
3 * unity.h
4 *
5 * Copyright (c) 2010-11 Canonical Ltd.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
18 */
19
20#include "ScreenEffectFramebufferObject.h"
21#include "BackgroundEffectHelper.h"
22#include "GLFuncLoader.h"
23#include <Nux/Nux.h>
24#include <Nux/VLayout.h>
25#include <Nux/View.h>
26#include <Nux/BaseWindow.h>
27#include <Nux/WindowCompositor.h>
28#include <NuxCore/Logger.h>
29#include <NuxCore/Object.h>
30#include <X11/Xlib.h>
31#include <X11/Xutil.h>
32#include <GL/glx.h>
33#include <GL/gl.h>
34#include <dlfcn.h>
35#include <sys/poll.h>
36#include <unistd.h>
37#include <glib.h>
38#include <gtk/gtk.h>
39#include <cmath>
40
41using namespace unity::GLLoader;
42
43namespace
44{
45 nux::logging::Logger logger ("unity.test-screeneffectframebufferobject");
46
47 const static int attributes[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT,
48 GLX_X_RENDERABLE, True,
49 GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
50 GLX_DOUBLEBUFFER, True,
51 GLX_RED_SIZE, 8,
52 GLX_GREEN_SIZE, 8,
53 GLX_BLUE_SIZE, 8, 0};
54}
55
56namespace GLFuncs
57{
58 GLXGetProcAddressProc glXGetProcAddressP;
59 PFNGLXCHOOSEFBCONFIGPROC glXChooseFBConfigP;
60 PFNGLXGETVISUALFROMFBCONFIGPROC glXGetVisualFromFBConfigP;
61 PFNGLXCREATEWINDOWPROC glXCreateWindowP;
62 PFNGLXDESTROYWINDOWPROC glXDestroyWindowP;
63 PFNGLXMAKECONTEXTCURRENTPROC glXMakeContextCurrentP;
64
65 void init ()
66 {
67 glXGetProcAddressP = (GLXGetProcAddressProc) getProcAddr ("glXGetProcAddress");
68 glXChooseFBConfigP = (PFNGLXCHOOSEFBCONFIGPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXChooseFBConfig");
69 glXGetVisualFromFBConfigP = (PFNGLXGETVISUALFROMFBCONFIGPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXGetVisualFromFBConfig");
70 glXCreateWindowP = (PFNGLXCREATEWINDOWPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXCreateWindow");
71 glXMakeContextCurrentP = (PFNGLXMAKECONTEXTCURRENTPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXMakeContextCurrent");
72 glXDestroyWindowP = (PFNGLXDESTROYWINDOWPROC) (*glXGetProcAddressP) ((const GLubyte *) "glXDestroyWindow");
73 }
74}
75
76class EffectView :
77 public nux::View
78{
79public:
80 EffectView (NUX_FILE_LINE_PROTO);
81 virtual ~EffectView ();
82
83 void Draw (nux::GraphicsEngine &context, bool force) { return; };
84 void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
85private:
86 BackgroundEffectHelper bg_effect_helper_;
87};
88
89class Shape
90{
91 public:
92
93 typedef boost::shared_ptr <Shape> Ptr;
94
95 Shape ();
96 virtual ~Shape ();
97
98 float rotation () { return mRotation; }
99
100 void draw (unsigned int width, unsigned int height) { glDraw (width, height); }
101 void rotate () { applyRotation (); }
102
103 protected:
104
105 float mRotation;
106
107 virtual void glDraw (unsigned int width, unsigned int height) = 0;
108 virtual void applyRotation () = 0;
109 virtual void getRotationAxes (float &x, float &y, float &z) = 0;
110};
111
112Shape::Shape () :
113 mRotation (0.0f)
114{
115}
116
117Shape::~Shape ()
118{
119}
120
121class Triangle :
122 public Shape
123{
124 public:
125
126 typedef boost::shared_ptr <Triangle> Ptr;
127
128 protected:
129
130 void glDraw (unsigned int width, unsigned int height);
131 void applyRotation () { mRotation += 5.0f; }
132 void getRotationAxes (float &x, float &y, float &z) { x = 0.0f; y = 1.0f; z = 0.0f; }
133};
134
135void
136Triangle::glDraw (unsigned int width, unsigned int height)
137{
138 glBegin(GL_TRIANGLES);
139 glColor3f(1.0f, 0.0f, 0.0f);
140 glVertex3f(width / 4, height, 0.0f);
141 glColor3f(0.0f, 1.0f, 0.0f);
142 glVertex3f(0.0f, 0.0f, 0.0f);
143 glColor3f(0.0f, 0.0f, 1.0f);
144 glVertex3f(width / 2, 0.0f, 0.0f);
145 glEnd();
146}
147
148class Square :
149 public Shape
150{
151 public:
152
153 typedef boost::shared_ptr <Square> Ptr;
154
155 protected:
156
157 void glDraw (unsigned int width, unsigned int height);
158 void applyRotation () { mRotation -= 2.5f; }
159 void getRotationAxes (float &x, float &y, float &z) { x = 1.0f; y = 0.0f; z = 0.0f; }
160
161};
162
163void
164Square::glDraw (unsigned int width, unsigned int height)
165{
166 glBegin(GL_QUADS);
167 glColor3f(sin (rotation () / 100.0f), -sin (rotation () / 100.0f), cos (rotation () / 100.0f));
168 glVertex3f(width / 2, height, 0.0f);
169 glColor3f(-sin (rotation () / 100.0f), sin (rotation () / 100.0f), cos (rotation () / 100.0f));
170 glVertex3f(width, height, 0.0f);
171 glColor3f(sin (rotation () / 100.0f), sin (rotation () / 100.0f), sin (rotation () / 100.0f));
172 glVertex3f(width, 0.0f, 0.0f);
173 glColor3f(-sin (rotation () / 100.0f), cos (rotation () / 100.0f), cos (rotation () / 100.0f));
174 glVertex3f(width / 2, 0.0f, 0.0f);
175 glEnd();
176}
177
178class BaseContext
179{
180 public:
181
182 BaseContext (Display *);
183 ~BaseContext ();
184
185 void run ();
186
187 protected:
188
189 bool eventHandler ();
190 bool paintDispatch ();
191
192 enum class ModifierApplication
193 {
194 Square,
195 Triangle,
196 Both
197 };
198
199 void nextWindowPosition ();
200 void nextShapeRotation ();
201 void setupContextForSize (unsigned int width,
202 unsigned int height);
203 void drawShape (const Shape::Ptr &) {};
204
205 private:
206
207 static gboolean onNewEvents (GIOChannel *channel,
208 GIOCondition condition,
209 gpointer data);
210
211 static gboolean onPaintTimeout (gpointer data);
212
213 static void onWindowThreadCreation (nux::NThread *thread, void *d);
214
215 Display *mDisplay;
216 Window mWindow;
217 Colormap mColormap;
218 nux::WindowThread *mWindowThread;
219 nux::View *mRootView;
220 ScreenEffectFramebufferObject::Ptr mFbo;
221 GLXWindow mGlxWindow;
222 GLXContext mContext;
223 ModifierApplication mRotating;
224 ModifierApplication mBlur;
225 unsigned int mWidth;
226 unsigned int mHeight;
227 bool mNuxReady;
228 Shape::Ptr mTriangle;
229 Shape::Ptr mSquare;
230};
231
232BaseContext::BaseContext (Display *display) :
233 mDisplay (display),
234 mWindowThread (NULL),
235 mRotating (ModifierApplication::Both),
236 mBlur (ModifierApplication::Both),
237 mWidth (640),
238 mHeight (480),
239 mNuxReady (false),
240 mTriangle (new Triangle ()),
241 mSquare (new Square ())
242{
243 int numFBConfig = 0;
244 GLXFBConfig *fbConfigs = (*GLFuncs::glXChooseFBConfigP) (mDisplay,
245 DefaultScreen (mDisplay),
246 attributes,
247 &numFBConfig);
248 XVisualInfo *visinfo = (*GLFuncs::glXGetVisualFromFBConfigP) (mDisplay,
249 fbConfigs[0]);
250
251 mContext = glXCreateContext (mDisplay, visinfo, 0, GL_TRUE);
252 mColormap = XCreateColormap (mDisplay,
253 DefaultRootWindow (mDisplay),
254 visinfo->visual,
255 AllocNone);
256
257 XSetWindowAttributes wa;
258
259 wa.colormap = mColormap;
260 wa.border_pixel = 0;
261 wa.event_mask = StructureNotifyMask | KeyPressMask | ExposureMask;
262
263 mWindow = XCreateWindow (mDisplay, DefaultRootWindow (mDisplay),
264 0, 0, mWidth, mHeight, 0, visinfo->depth, InputOutput,
265 visinfo->visual, CWColormap | CWEventMask | CWBorderPixel,
266 &wa);
267
268 mGlxWindow = (*GLFuncs::glXCreateWindowP) (mDisplay, fbConfigs[0], mWindow, NULL);
269
270 XStoreName (mDisplay, mWindow, "F1: Toggle Effect, F2: Rotation, F3: Effect");
271 XMapWindow (mDisplay, mWindow);
272
273 bool ready = false;
274
275 do
276 {
277 XEvent ev;
278 XNextEvent (mDisplay, &ev);
279 switch (ev.type)
280 {
281 case MapNotify:
282 case ConfigureNotify:
283 case Expose:
284 ready = true;
285 break;
286 default:
287 break;
288 }
289
290 } while (!ready);
291
292 (*GLFuncs::glXMakeContextCurrentP) (mDisplay, mGlxWindow, mGlxWindow, mContext);
293
294 setupContextForSize (mWidth, mHeight);
295}
296
297void
298BaseContext::run ()
299{
300 GIOChannel *channel;
301 mWindowThread = nux::CreateFromForeignWindow (mWindow,
302 mContext,
303 &BaseContext::onWindowThreadCreation,
304 (void *) this);
305
306 mWindowThread->Run(NULL);
307
308 while (!mNuxReady);
309 g_timeout_add (128, &BaseContext::onPaintTimeout, (gpointer) this);
310
311 channel = g_io_channel_unix_new (ConnectionNumber (mDisplay));
312
313 g_io_add_watch (channel, (GIOCondition) (G_IO_IN | G_IO_HUP | G_IO_ERR),
314 &BaseContext::onNewEvents, (gpointer) this);
315 gtk_main ();
316}
317
318BaseContext::~BaseContext ()
319{
320 delete mWindowThread;
321
322 (*GLFuncs::glXMakeContextCurrentP) (mDisplay, None, None, mContext);
323 glXDestroyContext (mDisplay, mContext);
324 (*GLFuncs::glXDestroyWindowP) (mDisplay, mGlxWindow);
325
326 XFreeColormap (mDisplay, mColormap);
327 XDestroyWindow (mDisplay, mWindow);
328}
329
330void
331BaseContext::setupContextForSize (unsigned int width,
332 unsigned int height)
333{
334 mWidth = width;
335 mHeight = height;
336
337 glViewport(0, 0, width, height);
338 glDrawBuffer (GL_BACK);
339 glReadBuffer (GL_BACK);
340 glMatrixMode(GL_PROJECTION);
341 glLoadIdentity();
342 gluPerspective(60.0f, 1.0f, 0.1f, 100.0f);
343 glMatrixMode(GL_MODELVIEW);
344 glLoadIdentity ();
345 glClearColor (1, 1, 1, 1);
346 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
347 glXSwapBuffers (mDisplay, mGlxWindow);
348
349 if (mFbo)
350 mFbo.reset (new ScreenEffectFramebufferObject (GLFuncs::glXGetProcAddressP, nux::Geometry (0, 0, mWidth, mHeight)));
351
352 if (mRootView && mNuxReady)
353 {
354 switch (mBlur)
355 {
356 case ModifierApplication::Both:
357 mRootView->SetGeometry (nux::Geometry (0, 0, mWidth / 2, mHeight));
358 break;
359 case ModifierApplication::Triangle:
360 mRootView->SetGeometry (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
361 break;
362 case ModifierApplication::Square:
363 mRootView->SetGeometry (nux::Geometry (0, 0, mWidth, mHeight));
364 break;
365 default:
366 break;
367 }
368 }
369}
370
371bool
372BaseContext::eventHandler ()
373{
374 XEvent event;
375 XEvent *ev = &event;
376
377 XNextEvent (mDisplay, &event);
378
379 switch (ev->type)
380 {
381 case KeyPress:
382 if (XLookupKeysym (&ev->xkey, 0) == XK_Escape)
383 return false;
384 else if (XLookupKeysym (&ev->xkey, 0) == XK_F1)
385 {
386 if (!mFbo)
387 {
388 BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE;
389 mFbo.reset (new ScreenEffectFramebufferObject (GLFuncs::glXGetProcAddressP, nux::Geometry (0, 0, mWidth, mHeight)));
390 }
391 else
392 {
393 BackgroundEffectHelper::blur_type = unity::BLUR_NONE;
394 mFbo.reset ();
395 }
396 }
397 else if (XLookupKeysym (&ev->xkey, 0) == XK_F2)
398 nextShapeRotation ();
399 else if (XLookupKeysym (&ev->xkey, 0) == XK_F3)
400 nextWindowPosition ();
401 break;
402 case ConfigureNotify:
403 setupContextForSize (ev->xconfigure.width, ev->xconfigure.height);
404 default:
405 break;
406 }
407
408 return true;
409}
410
411gboolean
412BaseContext::onNewEvents (GIOChannel *channel,
413 GIOCondition condition,
414 gpointer data)
415{
416 BaseContext *self = static_cast <BaseContext *> (data);
417
418 if (condition & G_IO_IN)
419 {
420 if (self->eventHandler ())
421 return TRUE;
422 else
423 return FALSE;
424 }
425
426 return TRUE;
427}
428
429gboolean
430BaseContext::onPaintTimeout (gpointer data)
431{
432 BaseContext *self = static_cast <BaseContext *> (data);
433
434 if (self->paintDispatch ())
435 return TRUE;
436
437 return FALSE;
438}
439
440void
441BaseContext::nextShapeRotation ()
442{
443 switch (mRotating)
444 {
445 case ModifierApplication::Both:
446 mRotating = ModifierApplication::Triangle;
447 break;
448 case ModifierApplication::Triangle:
449 mRotating = ModifierApplication::Square;
450 break;
451 case ModifierApplication::Square:
452 mRotating = ModifierApplication::Both;
453 break;
454 default:
455 break;
456 }
457}
458
459void
460BaseContext::nextWindowPosition ()
461{
462 switch (mBlur)
463 {
464 case ModifierApplication::Both:
465 mBlur = ModifierApplication::Triangle;
466 mRootView->SetGeometry (nux::Geometry (0, 0, mWidth / 2, mHeight));
467 break;
468 case ModifierApplication::Triangle:
469 mBlur = ModifierApplication::Square;
470 mRootView->SetGeometry (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
471 break;
472 case ModifierApplication::Square:
473 mBlur = ModifierApplication::Both;
474 mRootView->SetGeometry (nux::Geometry (0, 0, mWidth, mHeight));
475 break;
476 default:
477 break;
478 }
479}
480
481EffectView::EffectView (NUX_FILE_LINE_DECL)
482 : View (NUX_FILE_LINE_PARAM)
483{
484 bg_effect_helper_.owner = this;
485}
486
487EffectView::~EffectView ()
488{
489}
490
491void EffectView::DrawContent (nux::GraphicsEngine &GfxContext, bool force_draw)
492{
493 nux::Geometry base = GetGeometry();
494 GfxContext.PushClippingRectangle(base);
495 nux::Geometry blur_geo (base.x, base.y, base.width, base.height);
496
497 if (BackgroundEffectHelper::blur_type == unity::BLUR_ACTIVE)
498 {
499 bg_effect_helper_.enabled = true;
500
501 auto blur_texture = bg_effect_helper_.GetBlurRegion(blur_geo);
502
503 if (blur_texture.IsValid ())
504 {
505 nux::TexCoordXForm texxform_blur_bg;
506 texxform_blur_bg.flip_v_coord = true;
507 texxform_blur_bg.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
508 texxform_blur_bg.uoffset = ((float) base.x) / (base.width);
509 texxform_blur_bg.voffset = ((float) base.y) / (base.height);
510
511 nux::ROPConfig rop;
512 rop.Blend = false;
513 rop.SrcBlend = GL_ONE;
514 rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
515
516 gPainter.PushDrawTextureLayer(GfxContext, base,
517 blur_texture,
518 texxform_blur_bg,
519 nux::color::White,
520 true,
521 rop);
522 }
523 }
524 else
525 bg_effect_helper_.enabled = false;
526 GfxContext.PopClippingRectangle();
527}
528
529bool
530BaseContext::paintDispatch ()
531{
532 if (mFbo)
533 {
534 switch (mRotating)
535 {
536 case ModifierApplication::Both:
537 BackgroundEffectHelper::ProcessDamage (nux::Geometry (0, 0, mWidth, mHeight));
538 break;
539 case ModifierApplication::Triangle:
540 BackgroundEffectHelper::ProcessDamage (nux::Geometry (0, 0, mWidth / 2, mHeight));
541 break;
542 case ModifierApplication::Square:
543 BackgroundEffectHelper::ProcessDamage (nux::Geometry (mWidth / 2, 0, mWidth / 2, mHeight));
544 break;
545 }
546
547 mFbo->bind (nux::Geometry (0, 0, mWidth, mHeight));
548
549 if (!mFbo->status ())
550 {
551 LOG_INFO (logger) << "FBO not ok!";
552 }
553 }
554
555 glClearColor (1, 1, 1, 1);
556 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
557 glPushMatrix ();
558 glLoadIdentity();
559 glTranslatef(-0.5f, -0.5f, -0.866025404f);
560 glScalef (1.0f / mWidth, 1.0f / mHeight, 0.0f);
561 glTranslatef(mWidth * 0.25, 0, 0);
562 glRotatef(mTriangle->rotation (), 0.0f, 1.0f, 0.0f);
563 glTranslatef(-(mWidth * 0.25), 0, 0);
564
565 mTriangle->draw (mWidth, mHeight);
566
567 glLoadIdentity();
568 glTranslatef(-0.5f, -0.5f, -0.866025404f);
569 glScalef (1.0f / mWidth, 1.0f / mHeight, 0.0f);
570 glTranslatef(mWidth * 0.75, 0, 0);
571 glRotatef(mSquare->rotation (), 0.0f, 1.0f, 0.0f);
572 glTranslatef(-(mWidth * 0.75), 0, 0);
573
574 mSquare->draw (mWidth, mHeight);
575
576 glColor4f (1.0f, 1.0f, 1.0f, 5.0f);
577 glPopMatrix ();
578
579 if (mFbo)
580 mFbo->unbind ();
581
582 if (mFbo && mFbo->status ())
583 {
584 glClearColor (1, 1, 1, 1);
585 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
586 glPushMatrix ();
587 glLoadIdentity();
588 glTranslatef(-0.5f, 0.5f, -0.866025404f);
589 glScalef (1.0f / mWidth, -(1.0f / mHeight), 0.0f);
590 mFbo->paint (nux::Geometry (0, 0, mWidth, mHeight));
591 glPopMatrix ();
592
593 nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture =
594 nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID (mFbo->texture(),
595 mWidth, mHeight, 1, nux::BITFMT_R8G8B8A8);
596
597 nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture;
598
599 nux::Geometry geo = nux::Geometry (0, 0, mWidth, mHeight);
600 BackgroundEffectHelper::monitor_rect_ = geo;
601 }
602
603 glMatrixMode(GL_PROJECTION);
604 glPushMatrix();
605
606 glMatrixMode(GL_MODELVIEW);
607 glPushMatrix();
608 glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT |
609 GL_TEXTURE_BIT | GL_COLOR_BUFFER_BIT | GL_SCISSOR_BIT);
610 mRootView->ProcessDraw (mWindowThread->GetGraphicsEngine (), true);
611 glMatrixMode(GL_PROJECTION);
612 glPopMatrix();
613 glMatrixMode(GL_MODELVIEW);
614 glPopMatrix();
615
616 glDrawBuffer(GL_BACK);
617 glReadBuffer(GL_BACK);
618
619 glPopAttrib();
620
621 glXSwapBuffers (mDisplay, mGlxWindow);
622
623 switch (mRotating)
624 {
625 case ModifierApplication::Both:
626 mTriangle->rotate ();
627 mSquare->rotate ();
628 break;
629 case ModifierApplication::Triangle:
630 mTriangle->rotate ();
631 break;
632 case ModifierApplication::Square:
633 mSquare->rotate ();
634 break;
635 }
636
637 return true;
638}
639
640void
641BaseContext::onWindowThreadCreation (nux::NThread *thread, void *data)
642{
643 BaseContext *bc = static_cast <BaseContext *> (data);
644
645 bc->mRootView = new EffectView ();
646 bc->mRootView->SetGeometry (nux::Geometry (0, 0, 640, 480));
647 bc->mNuxReady = true;
648 BackgroundEffectHelper::blur_type = unity::BLUR_ACTIVE;
649}
650
651int main (int argc, char **argv)
652{
653 Display *display = XOpenDisplay (NULL);
654 nux::NuxInitialize (0);
655 GLFuncs::init ();
656 g_type_init ();
657 g_thread_init (NULL);
658 gtk_init(&argc, &argv);
659
660 BaseContext *bc = new BaseContext (display);
661
662 bc->run ();
663
664 delete bc;
665
666 XCloseDisplay (display);
667
668 return 0;
669}
670
671
0672
=== modified file 'tests/test-get-transients/CMakeLists.txt'
--- tests/test-get-transients/CMakeLists.txt 2011-10-26 16:17:24 +0000
+++ tests/test-get-transients/CMakeLists.txt 2012-01-06 13:12:27 +0000
@@ -20,5 +20,6 @@
20 add_dependencies (test-get-transients unity-core-${UNITY_API_VERSION})20 add_dependencies (test-get-transients unity-core-${UNITY_API_VERSION})
21 target_link_libraries (test-get-transients21 target_link_libraries (test-get-transients
22 ${COMPIZ_TEST_GET_TRANSIENTS_LIBRARIES})22 ${COMPIZ_TEST_GET_TRANSIENTS_LIBRARIES})
23 add_dependencies (test-get-transients unity-core-${UNITY_API_VERSION})
2324
24endif (COMPIZ_TEST_GET_TRANSIENTS_FOUND)25endif (COMPIZ_TEST_GET_TRANSIENTS_FOUND)
2526
=== modified file 'tests/test-input-remover/CMakeLists.txt'
--- tests/test-input-remover/CMakeLists.txt 2011-10-26 16:17:24 +0000
+++ tests/test-input-remover/CMakeLists.txt 2012-01-06 13:12:27 +0000
@@ -16,5 +16,6 @@
16 add_dependencies (test-input-remover unity-core-${UNITY_API_VERSION})16 add_dependencies (test-input-remover unity-core-${UNITY_API_VERSION})
17 target_link_libraries (test-input-remover17 target_link_libraries (test-input-remover
18 ${COMPIZ_TEST_INPUT_REMOVER_LIBRARIES})18 ${COMPIZ_TEST_INPUT_REMOVER_LIBRARIES})
19 add_dependencies (test-input-remover unity-core-${UNITY_API_VERSION})
1920
20endif (COMPIZ_TEST_INPUT_REMOVER_FOUND)21endif (COMPIZ_TEST_INPUT_REMOVER_FOUND)
2122
=== modified file 'tests/test-minimize-window-handler/CMakeLists.txt'
--- tests/test-minimize-window-handler/CMakeLists.txt 2011-10-26 16:17:24 +0000
+++ tests/test-minimize-window-handler/CMakeLists.txt 2012-01-06 13:12:27 +0000
@@ -21,5 +21,6 @@
21 add_dependencies (test-minimize-handler unity-core-${UNITY_API_VERSION})21 add_dependencies (test-minimize-handler unity-core-${UNITY_API_VERSION})
22 target_link_libraries (test-minimize-handler22 target_link_libraries (test-minimize-handler
23 ${COMPIZ_TEST_MINIMIZED_HANDER_LIBRARIES})23 ${COMPIZ_TEST_MINIMIZED_HANDER_LIBRARIES})
24 add_dependencies (test-minimize-handler unity-core-${UNITY_API_VERSION})
2425
25endif (COMPIZ_TEST_MINIMIZED_HANDER_FOUND)26endif (COMPIZ_TEST_MINIMIZED_HANDER_FOUND)
2627
=== modified file 'tests/test_lens.cpp'