Merge lp:~3v1n0/unity/fix-690143 into lp:unity
- fix-690143
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 1462 |
Proposed branch: | lp:~3v1n0/unity/fix-690143 |
Merge into: | lp:unity |
Diff against target: |
554 lines (+169/-33) 13 files modified
plugins/unityshell/src/AbstractIconRenderer.h (+2/-0) plugins/unityshell/src/BamfLauncherIcon.cpp (+40/-1) plugins/unityshell/src/BamfLauncherIcon.h (+1/-0) plugins/unityshell/src/IconRenderer.cpp (+5/-6) plugins/unityshell/src/Launcher.cpp (+52/-3) plugins/unityshell/src/Launcher.h (+7/-0) plugins/unityshell/src/PluginAdapter.cpp (+24/-0) plugins/unityshell/src/PluginAdapter.h (+3/-0) plugins/unityshell/src/WindowManager.cpp (+5/-0) plugins/unityshell/src/WindowManager.h (+6/-0) plugins/unityshell/src/compizminimizedwindowhandler.h (+14/-6) plugins/unityshell/src/unityshell.cpp (+1/-16) plugins/unityshell/unityshell.xml.in (+9/-1) |
To merge this branch: | bzr merge lp:~3v1n0/unity/fix-690143 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jason Smith (community) | Approve | ||
Review via email: mp+73430@code.launchpad.net |
This proposal supersedes a proposal from 2011-07-29.
Commit message
Description of the change
Proposal of merge resubmitted after the update of the branch against the newest unity trunk.
I never experienced the crash that Jason found on my test with this version (as I never found one with the previous one), and it also fixes a new bug introduced by the CompizMinimized
Old merge request message (still valid)
=======
Fixed bug #690143 as requested by the design team specifications.
To get this I had to get signals from Compiz related to the viewport switch, so to achive this and to keep the implementation clean, I decided to implement the new PluginAdapter signals compiz_
So now both Launcher and BamfLauncherIcon are listening to these signals to perform their operations. In particular BamfLauncherIcon uses it to check if, after a viewport switch (or a scale terminate), all the windows of the given Icon are viewable in the current workspace and to update the icon indicator accordingly.
Plus I decided to give also another Icon backlight coloring option, and after talking with JohnLea on #ayatana I also added two more options to the "Backlight Mode":
- Edge Illumination Toggles: illuminate only the edge of the icons linked to
- Backlight and Edge Illumination Toggles: illuminate the background of the
You can see a working example of the "Backlight and Edge Illumination Toggles" option on this screenshot [1].
[1] https:/
Jason Smith (jassmith) wrote : Posted in a previous version of this proposal | # |
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal | # |
Mhmhm... Maybe I've worked with a too old version but it was working fine. However I'll retry with the current trunk.
Thank you!
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal | # |
It seems to work fine here also after merging with upstream, so I'm waiting for a crash log to fix it.
Preview Diff
1 | === modified file 'plugins/unityshell/src/AbstractIconRenderer.h' | |||
2 | --- plugins/unityshell/src/AbstractIconRenderer.h 2011-08-24 22:30:37 +0000 | |||
3 | +++ plugins/unityshell/src/AbstractIconRenderer.h 2011-08-30 19:14:24 +0000 | |||
4 | @@ -54,6 +54,7 @@ | |||
5 | 54 | , running_arrow(false) | 54 | , running_arrow(false) |
6 | 55 | , running_colored(false) | 55 | , running_colored(false) |
7 | 56 | , running_on_viewport(false) | 56 | , running_on_viewport(false) |
8 | 57 | , draw_edge_only(false) | ||
9 | 57 | , active_arrow(false) | 58 | , active_arrow(false) |
10 | 58 | , active_colored(false) | 59 | , active_colored(false) |
11 | 59 | , skip(false) | 60 | , skip(false) |
12 | @@ -82,6 +83,7 @@ | |||
13 | 82 | bool running_arrow; | 83 | bool running_arrow; |
14 | 83 | bool running_colored; | 84 | bool running_colored; |
15 | 84 | bool running_on_viewport; | 85 | bool running_on_viewport; |
16 | 86 | bool draw_edge_only; | ||
17 | 85 | bool active_arrow; | 87 | bool active_arrow; |
18 | 86 | bool active_colored; | 88 | bool active_colored; |
19 | 87 | bool skip; | 89 | bool skip; |
20 | 88 | 90 | ||
21 | === modified file 'plugins/unityshell/src/BamfLauncherIcon.cpp' | |||
22 | --- plugins/unityshell/src/BamfLauncherIcon.cpp 2011-08-29 23:36:21 +0000 | |||
23 | +++ plugins/unityshell/src/BamfLauncherIcon.cpp 2011-08-30 19:14:24 +0000 | |||
24 | @@ -186,6 +186,8 @@ | |||
25 | 186 | this); | 186 | this); |
26 | 187 | 187 | ||
27 | 188 | WindowManager::Default()->window_minimized.connect(sigc::mem_fun(this, &BamfLauncherIcon::OnWindowMinimized)); | 188 | WindowManager::Default()->window_minimized.connect(sigc::mem_fun(this, &BamfLauncherIcon::OnWindowMinimized)); |
28 | 189 | WindowManager::Default()->compiz_screen_viewport_switch_ended.connect(sigc::mem_fun(this, &BamfLauncherIcon::OnViewPortSwitchEnded)); | ||
29 | 190 | WindowManager::Default()->terminate_expo.connect(sigc::mem_fun(this, &BamfLauncherIcon::OnViewPortSwitchEnded)); | ||
30 | 189 | IconManager->hidden_changed.connect(sigc::mem_fun(this, &BamfLauncherIcon::OnLauncherHiddenChanged)); | 191 | IconManager->hidden_changed.connect(sigc::mem_fun(this, &BamfLauncherIcon::OnLauncherHiddenChanged)); |
31 | 190 | 192 | ||
32 | 191 | // hack | 193 | // hack |
33 | @@ -290,6 +292,31 @@ | |||
34 | 290 | UpdateQuirkTimeDelayed(300, QUIRK_SHIMMER); | 292 | UpdateQuirkTimeDelayed(300, QUIRK_SHIMMER); |
35 | 291 | } | 293 | } |
36 | 292 | 294 | ||
37 | 295 | void BamfLauncherIcon::OnViewPortSwitchEnded() | ||
38 | 296 | { | ||
39 | 297 | bool any_on_current = false; | ||
40 | 298 | GList *children = bamf_view_get_children(BAMF_VIEW(m_App)); | ||
41 | 299 | |||
42 | 300 | for (GList *l = children; l; l = l->next) | ||
43 | 301 | { | ||
44 | 302 | BamfView *view = BAMF_VIEW(l->data); | ||
45 | 303 | |||
46 | 304 | if (BAMF_IS_WINDOW(view)) | ||
47 | 305 | { | ||
48 | 306 | Window xid = bamf_window_get_xid(BAMF_WINDOW(view)); | ||
49 | 307 | if (WindowManager::Default()->IsWindowOnCurrentDesktop(xid)) | ||
50 | 308 | { | ||
51 | 309 | any_on_current = true; | ||
52 | 310 | break; | ||
53 | 311 | } | ||
54 | 312 | } | ||
55 | 313 | } | ||
56 | 314 | |||
57 | 315 | SetHasWindowOnViewport(any_on_current); | ||
58 | 316 | |||
59 | 317 | g_list_free(children); | ||
60 | 318 | } | ||
61 | 319 | |||
62 | 293 | bool BamfLauncherIcon::IsSticky() | 320 | bool BamfLauncherIcon::IsSticky() |
63 | 294 | { | 321 | { |
64 | 295 | return bamf_view_is_sticky(BAMF_VIEW(m_App)); | 322 | return bamf_view_is_sticky(BAMF_VIEW(m_App)); |
65 | @@ -358,6 +385,8 @@ | |||
66 | 358 | BamfView* view; | 385 | BamfView* view; |
67 | 359 | bool owns = false; | 386 | bool owns = false; |
68 | 360 | 387 | ||
69 | 388 | if (!w) return owns; | ||
70 | 389 | |||
71 | 361 | children = bamf_view_get_children(BAMF_VIEW(m_App)); | 390 | children = bamf_view_get_children(BAMF_VIEW(m_App)); |
72 | 362 | 391 | ||
73 | 363 | for (l = children; l; l = l->next) | 392 | for (l = children; l; l = l->next) |
74 | @@ -546,16 +575,26 @@ | |||
75 | 546 | { | 575 | { |
76 | 547 | GList* children, *l; | 576 | GList* children, *l; |
77 | 548 | int count = 0; | 577 | int count = 0; |
78 | 578 | bool has_visible = false; | ||
79 | 579 | |||
80 | 549 | children = bamf_view_get_children(BAMF_VIEW(m_App)); | 580 | children = bamf_view_get_children(BAMF_VIEW(m_App)); |
81 | 550 | for (l = children; l; l = l->next) | 581 | for (l = children; l; l = l->next) |
82 | 551 | { | 582 | { |
83 | 552 | if (!BAMF_IS_WINDOW(l->data)) | 583 | if (!BAMF_IS_WINDOW(l->data)) |
84 | 553 | continue; | 584 | continue; |
85 | 585 | |||
86 | 586 | if (!has_visible) | ||
87 | 587 | { | ||
88 | 588 | Window xid = bamf_window_get_xid(BAMF_WINDOW(l->data)); | ||
89 | 589 | if (WindowManager::Default()->IsWindowOnCurrentDesktop(xid)) | ||
90 | 590 | has_visible = true; | ||
91 | 591 | } | ||
92 | 592 | |||
93 | 554 | count++; | 593 | count++; |
94 | 555 | } | 594 | } |
95 | 556 | 595 | ||
96 | 557 | SetRelatedWindows(count); | 596 | SetRelatedWindows(count); |
98 | 558 | SetHasWindowOnViewport(true); // FIXME | 597 | SetHasWindowOnViewport(has_visible); |
99 | 559 | 598 | ||
100 | 560 | g_list_free(children); | 599 | g_list_free(children); |
101 | 561 | } | 600 | } |
102 | 562 | 601 | ||
103 | === modified file 'plugins/unityshell/src/BamfLauncherIcon.h' | |||
104 | --- plugins/unityshell/src/BamfLauncherIcon.h 2011-08-29 23:36:21 +0000 | |||
105 | +++ plugins/unityshell/src/BamfLauncherIcon.h 2011-08-30 19:14:24 +0000 | |||
106 | @@ -108,6 +108,7 @@ | |||
107 | 108 | void EnsureMenuItemsReady(); | 108 | void EnsureMenuItemsReady(); |
108 | 109 | 109 | ||
109 | 110 | void OnWindowMinimized(guint32 xid); | 110 | void OnWindowMinimized(guint32 xid); |
110 | 111 | void OnViewPortSwitchEnded(); | ||
111 | 111 | bool OwnsWindow(Window w); | 112 | bool OwnsWindow(Window w); |
112 | 112 | 113 | ||
113 | 113 | const std::set<std::string>& GetSupportedTypes(); | 114 | const std::set<std::string>& GetSupportedTypes(); |
114 | 114 | 115 | ||
115 | === modified file 'plugins/unityshell/src/IconRenderer.cpp' | |||
116 | --- plugins/unityshell/src/IconRenderer.cpp 2011-08-25 18:55:57 +0000 | |||
117 | +++ plugins/unityshell/src/IconRenderer.cpp 2011-08-30 19:14:24 +0000 | |||
118 | @@ -408,7 +408,7 @@ | |||
119 | 408 | auto tile_transform = arg.icon->GetTransform(AbstractLauncherIcon::TRANSFORM_TILE); | 408 | auto tile_transform = arg.icon->GetTransform(AbstractLauncherIcon::TRANSFORM_TILE); |
120 | 409 | 409 | ||
121 | 410 | // draw tile | 410 | // draw tile |
123 | 411 | if (backlight_intensity > 0) | 411 | if (backlight_intensity > 0 && !arg.draw_edge_only) |
124 | 412 | { | 412 | { |
125 | 413 | RenderElement(GfxContext, | 413 | RenderElement(GfxContext, |
126 | 414 | arg, | 414 | arg, |
127 | @@ -778,13 +778,12 @@ | |||
128 | 778 | // markers are well outside screen bounds to start | 778 | // markers are well outside screen bounds to start |
129 | 779 | int markers [3] = {-100, -100, -100}; | 779 | int markers [3] = {-100, -100, -100}; |
130 | 780 | 780 | ||
132 | 781 | /*if (!arg.running_on_viewport) | 781 | if (!arg.running_on_viewport) |
133 | 782 | { | 782 | { |
136 | 783 | markers.push_back (markerCenter); | 783 | markers[0] = markerCenter; |
137 | 784 | texture = _arrow_empty_ltr; | 784 | texture = local::arrow_empty_ltr; |
138 | 785 | } | 785 | } |
141 | 786 | else*/ | 786 | else if (running == 1) |
140 | 787 | if (running == 1) | ||
142 | 788 | { | 787 | { |
143 | 789 | markers[0] = markerCenter; | 788 | markers[0] = markerCenter; |
144 | 790 | texture = local::arrow_ltr; | 789 | texture = local::arrow_ltr; |
145 | 791 | 790 | ||
146 | === modified file 'plugins/unityshell/src/Launcher.cpp' | |||
147 | --- plugins/unityshell/src/Launcher.cpp 2011-08-29 23:36:21 +0000 | |||
148 | +++ plugins/unityshell/src/Launcher.cpp 2011-08-30 19:14:24 +0000 | |||
149 | @@ -189,6 +189,8 @@ | |||
150 | 189 | plugin_adapter.initiate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged)); | 189 | plugin_adapter.initiate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged)); |
151 | 190 | plugin_adapter.terminate_spread.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged)); | 190 | plugin_adapter.terminate_spread.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged)); |
152 | 191 | plugin_adapter.terminate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged)); | 191 | plugin_adapter.terminate_expo.connect(sigc::mem_fun(this, &Launcher::OnPluginStateChanged)); |
153 | 192 | plugin_adapter.compiz_screen_viewport_switch_started.connect(sigc::mem_fun(this, &Launcher::OnViewPortSwitchStarted)); | ||
154 | 193 | plugin_adapter.compiz_screen_viewport_switch_ended.connect(sigc::mem_fun(this, &Launcher::OnViewPortSwitchEnded)); | ||
155 | 192 | 194 | ||
156 | 193 | GeisAdapter& adapter = *(GeisAdapter::Default()); | 195 | GeisAdapter& adapter = *(GeisAdapter::Default()); |
157 | 194 | adapter.drag_start.connect(sigc::mem_fun(this, &Launcher::OnDragStart)); | 196 | adapter.drag_start.connect(sigc::mem_fun(this, &Launcher::OnDragStart)); |
158 | @@ -895,7 +897,8 @@ | |||
159 | 895 | struct timespec starting_time = icon->GetQuirkTime(LauncherIcon::QUIRK_STARTING); | 897 | struct timespec starting_time = icon->GetQuirkTime(LauncherIcon::QUIRK_STARTING); |
160 | 896 | int starting_ms = TimeDelta(¤t, &starting_time); | 898 | int starting_ms = TimeDelta(¤t, &starting_time); |
161 | 897 | double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * STARTING_BLINK_LAMBDA), 0.0f, 1.0f); | 899 | double starting_progress = (double) CLAMP((float) starting_ms / (float)(ANIM_DURATION_LONG * STARTING_BLINK_LAMBDA), 0.0f, 1.0f); |
163 | 898 | return 0.5f + (float)(std::cos(M_PI * (_backlight_mode != BACKLIGHT_NORMAL ? 4.0f : 3.0f) * starting_progress)) * 0.5f; | 900 | double val = IsBackLightModeToggles() ? 3.0f : 4.0f; |
164 | 901 | return 0.5f + (float)(std::cos(M_PI * val * starting_progress)) * 0.5f; | ||
165 | 899 | } | 902 | } |
166 | 900 | 903 | ||
167 | 901 | float Launcher::IconStartingPulseValue(LauncherIcon* icon, struct timespec const& current) | 904 | float Launcher::IconStartingPulseValue(LauncherIcon* icon, struct timespec const& current) |
168 | @@ -931,7 +934,7 @@ | |||
169 | 931 | float backlight_strength; | 934 | float backlight_strength; |
170 | 932 | if (_backlight_mode == BACKLIGHT_ALWAYS_ON) | 935 | if (_backlight_mode == BACKLIGHT_ALWAYS_ON) |
171 | 933 | backlight_strength = BACKLIGHT_STRENGTH; | 936 | backlight_strength = BACKLIGHT_STRENGTH; |
173 | 934 | else if (_backlight_mode == BACKLIGHT_NORMAL) | 937 | else if (IsBackLightModeToggles()) |
174 | 935 | backlight_strength = BACKLIGHT_STRENGTH * running_progress; | 938 | backlight_strength = BACKLIGHT_STRENGTH * running_progress; |
175 | 936 | else | 939 | else |
176 | 937 | backlight_strength = 0.0f; | 940 | backlight_strength = 0.0f; |
177 | @@ -956,7 +959,7 @@ | |||
178 | 956 | result = backlight_strength; | 959 | result = backlight_strength; |
179 | 957 | if (_backlight_mode == BACKLIGHT_ALWAYS_ON) | 960 | if (_backlight_mode == BACKLIGHT_ALWAYS_ON) |
180 | 958 | result *= CLAMP(running_progress + IconStartingPulseValue(icon, current), 0.0f, 1.0f); | 961 | result *= CLAMP(running_progress + IconStartingPulseValue(icon, current), 0.0f, 1.0f); |
182 | 959 | else if (_backlight_mode == BACKLIGHT_NORMAL) | 962 | else if (IsBackLightModeToggles()) |
183 | 960 | result += (BACKLIGHT_STRENGTH - result) * (1.0f - IconStartingPulseValue(icon, current)); | 963 | result += (BACKLIGHT_STRENGTH - result) * (1.0f - IconStartingPulseValue(icon, current)); |
184 | 961 | else | 964 | else |
185 | 962 | result = 1.0f - CLAMP(running_progress + IconStartingPulseValue(icon, current), 0.0f, 1.0f); | 965 | result = 1.0f - CLAMP(running_progress + IconStartingPulseValue(icon, current), 0.0f, 1.0f); |
186 | @@ -992,6 +995,17 @@ | |||
187 | 992 | return result; | 995 | return result; |
188 | 993 | } | 996 | } |
189 | 994 | 997 | ||
190 | 998 | bool Launcher::IconDrawEdgeOnly(LauncherIcon* icon) | ||
191 | 999 | { | ||
192 | 1000 | if (_backlight_mode == BACKLIGHT_EDGE_TOGGLE) | ||
193 | 1001 | return true; | ||
194 | 1002 | |||
195 | 1003 | if (_backlight_mode == BACKLIGHT_NORMAL_EDGE_TOGGLE && !icon->HasWindowOnViewport()) | ||
196 | 1004 | return true; | ||
197 | 1005 | |||
198 | 1006 | return false; | ||
199 | 1007 | } | ||
200 | 1008 | |||
201 | 995 | void Launcher::SetupRenderArg(LauncherIcon* icon, struct timespec const& current, RenderArg& arg) | 1009 | void Launcher::SetupRenderArg(LauncherIcon* icon, struct timespec const& current, RenderArg& arg) |
202 | 996 | { | 1010 | { |
203 | 997 | arg.icon = icon; | 1011 | arg.icon = icon; |
204 | @@ -1000,6 +1014,7 @@ | |||
205 | 1000 | arg.running_arrow = icon->GetQuirk(LauncherIcon::QUIRK_RUNNING); | 1014 | arg.running_arrow = icon->GetQuirk(LauncherIcon::QUIRK_RUNNING); |
206 | 1001 | arg.running_colored = icon->GetQuirk(LauncherIcon::QUIRK_URGENT); | 1015 | arg.running_colored = icon->GetQuirk(LauncherIcon::QUIRK_URGENT); |
207 | 1002 | arg.running_on_viewport = icon->HasWindowOnViewport(); | 1016 | arg.running_on_viewport = icon->HasWindowOnViewport(); |
208 | 1017 | arg.draw_edge_only = IconDrawEdgeOnly(icon); | ||
209 | 1003 | arg.active_colored = false; | 1018 | arg.active_colored = false; |
210 | 1004 | arg.x_rotation = 0.0f; | 1019 | arg.x_rotation = 0.0f; |
211 | 1005 | arg.y_rotation = 0.0f; | 1020 | arg.y_rotation = 0.0f; |
212 | @@ -1653,6 +1668,28 @@ | |||
213 | 1653 | return; | 1668 | return; |
214 | 1654 | } | 1669 | } |
215 | 1655 | 1670 | ||
216 | 1671 | void | ||
217 | 1672 | Launcher::OnViewPortSwitchStarted() | ||
218 | 1673 | { | ||
219 | 1674 | /* | ||
220 | 1675 | * don't take into account window over launcher state during | ||
221 | 1676 | * the viewport switch as we can get false positives | ||
222 | 1677 | * (like switching to an empty viewport while grabbing a fullscreen window) | ||
223 | 1678 | */ | ||
224 | 1679 | _check_window_over_launcher = false; | ||
225 | 1680 | } | ||
226 | 1681 | |||
227 | 1682 | void | ||
228 | 1683 | Launcher::OnViewPortSwitchEnded() | ||
229 | 1684 | { | ||
230 | 1685 | /* | ||
231 | 1686 | * compute again the list of all window on the new viewport | ||
232 | 1687 | * to decide if we should or not hide the launcher | ||
233 | 1688 | */ | ||
234 | 1689 | _check_window_over_launcher = true; | ||
235 | 1690 | CheckWindowOverLauncher(); | ||
236 | 1691 | } | ||
237 | 1692 | |||
238 | 1656 | Launcher::LauncherHideMode Launcher::GetHideMode() | 1693 | Launcher::LauncherHideMode Launcher::GetHideMode() |
239 | 1657 | { | 1694 | { |
240 | 1658 | return _hidemode; | 1695 | return _hidemode; |
241 | @@ -1729,6 +1766,18 @@ | |||
242 | 1729 | return _backlight_mode; | 1766 | return _backlight_mode; |
243 | 1730 | } | 1767 | } |
244 | 1731 | 1768 | ||
245 | 1769 | bool Launcher::IsBackLightModeToggles() | ||
246 | 1770 | { | ||
247 | 1771 | switch (_backlight_mode) { | ||
248 | 1772 | case BACKLIGHT_NORMAL: | ||
249 | 1773 | case BACKLIGHT_EDGE_TOGGLE: | ||
250 | 1774 | case BACKLIGHT_NORMAL_EDGE_TOGGLE: | ||
251 | 1775 | return true; | ||
252 | 1776 | default: | ||
253 | 1777 | return false; | ||
254 | 1778 | } | ||
255 | 1779 | } | ||
256 | 1780 | |||
257 | 1732 | void | 1781 | void |
258 | 1733 | Launcher::SetLaunchAnimation(LaunchAnimation animation) | 1782 | Launcher::SetLaunchAnimation(LaunchAnimation animation) |
259 | 1734 | { | 1783 | { |
260 | 1735 | 1784 | ||
261 | === modified file 'plugins/unityshell/src/Launcher.h' | |||
262 | --- plugins/unityshell/src/Launcher.h 2011-08-29 23:36:21 +0000 | |||
263 | +++ plugins/unityshell/src/Launcher.h 2011-08-30 19:14:24 +0000 | |||
264 | @@ -99,6 +99,8 @@ | |||
265 | 99 | BACKLIGHT_ALWAYS_ON, | 99 | BACKLIGHT_ALWAYS_ON, |
266 | 100 | BACKLIGHT_NORMAL, | 100 | BACKLIGHT_NORMAL, |
267 | 101 | BACKLIGHT_ALWAYS_OFF, | 101 | BACKLIGHT_ALWAYS_OFF, |
268 | 102 | BACKLIGHT_EDGE_TOGGLE, | ||
269 | 103 | BACKLIGHT_NORMAL_EDGE_TOGGLE | ||
270 | 102 | } BacklightMode; | 104 | } BacklightMode; |
271 | 103 | 105 | ||
272 | 104 | Launcher(nux::BaseWindow* parent, NUX_FILE_LINE_PROTO); | 106 | Launcher(nux::BaseWindow* parent, NUX_FILE_LINE_PROTO); |
273 | @@ -140,6 +142,7 @@ | |||
274 | 140 | 142 | ||
275 | 141 | void SetBacklightMode(BacklightMode mode); | 143 | void SetBacklightMode(BacklightMode mode); |
276 | 142 | BacklightMode GetBacklightMode(); | 144 | BacklightMode GetBacklightMode(); |
277 | 145 | bool IsBackLightModeToggles(); | ||
278 | 143 | 146 | ||
279 | 144 | void SetLaunchAnimation(LaunchAnimation animation); | 147 | void SetLaunchAnimation(LaunchAnimation animation); |
280 | 145 | LaunchAnimation GetLaunchAnimation(); | 148 | LaunchAnimation GetLaunchAnimation(); |
281 | @@ -247,6 +250,9 @@ | |||
282 | 247 | 250 | ||
283 | 248 | void OnPluginStateChanged(); | 251 | void OnPluginStateChanged(); |
284 | 249 | 252 | ||
285 | 253 | void OnViewPortSwitchStarted(); | ||
286 | 254 | void OnViewPortSwitchEnded(); | ||
287 | 255 | |||
288 | 250 | static gboolean AnimationTimeout(gpointer data); | 256 | static gboolean AnimationTimeout(gpointer data); |
289 | 251 | static gboolean SuperShowLauncherTimeout(gpointer data); | 257 | static gboolean SuperShowLauncherTimeout(gpointer data); |
290 | 252 | static gboolean SuperHideLauncherTimeout(gpointer data); | 258 | static gboolean SuperHideLauncherTimeout(gpointer data); |
291 | @@ -266,6 +272,7 @@ | |||
292 | 266 | void OnDragWindowAnimCompleted(); | 272 | void OnDragWindowAnimCompleted(); |
293 | 267 | 273 | ||
294 | 268 | bool IconNeedsAnimation(LauncherIcon* icon, struct timespec const& current); | 274 | bool IconNeedsAnimation(LauncherIcon* icon, struct timespec const& current); |
295 | 275 | bool IconDrawEdgeOnly(LauncherIcon* icon); | ||
296 | 269 | bool AnimationInProgress(); | 276 | bool AnimationInProgress(); |
297 | 270 | 277 | ||
298 | 271 | void SetActionState(LauncherActionState actionstate); | 278 | void SetActionState(LauncherActionState actionstate); |
299 | 272 | 279 | ||
300 | === modified file 'plugins/unityshell/src/PluginAdapter.cpp' | |||
301 | --- plugins/unityshell/src/PluginAdapter.cpp 2011-08-29 23:36:21 +0000 | |||
302 | +++ plugins/unityshell/src/PluginAdapter.cpp 2011-08-30 19:14:24 +0000 | |||
303 | @@ -63,6 +63,7 @@ | |||
304 | 63 | { | 63 | { |
305 | 64 | _spread_state = false; | 64 | _spread_state = false; |
306 | 65 | _expo_state = false; | 65 | _expo_state = false; |
307 | 66 | _vp_switch_started = false; | ||
308 | 66 | 67 | ||
309 | 67 | _grab_show_action = 0; | 68 | _grab_show_action = 0; |
310 | 68 | _grab_hide_action = 0; | 69 | _grab_hide_action = 0; |
311 | @@ -190,6 +191,23 @@ | |||
312 | 190 | } | 191 | } |
313 | 191 | 192 | ||
314 | 192 | void | 193 | void |
315 | 194 | PluginAdapter::NotifyCompizEvent(const char* plugin, const char* event, CompOption::Vector& option) | ||
316 | 195 | { | ||
317 | 196 | if (g_strcmp0(event, "start_viewport_switch") == 0) | ||
318 | 197 | { | ||
319 | 198 | _vp_switch_started = true; | ||
320 | 199 | compiz_screen_viewport_switch_started.emit(); | ||
321 | 200 | } | ||
322 | 201 | else if (g_strcmp0(event, "end_viewport_switch") == 0) | ||
323 | 202 | { | ||
324 | 203 | _vp_switch_started = false; | ||
325 | 204 | compiz_screen_viewport_switch_ended.emit(); | ||
326 | 205 | } | ||
327 | 206 | |||
328 | 207 | compiz_event.emit(plugin, event, option); | ||
329 | 208 | } | ||
330 | 209 | |||
331 | 210 | void | ||
332 | 193 | MultiActionList::AddNewAction(CompAction* a, bool primary) | 211 | MultiActionList::AddNewAction(CompAction* a, bool primary) |
333 | 194 | { | 212 | { |
334 | 195 | if (std::find(m_ActionList.begin(), m_ActionList.end(), a) == m_ActionList.end()) | 213 | if (std::find(m_ActionList.begin(), m_ActionList.end(), a) == m_ActionList.end()) |
335 | @@ -785,6 +803,12 @@ | |||
336 | 785 | return m_Screen->grabbed(); | 803 | return m_Screen->grabbed(); |
337 | 786 | } | 804 | } |
338 | 787 | 805 | ||
339 | 806 | bool | ||
340 | 807 | PluginAdapter::IsViewPortSwitchStarted() | ||
341 | 808 | { | ||
342 | 809 | return _vp_switch_started; | ||
343 | 810 | } | ||
344 | 811 | |||
345 | 788 | void PluginAdapter::MaximizeIfBigEnough(CompWindow* window) | 812 | void PluginAdapter::MaximizeIfBigEnough(CompWindow* window) |
346 | 789 | { | 813 | { |
347 | 790 | XClassHint classHint; | 814 | XClassHint classHint; |
348 | 791 | 815 | ||
349 | === modified file 'plugins/unityshell/src/PluginAdapter.h' | |||
350 | --- plugins/unityshell/src/PluginAdapter.h 2011-08-29 23:36:21 +0000 | |||
351 | +++ plugins/unityshell/src/PluginAdapter.h 2011-08-30 19:14:24 +0000 | |||
352 | @@ -103,6 +103,7 @@ | |||
353 | 103 | void NotifyMoved(CompWindow* window, int x, int y); | 103 | void NotifyMoved(CompWindow* window, int x, int y); |
354 | 104 | void NotifyResized(CompWindow* window, int x, int y, int w, int h); | 104 | void NotifyResized(CompWindow* window, int x, int y, int w, int h); |
355 | 105 | void NotifyStateChange(CompWindow* window, unsigned int state, unsigned int last_state); | 105 | void NotifyStateChange(CompWindow* window, unsigned int state, unsigned int last_state); |
356 | 106 | void NotifyCompizEvent(const char* plugin, const char* event, CompOption::Vector& option); | ||
357 | 106 | 107 | ||
358 | 107 | void Decorate(guint32 xid); | 108 | void Decorate(guint32 xid); |
359 | 108 | void Undecorate(guint32 xid); | 109 | void Undecorate(guint32 xid); |
360 | @@ -126,6 +127,7 @@ | |||
361 | 126 | bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force); | 127 | bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force); |
362 | 127 | 128 | ||
363 | 128 | bool IsScreenGrabbed(); | 129 | bool IsScreenGrabbed(); |
364 | 130 | bool IsViewPortSwitchStarted(); | ||
365 | 129 | 131 | ||
366 | 130 | unsigned int GetWindowActiveNumber (guint32 xid); | 132 | unsigned int GetWindowActiveNumber (guint32 xid); |
367 | 131 | 133 | ||
368 | @@ -160,6 +162,7 @@ | |||
369 | 160 | 162 | ||
370 | 161 | bool _spread_state; | 163 | bool _spread_state; |
371 | 162 | bool _expo_state; | 164 | bool _expo_state; |
372 | 165 | bool _vp_switch_started; | ||
373 | 163 | 166 | ||
374 | 164 | CompAction* _grab_show_action; | 167 | CompAction* _grab_show_action; |
375 | 165 | CompAction* _grab_hide_action; | 168 | CompAction* _grab_hide_action; |
376 | 166 | 169 | ||
377 | === modified file 'plugins/unityshell/src/WindowManager.cpp' | |||
378 | --- plugins/unityshell/src/WindowManager.cpp 2011-08-29 23:36:21 +0000 | |||
379 | +++ plugins/unityshell/src/WindowManager.cpp 2011-08-30 19:14:24 +0000 | |||
380 | @@ -32,6 +32,11 @@ | |||
381 | 32 | return false; | 32 | return false; |
382 | 33 | } | 33 | } |
383 | 34 | 34 | ||
384 | 35 | bool IsViewPortSwitchStarted() | ||
385 | 36 | { | ||
386 | 37 | return false; | ||
387 | 38 | } | ||
388 | 39 | |||
389 | 35 | void ShowDesktop() | 40 | void ShowDesktop() |
390 | 36 | { | 41 | { |
391 | 37 | g_debug("%s", G_STRFUNC); | 42 | g_debug("%s", G_STRFUNC); |
392 | 38 | 43 | ||
393 | === modified file 'plugins/unityshell/src/WindowManager.h' | |||
394 | --- plugins/unityshell/src/WindowManager.h 2011-08-29 23:36:21 +0000 | |||
395 | +++ plugins/unityshell/src/WindowManager.h 2011-08-30 19:14:24 +0000 | |||
396 | @@ -25,6 +25,7 @@ | |||
397 | 25 | #include "Nux/WindowThread.h" | 25 | #include "Nux/WindowThread.h" |
398 | 26 | #include "NuxGraphics/GLWindowManager.h" | 26 | #include "NuxGraphics/GLWindowManager.h" |
399 | 27 | #include <gdk/gdkx.h> | 27 | #include <gdk/gdkx.h> |
400 | 28 | #include <core/core.h> | ||
401 | 28 | 29 | ||
402 | 29 | class WindowManager | 30 | class WindowManager |
403 | 30 | { | 31 | { |
404 | @@ -75,6 +76,7 @@ | |||
405 | 75 | virtual void Undecorate(guint32 xid) {}; | 76 | virtual void Undecorate(guint32 xid) {}; |
406 | 76 | 77 | ||
407 | 77 | virtual bool IsScreenGrabbed() = 0; | 78 | virtual bool IsScreenGrabbed() = 0; |
408 | 79 | virtual bool IsViewPortSwitchStarted() = 0; | ||
409 | 78 | 80 | ||
410 | 79 | void StartMove(guint32 id, int, int); | 81 | void StartMove(guint32 id, int, int); |
411 | 80 | 82 | ||
412 | @@ -113,6 +115,10 @@ | |||
413 | 113 | 115 | ||
414 | 114 | sigc::signal<void> compiz_screen_grabbed; | 116 | sigc::signal<void> compiz_screen_grabbed; |
415 | 115 | sigc::signal<void> compiz_screen_ungrabbed; | 117 | sigc::signal<void> compiz_screen_ungrabbed; |
416 | 118 | sigc::signal<void> compiz_screen_viewport_switch_started; | ||
417 | 119 | sigc::signal<void> compiz_screen_viewport_switch_ended; | ||
418 | 120 | |||
419 | 121 | sigc::signal<void, const char*, const char*, CompOption::Vector&> compiz_event; | ||
420 | 116 | 122 | ||
421 | 117 | private: | 123 | private: |
422 | 118 | Atom m_MoveResizeAtom; | 124 | Atom m_MoveResizeAtom; |
423 | 119 | 125 | ||
424 | === modified file 'plugins/unityshell/src/compizminimizedwindowhandler.h' | |||
425 | --- plugins/unityshell/src/compizminimizedwindowhandler.h 2011-08-24 17:01:08 +0000 | |||
426 | +++ plugins/unityshell/src/compizminimizedwindowhandler.h 2011-08-30 19:14:24 +0000 | |||
427 | @@ -1,3 +1,4 @@ | |||
428 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
429 | 1 | /* | 2 | /* |
430 | 2 | * Copyright (C) 2011 Canonical Ltd. | 3 | * Copyright (C) 2011 Canonical Ltd. |
431 | 3 | * | 4 | * |
432 | @@ -53,9 +54,7 @@ | |||
433 | 53 | void unminimize (); | 54 | void unminimize (); |
434 | 54 | 55 | ||
435 | 55 | static void setFunctions (bool keepMinimized); | 56 | static void setFunctions (bool keepMinimized); |
439 | 56 | static void handleCompizEvent (const char *, | 57 | static void handleCompizEvent (const char *, const char *, CompOption::Vector &); |
437 | 57 | const char *, | ||
438 | 58 | CompOption::Vector &); | ||
440 | 59 | static std::list<CompWindow *> minimizingWindows; | 58 | static std::list<CompWindow *> minimizingWindows; |
441 | 60 | 59 | ||
442 | 61 | typedef CompizMinimizedWindowHandler<Screen, Window> CompizMinimizedWindowHandler_complete; | 60 | typedef CompizMinimizedWindowHandler<Screen, Window> CompizMinimizedWindowHandler_complete; |
443 | @@ -67,6 +66,7 @@ | |||
444 | 67 | private: | 66 | private: |
445 | 68 | 67 | ||
446 | 69 | PrivateCompizMinimizedWindowHandler *priv; | 68 | PrivateCompizMinimizedWindowHandler *priv; |
447 | 69 | static bool handleEvents; | ||
448 | 70 | }; | 70 | }; |
449 | 71 | } | 71 | } |
450 | 72 | 72 | ||
451 | @@ -74,6 +74,9 @@ | |||
452 | 74 | CompWindowList compiz::CompizMinimizedWindowHandler<Screen, Window>::minimizingWindows; | 74 | CompWindowList compiz::CompizMinimizedWindowHandler<Screen, Window>::minimizingWindows; |
453 | 75 | 75 | ||
454 | 76 | template <typename Screen, typename Window> | 76 | template <typename Screen, typename Window> |
455 | 77 | bool compiz::CompizMinimizedWindowHandler<Screen, Window>::handleEvents = true; | ||
456 | 78 | |||
457 | 79 | template <typename Screen, typename Window> | ||
458 | 77 | compiz::CompizMinimizedWindowHandler<Screen, Window>::CompizMinimizedWindowHandler(CompWindow *w) : | 80 | compiz::CompizMinimizedWindowHandler<Screen, Window>::CompizMinimizedWindowHandler(CompWindow *w) : |
459 | 78 | MinimizedWindowHandler (screen->dpy (), w->id ()) | 81 | MinimizedWindowHandler (screen->dpy (), w->id ()) |
460 | 79 | { | 82 | { |
461 | @@ -121,7 +124,7 @@ | |||
462 | 121 | 124 | ||
463 | 122 | std::vector<unsigned int> transients = getTransients (); | 125 | std::vector<unsigned int> transients = getTransients (); |
464 | 123 | 126 | ||
466 | 124 | screen->handleCompizEventSetEnabled (Screen::get (screen), true); | 127 | handleEvents = true; |
467 | 125 | priv->mWindow->windowNotify (CompWindowNotifyMinimize); | 128 | priv->mWindow->windowNotify (CompWindowNotifyMinimize); |
468 | 126 | priv->mWindow->changeState (priv->mWindow->state () | CompWindowStateHiddenMask); | 129 | priv->mWindow->changeState (priv->mWindow->state () | CompWindowStateHiddenMask); |
469 | 127 | 130 | ||
470 | @@ -205,6 +208,9 @@ | |||
471 | 205 | const char *eventName, | 208 | const char *eventName, |
472 | 206 | CompOption::Vector &o) | 209 | CompOption::Vector &o) |
473 | 207 | { | 210 | { |
474 | 211 | if (!handleEvents) | ||
475 | 212 | return; | ||
476 | 213 | |||
477 | 208 | if (strncmp (pluginName, "animation", 9) == 0 && | 214 | if (strncmp (pluginName, "animation", 9) == 0 && |
478 | 209 | strncmp (eventName, "window_animation", 16) == 0) | 215 | strncmp (eventName, "window_animation", 16) == 0) |
479 | 210 | { | 216 | { |
480 | @@ -218,13 +224,15 @@ | |||
481 | 218 | minimizingWindows.push_back (w); | 224 | minimizingWindows.push_back (w); |
482 | 219 | else | 225 | else |
483 | 220 | minimizingWindows.remove (w); | 226 | minimizingWindows.remove (w); |
485 | 221 | } | 227 | } |
486 | 222 | } | 228 | } |
487 | 223 | } | 229 | } |
488 | 224 | 230 | ||
489 | 225 | if (!CompOption::getBoolOptionNamed (o, "active", false) && | 231 | if (!CompOption::getBoolOptionNamed (o, "active", false) && |
490 | 226 | minimizingWindows.empty ()) | 232 | minimizingWindows.empty ()) |
492 | 227 | screen->handleCompizEventSetEnabled (Screen::get (screen), false); | 233 | { |
493 | 234 | handleEvents = false; | ||
494 | 235 | } | ||
495 | 228 | } | 236 | } |
496 | 229 | 237 | ||
497 | 230 | template <typename Screen, typename Window> | 238 | template <typename Screen, typename Window> |
498 | 231 | 239 | ||
499 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
500 | --- plugins/unityshell/src/unityshell.cpp 2011-08-29 23:36:21 +0000 | |||
501 | +++ plugins/unityshell/src/unityshell.cpp 2011-08-30 19:14:24 +0000 | |||
502 | @@ -848,23 +848,8 @@ | |||
503 | 848 | const char* event, | 848 | const char* event, |
504 | 849 | CompOption::Vector& option) | 849 | CompOption::Vector& option) |
505 | 850 | { | 850 | { |
521 | 851 | /* | 851 | PluginAdapter::Default()->NotifyCompizEvent(plugin, event, option); |
507 | 852 | * don't take into account window over launcher state during | ||
508 | 853 | * the ws switch as we can get false positives | ||
509 | 854 | * (like switching to an empty viewport while grabbing a fullscreen window) | ||
510 | 855 | */ | ||
511 | 856 | if (strcmp(event, "start_viewport_switch") == 0) | ||
512 | 857 | launcher->EnableCheckWindowOverLauncher(false); | ||
513 | 858 | else if (strcmp(event, "end_viewport_switch") == 0) | ||
514 | 859 | { | ||
515 | 860 | // compute again the list of all window on the new viewport | ||
516 | 861 | // to decide if we should or not hide the launcher | ||
517 | 862 | launcher->EnableCheckWindowOverLauncher(true); | ||
518 | 863 | launcher->CheckWindowOverLauncher(); | ||
519 | 864 | } | ||
520 | 865 | |||
522 | 866 | compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>::handleCompizEvent (plugin, event, option); | 852 | compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>::handleCompizEvent (plugin, event, option); |
523 | 867 | |||
524 | 868 | screen->handleCompizEvent(plugin, event, option); | 853 | screen->handleCompizEvent(plugin, event, option); |
525 | 869 | } | 854 | } |
526 | 870 | 855 | ||
527 | 871 | 856 | ||
528 | === modified file 'plugins/unityshell/unityshell.xml.in' | |||
529 | --- plugins/unityshell/unityshell.xml.in 2011-08-26 22:31:20 +0000 | |||
530 | +++ plugins/unityshell/unityshell.xml.in 2011-08-30 19:14:24 +0000 | |||
531 | @@ -160,7 +160,7 @@ | |||
532 | 160 | <_short>Backlight Mode</_short> | 160 | <_short>Backlight Mode</_short> |
533 | 161 | <_long>Change how the icons are backlit</_long> | 161 | <_long>Change how the icons are backlit</_long> |
534 | 162 | <min>0</min> | 162 | <min>0</min> |
536 | 163 | <max>2</max> | 163 | <max>4</max> |
537 | 164 | <default>0</default> | 164 | <default>0</default> |
538 | 165 | <desc> | 165 | <desc> |
539 | 166 | <value>0</value> | 166 | <value>0</value> |
540 | @@ -174,6 +174,14 @@ | |||
541 | 174 | <value>2</value> | 174 | <value>2</value> |
542 | 175 | <_name>Backlight Always Off</_name> | 175 | <_name>Backlight Always Off</_name> |
543 | 176 | </desc> | 176 | </desc> |
544 | 177 | <desc> | ||
545 | 178 | <value>3</value> | ||
546 | 179 | <_name>Edge Illumination Toggles</_name> | ||
547 | 180 | </desc> | ||
548 | 181 | <desc> | ||
549 | 182 | <value>4</value> | ||
550 | 183 | <_name>Backlight and Edge Illumination Toggles</_name> | ||
551 | 184 | </desc> | ||
552 | 177 | </option> | 185 | </option> |
553 | 178 | <option name="launch_animation" type="int"> | 186 | <option name="launch_animation" type="int"> |
554 | 179 | <_short>Launch Animation</_short> | 187 | <_short>Launch Animation</_short> |
Crashes in current trunk