Merge lp:~brandontschaefer/unity/lp806248-fix-int32-buffer-overflow-4.0 into lp:~ubuntu-desktop/unity/precise

Proposed by Chris J Arges
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~brandontschaefer/unity/lp806248-fix-int32-buffer-overflow-4.0
Merge into: lp:~ubuntu-desktop/unity/precise
Diff against target: 3906 lines (+2970/-5) (has conflicts)
37 files modified
AUTHORS (+8/-0)
CMakeLists.txt (+15/-0)
ChangeLog (+280/-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 (+14/-0)
plugins/unityshell/src/DashView.cpp (+57/-0)
plugins/unityshell/src/DashView.h (+11/-0)
plugins/unityshell/src/ElapsedTimeMonitor.cpp (+1/-1)
plugins/unityshell/src/GeisAdapter.cpp (+1/-1)
plugins/unityshell/src/Launcher.cpp (+204/-0)
plugins/unityshell/src/LauncherIcon.cpp (+61/-0)
plugins/unityshell/src/LauncherIcon.h (+14/-0)
plugins/unityshell/src/PanelMenuView.cpp (+46/-0)
plugins/unityshell/src/PanelTray.cpp (+10/-0)
plugins/unityshell/src/PanelView.cpp (+5/-0)
plugins/unityshell/src/ScreenEffectFramebufferObject.cpp (+237/-0)
plugins/unityshell/src/ScreenEffectFramebufferObject.h (+87/-0)
plugins/unityshell/src/SwitcherController.cpp (+15/-0)
plugins/unityshell/src/SwitcherController.h (+1/-0)
plugins/unityshell/src/SwitcherModel.cpp (+7/-0)
plugins/unityshell/src/SwitcherView.cpp (+6/-2)
plugins/unityshell/src/TimeUtil.h (+17/-0)
plugins/unityshell/src/unityshell.cpp (+363/-1)
plugins/unityshell/src/unityshell.h (+75/-0)
tests/CMakeLists.txt (+444/-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)
tests/test_time_util.cpp (+37/-0)
Text conflict in AUTHORS
Text conflict in CMakeLists.txt
Text conflict in ChangeLog
Path conflict: manual-tests/Launcher.txt / manual-tests/launcher.txt
Text conflict in manual-tests/launcher.txt
Text conflict in plugins/unityshell/src/DashView.cpp
Text conflict in plugins/unityshell/src/DashView.h
Text conflict in plugins/unityshell/src/Launcher.cpp
Text conflict in plugins/unityshell/src/LauncherIcon.cpp
Text conflict in plugins/unityshell/src/LauncherIcon.h
Text conflict in plugins/unityshell/src/PanelMenuView.cpp
Text conflict in plugins/unityshell/src/PanelTray.cpp
Text conflict in plugins/unityshell/src/PanelView.cpp
Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.cpp
Text conflict in plugins/unityshell/src/ScreenEffectFramebufferObject.h
Text conflict in plugins/unityshell/src/SwitcherController.cpp
Text conflict in plugins/unityshell/src/SwitcherModel.cpp
Text conflict in plugins/unityshell/src/SwitcherView.cpp
Text conflict in plugins/unityshell/src/TimeUtil.h
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:~brandontschaefer/unity/lp806248-fix-int32-buffer-overflow-4.0
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Disapprove
Ubuntu Desktop Pending
Review via email: mp+143901@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

I see an awful lot of merge conflicts.

I think it would be better to get https://code.launchpad.net/~brandontschaefer/unity/lp806248-fix-int32-buffer-overflow-4.0/+merge/137684 merged upstream and then do an upstream release into Ubuntu through the regular SRU process.

Revision history for this message
Stephen M. Webb (bregma) wrote :

Patch has already been merged into lp:unity/5.0 which will be SRUd to lp:ubuntu-desktop/unity/precise... merging a unity 4.0 into lp:ubuntu-desktop/unity/precise makes no sense.

review: Disapprove
Revision history for this message
Sebastien Bacher (seb128) wrote :

setting as rejected, it got uploaded/merged through another merge request: http://bazaar.launchpad.net/~ubuntu-desktop/unity/precise/revision/712

Unmerged revisions

1740. By Brandon Schaefer

* Fix header

1739. By Brandon Schaefer

* Fix int32 buffer overflow in TimeUtil, now uses int64

1738. By Łukasz Zemczak

Release\ 4.30.0

1737. By Francis Ginther

Updated dependency to the renamed libgeis

1736. By Sam Spilsbury

Merge lp:unity/4.0

1735. By Sam Spilsbury

Unrevert 1721 , as it did not cause any regressions (yet)

1734. By Sam Spilsbury

Revert 1721 for now

It enters some strange codepaths and caused regressions better handled by
https://code.launchpad.net/~smspillaz/unity/unity.fix_881190_918360/+merge/89181

1733. By Sam Spilsbury

Merge lp:~smspillaz/unity/4.0_fix_912682

1732. By David Barth

Bumping revision to 4.2.28 to prepare a new SRU

1731. By David Barth

Fix for "right-clicking launcher when choosing a workspace causes quicklists to freeze" (#791810)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2012-11-12 12:20:38 +0000
+++ AUTHORS 2013-01-18 15:43:30 +0000
@@ -31,10 +31,14 @@
31 David Gomes <davidrafagomes@gmail.com>31 David Gomes <davidrafagomes@gmail.com>
32 David Planella <david.planella@ubuntu.com>32 David Planella <david.planella@ubuntu.com>
33 Didier Roche <didier.roche@canonical.com>33 Didier Roche <didier.roche@canonical.com>
34<<<<<<< TREE
34 foxoman <foxoman.u@gmail.com>35 foxoman <foxoman.u@gmail.com>
35 Francis Ginther <francis.ginther@canonical.com>36 Francis Ginther <francis.ginther@canonical.com>
36 Gabor Kelemen <kelemeng@ubuntu.com>37 Gabor Kelemen <kelemeng@ubuntu.com>
37 Gary Lasker <gary.lasker@canonical.com>38 Gary Lasker <gary.lasker@canonical.com>
39=======
40 Francis Ginther <francis.ginther@canonical.com>
41>>>>>>> MERGE-SOURCE
38 Gordon Allott <gord.allott@canonical.com>42 Gordon Allott <gord.allott@canonical.com>
39 Henri De Veene <henri.deveene@gmail.com>43 Henri De Veene <henri.deveene@gmail.com>
40 Jani Monoses <jani.monoses@canonical.com>44 Jani Monoses <jani.monoses@canonical.com>
@@ -96,11 +100,15 @@
96 Sam Spilsbury <sam.spilsbury@canonical.com>100 Sam Spilsbury <sam.spilsbury@canonical.com>
97 Sam Spilsbury <sam.spilsbury@canonical.com>, Daniel van Vugt <vanvugt@gmail.com>101 Sam Spilsbury <sam.spilsbury@canonical.com>, Daniel van Vugt <vanvugt@gmail.com>
98 Sebastien Bacher <seb128@ubuntu.com>102 Sebastien Bacher <seb128@ubuntu.com>
103<<<<<<< TREE
99 smspillaz <sam.spilsbury@canonical.com>104 smspillaz <sam.spilsbury@canonical.com>
100 smspillaz <sam.spilsbury@canonical.com>, Daniel van Vugt <vanvugt@gmail.com>105 smspillaz <sam.spilsbury@canonical.com>, Daniel van Vugt <vanvugt@gmail.com>
101 smspillaz <sam.spilsbury@canonical.com>, Sam Spilsbury <sam.spilsbury@canonical.com>106 smspillaz <sam.spilsbury@canonical.com>, Sam Spilsbury <sam.spilsbury@canonical.com>
102 Sven Baars <svenb.linux@gmail.com>107 Sven Baars <svenb.linux@gmail.com>
103 Tarmac108 Tarmac
109=======
110 smspillaz <sam.spilsbury@canonical.com>
111>>>>>>> MERGE-SOURCE
104 Ted Gould <ted@gould.cx>112 Ted Gould <ted@gould.cx>
105 Thomas Voß <thomas.voss@rub.de>113 Thomas Voß <thomas.voss@rub.de>
106 Thomi Richards <thomir@gmail.com>114 Thomi Richards <thomir@gmail.com>
107115
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2012-11-12 12:20:38 +0000
+++ CMakeLists.txt 2013-01-18 15:43:30 +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 18)12set (UNITY_MINOR 18)
13=======
14set (UNITY_MAJOR 4)
15set (UNITY_MINOR 30)
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")
@@ -122,6 +127,7 @@
122#127#
123# Compiz Plugins128# Compiz Plugins
124#129#
130<<<<<<< TREE
125set (UNITY_PLUGIN_DEPS "compiz;nux-2.0>=2.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;unity-misc>=0.4.0;gconf-2.0;libgeis;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;gnome-desktop-3.0;gdu;xfixes")131set (UNITY_PLUGIN_DEPS "compiz;nux-2.0>=2.0.0;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4>=0.4.90;atk;unity-misc>=0.4.0;gconf-2.0;libgeis;gtk+-3.0>=3.1;sigc++-2.0;json-glib-1.0;libnotify;gnome-desktop-3.0;gdu;xfixes")
126132
127add_subdirectory(plugins/unityshell)133add_subdirectory(plugins/unityshell)
@@ -158,6 +164,15 @@
158add_subdirectory(guides)164add_subdirectory(guides)
159add_subdirectory(standalone-clients EXCLUDE_FROM_ALL)165add_subdirectory(standalone-clients EXCLUDE_FROM_ALL)
160166
167=======
168set (UNITY_PLUGIN_DEPS "compiz;nux-1.0 >= 1.2.2;libbamf3;dee-1.0;gio-2.0;gio-unix-2.0;dbusmenu-glib-0.4;x11;libstartup-notification-1.0;gthread-2.0;indicator3-0.4;atk;unity-misc >= 0.4.0;gconf-2.0;libgeis;gtk+-3.0 >= 3.1;sigc++-2.0;json-glib-1.0;libnotify;gnome-desktop-3.0")
169
170
171find_package (Compiz REQUIRED)
172include (CompizPlugin)
173
174compiz_add_plugins_in_folder ("${CMAKE_SOURCE_DIR}/plugins/")
175>>>>>>> MERGE-SOURCE
161176
162#177#
163# GSettings Schema178# GSettings Schema
164179
=== modified file 'ChangeLog'
--- ChangeLog 2012-11-12 12:20:38 +0000
+++ ChangeLog 2013-01-18 15:43:30 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
12012-10-18 Andrea Azzarone <azzaronea@gmail.com>22012-10-18 Andrea Azzarone <azzaronea@gmail.com>
23
3 Use linear filtering to draw icons (when needed).. Fixes: https://bugs.launchpad.net/bugs/1036231. Approved by Marco Trevisan (Treviño).4 Use linear filtering to draw icons (when needed).. Fixes: https://bugs.launchpad.net/bugs/1036231. Approved by Marco Trevisan (Treviño).
@@ -18898,6 +18899,285 @@
1889818899
18899 fixes an issue with the panel service segfaulting on window change18900 fixes an issue with the panel service segfaulting on window change
1890018901
18902=======
189032012-09-07 Francis Ginther <francis.ginther@canonical.com>
18904
18905 Updated dependency to the renamed libgeis
18906
189072012-01-19 smspillaz <sam.spilsbury@canonical.com>
18908
18909 Merge lp:unity/4.0
18910
189112012-01-13 David Barth <david.barth@canonical.com>
18912
18913 revert custom dash patch
18914
189152012-01-11 David Barth <david.barth@canonical.com>
18916
18917 Fixed bug #914251, local variables should be passed by value.
18918
189192012-01-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
18920
18921 LauncherIcon: pass quicklist positions by value on expo-terminated lambda.
18922
18923 This fixes bug #914251
18924
189252012-01-06 Didier Roche <didier.roche@canonical.com>
18926
18927 merge sam's fix for building standalone application on clean environment
18928
189292012-01-06 Sam Spilsbury <sam.spilsbury@canonical.com>
18930
18931 Also add a dependency on libunity-core for the window handling tests and
18932 the glfuncloader dlopen loader since link_libraries forces those to be linked
18933 against libunity-core and since link_libraries doesn't care about target
18934 dependencies, there is a build race where libunity-core isn't built in time
18935 for those targets to be (erroneously) linked to.
18936
18937 The real solution is to kill the call to link_libraries.
18938
189392012-01-19 smspillaz <sam.spilsbury@canonical.com>
18940
18941 Unrevert 1721 , as it did not cause any regressions (yet)
18942
189432012-01-19 smspillaz <sam.spilsbury@canonical.com>
18944
18945 Revert 1721 for now
18946
18947 It enters some strange codepaths and caused regressions better handled by
18948 https://code.launchpad.net/~smspillaz/unity/unity.fix_881190_918360/+merge/89181
18949
189502012-01-19 smspillaz <sam.spilsbury@canonical.com>
18951
18952 Merge lp:~smspillaz/unity/4.0_fix_912682
18953
189542012-01-19 smspillaz <sam.spilsbury@canonical.com>
18955
18956 Fixes bug 912682
18957
189582012-01-05 David Barth <david.barth@canonical.com>
18959
18960 Bumping revision to 4.2.28 to prepare a new SRU
18961
189622012-01-05 David Barth <david.barth@canonical.com>
18963
18964 Fix for "right-clicking launcher when choosing a workspace causes quicklists to freeze" (#791810)
18965
189662011-12-08 Marco Trevisan (Treviño) <mail@3v1n0.net>
18967
18968 LauncherIcon: don't use auto operator when the content is not explicit
18969
189702011-12-05 Marco Trevisan (Treviño) <mail@3v1n0.net>
18971
18972 LauncherIcon: If expo is active, wait it to be terminated before showing a quicklist
18973
18974 Opening a quicklist when the expo is active, cause the quicklist to freeze,
18975 so if we're opening one when expo is runing, we need to wait it to be
18976 terminated before showing up the quicklist.
18977
18978 Including a manual-test.
18979
18980 This fixes bug #791810
18981
189822011-12-05 Marco Trevisan (Treviño) <mail@3v1n0.net>
18983
18984 Added Manual Tests ReadMe
18985
18986 Backported patch by Tim to Unity/4.0.
18987
189882012-01-05 David Barth <david.barth@canonical.com>
18989
18990 Fix SIGSEGV after SwitcherController desctruction (LP: #887465)
18991
189922011-12-08 Daniel van Vugt <vanvugt@gmail.com>
18993
18994 Safer destruction order.
18995
189962011-12-08 Daniel van Vugt <vanvugt@gmail.com>
18997
18998 Fix SIGSEGV after SwitcherController desctruction (LP: #887465)
18999
190002012-01-05 David Barth <david.barth@canonical.com>
19001
19002 reapplies 1713
19003
190042012-01-05 David Barth <david.barth@canonical.com>
19005
19006 revert rev. 1721 which was causing a regression (#905417)
19007
190082012-01-05 David Barth <david.barth@canonical.com>
19009
19010 Merge custom dash patch (#785840)
19011
190122011-12-15 Olivier Tilloy <olivier.tilloy@canonical.com>
19013
19014 Add some manual tests for the dash custom home screen functionality.
19015
190162011-12-15 Olivier Tilloy <olivier.tilloy@canonical.com>
19017
19018 Allow customizing the dash’s home screen.
19019
19020 The contents of the custom home screen are described in a JSON file called HomeShortcutsCustomized.json.
19021
19022 The file is looked for in the following locations in decreasing order of priority:
19023 - $XDG_CONFIG_HOME/unity/ (defaults to $HOME/.config/unity/)
19024 - $DIR/unity/ for $DIR in $XDG_CONFIG_DIRS
19025
19026 The syntax of the file is as follows:
19027 ==========================================================================
19028 {
19029 "shortcut1": {
19030 "source": $source,
19031 "name": $name,
19032 "name[fr]": $name_in_french,
19033 […]
19034 "icon": $icon
19035 },
19036 "shortcut2": {
19037 […]
19038 },
19039 […]
19040 }
19041 ==========================================================================
19042
19043 The source attribute may either be a desktop file (full path or just its basename if it is located in a standard directory), or a lens file (basename only). This attribute is mandatory.
19044 The 'name' attribute is optional. If present, it will override the default display name as advertised by the desktop file or by the lens. The name can be localized in several languages using the square brackets suffix notation, in which case the locale matching the system’s will be used, defaulting to the untranslated 'name' attribute if necessary.
19045 The 'icon' attribute is optional. If present, it will override the default icon as advertised by the desktop file or by the lens. It should be a full path name.
19046 If the source is a lens, the optional 'filter' attribute allows specifying a filter in the form "$name:$value", e.g. "type:videos" for the files lens.
19047 If the source is a lens, the optional 'section' attribute allows specifying a section number (an integer starting at index 0).
19048
190492012-01-05 David Barth <david.barth@canonical.com>
19050
19051 Merging in Sam's fix for a multi-monitor crasher (#838128)
19052
190532012-01-05 Sam Spilsbury <sam.spilsbury@canonical.com>
19054
19055 Check glGetError ()
19056
190572012-01-05 Sam Spilsbury <sam.spilsbury@canonical.com>
19058
19059 Minor style fix - use for loop
19060
190612012-01-05 Sam Spilsbury <sam.spilsbury@canonical.com>
19062
19063 Don't disable the scissor test explicitly
19064
190652012-01-04 Sam Spilsbury <sam.spilsbury@canonical.com>
19066
19067 Added missing file
19068
190692011-12-24 Sam Spilsbury <sam.spilsbury@canonical.com>
19070
19071 Added framebuffer object fixes
19072
190732011-12-15 David Barth <david.barth@canonical.com>
19074
19075 changelog update, a patch was reverted earlier by gord, see rev. 1723
19076
190772011-12-15 David Barth <david.barth@canonical.com>
19078
19079 merge lp:~macslow/unity/unity-sru1-4.26.0 in preparation of the 4.26 release candidate
19080
190812011-12-15 Mirco Müller <mirco.mueller@ubuntu.com>
19082
19083 Release 4.26.0 (SRU1)
19084
190852011-12-15 Mirco Müller <mirco.mueller@ubuntu.com>
19086
19087 Fixes #850623: don't segfault in geis_configuration_get_value() (backported from unity trunk r1728)
19088
190892011-12-15 Mirco Müller <mirco.mueller@ubuntu.com>
19090
19091 Fixes #860805: get focus on dash by pressing the super key first time after login (backported from unity trunk r1759)
19092
190932011-12-15 Mirco Müller <mirco.mueller@ubuntu.com>
19094
19095 Fixes #873100: clicking on panel when dash is open no longer causes maximized window to raise (backported from unity trunk r1751)
19096
190972011-12-15 Gord Allott <gord.allott@canonical.com>
19098
19099 Reverted out r1713
19100
191012011-12-16 Sam Spilsbury <sam.spilsbury@canonical.com>
19102
19103 Merged lp:~smspillaz/unity/unity4.0_fix_881190
19104
191052011-12-15 Sam Spilsbury <sam.spilsbury@canonical.com>
19106
19107 Don't read transients on windows which are not valid since all not valid
19108 transient windows will match with that window.
19109
19110 Also don't bother to re-fake-unminimize windows that have been fake minimized
19111 if they were destroyed since the window isn't valid anyways and the operation
19112 will be a no-op (note that we should do it on ~UnityWindow in the case where
19113 the window has not been destroyed yet, as it probably means that the plugin
19114 is being unloaded)
19115
191162011-12-15 Sam Spilsbury <sam.spilsbury@canonical.com>
19117
19118 Inhibit other windows from leaving show desktop mode in the case that
19119 core tries to leave show desktop mode after a window was activated - in this
19120 case we should only allow the window that was activated to leave show desktop
19121 mode and keep the "show desktop" mode state on until the user explicitly leave
19122 s
19123 show desktop mode.
19124
19125 Fixes LP #871801 and LP #899932
19126
191272011-12-06 Michal Hruby <michal.mhr@gmail.com>
19128
19129 Backport fix for bug #856205 from trunk
19130
191312011-11-29 Mirco Müller <mirco.mueller@ubuntu.com>
19132
19133 Fixes LP: #834630
19134
191352011-10-26 Mirco Müller <mirco.mueller@canonical.com>
19136
19137 Add an out-of-bounds check to the DetailXids vector. Fixes LP: #834630
19138
191392011-11-29 Mirco Müller <mirco.mueller@ubuntu.com>
19140
19141 Fixes LP: #832151
19142
191432011-10-26 Mirco Müller <mirco.mueller@canonical.com>
19144
19145 Be properly unref'ing _tray the FilterTrayCallback should be correctly unregistered and not called again. Fixes LP: 832151
19146
191472011-10-18 Jason Smith <jason.smith@canonical.com>
19148
19149 merge automatic raising of input winodws
19150
191512011-10-17 Jason Smith <jason.smith@canonical.com>
19152
19153 Raise input windows from nux unconditionally on alt-tab and showing of the dash using compiz
19154
191552011-10-14 Robert Carr <racarr@canonical.com>
19156
19157 Back out a horizontal margin that breaks sizing in some cases
19158
191592011-10-14 Sam Spilsbury <sam.spilsbury@canonical.com>
19160
19161 Bug #863114: Cannot raise window from panel after minimize
19162 Bug #865890: compiz crashed with SIGSEGV in nux::BaseWindow::GetInputWindowId() (when onboard is used)
19163
191642011-10-13 Neil Jagdish Patel <neil.patel@canonical.com>
19165
19166 Revert out maximised window dash change
19167
191682011-10-13 Gord Allott <gord.allott@canonical.com>
19169
19170 fixes an issue with the panel segfaulting on window change
19171
191722011-10-13 Gord Allott <gord.allott@canonical.com>
19173
19174 fixes the panel service segfaulting in certain conditions
19175
191762011-10-12 Neil Jagdish Patel <neil.patel@canonical.com>
19177
19178 Release\ 4.24.0
19179
19180>>>>>>> MERGE-SOURCE
189012011-10-12 Neil Jagdish Patel <neil.patel@canonical.com>191812011-10-12 Neil Jagdish Patel <neil.patel@canonical.com>
1890219182
18903 Fix tests for FilerMultirangeWidget19183 Fix tests for FilerMultirangeWidget
1890419184
=== modified file 'HACKING'
=== added file 'manual-tests/QuicklistOnExpo.txt'
--- manual-tests/QuicklistOnExpo.txt 1970-01-01 00:00:00 +0000
+++ manual-tests/QuicklistOnExpo.txt 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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
=== renamed file 'manual-tests/Launcher.txt' => 'manual-tests/launcher.txt'
--- manual-tests/Launcher.txt 2012-08-11 11:56:31 +0000
+++ manual-tests/launcher.txt 2013-01-18 15:43:30 +0000
@@ -1,3 +1,4 @@
1<<<<<<< TREE
1Test Launcher Icon with Windows in multiple workspaces2Test Launcher Icon with Windows in multiple workspaces
2------------------------------------------------------3------------------------------------------------------
3This test shows how the launcher should draw when there are application windows4This test shows how the launcher should draw when there are application windows
@@ -644,3 +645,16 @@
644645
645Expected Results:646Expected Results:
646 * The launcher should autoscroll so you can reach the trash icon.647 * The launcher should autoscroll so you can reach the trash icon.
648=======
649Test Dash Key Focus
650-------------------
651This test shows that the search bar in the dash gets key focus when using the super key to start the dash on start up.
652
653#. Start on a fresh login
654#. Press the <super> key
655#. Wait for dash to appear
656#. Type "hello"
657
658Outcome
659 The dash will appear, and "hello" will be in the search box.
660>>>>>>> MERGE-SOURCE
647661
=== modified file 'plugins/unityshell/src/BackgroundEffectHelper.cpp'
=== modified file 'plugins/unityshell/src/BackgroundEffectHelper.h'
=== modified file 'plugins/unityshell/src/DashView.cpp'
--- plugins/unityshell/src/DashView.cpp 2012-06-28 08:49:20 +0000
+++ plugins/unityshell/src/DashView.cpp 2013-01-18 15:43:30 +0000
@@ -80,10 +80,16 @@
80 , home_lens_(new HomeLens(_("Home"), _("Home screen"), _("Search")))80 , home_lens_(new HomeLens(_("Home"), _("Home screen"), _("Search")))
81 , active_lens_view_(0)81 , active_lens_view_(0)
82 , last_activated_uri_("")82 , last_activated_uri_("")
83<<<<<<< TREE
83 , searching_timeout_id_(0)84 , searching_timeout_id_(0)
84 , search_in_progress_(false)85 , search_in_progress_(false)
85 , activate_on_finish_(false)86 , activate_on_finish_(false)
86 , hide_message_delay_id_(0)87 , hide_message_delay_id_(0)
88=======
89 , searching_timeout_id_(0)
90 , search_in_progress_(false)
91 , activate_on_finish_(false)
92>>>>>>> MERGE-SOURCE
87 , visible_(false)93 , visible_(false)
88{94{
89 renderer_.SetOwner(this);95 renderer_.SetOwner(this);
@@ -107,6 +113,7 @@
107113
108DashView::~DashView()114DashView::~DashView()
109{115{
116<<<<<<< TREE
110 if (searching_timeout_id_)117 if (searching_timeout_id_)
111 g_source_remove (searching_timeout_id_);118 g_source_remove (searching_timeout_id_);
112 if (hide_message_delay_id_)119 if (hide_message_delay_id_)
@@ -121,6 +128,12 @@
121{128{
122 renderer_.x_offset = x;129 renderer_.x_offset = x;
123 renderer_.y_offset = y;130 renderer_.y_offset = y;
131=======
132 if (searching_timeout_id_)
133 g_source_remove (searching_timeout_id_);
134 delete bg_layer_;
135 delete bg_darken_layer_;
136>>>>>>> MERGE-SOURCE
124}137}
125138
126void DashView::AboutToShow()139void DashView::AboutToShow()
@@ -430,9 +443,21 @@
430 return FALSE;443 return FALSE;
431}444}
432445
446gboolean DashView::ResetSearchStateCb(gpointer data)
447{
448 DashView *self = static_cast<DashView*>(data);
449
450 self->search_in_progress_ = false;
451 self->activate_on_finish_ = false;
452 self->searching_timeout_id_ = 0;
453
454 return FALSE;
455}
456
433void DashView::OnSearchChanged(std::string const& search_string)457void DashView::OnSearchChanged(std::string const& search_string)
434{458{
435 LOG_DEBUG(logger) << "Search changed: " << search_string;459 LOG_DEBUG(logger) << "Search changed: " << search_string;
460<<<<<<< TREE
436 if (active_lens_view_)461 if (active_lens_view_)
437 {462 {
438 search_in_progress_ = true;463 search_in_progress_ = true;
@@ -457,6 +482,20 @@
457 // 150ms to hide the no reults message if its take a while to return results482 // 150ms to hide the no reults message if its take a while to return results
458 hide_message_delay_id_ = g_timeout_add (150, &DashView::HideResultMessageCb, this);483 hide_message_delay_id_ = g_timeout_add (150, &DashView::HideResultMessageCb, this);
459 }484 }
485=======
486 if (active_lens_view_)
487 {
488 search_in_progress_ = true;
489 // it isn't guaranteed that we get a SearchFinished signal, so we need
490 // to make sure this isn't set even though we aren't doing any search
491 if (searching_timeout_id_)
492 {
493 g_source_remove (searching_timeout_id_);
494 }
495 // 250ms for the Search method call, rest for the actual search
496 searching_timeout_id_ = g_timeout_add (500, &DashView::ResetSearchStateCb, this);
497 }
498>>>>>>> MERGE-SOURCE
460}499}
461500
462void DashView::OnLiveSearchReached(std::string const& search_string)501void DashView::OnLiveSearchReached(std::string const& search_string)
@@ -554,6 +593,7 @@
554593
555void DashView::OnSearchFinished(Lens::Hints const& hints)594void DashView::OnSearchFinished(Lens::Hints const& hints)
556{595{
596<<<<<<< TREE
557 if (hide_message_delay_id_)597 if (hide_message_delay_id_)
558 {598 {
559 g_source_remove(hide_message_delay_id_);599 g_source_remove(hide_message_delay_id_);
@@ -567,7 +607,12 @@
567607
568 if (active_lens_view_->search_string == search_string)608 if (active_lens_view_->search_string == search_string)
569 {609 {
610=======
611 if (search_bar_->search_string == search_string)
612 {
613>>>>>>> MERGE-SOURCE
570 search_bar_->SearchFinished();614 search_bar_->SearchFinished();
615<<<<<<< TREE
571 search_in_progress_ = false;616 search_in_progress_ = false;
572 if (activate_on_finish_)617 if (activate_on_finish_)
573 this->OnEntryActivated();618 this->OnEntryActivated();
@@ -594,6 +639,18 @@
594 if (activate_on_finish_)639 if (activate_on_finish_)
595 this->OnEntryActivated();640 this->OnEntryActivated();
596 }641 }
642=======
643 search_in_progress_ = false;
644 if (activate_on_finish_)
645 this->OnEntryActivated();
646 }
647}
648
649void DashView::OnGlobalSearchFinished(std::string const& search_string)
650{
651 if (active_lens_view_ == home_view_)
652 OnSearchFinished(search_string);
653>>>>>>> MERGE-SOURCE
597}654}
598655
599void DashView::OnUriActivated(std::string const& uri)656void DashView::OnUriActivated(std::string const& uri)
600657
=== modified file 'plugins/unityshell/src/DashView.h'
--- plugins/unityshell/src/DashView.h 2012-03-30 11:40:10 +0000
+++ plugins/unityshell/src/DashView.h 2013-01-18 15:43:30 +0000
@@ -108,9 +108,14 @@
108108
109 nux::Area* KeyNavIteration(nux::KeyNavDirection direction);109 nux::Area* KeyNavIteration(nux::KeyNavDirection direction);
110110
111<<<<<<< TREE
111 static gboolean ResetSearchStateCb(gpointer data);112 static gboolean ResetSearchStateCb(gpointer data);
112 static gboolean HideResultMessageCb(gpointer data);113 static gboolean HideResultMessageCb(gpointer data);
113114
115=======
116 static gboolean ResetSearchStateCb(gpointer data);
117
118>>>>>>> MERGE-SOURCE
114private:119private:
115 UBusManager ubus_manager_;120 UBusManager ubus_manager_;
116 FilesystemLenses lenses_;121 FilesystemLenses lenses_;
@@ -134,12 +139,18 @@
134 OverlayRenderer renderer_;139 OverlayRenderer renderer_;
135140
136 std::string last_activated_uri_;141 std::string last_activated_uri_;
142<<<<<<< TREE
137 // we're passing this back to g_* functions, so we'll keep the g* type143 // we're passing this back to g_* functions, so we'll keep the g* type
138 guint searching_timeout_id_;144 guint searching_timeout_id_;
139 bool search_in_progress_;145 bool search_in_progress_;
140 bool activate_on_finish_;146 bool activate_on_finish_;
141147
142 guint hide_message_delay_id_;148 guint hide_message_delay_id_;
149=======
150 guint searching_timeout_id_;
151 bool search_in_progress_;
152 bool activate_on_finish_;
153>>>>>>> MERGE-SOURCE
143154
144 bool visible_;155 bool visible_;
145};156};
146157
=== modified file 'plugins/unityshell/src/ElapsedTimeMonitor.cpp'
--- plugins/unityshell/src/ElapsedTimeMonitor.cpp 2012-03-14 06:24:18 +0000
+++ plugins/unityshell/src/ElapsedTimeMonitor.cpp 2013-01-18 15:43:30 +0000
@@ -39,7 +39,7 @@
39{39{
40 struct timespec current;40 struct timespec current;
41 clock_gettime(CLOCK_MONOTONIC, &current);41 clock_gettime(CLOCK_MONOTONIC, &current);
42 int diff = TimeUtil::TimeDelta(&current, &_start);42 DeltaTime diff = TimeUtil::TimeDelta(&current, &_start);
4343
44 variant::BuilderWrapper(builder)44 variant::BuilderWrapper(builder)
45 .add("elapsed-time", diff);45 .add("elapsed-time", diff);
4646
=== modified file 'plugins/unityshell/src/GeisAdapter.cpp'
--- plugins/unityshell/src/GeisAdapter.cpp 2012-04-10 01:41:16 +0000
+++ plugins/unityshell/src/GeisAdapter.cpp 2013-01-18 15:43:30 +0000
@@ -488,7 +488,7 @@
488 GEIS_XCB_FULL_WINDOW,488 GEIS_XCB_FULL_WINDOW,
489 &xcb_win_info489 &xcb_win_info
490 };490 };
491 GeisInstance instance;491 GeisInstance instance = nullptr;
492492
493 status = geis_init(&win_info, &instance);493 status = geis_init(&win_info, &instance);
494 if (status != GEIS_STATUS_SUCCESS)494 if (status != GEIS_STATUS_SUCCESS)
495495
=== modified file 'plugins/unityshell/src/Launcher.cpp'
--- plugins/unityshell/src/Launcher.cpp 2012-11-12 12:20:38 +0000
+++ plugins/unityshell/src/Launcher.cpp 2013-01-18 15:43:30 +0000
@@ -111,6 +111,22 @@
111111
112NUX_IMPLEMENT_OBJECT_TYPE(Launcher);112NUX_IMPLEMENT_OBJECT_TYPE(Launcher);
113113
114<<<<<<< TREE
115=======
116void SetTimeBack(struct timespec* timeref, DeltaTime remove)
117{
118 timeref->tv_sec -= remove / 1000;
119 remove = remove % 1000;
120
121 if (remove > timeref->tv_nsec / 1000000)
122 {
123 timeref->tv_sec--;
124 timeref->tv_nsec += 1000000000;
125 }
126 timeref->tv_nsec -= remove * 1000000;
127}
128
129>>>>>>> MERGE-SOURCE
114const gchar Launcher::introspection_xml[] =130const gchar Launcher::introspection_xml[] =
115 "<node>"131 "<node>"
116 " <interface name='com.canonical.Unity.Launcher'>"132 " <interface name='com.canonical.Unity.Launcher'>"
@@ -615,6 +631,28 @@
615 return false;631 return false;
616}632}
617633
634<<<<<<< TREE
635=======
636void Launcher::SetTimeStruct(struct timespec* timer, struct timespec* sister, DeltaTime sister_relation)
637{
638 struct timespec current;
639 clock_gettime(CLOCK_MONOTONIC, &current);
640
641 if (sister)
642 {
643 DeltaTime diff = unity::TimeUtil::TimeDelta(&current, sister);
644
645 if (diff < sister_relation)
646 {
647 DeltaTime remove = sister_relation - diff;
648 SetTimeBack(&current, remove);
649 }
650 }
651
652 timer->tv_sec = current.tv_sec;
653 timer->tv_nsec = current.tv_nsec;
654}
655>>>>>>> MERGE-SOURCE
618/* Min is when you are on the trigger */656/* Min is when you are on the trigger */
619float Launcher::GetAutohidePositionMin() const657float Launcher::GetAutohidePositionMin() const
620{658{
@@ -635,6 +673,7 @@
635673
636float Launcher::IconVisibleProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const674float Launcher::IconVisibleProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
637{675{
676<<<<<<< TREE
638 if (!icon->IsVisibleOnMonitor(monitor))677 if (!icon->IsVisibleOnMonitor(monitor))
639 return 0.0f;678 return 0.0f;
640679
@@ -647,12 +686,23 @@
647 {686 {
648 struct timespec icon_visible_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE);687 struct timespec icon_visible_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE);
649 int enter_ms = unity::TimeUtil::TimeDelta(&current, &icon_visible_time);688 int enter_ms = unity::TimeUtil::TimeDelta(&current, &icon_visible_time);
689=======
690 if (icon->GetQuirk(LauncherIcon::QUIRK_VISIBLE))
691 {
692 struct timespec icon_visible_time = icon->GetQuirkTime(LauncherIcon::QUIRK_VISIBLE);
693 DeltaTime enter_ms = unity::TimeUtil::TimeDelta(&current, &icon_visible_time);
694>>>>>>> MERGE-SOURCE
650 return CLAMP((float) enter_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);695 return CLAMP((float) enter_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);
651 }696 }
652 else697 else
653 {698 {
699<<<<<<< TREE
654 struct timespec icon_hide_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE);700 struct timespec icon_hide_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_VISIBLE);
655 int hide_ms = unity::TimeUtil::TimeDelta(&current, &icon_hide_time);701 int hide_ms = unity::TimeUtil::TimeDelta(&current, &icon_hide_time);
702=======
703 struct timespec icon_hide_time = icon->GetQuirkTime(LauncherIcon::QUIRK_VISIBLE);
704 DeltaTime hide_ms = unity::TimeUtil::TimeDelta(&current, &icon_hide_time);
705>>>>>>> MERGE-SOURCE
656 return 1.0f - CLAMP((float) hide_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);706 return 1.0f - CLAMP((float) hide_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);
657 }707 }
658}708}
@@ -684,8 +734,13 @@
684734
685float Launcher::IconPresentProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const735float Launcher::IconPresentProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
686{736{
737<<<<<<< TREE
687 struct timespec icon_present_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PRESENTED);738 struct timespec icon_present_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PRESENTED);
688 int ms = unity::TimeUtil::TimeDelta(&current, &icon_present_time);739 int ms = unity::TimeUtil::TimeDelta(&current, &icon_present_time);
740=======
741 struct timespec icon_present_time = icon->GetQuirkTime(LauncherIcon::QUIRK_PRESENTED);
742 DeltaTime ms = unity::TimeUtil::TimeDelta(&current, &icon_present_time);
743>>>>>>> MERGE-SOURCE
689 float result = CLAMP((float) ms / (float) ANIM_DURATION, 0.0f, 1.0f);744 float result = CLAMP((float) ms / (float) ANIM_DURATION, 0.0f, 1.0f);
690745
691 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PRESENTED))746 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PRESENTED))
@@ -696,8 +751,13 @@
696751
697float Launcher::IconUrgentProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const752float Launcher::IconUrgentProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
698{753{
754<<<<<<< TREE
699 struct timespec urgent_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_URGENT);755 struct timespec urgent_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_URGENT);
700 int urgent_ms = unity::TimeUtil::TimeDelta(&current, &urgent_time);756 int urgent_ms = unity::TimeUtil::TimeDelta(&current, &urgent_time);
757=======
758 struct timespec urgent_time = icon->GetQuirkTime(LauncherIcon::QUIRK_URGENT);
759 DeltaTime urgent_ms = unity::TimeUtil::TimeDelta(&current, &urgent_time);
760>>>>>>> MERGE-SOURCE
701 float result;761 float result;
702762
703 if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)763 if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
@@ -713,8 +773,13 @@
713773
714float Launcher::IconDropDimValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const774float Launcher::IconDropDimValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
715{775{
776<<<<<<< TREE
716 struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DROP_DIM);777 struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DROP_DIM);
717 int dim_ms = unity::TimeUtil::TimeDelta(&current, &dim_time);778 int dim_ms = unity::TimeUtil::TimeDelta(&current, &dim_time);
779=======
780 struct timespec dim_time = icon->GetQuirkTime(LauncherIcon::QUIRK_DROP_DIM);
781 DeltaTime dim_ms = unity::TimeUtil::TimeDelta(&current, &dim_time);
782>>>>>>> MERGE-SOURCE
718 float result = CLAMP((float) dim_ms / (float) ANIM_DURATION, 0.0f, 1.0f);783 float result = CLAMP((float) dim_ms / (float) ANIM_DURATION, 0.0f, 1.0f);
719784
720 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM))785 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_DROP_DIM))
@@ -725,11 +790,16 @@
725790
726float Launcher::IconDesatValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const791float Launcher::IconDesatValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
727{792{
793<<<<<<< TREE
728 if (!IsOverlayOpen())794 if (!IsOverlayOpen())
729 return 1.0f;795 return 1.0f;
730796
731 struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DESAT);797 struct timespec dim_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_DESAT);
732 int ms = unity::TimeUtil::TimeDelta(&current, &dim_time);798 int ms = unity::TimeUtil::TimeDelta(&current, &dim_time);
799=======
800 struct timespec dim_time = icon->GetQuirkTime(LauncherIcon::QUIRK_DESAT);
801 DeltaTime ms = unity::TimeUtil::TimeDelta(&current, &dim_time);
802>>>>>>> MERGE-SOURCE
733 float result = CLAMP((float) ms / (float) ANIM_DURATION_SHORT_SHORT, 0.0f, 1.0f);803 float result = CLAMP((float) ms / (float) ANIM_DURATION_SHORT_SHORT, 0.0f, 1.0f);
734804
735 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_DESAT))805 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_DESAT))
@@ -740,15 +810,25 @@
740810
741float Launcher::IconShimmerProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const811float Launcher::IconShimmerProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
742{812{
813<<<<<<< TREE
743 struct timespec shimmer_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_SHIMMER);814 struct timespec shimmer_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_SHIMMER);
744 int shimmer_ms = unity::TimeUtil::TimeDelta(&current, &shimmer_time);815 int shimmer_ms = unity::TimeUtil::TimeDelta(&current, &shimmer_time);
816=======
817 struct timespec shimmer_time = icon->GetQuirkTime(LauncherIcon::QUIRK_SHIMMER);
818 DeltaTime shimmer_ms = unity::TimeUtil::TimeDelta(&current, &shimmer_time);
819>>>>>>> MERGE-SOURCE
745 return CLAMP((float) shimmer_ms / (float) ANIM_DURATION_LONG, 0.0f, 1.0f);820 return CLAMP((float) shimmer_ms / (float) ANIM_DURATION_LONG, 0.0f, 1.0f);
746}821}
747822
748float Launcher::IconCenterTransitionProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const823float Launcher::IconCenterTransitionProgress(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
749{824{
825<<<<<<< TREE
750 struct timespec save_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_CENTER_SAVED);826 struct timespec save_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_CENTER_SAVED);
751 int save_ms = unity::TimeUtil::TimeDelta(&current, &save_time);827 int save_ms = unity::TimeUtil::TimeDelta(&current, &save_time);
828=======
829 struct timespec save_time = icon->GetQuirkTime(LauncherIcon::QUIRK_CENTER_SAVED);
830 DeltaTime save_ms = unity::TimeUtil::TimeDelta(&current, &save_time);
831>>>>>>> MERGE-SOURCE
752 return CLAMP((float) save_ms / (float) ANIM_DURATION, 0.0f, 1.0f);832 return CLAMP((float) save_ms / (float) ANIM_DURATION, 0.0f, 1.0f);
753}833}
754834
@@ -763,8 +843,13 @@
763843
764float Launcher::IconPulseOnceValue(AbstractLauncherIcon::Ptr icon, struct timespec const &current) const844float Launcher::IconPulseOnceValue(AbstractLauncherIcon::Ptr icon, struct timespec const &current) const
765{845{
846<<<<<<< TREE
766 struct timespec pulse_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PULSE_ONCE);847 struct timespec pulse_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PULSE_ONCE);
767 int pulse_ms = unity::TimeUtil::TimeDelta(&current, &pulse_time);848 int pulse_ms = unity::TimeUtil::TimeDelta(&current, &pulse_time);
849=======
850 struct timespec pulse_time = icon->GetQuirkTime(LauncherIcon::QUIRK_PULSE_ONCE);
851 DeltaTime pulse_ms = unity::TimeUtil::TimeDelta(&current, &pulse_time);
852>>>>>>> MERGE-SOURCE
768 double pulse_progress = (double) CLAMP((float) pulse_ms / (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), 0.0f, 1.0f);853 double pulse_progress = (double) CLAMP((float) pulse_ms / (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), 0.0f, 1.0f);
769854
770 if (pulse_progress == 1.0f)855 if (pulse_progress == 1.0f)
@@ -784,8 +869,13 @@
784869
785float Launcher::IconStartingBlinkValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const870float Launcher::IconStartingBlinkValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
786{871{
872<<<<<<< TREE
787 struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);873 struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);
788 int starting_ms = unity::TimeUtil::TimeDelta(&current, &starting_time);874 int starting_ms = unity::TimeUtil::TimeDelta(&current, &starting_time);
875=======
876 struct timespec starting_time = icon->GetQuirkTime(LauncherIcon::QUIRK_STARTING);
877 DeltaTime starting_ms = unity::TimeUtil::TimeDelta(&current, &starting_time);
878>>>>>>> MERGE-SOURCE
789 double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * STARTING_BLINK_LAMBDA), 0.0f, 1.0f);879 double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * STARTING_BLINK_LAMBDA), 0.0f, 1.0f);
790 double val = IsBackLightModeToggles() ? 3.0f : 4.0f;880 double val = IsBackLightModeToggles() ? 3.0f : 4.0f;
791 return 0.5f + (float)(std::cos(M_PI * val * starting_progress)) * 0.5f;881 return 0.5f + (float)(std::cos(M_PI * val * starting_progress)) * 0.5f;
@@ -793,8 +883,13 @@
793883
794float Launcher::IconStartingPulseValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const884float Launcher::IconStartingPulseValue(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
795{885{
886<<<<<<< TREE
796 struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);887 struct timespec starting_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_STARTING);
797 int starting_ms = unity::TimeUtil::TimeDelta(&current, &starting_time);888 int starting_ms = unity::TimeUtil::TimeDelta(&current, &starting_time);
889=======
890 struct timespec starting_time = icon->GetQuirkTime(LauncherIcon::QUIRK_STARTING);
891 DeltaTime starting_ms = unity::TimeUtil::TimeDelta(&current, &starting_time);
892>>>>>>> MERGE-SOURCE
798 double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), 0.0f, 1.0f);893 double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), 0.0f, 1.0f);
799894
800 if (starting_progress == 1.0f && !icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING))895 if (starting_progress == 1.0f && !icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING))
@@ -810,8 +905,13 @@
810{905{
811 float result = 0.0f;906 float result = 0.0f;
812907
908<<<<<<< TREE
813 struct timespec running_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_RUNNING);909 struct timespec running_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_RUNNING);
814 int running_ms = unity::TimeUtil::TimeDelta(&current, &running_time);910 int running_ms = unity::TimeUtil::TimeDelta(&current, &running_time);
911=======
912 struct timespec running_time = icon->GetQuirkTime(LauncherIcon::QUIRK_RUNNING);
913 DeltaTime running_ms = unity::TimeUtil::TimeDelta(&current, &running_time);
914>>>>>>> MERGE-SOURCE
815 float running_progress = CLAMP((float) running_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);915 float running_progress = CLAMP((float) running_ms / (float) ANIM_DURATION_SHORT, 0.0f, 1.0f);
816916
817 if (!icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING))917 if (!icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING))
@@ -875,8 +975,13 @@
875975
876float Launcher::IconProgressBias(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const976float Launcher::IconProgressBias(AbstractLauncherIcon::Ptr icon, struct timespec const& current) const
877{977{
978<<<<<<< TREE
878 struct timespec icon_progress_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PROGRESS);979 struct timespec icon_progress_time = icon->GetQuirkTime(AbstractLauncherIcon::QUIRK_PROGRESS);
879 int ms = unity::TimeUtil::TimeDelta(&current, &icon_progress_time);980 int ms = unity::TimeUtil::TimeDelta(&current, &icon_progress_time);
981=======
982 struct timespec icon_progress_time = icon->GetQuirkTime(LauncherIcon::QUIRK_PROGRESS);
983 DeltaTime ms = unity::TimeUtil::TimeDelta(&current, &icon_progress_time);
984>>>>>>> MERGE-SOURCE
880 float result = CLAMP((float) ms / (float) ANIM_DURATION, 0.0f, 1.0f);985 float result = CLAMP((float) ms / (float) ANIM_DURATION, 0.0f, 1.0f);
881986
882 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PROGRESS))987 if (icon->GetQuirk(AbstractLauncherIcon::QUIRK_PROGRESS))
@@ -1286,6 +1391,7 @@
12861391
1287/* End Render Layout Logic */1392/* End Render Layout Logic */
12881393
1394<<<<<<< TREE
1289void Launcher::ForceReveal(bool force_reveal)1395void Launcher::ForceReveal(bool force_reveal)
1290{1396{
1291 _hide_machine->SetQuirk(LauncherHideMachine::TRIGGER_BUTTON_SHOW, force_reveal);1397 _hide_machine->SetQuirk(LauncherHideMachine::TRIGGER_BUTTON_SHOW, force_reveal);
@@ -1300,6 +1406,104 @@
13001406
1301void Launcher::OnBGColorChanged(GVariant *data)1407void Launcher::OnBGColorChanged(GVariant *data)
1302{1408{
1409=======
1410gboolean Launcher::TapOnSuper()
1411{
1412 struct timespec current;
1413 clock_gettime(CLOCK_MONOTONIC, &current);
1414
1415 return (unity::TimeUtil::TimeDelta(&current, &_times[TIME_TAP_SUPER]) < SUPER_TAP_DURATION);
1416}
1417
1418/* Launcher Show/Hide logic */
1419
1420void Launcher::StartKeyShowLauncher()
1421{
1422 _hide_machine->SetQuirk(LauncherHideMachine::LAST_ACTION_ACTIVATE, false);
1423
1424 SetTimeStruct(&_times[TIME_TAP_SUPER]);
1425 SetTimeStruct(&_times[TIME_SUPER_PRESSED]);
1426
1427 if (_super_show_launcher_handle > 0)
1428 g_source_remove(_super_show_launcher_handle);
1429 _super_show_launcher_handle = g_timeout_add(SUPER_TAP_DURATION, &Launcher::SuperShowLauncherTimeout, this);
1430
1431 if (_super_show_shortcuts_handle > 0)
1432 g_source_remove(_super_show_shortcuts_handle);
1433 _super_show_shortcuts_handle = g_timeout_add(SHORTCUTS_SHOWN_DELAY, &Launcher::SuperShowShortcutsTimeout, this);
1434
1435 ubus_server_send_message(ubus_server_get_default(), UBUS_DASH_ABOUT_TO_SHOW, NULL);
1436 ubus_server_force_message_pump(ubus_server_get_default());
1437}
1438
1439void Launcher::EndKeyShowLauncher()
1440{
1441 int remaining_time_before_hide;
1442 struct timespec current;
1443 clock_gettime(CLOCK_MONOTONIC, &current);
1444
1445 _hover_machine->SetQuirk(LauncherHoverMachine::SHORTCUT_KEYS_VISIBLE, false);
1446 _shortcuts_shown = false;
1447 QueueDraw();
1448
1449 // remove further show launcher (which can happen when we close the dash with super)
1450 if (_super_show_launcher_handle > 0)
1451 g_source_remove(_super_show_launcher_handle);
1452 if (_super_show_shortcuts_handle > 0)
1453 g_source_remove(_super_show_shortcuts_handle);
1454 _super_show_launcher_handle = 0;
1455 _super_show_shortcuts_handle = 0;
1456
1457 // it's a tap on super and we didn't use any shortcuts
1458 if (TapOnSuper() && !_latest_shortcut)
1459 ubus_server_send_message(ubus_server_get_default(),
1460 UBUS_PLACE_ENTRY_ACTIVATE_REQUEST,
1461 g_variant_new("(sus)", "home.lens", 0, ""));
1462
1463 remaining_time_before_hide = BEFORE_HIDE_LAUNCHER_ON_SUPER_DURATION - CLAMP((DeltaTime)(unity::TimeUtil::TimeDelta(&current, &_times[TIME_SUPER_PRESSED])), 0, BEFORE_HIDE_LAUNCHER_ON_SUPER_DURATION);
1464
1465 if (_super_hide_launcher_handle > 0)
1466 g_source_remove(_super_hide_launcher_handle);
1467 _super_hide_launcher_handle = g_timeout_add(remaining_time_before_hide, &Launcher::SuperHideLauncherTimeout, this);
1468}
1469
1470gboolean Launcher::SuperHideLauncherTimeout(gpointer data)
1471{
1472 Launcher* self = (Launcher*) data;
1473
1474 self->_hide_machine->SetQuirk(LauncherHideMachine::TRIGGER_BUTTON_SHOW, false);
1475
1476 self->_super_hide_launcher_handle = 0;
1477 return false;
1478}
1479
1480gboolean Launcher::SuperShowLauncherTimeout(gpointer data)
1481{
1482 Launcher* self = (Launcher*) data;
1483
1484 self->_hide_machine->SetQuirk(LauncherHideMachine::TRIGGER_BUTTON_SHOW, true);
1485
1486 self->_super_show_launcher_handle = 0;
1487 return false;
1488}
1489
1490gboolean Launcher::SuperShowShortcutsTimeout(gpointer data)
1491{
1492 Launcher* self = (Launcher*) data;
1493
1494 self->_shortcuts_shown = true;
1495 self->_hover_machine->SetQuirk(LauncherHoverMachine::SHORTCUT_KEYS_VISIBLE, true);
1496
1497 self->QueueDraw();
1498
1499 self->_super_show_shortcuts_handle = 0;
1500 return false;
1501}
1502
1503void Launcher::OnBGColorChanged(GVariant *data, void *val)
1504{
1505 Launcher *self = (Launcher*)val;
1506>>>>>>> MERGE-SOURCE
1303 double red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f;1507 double red = 0.0f, green = 0.0f, blue = 0.0f, alpha = 0.0f;
13041508
1305 g_variant_get(data, "(dddd)", &red, &green, &blue, &alpha);1509 g_variant_get(data, "(dddd)", &red, &green, &blue, &alpha);
13061510
=== modified file 'plugins/unityshell/src/LauncherIcon.cpp'
--- plugins/unityshell/src/LauncherIcon.cpp 2012-09-11 10:38:44 +0000
+++ plugins/unityshell/src/LauncherIcon.cpp 2013-01-18 15:43:30 +0000
@@ -537,6 +537,7 @@
537 return;537 return;
538 }538 }
539539
540<<<<<<< TREE
540 ShowTooltip();541 ShowTooltip();
541}542}
542543
@@ -551,22 +552,60 @@
551552
552bool LauncherIcon::OpenQuicklist(bool select_first_item, int monitor)553bool LauncherIcon::OpenQuicklist(bool select_first_item, int monitor)
553{554{
555=======
556 if (!_skip_tooltip_delay)
557 _tooltip_delay_handle = g_timeout_add(500, &LauncherIcon::OnTooltipTimeout, this);
558 else
559 OnTooltipTimeout(this);
560}
561
562void LauncherIcon::RecvMouseLeave()
563{
564 if (_tooltip_delay_handle)
565 g_source_remove(_tooltip_delay_handle);
566 _tooltip_delay_handle = 0;
567
568 _tooltip->ShowWindow(false);
569}
570
571bool LauncherIcon::OpenQuicklist(bool default_to_first_item)
572{
573>>>>>>> MERGE-SOURCE
554 std::list<DbusmenuMenuitem*> menus = Menus();574 std::list<DbusmenuMenuitem*> menus = Menus();
575<<<<<<< TREE
555576
556 if (!_quicklist)577 if (!_quicklist)
557 LoadQuicklist();578 LoadQuicklist();
558579
580=======
581
582>>>>>>> MERGE-SOURCE
559 if (menus.empty())583 if (menus.empty())
560 return false;584 return false;
561585
586<<<<<<< TREE
562 if (_tooltip)587 if (_tooltip)
563 _tooltip->ShowWindow(false);588 _tooltip->ShowWindow(false);
564 _quicklist->RemoveAllMenuItem();589 _quicklist->RemoveAllMenuItem();
565590
566 for (auto menu_item : menus)591 for (auto menu_item : menus)
592=======
593 if (_tooltip_delay_handle)
594 g_source_remove(_tooltip_delay_handle);
595 _tooltip_delay_handle = 0;
596 _skip_tooltip_delay = false;
597
598 _tooltip->ShowWindow(false);
599 _quicklist->RemoveAllMenuItem();
600
601 for (auto menu_item : menus)
602>>>>>>> MERGE-SOURCE
567 {603 {
604<<<<<<< TREE
568 QuicklistMenuItem* ql_item;605 QuicklistMenuItem* ql_item;
569606
607=======
608>>>>>>> MERGE-SOURCE
570 const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);609 const gchar* type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TYPE);
571 const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);610 const gchar* toggle_type = dbusmenu_menuitem_property_get(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE);
572 gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE);611 gboolean prop_visible = dbusmenu_menuitem_property_get_bool(menu_item, DBUSMENU_MENUITEM_PROP_VISIBLE);
@@ -628,6 +667,28 @@
628 {667 {
629 QuicklistManager::Default()->ShowQuicklist(_quicklist.GetPointer(), tip_x, tip_y);668 QuicklistManager::Default()->ShowQuicklist(_quicklist.GetPointer(), tip_x, tip_y);
630 }669 }
670<<<<<<< TREE
671=======
672
673 auto win_manager = WindowManager::Default();
674
675 if (win_manager->IsScaleActive())
676 win_manager->TerminateScale();
677
678 /* If the expo plugin is active, we need to wait it to be termated, before
679 * shwing the icon quicklist. */
680 if (win_manager->IsExpoActive())
681 {
682 on_expo_terminated_connection = win_manager->terminate_expo.connect([&, tip_x, tip_y]() {
683 QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
684 on_expo_terminated_connection.disconnect();
685 });
686 }
687 else
688 {
689 QuicklistManager::Default()->ShowQuicklist(_quicklist, tip_x, tip_y);
690 }
691>>>>>>> MERGE-SOURCE
631692
632 return true;693 return true;
633}694}
634695
=== modified file 'plugins/unityshell/src/LauncherIcon.h'
--- plugins/unityshell/src/LauncherIcon.h 2012-07-18 15:25:17 +0000
+++ plugins/unityshell/src/LauncherIcon.h 2013-01-18 15:43:30 +0000
@@ -194,6 +194,7 @@
194194
195 void SetIconType(IconType type);195 void SetIconType(IconType type);
196196
197<<<<<<< TREE
197 virtual std::string DesktopFile() { return std::string(""); }198 virtual std::string DesktopFile() { return std::string(""); }
198199
199 virtual bool IsSticky() const { return false; }200 virtual bool IsSticky() const { return false; }
@@ -209,6 +210,19 @@
209 virtual void Stick(bool save = true) {}210 virtual void Stick(bool save = true) {}
210211
211 virtual void UnStick() {}212 virtual void UnStick() {}
213=======
214 std::vector<nux::Vector4> & GetTransform(TransformIndex index);
215
216 static void SetSkipTooltipDelay(gboolean skip_tooltip_delay);
217
218 sigc::signal<void, LauncherIcon*> remove;
219
220 sigc::connection needs_redraw_connection;
221 sigc::connection on_icon_added_connection;
222 sigc::connection on_icon_removed_connection;
223 sigc::connection on_order_changed_connection;
224 sigc::connection on_expo_terminated_connection;
225>>>>>>> MERGE-SOURCE
212226
213protected:227protected:
214 std::vector<nux::Point3> GetCenters();228 std::vector<nux::Point3> GetCenters();
215229
=== modified file 'plugins/unityshell/src/PanelMenuView.cpp'
--- plugins/unityshell/src/PanelMenuView.cpp 2012-04-27 11:42:56 +0000
+++ plugins/unityshell/src/PanelMenuView.cpp 2013-01-18 15:43:30 +0000
@@ -1531,6 +1531,52 @@
1531 FullRedraw();1531 FullRedraw();
1532}1532}
15331533
1534<<<<<<< TREE
1535=======
1536void
1537PanelMenuView::OnMouseDoubleClicked(int x, int y, unsigned long button_flags, unsigned long)
1538{
1539 if (nux::GetEventButton(button_flags) != 1 || _places_showing)
1540 return;
1541
1542 guint32 window_xid = GetMaximizedWindow();
1543
1544 if (window_xid != 0)
1545 {
1546 WindowManager::Default()->Restore(window_xid);
1547 _is_inside = true;
1548 }
1549}
1550
1551void
1552PanelMenuView::OnMouseClicked(int x, int y, unsigned long button_flags, unsigned long)
1553{
1554 if (nux::GetEventButton(button_flags) != 1 || _places_showing)
1555 return;
1556
1557 guint32 window_xid = GetMaximizedWindow();
1558
1559 if (window_xid != 0)
1560 {
1561 WindowManager::Default()->Raise(window_xid);
1562 }
1563}
1564
1565void
1566PanelMenuView::OnMouseMiddleClicked(int x, int y, unsigned long button_flags, unsigned long)
1567{
1568 if (nux::GetEventButton(button_flags) != 2 || _places_showing)
1569 return;
1570
1571 guint32 window_xid = GetMaximizedWindow();
1572
1573 if (window_xid != 0)
1574 {
1575 WindowManager::Default()->Lower(window_xid);
1576 }
1577}
1578
1579>>>>>>> MERGE-SOURCE
1534// Introspectable1580// Introspectable
1535std::string1581std::string
1536PanelMenuView::GetName() const1582PanelMenuView::GetName() const
15371583
=== modified file 'plugins/unityshell/src/PanelTray.cpp'
--- plugins/unityshell/src/PanelTray.cpp 2012-04-12 13:23:29 +0000
+++ plugins/unityshell/src/PanelTray.cpp 2013-01-18 15:43:30 +0000
@@ -81,6 +81,16 @@
8181
82PanelTray::~PanelTray()82PanelTray::~PanelTray()
83{83{
84<<<<<<< TREE
85=======
86 if (_tray)
87 {
88 g_signal_handler_disconnect(na_tray_get_manager(_tray), _tray_icon_added_id);
89 g_object_unref(_tray);
90 _tray = NULL;
91 }
92
93>>>>>>> MERGE-SOURCE
84 g_idle_remove_by_data(this);94 g_idle_remove_by_data(this);
85 g_strfreev(whitelist_);95 g_strfreev(whitelist_);
8696
8797
=== modified file 'plugins/unityshell/src/PanelView.cpp'
--- plugins/unityshell/src/PanelView.cpp 2012-04-27 11:42:56 +0000
+++ plugins/unityshell/src/PanelView.cpp 2013-01-18 15:43:30 +0000
@@ -638,7 +638,12 @@
638 return;638 return;
639639
640 _opacity = opacity;640 _opacity = opacity;
641<<<<<<< TREE
641 _bg_effect_helper.enabled = (_opacity < 1.0f || _overlay_is_open);642 _bg_effect_helper.enabled = (_opacity < 1.0f || _overlay_is_open);
643=======
644
645 bg_effect_helper_.enabled = (_opacity < 1.0f || _dash_is_open);
646>>>>>>> MERGE-SOURCE
642647
643 ForceUpdateBackground();648 ForceUpdateBackground();
644}649}
645650
=== modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.cpp'
--- plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2012-07-18 15:25:17 +0000
+++ plugins/unityshell/src/ScreenEffectFramebufferObject.cpp 2013-01-18 15:43:30 +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
@@ -236,3 +237,239 @@
236237
237#endif // USE_GLES238#endif // USE_GLES
238239
240=======
241// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
242/* Compiz unity plugin
243 * unity.h
244 *
245 * Copyright (c) 2010-11 Canonical Ltd.
246 *
247 * This program is free software; you can redistribute it and/or
248 * modify it under the terms of the GNU General Public License
249 * as published by the Free Software Foundation; either version 3
250 * of the License, or (at your option) any later version.
251 *
252 * This program is distributed in the hope that it will be useful,
253 * but WITHOUT ANY WARRANTY; without even the implied warranty of
254 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
255 * GNU General Public License for more details.
256 *
257 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
258 */
259
260#include "ScreenEffectFramebufferObject.h"
261#include "BackgroundEffectHelper.h"
262#include <NuxCore/Logger.h>
263#include <dlfcn.h>
264
265namespace
266{
267 nux::logging::Logger logger ("unity.screeneffectframebufferobject");
268}
269
270void ScreenEffectFramebufferObject::paint (const nux::Geometry &output)
271{
272 /* Draw the bit of the relevant framebuffer for each output */
273
274 glPushAttrib (GL_VIEWPORT_BIT);
275 glViewport (0, mScreenSize.height - (output.y + output.height), mScreenSize.width, mScreenSize.height);
276
277 if (mFBTexture)
278 {
279 glEnable (GL_TEXTURE_2D);
280 activeTexture (GL_TEXTURE0_ARB);
281 glBindTexture (GL_TEXTURE_2D, mFBTexture);
282 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
283 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
284
285 glPushAttrib (GL_SCISSOR_BIT);
286 glEnable (GL_SCISSOR_TEST);
287
288 glScissor (output.x, mScreenSize.height - (output.y + output.height),
289 output.width, output.height);
290
291 /* FIXME: This needs to be GL_TRIANGLE_STRIP */
292 glBegin (GL_QUADS);
293 glTexCoord2f (0, 1);
294 glVertex2i (mGeometry.x, mGeometry.y);
295 glTexCoord2f (0, 0);
296 glVertex2i (mGeometry.x, mGeometry.y + mGeometry.height);
297 glTexCoord2f (1, 0);
298 glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y + mGeometry.height);
299 glTexCoord2f (1, 1);
300 glVertex2i (mGeometry.x + mGeometry.width, mGeometry.y);
301 glEnd ();
302
303 activeTexture (GL_TEXTURE0_ARB);
304 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
305 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
306 glBindTexture (GL_TEXTURE_2D, 0);
307 glDisable (GL_TEXTURE_2D);
308 glPopAttrib ();
309 }
310 glPopAttrib ();
311}
312
313void ScreenEffectFramebufferObject::onScreenSizeChanged(const nux::Geometry& screenSize)
314{
315 mScreenSize = screenSize;
316}
317
318
319void ScreenEffectFramebufferObject::unbind ()
320{
321 if (!mBoundCnt)
322 return;
323
324 mBoundCnt--;
325
326 (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, 0);
327
328 glDrawBuffer (GL_BACK);
329 glReadBuffer (GL_BACK);
330
331 /* Matches the viewport set we did in ::bind () */
332 glPopAttrib ();
333
334}
335
336bool ScreenEffectFramebufferObject::status ()
337{
338 return mFboStatus;
339}
340
341void ScreenEffectFramebufferObject::bind (const nux::Geometry &output)
342{
343 if (!BackgroundEffectHelper::HasDirtyHelpers())
344 return;
345
346 /* Clear the error bit */
347 glGetError ();
348
349 if (!mFBTexture)
350 {
351 glGenTextures (1, &mFBTexture);
352
353 glBindTexture (GL_TEXTURE_2D, mFBTexture);
354 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
355 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
356 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
357 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
358 glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, mGeometry.width, mGeometry.height, 0, GL_BGRA,
359#if IMAGE_BYTE_ORDER == MSBFirst
360 GL_UNSIGNED_INT_8_8_8_8_REV,
361#else
362 GL_UNSIGNED_BYTE,
363#endif
364 NULL);
365
366 glBindTexture (GL_TEXTURE_2D, 0);
367
368 if (glGetError () != GL_NO_ERROR)
369 {
370 mFboHandle = 0;
371 mFboStatus = false;
372 return;
373 }
374 }
375
376 (*bindFramebuffer) (GL_FRAMEBUFFER_EXT, mFboHandle);
377
378 (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
379 GL_TEXTURE_2D, mFBTexture, 0);
380
381 (*framebufferTexture2D) (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
382 GL_TEXTURE_2D, 0, 0);
383
384 /* Ensure that a framebuffer is actually available */
385 if (!mFboStatus)
386 {
387 GLint status = (*checkFramebufferStatus) (GL_DRAW_FRAMEBUFFER);
388
389 if (status != GL_FRAMEBUFFER_COMPLETE)
390 {
391 switch (status)
392 {
393 case GL_FRAMEBUFFER_UNDEFINED:
394 LOG_WARN (logger) << "no window";
395 break;
396 case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
397 LOG_WARN (logger) << "attachment incomplete";
398 break;
399 case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
400 LOG_WARN (logger) << "no buffers attached to fbo";
401 break;
402 case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
403 LOG_WARN (logger) << "some attachment in glDrawBuffers doesn't exist in FBO";
404 break;
405 case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
406 LOG_WARN (logger) << "some attachment in glReadBuffers doesn't exist in FBO";
407 break;
408 case GL_FRAMEBUFFER_UNSUPPORTED:
409 LOG_WARN (logger) << "unsupported internal format";
410 break;
411 case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
412 LOG_WARN (logger) << "different levels of sampling for each attachment";
413 break;
414 case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
415 LOG_WARN (logger) << "number of layers is different";
416 break;
417 default:
418 LOG_WARN (logger) << "unable to bind the framebuffer for an unknown reason";
419 break;
420 }
421
422 bindFramebuffer (GL_FRAMEBUFFER_EXT, 0);
423 deleteFramebuffers (1, &mFboHandle);
424
425 glDrawBuffer (GL_BACK);
426 glReadBuffer (GL_BACK);
427
428 mFboHandle = 0;
429
430 mFboStatus = false;
431 }
432 else
433 mFboStatus = true;
434 }
435
436 if (mFboStatus)
437 {
438 glPushAttrib (GL_VIEWPORT_BIT);
439
440 glViewport (output.x,
441 mScreenSize.height - (output.y + output.height),
442 output.width,
443 output.height);
444 }
445
446 mBoundCnt++;
447}
448
449
450ScreenEffectFramebufferObject::ScreenEffectFramebufferObject (GLXGetProcAddressProc p, const nux::Geometry &geom)
451 : getProcAddressGLX (p)
452 , mFboStatus (false)
453 , mFBTexture (0)
454 , mGeometry (geom)
455 , mBoundCnt (0)
456 , mScreenSize (geom)
457{
458 activeTexture = (GLActiveTextureProc) (*getProcAddressGLX) ((GLubyte *) "glActiveTexture");
459 genFramebuffers = (GLGenFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glGenFramebuffersEXT");
460 deleteFramebuffers = (GLDeleteFramebuffersProc) (*getProcAddressGLX) ((GLubyte *)"glDeleteFramebuffersEXT");
461 bindFramebuffer = (GLBindFramebufferProc) (*getProcAddressGLX) ((GLubyte *)"glBindFramebufferEXT");
462 checkFramebufferStatus = (GLCheckFramebufferStatusProc) (*getProcAddressGLX) ((GLubyte *) "glCheckFramebufferStatusEXT");
463 framebufferTexture2D = (GLFramebufferTexture2DProc) (*getProcAddressGLX) ((GLubyte *) "glFramebufferTexture2DEXT");
464
465 (*genFramebuffers) (1, &mFboHandle);
466}
467
468ScreenEffectFramebufferObject::~ScreenEffectFramebufferObject ()
469{
470 (*deleteFramebuffers) (1, &mFboHandle);
471
472 if (mFBTexture)
473 glDeleteTextures (1, &mFBTexture);
474}
475>>>>>>> MERGE-SOURCE
239476
=== modified file 'plugins/unityshell/src/ScreenEffectFramebufferObject.h'
--- plugins/unityshell/src/ScreenEffectFramebufferObject.h 2012-03-14 06:24:18 +0000
+++ plugins/unityshell/src/ScreenEffectFramebufferObject.h 2013-01-18 15:43:30 +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
@@ -87,3 +88,89 @@
8788
88#endif // USE_GLES89#endif // USE_GLES
89#endif90#endif
91=======
92// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
93/* Compiz unity plugin
94 * unity.h
95 *
96 * Copyright (c) 2010-11 Canonical Ltd.
97 *
98 * This program is free software; you can redistribute it and/or
99 * modify it under the terms of the GNU General Public License
100 * as published by the Free Software Foundation; either version 3
101 * of the License, or (at your option) any later version.
102 *
103 * This program is distributed in the hope that it will be useful,
104 * but WITHOUT ANY WARRANTY; without even the implied warranty of
105 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
106 * GNU General Public License for more details.
107 *
108 * Authored By: Sam Spilsbury <sam.spilsbury@canonical.com>
109 */
110
111#ifndef UNITY_SCREENEFFECT_FRAMEBUFFER_H
112#define UNITY_SCREENEFFECT_FRAMEBUFFER_H
113
114#include <Nux/Nux.h>
115
116class ScreenEffectFramebufferObject
117{
118public:
119
120 typedef boost::shared_ptr <ScreenEffectFramebufferObject> Ptr;
121 typedef void (*FuncPtr) (void);
122 typedef FuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
123
124 ScreenEffectFramebufferObject (GLXGetProcAddressProc, const nux::Geometry &geom);
125 ~ScreenEffectFramebufferObject ();
126
127public:
128
129 void bind (const nux::Geometry &geom);
130 void unbind ();
131
132 bool status ();
133 void paint (const nux::Geometry &geom);
134 bool bound () { return mBoundCnt > 0; }
135
136 GLuint texture () { return mFBTexture; }
137
138 void onScreenSizeChanged (const nux::Geometry &screenSize);
139
140private:
141
142 FuncPtr getProcAddr (const std::string &);
143
144 typedef void (*GLActiveTextureProc) (GLenum texture);
145 typedef void (*GLGenFramebuffersProc) (GLsizei n,
146 GLuint *framebuffers);
147 typedef void (*GLDeleteFramebuffersProc) (GLsizei n,
148 GLuint *framebuffers);
149 typedef void (*GLBindFramebufferProc) (GLenum target,
150 GLuint framebuffer);
151 typedef GLenum (*GLCheckFramebufferStatusProc) (GLenum target);
152 typedef void (*GLFramebufferTexture2DProc) (GLenum target,
153 GLenum attachment,
154 GLenum textarget,
155 GLuint texture,
156 GLint level);
157
158 GLXGetProcAddressProc getProcAddressGLX;
159 GLActiveTextureProc activeTexture;
160 GLGenFramebuffersProc genFramebuffers;
161 GLDeleteFramebuffersProc deleteFramebuffers;
162 GLBindFramebufferProc bindFramebuffer;
163 GLCheckFramebufferStatusProc checkFramebufferStatus;
164 GLFramebufferTexture2DProc framebufferTexture2D;
165 /* compiz fbo handle that goes through to nux */
166 GLuint mFboHandle; // actual handle to the framebuffer_ext
167 bool mFboStatus; // did the framebuffer texture bind succeed
168 GLuint mFBTexture;
169 nux::Geometry mGeometry;
170 unsigned int mBoundCnt;
171
172 nux::Geometry mScreenSize;
173};
174
175#endif
176>>>>>>> MERGE-SOURCE
90177
=== modified file 'plugins/unityshell/src/SwitcherController.cpp'
--- plugins/unityshell/src/SwitcherController.cpp 2012-07-18 15:25:17 +0000
+++ plugins/unityshell/src/SwitcherController.cpp 2013-01-18 15:43:30 +0000
@@ -55,6 +55,7 @@
55 , view_idle_timer_(0)55 , view_idle_timer_(0)
56 , bg_color_(0, 0, 0, 0.5)56 , bg_color_(0, 0, 0, 0.5)
57{57{
58<<<<<<< TREE
58 ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &Controller::OnBackgroundUpdate));59 ubus_manager_.RegisterInterest(UBUS_BACKGROUND_COLOR_CHANGED, sigc::mem_fun(this, &Controller::OnBackgroundUpdate));
5960
60 /* Construct the view after a prefixed timeout, to improve the startup time */61 /* Construct the view after a prefixed timeout, to improve the startup time */
@@ -64,10 +65,24 @@
64 self->ConstructWindow();65 self->ConstructWindow();
65 return FALSE;66 return FALSE;
66 }, this, nullptr);67 }, this, nullptr);
68=======
69 timeout_length = 150;
70 detail_on_timeout = true;
71 detail_timeout_length = 1500;
72
73 bg_color_ = nux::Color(0.0, 0.0, 0.0, 0.5);
74
75 UBusServer *ubus = ubus_server_get_default();
76 bg_update_handle_ =
77 ubus_server_register_interest(ubus, UBUS_BACKGROUND_COLOR_CHANGED,
78 (UBusCallback)&SwitcherController::OnBackgroundUpdate,
79 this);
80>>>>>>> MERGE-SOURCE
67}81}
6882
69Controller::~Controller()83Controller::~Controller()
70{84{
85 ubus_server_unregister_interest(ubus_server_get_default(), bg_update_handle_);
71 if (view_window_)86 if (view_window_)
72 view_window_->UnReference();87 view_window_->UnReference();
7388
7489
=== modified file 'plugins/unityshell/src/SwitcherController.h'
--- plugins/unityshell/src/SwitcherController.h 2012-06-25 23:18:15 +0000
+++ plugins/unityshell/src/SwitcherController.h 2013-01-18 15:43:30 +0000
@@ -137,6 +137,7 @@
137 guint view_idle_timer_;137 guint view_idle_timer_;
138 nux::Color bg_color_;138 nux::Color bg_color_;
139 DetailMode detail_mode_;139 DetailMode detail_mode_;
140 guint bg_update_handle_;
140141
141 static bool CompareSwitcherItemsPriority(launcher::AbstractLauncherIcon::Ptr first, launcher::AbstractLauncherIcon::Ptr second);142 static bool CompareSwitcherItemsPriority(launcher::AbstractLauncherIcon::Ptr first, launcher::AbstractLauncherIcon::Ptr second);
142};143};
143144
=== modified file 'plugins/unityshell/src/SwitcherModel.cpp'
--- plugins/unityshell/src/SwitcherModel.cpp 2012-08-15 18:26:01 +0000
+++ plugins/unityshell/src/SwitcherModel.cpp 2013-01-18 15:43:30 +0000
@@ -169,10 +169,17 @@
169{169{
170 if (!detail_selection || DetailXids ().empty())170 if (!detail_selection || DetailXids ().empty())
171 return 0;171 return 0;
172<<<<<<< TREE
172173
173 if (detail_selection_index > DetailXids().size() - 1)174 if (detail_selection_index > DetailXids().size() - 1)
174 return 0;175 return 0;
175176
177=======
178
179 if (detail_selection_index >= DetailXids().size())
180 return 0;
181
182>>>>>>> MERGE-SOURCE
176 return DetailXids()[detail_selection_index];183 return DetailXids()[detail_selection_index];
177}184}
178185
179186
=== modified file 'plugins/unityshell/src/SwitcherView.cpp'
--- plugins/unityshell/src/SwitcherView.cpp 2012-03-23 12:26:38 +0000
+++ plugins/unityshell/src/SwitcherView.cpp 2013-01-18 15:43:30 +0000
@@ -251,7 +251,7 @@
251{251{
252 std::vector<Window> xids = model_->DetailXids ();252 std::vector<Window> xids = model_->DetailXids ();
253253
254 int ms_since_change = TimeUtil::TimeDelta(&current, &save_time_);254 DeltaTime ms_since_change = TimeUtil::TimeDelta(&current, &save_time_);
255 float progress = MIN (1.0f, (float) ms_since_change / (float) animation_length());255 float progress = MIN (1.0f, (float) ms_since_change / (float) animation_length());
256256
257 for (Window window : xids)257 for (Window window : xids)
@@ -508,7 +508,7 @@
508 ++i;508 ++i;
509 }509 }
510510
511 int ms_since_change = TimeUtil::TimeDelta(&current, &save_time_);511 DeltaTime ms_since_change = TimeUtil::TimeDelta(&current, &save_time_);
512 if (saved_args_.size () == results.size () && ms_since_change < animation_length)512 if (saved_args_.size () == results.size () && ms_since_change < animation_length)
513 {513 {
514 float progress = (float) ms_since_change / (float) animation_length();514 float progress = (float) ms_since_change / (float) animation_length();
@@ -630,7 +630,11 @@
630 text_view_->SetBaseY(last_background_.y + last_background_.height - 45);630 text_view_->SetBaseY(last_background_.y + last_background_.height - 45);
631 text_view_->Draw(GfxContext, force_draw);631 text_view_->Draw(GfxContext, force_draw);
632632
633<<<<<<< TREE
633 int ms_since_change = TimeUtil::TimeDelta(&current_, &save_time_);634 int ms_since_change = TimeUtil::TimeDelta(&current_, &save_time_);
635=======
636 DeltaTime ms_since_change = TimeUtil::TimeDelta(&current, &save_time_);
637>>>>>>> MERGE-SOURCE
634638
635 if (ms_since_change < animation_length && redraw_handle_ == 0)639 if (ms_since_change < animation_length && redraw_handle_ == 0)
636 redraw_handle_ = g_idle_add_full (G_PRIORITY_DEFAULT, &SwitcherView::OnDrawTimeout, this, NULL);640 redraw_handle_ = g_idle_add_full (G_PRIORITY_DEFAULT, &SwitcherView::OnDrawTimeout, this, NULL);
637641
=== modified file 'plugins/unityshell/src/TimeUtil.h'
--- plugins/unityshell/src/TimeUtil.h 2012-03-14 06:24:18 +0000
+++ plugins/unityshell/src/TimeUtil.h 2013-01-18 15:43:30 +0000
@@ -19,12 +19,16 @@
19 */19 */
2020
21#include <time.h>21#include <time.h>
22#include <cstdint>
23
24typedef int64_t DeltaTime
2225
23namespace unity {26namespace unity {
2427
25class TimeUtil28class TimeUtil
26{29{
27public:30public:
31<<<<<<< TREE
28 static int TimeDelta (struct timespec const* x, struct timespec const* y)32 static int TimeDelta (struct timespec const* x, struct timespec const* y)
29 {33 {
30 return ((x->tv_sec - y->tv_sec) * 1000) + ((x->tv_nsec - y->tv_nsec) / 1000000);34 return ((x->tv_sec - y->tv_sec) * 1000) + ((x->tv_nsec - y->tv_nsec) / 1000000);
@@ -62,7 +66,20 @@
62 }66 }
63 timeref->tv_nsec -= remove * 1000000;67 timeref->tv_nsec -= remove * 1000000;
64 }68 }
69=======
70static DeltaTime TimeDelta (struct timespec const* x, struct timespec const* y);
71>>>>>>> MERGE-SOURCE
65};72};
6673
74<<<<<<< TREE
75=======
76inline
77DeltaTime TimeUtil::TimeDelta (struct timespec const* x, struct timespec const* y)
78{
79 DeltaTime d_sec = (x->tv_sec - y->tv_sec);
80 DeltaTime d_nsec = (x->tv_nsec - y->tv_nsec);
81 return (d_sec * 1000) + (d_nsec / 1000000);
82}
83>>>>>>> MERGE-SOURCE
6784
68}85}
6986
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-11-12 12:20:38 +0000
+++ plugins/unityshell/src/unityshell.cpp 2013-01-18 15:43:30 +0000
@@ -119,9 +119,14 @@
119 , allowWindowPaint(false)119 , allowWindowPaint(false)
120 , _key_nav_mode_requested(false)120 , _key_nav_mode_requested(false)
121 , _last_output(nullptr)121 , _last_output(nullptr)
122<<<<<<< TREE
122#ifndef USE_GLES123#ifndef USE_GLES
123 , _active_fbo (0)124 , _active_fbo (0)
124#endif125#endif
126=======
127 , _active_fbo (0)
128 , dash_is_open_ (false)
129>>>>>>> MERGE-SOURCE
125 , grab_index_ (0)130 , grab_index_ (0)
126 , painting_tray_ (false)131 , painting_tray_ (false)
127 , last_scroll_event_(0)132 , last_scroll_event_(0)
@@ -247,6 +252,7 @@
247 uScreen = this;252 uScreen = this;
248 _in_paint = false;253 _in_paint = false;
249254
255<<<<<<< TREE
250#ifndef USE_GLES256#ifndef USE_GLES
251 void *dlhand = dlopen ("libunityshell.so", RTLD_LAZY);257 void *dlhand = dlopen ("libunityshell.so", RTLD_LAZY);
252258
@@ -258,6 +264,18 @@
258 glXGetProcAddressP = NULL;264 glXGetProcAddressP = NULL;
259 }265 }
260266
267=======
268 void *dlhand = dlopen ("libunityshell.so", RTLD_LAZY);
269
270 if (dlhand)
271 {
272 dlerror ();
273 glXGetProcAddressP = (ScreenEffectFramebufferObject::GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddress");
274 if (dlerror () != NULL)
275 glXGetProcAddressP = NULL;
276 }
277
278>>>>>>> MERGE-SOURCE
261 if (GL::fbo)279 if (GL::fbo)
262 {280 {
263 nux::Geometry geometry (0, 0, screen->width (), screen->height ());281 nux::Geometry geometry (0, 0, screen->width (), screen->height ());
@@ -370,6 +388,7 @@
370388
371 BackgroundEffectHelper::updates_enabled = true;389 BackgroundEffectHelper::updates_enabled = true;
372390
391<<<<<<< TREE
373 ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [&](GVariant * data)392 ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, [&](GVariant * data)
374 {393 {
375 unity::glib::String overlay_identity;394 unity::glib::String overlay_identity;
@@ -386,6 +405,14 @@
386 Display* display = gdk_x11_display_get_xdisplay(gdk_display_get_default());;405 Display* display = gdk_x11_display_get_xdisplay(gdk_display_get_default());;
387 XSelectInput(display, GDK_ROOT_WINDOW(), PropertyChangeMask);406 XSelectInput(display, GDK_ROOT_WINDOW(), PropertyChangeMask);
388 LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s";407 LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s";
408=======
409 ubus_manager_.RegisterInterest(UBUS_PLACE_VIEW_SHOWN, [&](GVariant * args) {
410 dash_is_open_ = true;
411 RaiseInputWindows();
412 });
413 ubus_manager_.RegisterInterest(UBUS_PLACE_VIEW_HIDDEN, [&](GVariant * args) { dash_is_open_ = false; });
414 LOG_INFO(logger) << "UnityScreen constructed: " << timer.ElapsedSeconds() << "s";
415>>>>>>> MERGE-SOURCE
389 }416 }
390417
391 panel::Style::Instance().changed.connect(sigc::mem_fun(this, &UnityScreen::OnPanelStyleChanged));418 panel::Style::Instance().changed.connect(sigc::mem_fun(this, &UnityScreen::OnPanelStyleChanged));
@@ -521,8 +548,12 @@
521548
522void UnityScreen::nuxEpilogue()549void UnityScreen::nuxEpilogue()
523{550{
551<<<<<<< TREE
524#ifndef USE_GLES552#ifndef USE_GLES
525 (*GL::bindFramebuffer)(GL_FRAMEBUFFER_EXT, _active_fbo);553 (*GL::bindFramebuffer)(GL_FRAMEBUFFER_EXT, _active_fbo);
554=======
555 (*GL::bindFramebuffer)(GL_FRAMEBUFFER_EXT, _active_fbo);
556>>>>>>> MERGE-SOURCE
526557
527 glMatrixMode(GL_PROJECTION);558 glMatrixMode(GL_PROJECTION);
528 glLoadIdentity();559 glLoadIdentity();
@@ -581,6 +612,9 @@
581 float y1 = output->y() + panel_h;612 float y1 = output->y() + panel_h;
582 float x2 = x1 + output->width();613 float x2 = x1 + output->width();
583 float y2 = y1 + h;614 float y2 = y1 + h;
615 GLMatrix sTransform = GLMatrix ();
616
617 sTransform.toScreenSpace(output, -DEFAULT_Z_CAMERA);
584618
585 glPushMatrix ();619 glPushMatrix ();
586 glLoadMatrixf (panel_shadow_matrix_.getMatrix ());620 glLoadMatrixf (panel_shadow_matrix_.getMatrix ());
@@ -640,6 +674,7 @@
640 glDisable(GL_BLEND);674 glDisable(GL_BLEND);
641 }675 }
642 }676 }
677<<<<<<< TREE
643 glPopMatrix();678 glPopMatrix();
644#else679#else
645#warning Panel shadow not properly implemented for GLES2680#warning Panel shadow not properly implemented for GLES2
@@ -737,6 +772,8 @@
737 }772 }
738 nuxEpilogue();773 nuxEpilogue();
739#endif774#endif
775=======
776>>>>>>> MERGE-SOURCE
740}777}
741778
742void779void
@@ -764,6 +801,7 @@
764#endif801#endif
765{802{
766 CompOutput *output = _last_output;803 CompOutput *output = _last_output;
804<<<<<<< TREE
767805
768#ifndef USE_GLES806#ifndef USE_GLES
769 bool was_bound = _fbo->bound ();807 bool was_bound = _fbo->bound ();
@@ -820,10 +858,34 @@
820 nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(),858 nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(),
821 screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8);859 screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8);
822#else860#else
861=======
862 Window tray_xid = panelController->GetTrayXid ();
863
864 bool was_bound = _fbo->bound ();
865 _fbo->unbind ();
866
867 /* Draw the bit of the relevant framebuffer for each output */
868
869 if (was_bound)
870 {
871 GLMatrix sTransform;
872 sTransform.toScreenSpace (&screen->fullscreenOutput (), -DEFAULT_Z_CAMERA);
873 glPushMatrix ();
874 glLoadMatrixf (sTransform.getMatrix ());
875 _fbo->paint (nux::Geometry (output->x (), output->y (), output->width (), output->height ()));
876 glPopMatrix ();
877 }
878
879>>>>>>> MERGE-SOURCE
823 nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture =880 nux::ObjectPtr<nux::IOpenGLTexture2D> device_texture =
881<<<<<<< TREE
824 nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(gScreen->fbo ()->tex ()->name (),882 nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(gScreen->fbo ()->tex ()->name (),
825 output->width(), output->height(), 1, nux::BITFMT_R8G8B8A8);883 output->width(), output->height(), 1, nux::BITFMT_R8G8B8A8);
826#endif884#endif
885=======
886 nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture2DFromID(_fbo->texture(),
887 screen->width (), screen->height(), 1, nux::BITFMT_R8G8B8A8);
888>>>>>>> MERGE-SOURCE
827889
828 nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture;890 nux::GetGraphicsDisplay()->GetGpuDevice()->backup_texture0_ = device_texture;
829891
@@ -831,6 +893,7 @@
831 nux::Geometry oGeo = nux::Geometry (output->x (), output->y (), output->width (), output->height ());893 nux::Geometry oGeo = nux::Geometry (output->x (), output->y (), output->width (), output->height ());
832 BackgroundEffectHelper::monitor_rect_ = geo;894 BackgroundEffectHelper::monitor_rect_ = geo;
833895
896<<<<<<< TREE
834#ifdef USE_GLES897#ifdef USE_GLES
835 GLint fboID;898 GLint fboID;
836 // Nux renders to the referenceFramebuffer when it's embedded.899 // Nux renders to the referenceFramebuffer when it's embedded.
@@ -839,6 +902,9 @@
839#endif902#endif
840903
841 nuxPrologue();904 nuxPrologue();
905=======
906 nuxPrologue();
907>>>>>>> MERGE-SOURCE
842 _in_paint = true;908 _in_paint = true;
843 wt->RenderInterfaceFromForeignCmd (&oGeo);909 wt->RenderInterfaceFromForeignCmd (&oGeo);
844 _in_paint = false;910 _in_paint = false;
@@ -1020,6 +1086,7 @@
10201086
1021void UnityScreen::leaveShowDesktopMode (CompWindow *w)1087void UnityScreen::leaveShowDesktopMode (CompWindow *w)
1022{1088{
1089<<<<<<< TREE
1023 /* Where a window is inhibiting, only allow the window1090 /* Where a window is inhibiting, only allow the window
1024 * that is inhibiting the leave show desktop to actually1091 * that is inhibiting the leave show desktop to actually
1025 * fade in again - all other windows should remain faded out */1092 * fade in again - all other windows should remain faded out */
@@ -1051,6 +1118,39 @@
1051 }1118 }
1052 }1119 }
1053 }1120 }
1121=======
1122 /* Where a window is inhibiting, only allow the window
1123 * that is inhibiting the leave show desktop to actually
1124 * fade in again - all other windows should remain faded out */
1125 if (!UnityShowdesktopHandler::inhibitingXid ())
1126 {
1127 for (CompWindow *cw : screen->windows ())
1128 {
1129 if (cw->inShowDesktopMode ())
1130 {
1131 UnityWindow::get (cw)->leaveShowDesktop ();
1132 // the animation plugin does strange things here ...
1133 // if this notification is sent
1134 //cw->windowNotify (CompWindowNotifyLeaveShowDesktopMode);
1135 }
1136 }
1137
1138 PluginAdapter::Default()->OnLeaveDesktop();
1139
1140 screen->leaveShowDesktopMode (w);
1141 }
1142 else
1143 {
1144 CompWindow *cw = screen->findWindow (UnityShowdesktopHandler::inhibitingXid ());
1145 if (cw)
1146 {
1147 if (cw->inShowDesktopMode ())
1148 {
1149 UnityWindow::get (cw)->leaveShowDesktop ();
1150 }
1151 }
1152 }
1153>>>>>>> MERGE-SOURCE
1054}1154}
10551155
1056void UnityWindow::enterShowDesktop ()1156void UnityWindow::enterShowDesktop ()
@@ -1072,6 +1172,7 @@
1072 }1172 }
1073}1173}
10741174
1175<<<<<<< TREE
1075void UnityWindow::activate ()1176void UnityWindow::activate ()
1076{1177{
1077 ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ());1178 ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ());
@@ -1172,7 +1273,19 @@
1172{1273{
1173 ShowdesktopHandlerWindowInterface::PostPaintAction action = ShowdesktopHandlerWindowInterface::PostPaintAction::Wait;1274 ShowdesktopHandlerWindowInterface::PostPaintAction action = ShowdesktopHandlerWindowInterface::PostPaintAction::Wait;
11741275
1276=======
1277void UnityWindow::activate ()
1278{
1279 UnityShowdesktopHandler::inhibitLeaveShowdesktopMode (window->id ());
1280 window->activate ();
1281 UnityShowdesktopHandler::allowLeaveShowdesktopMode (window->id ());
1282}
1283
1284bool UnityWindow::handleAnimations (unsigned int ms)
1285{
1286>>>>>>> MERGE-SOURCE
1175 if (mShowdesktopHandler)1287 if (mShowdesktopHandler)
1288<<<<<<< TREE
1176 action = mShowdesktopHandler->Animate (ms);1289 action = mShowdesktopHandler->Animate (ms);
11771290
1178 return action;1291 return action;
@@ -1212,6 +1325,168 @@
1212{1325{
1213 if (screen->XShape () &&1326 if (screen->XShape () &&
1214 event->type == screen->shapeEvent () + ShapeNotify &&1327 event->type == screen->shapeEvent () + ShapeNotify &&
1328=======
1329 if (mShowdesktopHandler->animate (ms))
1330 {
1331 delete mShowdesktopHandler;
1332 mShowdesktopHandler = NULL;
1333 return true;
1334 }
1335
1336 return false;
1337}
1338
1339/* 300 ms */
1340const unsigned int UnityShowdesktopHandler::fade_time = 300;
1341CompWindowList UnityShowdesktopHandler::animating_windows (0);
1342
1343bool UnityShowdesktopHandler::shouldHide (CompWindow *w)
1344{
1345 if (w->overrideRedirect ())
1346 return false;
1347
1348 if (!w->managed ())
1349 return false;
1350
1351 if (w->grabbed ())
1352 return false;
1353
1354 if (w->wmType () & (CompWindowTypeDesktopMask |
1355 CompWindowTypeDockMask))
1356 return false;
1357
1358 if (w->state () & (CompWindowStateSkipPagerMask |
1359 CompWindowStateSkipTaskbarMask))
1360 return false;
1361
1362 if ((w->state () & CompWindowStateHiddenMask))
1363 if (!(w->inShowDesktopMode () || w->shaded ()))
1364 return false;
1365
1366 return true;
1367}
1368
1369guint32 UnityShowdesktopHandler::mInhibitingXid = 0;
1370
1371void
1372UnityShowdesktopHandler::inhibitLeaveShowdesktopMode (guint32 xid)
1373{
1374 if (!mInhibitingXid)
1375 mInhibitingXid = xid;
1376}
1377
1378void
1379UnityShowdesktopHandler::allowLeaveShowdesktopMode (guint32 xid)
1380{
1381 if (mInhibitingXid == xid)
1382 mInhibitingXid = 0;
1383}
1384
1385guint32
1386UnityShowdesktopHandler::inhibitingXid ()
1387{
1388 return mInhibitingXid;
1389}
1390
1391UnityShowdesktopHandler::UnityShowdesktopHandler (CompWindow *w) :
1392 mWindow (w),
1393 mRemover (new compiz::WindowInputRemover (screen->dpy (), w->id ())),
1394 mState (Visible),
1395 mProgress (0.0f)
1396{
1397}
1398
1399UnityShowdesktopHandler::~UnityShowdesktopHandler ()
1400{
1401 if (mRemover)
1402 delete mRemover;
1403}
1404
1405void UnityShowdesktopHandler::fadeOut ()
1406{
1407 mState = UnityShowdesktopHandler::FadeOut;
1408 mProgress = 1.0f;
1409
1410 mWasHidden = mWindow->state () & CompWindowStateHiddenMask;
1411
1412 if (!mWasHidden)
1413 {
1414 mWindow->changeState (mWindow->state () | CompWindowStateHiddenMask);
1415 mWindow->windowNotify (CompWindowNotifyHide);
1416 mRemover->save ();
1417 mRemover->remove ();
1418 }
1419
1420 CompositeWindow::get (mWindow)->addDamage ();
1421
1422 if (std::find (animating_windows.begin(),
1423 animating_windows.end(),
1424 mWindow) == animating_windows.end())
1425 animating_windows.push_back(mWindow);
1426}
1427
1428void UnityShowdesktopHandler::fadeIn ()
1429{
1430 mState = UnityShowdesktopHandler::FadeIn;
1431
1432 if (!mWasHidden)
1433 {
1434 mWindow->changeState (mWindow->state () & ~CompWindowStateHiddenMask);
1435 mWindow->windowNotify (CompWindowNotifyShow);
1436 mRemover->restore ();
1437 }
1438
1439 CompositeWindow::get (mWindow)->addDamage ();
1440}
1441
1442bool UnityShowdesktopHandler::animate (unsigned int ms)
1443{
1444 float inc = fade_time / (float) ms;
1445
1446 if (mState == UnityShowdesktopHandler::FadeOut)
1447 {
1448 mProgress -= inc;
1449 if (mProgress <= 0.0f)
1450 {
1451 mProgress = 0.0f;
1452 mState = Invisible;
1453 }
1454 else
1455 CompositeWindow::get (mWindow)->addDamage ();
1456 }
1457 else if (mState == FadeIn)
1458 {
1459 mProgress += inc;
1460 if (mProgress >= 1.0f)
1461 {
1462 mProgress = 1.0f;
1463 mState = Visible;
1464
1465 return true;
1466 }
1467 else
1468 CompositeWindow::get (mWindow)->addDamage ();
1469 }
1470
1471 return false;
1472}
1473
1474void UnityShowdesktopHandler::paintAttrib (GLWindowPaintAttrib &attrib)
1475{
1476 attrib.opacity = static_cast <int> (static_cast <float> (attrib.opacity) * mProgress);
1477}
1478
1479unsigned int UnityShowdesktopHandler::getPaintMask ()
1480{
1481 return 0;
1482}
1483
1484void UnityShowdesktopHandler::handleEvent (XEvent *event)
1485{
1486 /* Ignore sent events from the InputRemover */
1487 if (screen->XShape () && event->type ==
1488 screen->shapeEvent () + ShapeNotify &&
1489>>>>>>> MERGE-SOURCE
1215 !event->xany.send_event)1490 !event->xany.send_event)
1216 {1491 {
1217 if (mShowdesktopHandler)1492 if (mShowdesktopHandler)
@@ -1264,6 +1539,7 @@
1264{1539{
1265 bool ret;1540 bool ret;
12661541
1542<<<<<<< TREE
1267 /*1543 /*
1268 * Very important!1544 * Very important!
1269 * Don't waste GPU and CPU rendering the shell on every frame if you don't1545 * Don't waste GPU and CPU rendering the shell on every frame if you don't
@@ -1283,6 +1559,12 @@
1283 paint_panel_ = false;1559 paint_panel_ = false;
12841560
1285#ifndef USE_GLES1561#ifndef USE_GLES
1562=======
1563 doShellRepaint = true;
1564 allowWindowPaint = true;
1565 _last_output = output;
1566
1567>>>>>>> MERGE-SOURCE
1286 /* bind the framebuffer here1568 /* bind the framebuffer here
1287 * - it will be unbound and flushed1569 * - it will be unbound and flushed
1288 * to the backbuffer when some1570 * to the backbuffer when some
@@ -1292,6 +1574,7 @@
1292 * once an fbo is bound any further1574 * once an fbo is bound any further
1293 * attempts to bind it will only increment1575 * attempts to bind it will only increment
1294 * its bind reference so make sure that1576 * its bind reference so make sure that
1577<<<<<<< TREE
1295 * you always unbind as much as you bind1578 * you always unbind as much as you bind
1296 *1579 *
1297 * But NOTE: It is only safe to bind the FBO if !shellCouldBeHidden.1580 * But NOTE: It is only safe to bind the FBO if !shellCouldBeHidden.
@@ -1305,6 +1588,10 @@
1305 // CompRegion has no clear() method. So this is the fastest alternative.1588 // CompRegion has no clear() method. So this is the fastest alternative.
1306 fullscreenRegion = CompRegion();1589 fullscreenRegion = CompRegion();
1307 nuxRegion = CompRegion();1590 nuxRegion = CompRegion();
1591=======
1592 * you always unbind as much as you bind */
1593 _fbo->bind (nux::Geometry (output->x (), output->y (), output->width (), output->height ()));
1594>>>>>>> MERGE-SOURCE
13081595
1309 /* glPaintOutput is part of the opengl plugin, so we need the GLScreen base class. */1596 /* glPaintOutput is part of the opengl plugin, so we need the GLScreen base class. */
1310 ret = gScreen->glPaintOutput(attrib, transform, region, output, mask);1597 ret = gScreen->glPaintOutput(attrib, transform, region, output, mask);
@@ -1698,12 +1985,53 @@
1698 {1985 {
1699 wt->ProcessForeignEvent(event, NULL);1986 wt->ProcessForeignEvent(event, NULL);
1700 }1987 }
1988<<<<<<< TREE
1701}1989}
17021990
1703void UnityScreen::damageRegion(const CompRegion &region)1991void UnityScreen::damageRegion(const CompRegion &region)
1704{1992{
1705 compizDamageNux(region);1993 compizDamageNux(region);
1706 cScreen->damageRegion(region);1994 cScreen->damageRegion(region);
1995=======
1996
1997 if (event->type == cScreen->damageEvent() + XDamageNotify)
1998 {
1999 XDamageNotifyEvent *de = (XDamageNotifyEvent *) event;
2000 CompWindow* w = screen->findWindow (de->drawable);
2001 std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList();
2002 CompWindow* lastNWindow = screen->findWindow (xwns.back ());
2003 bool processDamage = true;
2004
2005 if (w)
2006 {
2007 if (!w->overrideRedirect () &&
2008 w->isViewable () &&
2009 !w->invisible ())
2010 {
2011
2012 for (; lastNWindow != NULL; lastNWindow = lastNWindow->next)
2013 {
2014 if (lastNWindow == w)
2015 {
2016 processDamage = false;
2017 break;
2018 }
2019 }
2020
2021 if (processDamage)
2022 {
2023 nux::Geometry damage (de->area.x, de->area.y, de->area.width, de->area.height);
2024
2025 const CompWindow::Geometry &geom = w->geometry ();
2026 damage.x += geom.x () + geom.border ();
2027 damage.y += geom.y () + geom.border ();
2028
2029 BackgroundEffectHelper::ProcessDamage(damage);
2030 }
2031 }
2032 }
2033 }
2034>>>>>>> MERGE-SOURCE
1707}2035}
17082036
1709void UnityScreen::handleCompizEvent(const char* plugin,2037void UnityScreen::handleCompizEvent(const char* plugin,
@@ -1908,6 +2236,7 @@
19082236
1909 // maybe check launcher position/hide state?2237 // maybe check launcher position/hide state?
19102238
2239<<<<<<< TREE
1911 WindowManager *wm = WindowManager::Default();2240 WindowManager *wm = WindowManager::Default();
1912 int monitor = wm->GetWindowMonitor(wm->GetActiveWindow());2241 int monitor = wm->GetWindowMonitor(wm->GetActiveWindow());
1913 nux::Geometry monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor);2242 nux::Geometry monitor_geo = UScreen::GetDefault()->GetMonitorGeometry(monitor);
@@ -1932,6 +2261,15 @@
1932 if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP))2261 if (!(results.size() == 1 && results[0]->GetIconType() == AbstractLauncherIcon::IconType::TYPE_DESKTOP))
1933 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);2262 switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, false, results);
19342263
2264=======
2265 int device = screen->outputDeviceForPoint (pointerX, pointerY);
2266 switcherController->SetWorkspace(nux::Geometry(screen->outputDevs()[device].x1() + 100,
2267 screen->outputDevs()[device].y1() + 100,
2268 screen->outputDevs()[device].width() - 200,
2269 screen->outputDevs()[device].height() - 200));
2270 switcherController->Show(SwitcherController::ALL, SwitcherController::FOCUS_ORDER, false, results);
2271 RaiseInputWindows();
2272>>>>>>> MERGE-SOURCE
1935 return true;2273 return true;
1936}2274}
19372275
@@ -2374,6 +2712,18 @@
2374 }2712 }
2375}2713}
23762714
2715void UnityScreen::RaiseInputWindows()
2716{
2717 std::vector<Window> const& xwns = nux::XInputWindow::NativeHandleList();
2718
2719 for (auto window : xwns)
2720 {
2721 CompWindow* cwin = screen->findWindow(window);
2722 if (cwin)
2723 cwin->raise();
2724 }
2725}
2726
2377/* detect occlusions2727/* detect occlusions
2378 *2728 *
2379 * core passes down the PAINT_WINDOW_OCCLUSION_DETECTION2729 * core passes down the PAINT_WINDOW_OCCLUSION_DETECTION
@@ -2958,7 +3308,14 @@
29583308
2959void UnityScreen::Relayout()3309void UnityScreen::Relayout()
2960{3310{
2961 nux::Geometry geometry (0, 0, screen->width (), screen->height ());3311<<<<<<< TREE
3312 nux::Geometry geometry (0, 0, screen->width (), screen->height ());
3313=======
3314 GdkRectangle rect;
3315 nux::Geometry lCurGeom;
3316 int panel_height = 24;
3317 nux::Geometry geometry (0, 0, screen->width (), screen->height ());
3318>>>>>>> MERGE-SOURCE
29623319
2963 if (!needsRelayout)3320 if (!needsRelayout)
2964 return;3321 return;
@@ -2966,8 +3323,13 @@
2966#ifndef USE_GLES3323#ifndef USE_GLES
2967 if (GL::fbo)3324 if (GL::fbo)
2968 {3325 {
3326<<<<<<< TREE
2969 uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));3327 uScreen->_fbo = ScreenEffectFramebufferObject::Ptr (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
2970 uScreen->_fbo->onScreenSizeChanged (geometry);3328 uScreen->_fbo->onScreenSizeChanged (geometry);
3329=======
3330 uScreen->_fbo.reset (new ScreenEffectFramebufferObject (glXGetProcAddressP, geometry));
3331 uScreen->_fbo->onScreenSizeChanged (geometry);
3332>>>>>>> MERGE-SOURCE
2971 }3333 }
2972#endif3334#endif
29733335
29743336
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2012-09-11 10:38:44 +0000
+++ plugins/unityshell/src/unityshell.h 2013-01-18 15:43:30 +0000
@@ -50,13 +50,71 @@
50#include "DebugDBusInterface.h"50#include "DebugDBusInterface.h"
51#include "SwitcherController.h"51#include "SwitcherController.h"
52#include "UBusWrapper.h"52#include "UBusWrapper.h"
53<<<<<<< TREE
53#include "UnityshellPrivate.h"54#include "UnityshellPrivate.h"
54#include "UnityShowdesktopHandler.h"55#include "UnityShowdesktopHandler.h"
55#ifndef USE_GLES56#ifndef USE_GLES
56#include "ScreenEffectFramebufferObject.h"57#include "ScreenEffectFramebufferObject.h"
57#endif58#endif
59=======
60#include <Nux/WindowThread.h>
61#include <sigc++/sigc++.h>
62#include <boost/shared_ptr.hpp>
63#include "ScreenEffectFramebufferObject.h"
64>>>>>>> MERGE-SOURCE
5865
59#include "compizminimizedwindowhandler.h"66#include "compizminimizedwindowhandler.h"
67<<<<<<< TREE
68=======
69#include <dlfcn.h>
70
71class UnityShowdesktopHandler
72{
73 public:
74
75 UnityShowdesktopHandler (CompWindow *w);
76 ~UnityShowdesktopHandler ();
77
78 typedef enum {
79 Visible = 0,
80 FadeOut = 1,
81 FadeIn = 2,
82 Invisible = 3
83 } State;
84
85public:
86
87 void fadeOut ();
88 void fadeIn ();
89 bool animate (unsigned int ms);
90 void paintAttrib (GLWindowPaintAttrib &attrib);
91 unsigned int getPaintMask ();
92 void handleEvent (XEvent *);
93 void windowNotify (CompWindowNotify n);
94 void updateFrameRegion (CompRegion &r);
95
96 UnityShowdesktopHandler::State state ();
97
98 static const unsigned int fade_time;
99 static CompWindowList animating_windows;
100 static bool shouldHide (CompWindow *);
101 static void inhibitLeaveShowdesktopMode (guint32 xid);
102 static void allowLeaveShowdesktopMode (guint32 xid);
103 static guint32 inhibitingXid ();
104
105private:
106
107 CompWindow *mWindow;
108 compiz::WindowInputRemover *mRemover;
109 UnityShowdesktopHandler::State mState;
110 float mProgress;
111 bool mWasHidden;
112 static guint32 mInhibitingXid;
113};
114
115
116
117>>>>>>> MERGE-SOURCE
60#include "BGHash.h"118#include "BGHash.h"
61#include <compiztoolbox/compiztoolbox.h>119#include <compiztoolbox/compiztoolbox.h>
62#include <dlfcn.h>120#include <dlfcn.h>
@@ -106,6 +164,8 @@
106164
107 void RaiseInputWindows();165 void RaiseInputWindows();
108166
167 void RaiseInputWindows();
168
109 void169 void
110 handleCompizEvent (const char *pluginName,170 handleCompizEvent (const char *pluginName,
111 const char *eventName,171 const char *eventName,
@@ -286,6 +346,7 @@
286 bool allowWindowPaint;346 bool allowWindowPaint;
287 bool _key_nav_mode_requested;347 bool _key_nav_mode_requested;
288 CompOutput* _last_output;348 CompOutput* _last_output;
349<<<<<<< TREE
289350
290 CompRegion nuxRegion;351 CompRegion nuxRegion;
291 CompRegion fullscreenRegion;352 CompRegion fullscreenRegion;
@@ -301,6 +362,18 @@
301 ScreenEffectFramebufferObject::Ptr _fbo;362 ScreenEffectFramebufferObject::Ptr _fbo;
302 GLuint _active_fbo;363 GLuint _active_fbo;
303#endif364#endif
365=======
366 CompWindowList _withRemovedNuxWindows;
367
368 DesktopLauncherIcon* switcher_desktop_icon;
369
370 GdkRectangle _primary_monitor;
371
372 unity::BGHash _bghash;
373
374 ScreenEffectFramebufferObject::Ptr _fbo;
375 GLuint _active_fbo;
376>>>>>>> MERGE-SOURCE
304377
305 bool queryForShader ();378 bool queryForShader ();
306379
@@ -326,6 +399,8 @@
326 ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP;399 ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP;
327#endif400#endif
328401
402 ScreenEffectFramebufferObject::GLXGetProcAddressProc glXGetProcAddressP;
403
329 friend class UnityWindow;404 friend class UnityWindow;
330};405};
331406
332407
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2012-11-12 12:20:38 +0000
+++ tests/CMakeLists.txt 2013-01-18 15:43:30 +0000
@@ -74,6 +74,445 @@
74 )74 )
75target_link_libraries (test-unit ${LIBS})75target_link_libraries (test-unit ${LIBS})
76add_dependencies (test-unit unity-core-${UNITY_API_VERSION})76add_dependencies (test-unit unity-core-${UNITY_API_VERSION})
77<<<<<<< TREE
78=======
79
80#
81# Standalone tests
82#
83add_executable (standalone-dash
84 standalone_dash.cpp
85 ${UNITY_SRC}/BackgroundEffectHelper.cpp
86 ${UNITY_SRC}/BackgroundEffectHelper.h
87 ${UNITY_SRC}/BGHash.cpp
88 ${UNITY_SRC}/BGHash.h
89 ${UNITY_SRC}/DashSearchBar.cpp
90 ${UNITY_SRC}/DashSearchBar.h
91 ${UNITY_SRC}/DashSearchBarSpinner.cpp
92 ${UNITY_SRC}/DashSearchBarSpinner.h
93 ${UNITY_SRC}/FilterExpanderLabel.cpp
94 ${UNITY_SRC}/FilterFactory.cpp
95 ${UNITY_SRC}/FilterBasicButton.cpp
96 ${UNITY_SRC}/FilterRatingsButton.cpp
97 ${UNITY_SRC}/FilterRatingsWidget.cpp
98 ${UNITY_SRC}/FilterMultiRangeWidget.cpp
99 ${UNITY_SRC}/FilterMultiRangeButton.cpp
100 ${UNITY_SRC}/FilterGenreButton.cpp
101 ${UNITY_SRC}/FilterGenreWidget.cpp
102 ${UNITY_SRC}/FilterBar.cpp
103 ${UNITY_SRC}/FontSettings.cpp
104 ${UNITY_SRC}/FontSettings.h
105 ${UNITY_SRC}/IMTextEntry.cpp
106 ${UNITY_SRC}/IMTextEntry.h
107 ${UNITY_SRC}/PlacesHomeView.cpp
108 ${UNITY_SRC}/PlacesHomeView.h
109 ${UNITY_SRC}/PlacesGroup.cpp
110 ${UNITY_SRC}/PlacesGroup.h
111 ${UNITY_SRC}/DashSettings.cpp
112 ${UNITY_SRC}/DashSettings.h
113 ${UNITY_SRC}/PlacesStyle.cpp
114 ${UNITY_SRC}/PlacesStyle.h
115 ${UNITY_SRC}/PlacesTile.cpp
116 ${UNITY_SRC}/PlacesTile.h
117 ${UNITY_SRC}/PlacesSimpleTile.cpp
118 ${UNITY_SRC}/PlacesSimpleTile.h
119 ${UNITY_SRC}/PlacesVScrollBar.cpp
120 ${UNITY_SRC}/PlacesVScrollBar.h
121 ${UNITY_SRC}/DashView.cpp
122 ${UNITY_SRC}/DashView.h
123 ${UNITY_SRC}/HomeView.cpp
124 ${UNITY_SRC}/HomeView.h
125 ${UNITY_SRC}/DashStyle.cpp
126 ${UNITY_SRC}/IconLoader.cpp
127 ${UNITY_SRC}/IconLoader.h
128 ${UNITY_SRC}/IconTexture.cpp
129 ${UNITY_SRC}/IconTexture.h
130 ${UNITY_SRC}/Introspectable.cpp
131 ${UNITY_SRC}/Introspectable.h
132 ${UNITY_SRC}/JSONParser.cpp
133 ${UNITY_SRC}/LensBar.cpp
134 ${UNITY_SRC}/LensBar.h
135 ${UNITY_SRC}/LensBarIcon.cpp
136 ${UNITY_SRC}/LensBarIcon.h
137 ${UNITY_SRC}/LensView.cpp
138 ${UNITY_SRC}/LensView.h
139 ${UNITY_SRC}/PreviewApplications.cpp
140 ${UNITY_SRC}/PreviewBase.cpp
141 ${UNITY_SRC}/PreviewBasicButton.cpp
142 ${UNITY_SRC}/ResultView.cpp
143 ${UNITY_SRC}/ResultViewGrid.cpp
144 ${UNITY_SRC}/ResultRenderer.cpp
145 ${UNITY_SRC}/ResultRendererTile.cpp
146 ${UNITY_SRC}/ResultRendererHorizontalTile.cpp
147 ${UNITY_SRC}/TextureCache.h
148 ${UNITY_SRC}/TextureCache.cpp
149 ${UNITY_SRC}/Timer.cpp
150 ${UNITY_SRC}/Timer.h
151 ${UNITY_SRC}/StaticCairoText.cpp
152 ${UNITY_SRC}/StaticCairoText.h
153 ${UNITY_SRC}/UBusMessages.h
154 ${UNITY_SRC}/UBusWrapper.cpp
155 ${UNITY_SRC}/UBusWrapper.h
156 ${UNITY_SRC}/ubus-server.cpp
157 ${UNITY_SRC}/ubus-server.h
158 ${UNITY_SRC}/UScreen.cpp
159 ${UNITY_SRC}/UScreen.h
160 )
161add_dependencies (standalone-dash unity-core-${UNITY_API_VERSION})
162
163
164#
165# Please use "standalone-$foo" naming convention for standalone tests
166#
167add_executable (test-panel
168 TestPanel.cpp
169 ${UNITY_SRC}/Animator.cpp
170 ${UNITY_SRC}/Animator.h
171 ${UNITY_SRC}/BackgroundEffectHelper.cpp
172 ${UNITY_SRC}/BackgroundEffectHelper.h
173 ${UNITY_SRC}/DashSettings.cpp
174 ${UNITY_SRC}/DashSettings.h
175 ${UNITY_SRC}/PanelStyle.cpp
176 ${UNITY_SRC}/PanelStyle.h
177 ${UNITY_SRC}/PanelView.cpp
178 ${UNITY_SRC}/PanelView.h
179 ${UNITY_SRC}/PanelIndicatorsView.cpp
180 ${UNITY_SRC}/PanelIndicatorsView.h
181 ${UNITY_SRC}/PanelIndicatorEntryView.cpp
182 ${UNITY_SRC}/PanelIndicatorEntryView.h
183 ${UNITY_SRC}/PanelTitlebarGrabAreaView.h
184 ${UNITY_SRC}/PanelTitlebarGrabAreaView.cpp
185 ${UNITY_SRC}/PanelTray.cpp
186 ${UNITY_SRC}/PanelTray.h
187 ${UNITY_SRC}/Introspectable.cpp
188 ${UNITY_SRC}/Introspectable.h
189 ${UNITY_SRC}/PanelMenuView.cpp
190 ${UNITY_SRC}/PanelMenuView.h
191 ${UNITY_SRC}/Timer.cpp
192 ${UNITY_SRC}/Timer.h
193 ${UNITY_SRC}/StaticCairoText.cpp
194 ${UNITY_SRC}/StaticCairoText.h
195 ${UNITY_SRC}/WindowButtons.cpp
196 ${UNITY_SRC}/WindowButtons.h
197 ${UNITY_SRC}/WindowManager.cpp
198 ${UNITY_SRC}/WindowManager.h
199 ${UNITY_SRC}/UScreen.cpp
200 ${UNITY_SRC}/UScreen.h
201 ${UNITY_SRC}/ubus-server.cpp
202 ${UNITY_SRC}/ubus-server.h
203 )
204add_dependencies (test-panel unity-core-${UNITY_API_VERSION})
205
206add_executable (test-switcher
207 TestSwitcher.cpp
208 ${UNITY_SRC}/AbstractLauncherIcon.h
209 ${UNITY_SRC}/AbstractIconRenderer.h
210 ${UNITY_SRC}/SwitcherController.cpp
211 ${UNITY_SRC}/SwitcherController.h
212 ${UNITY_SRC}/SwitcherModel.cpp
213 ${UNITY_SRC}/SwitcherModel.h
214 ${UNITY_SRC}/SwitcherView.cpp
215 ${UNITY_SRC}/SwitcherView.h
216 ${UNITY_SRC}/LayoutSystem.h
217 ${UNITY_SRC}/LayoutSystem.cpp
218 ${UNITY_SRC}/WindowManager.h
219 ${UNITY_SRC}/WindowManager.cpp
220 ${UNITY_SRC}/IconRenderer.cpp
221 ${UNITY_SRC}/IconRenderer.h
222 ${UNITY_SRC}/MockLauncherIcon.h
223 ${UNITY_SRC}/BackgroundEffectHelper.h
224 ${UNITY_SRC}/BackgroundEffectHelper.cpp
225 ${UNITY_SRC}/StaticCairoText.cpp
226 ${UNITY_SRC}/StaticCairoText.h
227 ${UNITY_SRC}/UBusMessages.h
228 ${UNITY_SRC}/ubus-server.cpp
229 ${UNITY_SRC}/ubus-server.h
230 )
231add_dependencies (test-switcher unity-core-${UNITY_API_VERSION})
232
233add_executable (test-launcher
234 TestLauncher.cpp
235 ${UNITY_SRC}/AbstractLauncherIcon.h
236 ${UNITY_SRC}/AbstractIconRenderer.h
237 ${UNITY_SRC}/LauncherIcon.cpp
238 ${UNITY_SRC}/LauncherIcon.h
239 ${UNITY_SRC}/SimpleLauncherIcon.cpp
240 ${UNITY_SRC}/SimpleLauncherIcon.h
241 ${UNITY_SRC}/BamfLauncherIcon.cpp
242 ${UNITY_SRC}/BamfLauncherIcon.h
243 ${UNITY_SRC}/BFBLauncherIcon.cpp
244 ${UNITY_SRC}/BFBLauncherIcon.h
245 ${UNITY_SRC}/SpacerLauncherIcon.cpp
246 ${UNITY_SRC}/SpacerLauncherIcon.h
247 ${UNITY_SRC}/DndData.cpp
248 ${UNITY_SRC}/DndData.h
249 ${UNITY_SRC}/TrashLauncherIcon.cpp
250 ${UNITY_SRC}/TrashLauncherIcon.h
251 ${UNITY_SRC}/DNDCollectionWindow.cpp
252 ${UNITY_SRC}/DNDCollectionWindow.h
253 ${UNITY_SRC}/DeviceLauncherIcon.cpp
254 ${UNITY_SRC}/DeviceLauncherIcon.h
255 ${UNITY_SRC}/DeviceLauncherSection.cpp
256 ${UNITY_SRC}/DeviceLauncherSection.h
257 ${UNITY_SRC}/DevicesSettings.cpp
258 ${UNITY_SRC}/DevicesSettings.h
259 ${UNITY_SRC}/FavoriteStore.cpp
260 ${UNITY_SRC}/FavoriteStore.h
261 ${UNITY_SRC}/FavoriteStoreGSettings.cpp
262 ${UNITY_SRC}/FavoriteStoreGSettings.h
263 ${UNITY_SRC}/LauncherEntryRemoteModel.cpp
264 ${UNITY_SRC}/LauncherEntryRemoteModel.h
265 ${UNITY_SRC}/LauncherEntryRemote.cpp
266 ${UNITY_SRC}/LauncherEntryRemote.h
267 ${UNITY_SRC}/LauncherController.cpp
268 ${UNITY_SRC}/LauncherController.h
269 ${UNITY_SRC}/LauncherModel.cpp
270 ${UNITY_SRC}/LauncherModel.h
271 ${UNITY_SRC}/Launcher.cpp
272 ${UNITY_SRC}/Launcher.h
273 ${UNITY_SRC}/LauncherHideMachine.cpp
274 ${UNITY_SRC}/LauncherHideMachine.h
275 ${UNITY_SRC}/LauncherHoverMachine.cpp
276 ${UNITY_SRC}/LauncherHoverMachine.h
277 ${UNITY_SRC}/LauncherDragWindow.cpp
278 ${UNITY_SRC}/LauncherDragWindow.h
279 ${UNITY_SRC}/GeisAdapter.cpp
280 ${UNITY_SRC}/GeisAdapter.h
281 ${UNITY_SRC}/WindowManager.h
282 ${UNITY_SRC}/WindowManager.cpp
283 ${UNITY_SRC}/IconRenderer.cpp
284 ${UNITY_SRC}/IconRenderer.h
285 ${UNITY_SRC}/Tooltip.cpp
286 ${UNITY_SRC}/Tooltip.h
287 ${UNITY_SRC}/BackgroundEffectHelper.h
288 ${UNITY_SRC}/BackgroundEffectHelper.cpp
289 ${UNITY_SRC}/StaticCairoText.cpp
290 ${UNITY_SRC}/StaticCairoText.h
291 ${UNITY_SRC}/Introspectable.cpp
292 ${UNITY_SRC}/Introspectable.h
293 ${UNITY_SRC}/QuicklistMenuItem.cpp
294 ${UNITY_SRC}/QuicklistMenuItem.h
295 ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
296 ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
297 ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
298 ${UNITY_SRC}/QuicklistMenuItemLabel.h
299 ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
300 ${UNITY_SRC}/QuicklistMenuItemRadio.h
301 ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
302 ${UNITY_SRC}/QuicklistMenuItemSeparator.h
303 ${UNITY_SRC}/QuicklistView.cpp
304 ${UNITY_SRC}/QuicklistView.h
305 ${UNITY_SRC}/QuicklistManager.cpp
306 ${UNITY_SRC}/QuicklistManager.h
307 ${UNITY_SRC}/UBusMessages.h
308 ${UNITY_SRC}/UBusWrapper.cpp
309 ${UNITY_SRC}/UBusWrapper.h
310 ${UNITY_SRC}/ubus-server.cpp
311 ${UNITY_SRC}/ubus-server.h
312 )
313add_dependencies (test-launcher unity-core-${UNITY_API_VERSION})
314
315add_executable (test-keyutil
316 TestKeyboardUtil.cpp
317 ${UNITY_SRC}/KeyboardUtil.h
318 ${UNITY_SRC}/KeyboardUtil.cpp
319 )
320add_dependencies (test-keyutil unity-core-${UNITY_API_VERSION})
321
322add_executable (test-quicklist
323 ui/TestQuicklist.cpp
324 ui/EventFaker.cpp
325 ui/EventFaker.h
326 ${UNITY_SRC}/Introspectable.cpp
327 ${UNITY_SRC}/Introspectable.h
328 ${UNITY_SRC}/QuicklistMenuItem.cpp
329 ${UNITY_SRC}/QuicklistMenuItem.h
330 ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
331 ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
332 ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
333 ${UNITY_SRC}/QuicklistMenuItemLabel.h
334 ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
335 ${UNITY_SRC}/QuicklistMenuItemRadio.h
336 ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
337 ${UNITY_SRC}/QuicklistMenuItemSeparator.h
338 ${UNITY_SRC}/QuicklistView.cpp
339 ${UNITY_SRC}/QuicklistView.h
340 ${UNITY_SRC}/ubus-server.cpp
341 ${UNITY_SRC}/ubus-server.h
342 )
343add_dependencies (test-quicklist unity-core-${UNITY_API_VERSION})
344
345add_executable (test-quicklist-visuals
346 ui/TestQuicklistVisuals.cpp
347 ui/EventFaker.cpp
348 ui/EventFaker.h
349 ${UNITY_SRC}/Introspectable.cpp
350 ${UNITY_SRC}/Introspectable.h
351 ${UNITY_SRC}/QuicklistMenuItem.cpp
352 ${UNITY_SRC}/QuicklistMenuItem.h
353 ${UNITY_SRC}/QuicklistMenuItemCheckmark.cpp
354 ${UNITY_SRC}/QuicklistMenuItemCheckmark.h
355 ${UNITY_SRC}/QuicklistMenuItemLabel.cpp
356 ${UNITY_SRC}/QuicklistMenuItemLabel.h
357 ${UNITY_SRC}/QuicklistMenuItemRadio.cpp
358 ${UNITY_SRC}/QuicklistMenuItemRadio.h
359 ${UNITY_SRC}/QuicklistMenuItemSeparator.cpp
360 ${UNITY_SRC}/QuicklistMenuItemSeparator.h
361 ${UNITY_SRC}/QuicklistView.cpp
362 ${UNITY_SRC}/QuicklistView.h
363 ${UNITY_SRC}/ubus-server.cpp
364 ${UNITY_SRC}/ubus-server.h
365 )
366add_dependencies (test-quicklist-visuals unity-core-${UNITY_API_VERSION})
367
368add_executable (test-filters
369 TestFilters.cpp
370 ${UNITY_SRC}/FilterExpanderLabel.cpp
371 ${UNITY_SRC}/FilterBasicButton.cpp
372 ${UNITY_SRC}/FilterRatingsButton.cpp
373 ${UNITY_SRC}/FilterRatingsWidget.cpp
374 ${UNITY_SRC}/FilterGenreButton.cpp
375 ${UNITY_SRC}/FilterGenreWidget.cpp
376 ${UNITY_SRC}/FilterMultiRangeButton.cpp
377 ${UNITY_SRC}/FilterMultiRangeWidget.cpp
378 ${UNITY_SRC}/DashStyle.cpp
379 ${UNITY_SRC}/JSONParser.cpp
380 ${UNITY_SRC}/PlacesStyle.cpp
381 ${UNITY_SRC}/PlacesStyle.h
382 )
383add_dependencies(test-filters unity-core-${UNITY_API_VERSION})
384
385add_executable (test-filter-bar
386 TestFilterBar.cpp
387 ${UNITY_SRC}/FilterExpanderLabel.cpp
388 ${UNITY_SRC}/FilterFactory.cpp
389 ${UNITY_SRC}/FilterBasicButton.cpp
390 ${UNITY_SRC}/FilterRatingsButton.cpp
391 ${UNITY_SRC}/FilterRatingsWidget.cpp
392 ${UNITY_SRC}/FilterMultiRangeWidget.cpp
393 ${UNITY_SRC}/FilterMultiRangeButton.cpp
394 ${UNITY_SRC}/FilterGenreButton.cpp
395 ${UNITY_SRC}/FilterGenreWidget.cpp
396 ${UNITY_SRC}/FilterBar.cpp
397 ${UNITY_SRC}/DashStyle.cpp
398 ${UNITY_SRC}/JSONParser.cpp
399 ${UNITY_SRC}/PlacesStyle.cpp
400 ${UNITY_SRC}/PlacesStyle.h
401 )
402add_dependencies(test-filter-bar unity-core-${UNITY_API_VERSION})
403
404add_executable (test-preview-applicaiton
405 TestPreviewApplications.cpp
406 ${UNITY_SRC}/PreviewApplications.cpp
407 ${UNITY_SRC}/PreviewBase.cpp
408 ${UNITY_SRC}/PreviewBasicButton.cpp
409 ${UNITY_SRC}/IconTexture.cpp
410 ${UNITY_SRC}/IconLoader.cpp
411 ${UNITY_SRC}/Introspectable.cpp
412 ${UNITY_SRC}/StaticCairoText.cpp
413 ${UNITY_SRC}/TextureCache.cpp
414 ${UNITY_SRC}/DashStyle.cpp
415 ${UNITY_SRC}/JSONParser.cpp
416 ${UNITY_SRC}/Timer.cpp
417 )
418add_dependencies(test-preview-applicaiton unity-core-${UNITY_API_VERSION})
419
420add_executable (test-preview-generic
421 TestPreviewGeneric.cpp
422 ${UNITY_SRC}/PreviewGeneric.cpp
423 ${UNITY_SRC}/PreviewBase.cpp
424 ${UNITY_SRC}/PreviewBasicButton.cpp
425 ${UNITY_SRC}/IconTexture.cpp
426 ${UNITY_SRC}/IconLoader.cpp
427 ${UNITY_SRC}/Introspectable.cpp
428 ${UNITY_SRC}/StaticCairoText.cpp
429 ${UNITY_SRC}/TextureCache.cpp
430 ${UNITY_SRC}/DashStyle.cpp
431 ${UNITY_SRC}/JSONParser.cpp
432 ${UNITY_SRC}/Timer.cpp
433 )
434add_dependencies(test-preview-generic unity-core-${UNITY_API_VERSION})
435
436add_executable (test-preview-music
437 TestPreviewMusic.cpp
438 ${UNITY_SRC}/PreviewBase.cpp
439 ${UNITY_SRC}/PreviewBasicButton.cpp
440 ${UNITY_SRC}/PreviewMusic.cpp
441 ${UNITY_SRC}/PreviewMusicTrack.cpp
442 ${UNITY_SRC}/PreviewMusicTrackWidget.cpp
443 ${UNITY_SRC}/IconTexture.cpp
444 ${UNITY_SRC}/IconLoader.cpp
445 ${UNITY_SRC}/Introspectable.cpp
446 ${UNITY_SRC}/StaticCairoText.cpp
447 ${UNITY_SRC}/TextureCache.cpp
448 ${UNITY_SRC}/DashStyle.cpp
449 ${UNITY_SRC}/JSONParser.cpp
450 ${UNITY_SRC}/Timer.cpp
451 )
452add_dependencies(test-preview-music unity-core-${UNITY_API_VERSION})
453
454add_executable (test-result-view
455 TestResultView.cpp
456 ${UNITY_SRC}/PlacesStyle.cpp
457 ${UNITY_SRC}/PlacesStyle.h
458 ${UNITY_SRC}/PreviewApplications.cpp
459 ${UNITY_SRC}/PreviewBase.cpp
460 ${UNITY_SRC}/PreviewBasicButton.cpp
461 ${UNITY_SRC}/ResultView.cpp
462 ${UNITY_SRC}/ResultViewGrid.cpp
463 ${UNITY_SRC}/ResultRenderer.cpp
464 ${UNITY_SRC}/ResultRendererTile.cpp
465 ${UNITY_SRC}/ResultRendererHorizontalTile.cpp
466 ${UNITY_SRC}/IconTexture.cpp
467 ${UNITY_SRC}/IconLoader.cpp
468 ${UNITY_SRC}/Introspectable.cpp
469 ${UNITY_SRC}/StaticCairoText.cpp
470 ${UNITY_SRC}/TextureCache.cpp
471 ${UNITY_SRC}/Timer.cpp
472 ${UNITY_SRC}/DashStyle.cpp
473 ${UNITY_SRC}/JSONParser.cpp
474 ${UNITY_SRC}/UBusMessages.h
475 ${UNITY_SRC}/UBusWrapper.cpp
476 ${UNITY_SRC}/UBusWrapper.h
477 ${UNITY_SRC}/ubus-server.cpp
478 ${UNITY_SRC}/ubus-server.h
479 )
480add_dependencies(test-result-view unity-core-${UNITY_API_VERSION})
481
482add_executable (test-dash-style
483 TestDashStyle.cpp
484 ${UNITY_SRC}/DashStyle.cpp
485 ${UNITY_SRC}/DashStyle.h
486 ${UNITY_SRC}/JSONParser.cpp
487 ${PLACES_COMMON_SOURCE}
488 )
489add_dependencies (test-dash-style unity-core-${UNITY_API_VERSION})
490
491add_executable (test-bg-hash
492 TestBGHash.cpp
493 ${UNITY_SRC}/BGHash.cpp
494 ${UNITY_SRC}/BGHash.h
495 ${UNITY_SRC}/ubus-server.cpp
496 ${UNITY_SRC}/ubus-server.h
497 )
498add_dependencies (test-bg-hash unity-core-${UNITY_API_VERSION})
499
500find_package (OpenGL)
501
502include_directories (${OPENGL_gl_INCDIRS})
503add_library (glfuncloader SHARED
504 ${CMAKE_CURRENT_SOURCE_DIR}/GLFuncLoader.cpp)
505add_dependencies (glfuncloader unity-core-${UNITY_API_VERSION})
506target_link_libraries (glfuncloader dl ${OPENGL_gl_LIBRARY})
507add_executable (screen-effect-fbo
508 TestScreenEffectFramebufferObject.cpp
509 ${UNITY_SRC}/ScreenEffectFramebufferObject.cpp
510 ${UNITY_SRC}/BackgroundEffectHelper.cpp)
511
512target_link_libraries (screen-effect-fbo glfuncloader ${OPENGL_gl_LIBRARY})
513add_dependencies (screen-effect-fbo unity-core-${UNITY_API_VERSION})
514
515>>>>>>> MERGE-SOURCE
77add_subdirectory (test-input-remover)516add_subdirectory (test-input-remover)
78add_subdirectory (test-minimize-window-handler)517add_subdirectory (test-minimize-window-handler)
79add_subdirectory (test-get-transients)518add_subdirectory (test-get-transients)
@@ -188,6 +627,11 @@
188 test_lens.cpp627 test_lens.cpp
189 test_main_dbus.cpp628 test_main_dbus.cpp
190 test_model.cpp629 test_model.cpp
630<<<<<<< TREE
631=======
632 test_texture_cache.cpp
633 test_time_util.cpp
634>>>>>>> MERGE-SOURCE
191 test_utils.h635 test_utils.h
192 test_ratings_filter.cpp636 test_ratings_filter.cpp
193 test_results.cpp637 test_results.cpp
194638
=== added file 'tests/GLFuncLoader.cpp'
--- tests/GLFuncLoader.cpp 1970-01-01 00:00:00 +0000
+++ tests/GLFuncLoader.cpp 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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 2013-01-18 15:43:30 +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
=== added file 'tests/test_time_util.cpp'
--- tests/test_time_util.cpp 1970-01-01 00:00:00 +0000
+++ tests/test_time_util.cpp 2013-01-18 15:43:30 +0000
@@ -0,0 +1,37 @@
1// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2/*
3* Copyright (C) 2012 Canonical Ltd
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License version 3 as
7* published by the Free Software Foundation.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with this program. If not, see <http://www.gnu.org/licenses/>.
16*
17* Authored by: Brandon Schaefer <brandon.schaefer@canonical.com>
18*
19*/
20
21
22#include <cinttypes>
23#include <gtest/gtest.h>
24#include "TimeUtil.h"
25
26using namespace testing;
27
28TEST(TestTimeUtil, Testin32BufferOverflow)
29{
30 struct timespec start, end;
31 unity::TimeUtil::SetTimeStruct(&start);
32 unity::TimeUtil::SetTimeStruct(&end);
33
34 end.tv_sec = start.tv_sec + INT32_MAX;
35
36 EXPECT_GT(unity::TimeUtil::TimeDelta(&end, &start), 0);
37}

Subscribers

People subscribed via source and target branches