Merge lp:~gordallott/unity/lock-out-hud into lp:unity
- lock-out-hud
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~gordallott/unity/lock-out-hud |
Merge into: | lp:unity |
Diff against target: |
661 lines (+323/-57) 14 files modified
manual-tests/Hud.txt (+13/-0) plugins/unityshell/src/BFBLauncherIcon.cpp (+19/-0) plugins/unityshell/src/BFBLauncherIcon.h (+1/-0) plugins/unityshell/src/HudController.cpp (+33/-11) plugins/unityshell/src/HudController.h (+4/-0) plugins/unityshell/src/HudLauncherIcon.cpp (+115/-0) plugins/unityshell/src/HudLauncherIcon.h (+56/-0) plugins/unityshell/src/HudView.cpp (+27/-6) plugins/unityshell/src/HudView.h (+10/-1) plugins/unityshell/src/Launcher.cpp (+26/-32) plugins/unityshell/src/LauncherController.cpp (+2/-0) plugins/unityshell/src/LauncherHideMachine.cpp (+7/-7) plugins/unityshell/src/UBusMessages.h (+5/-0) plugins/unityshell/src/unityshell.cpp (+5/-0) |
To merge this branch: | bzr merge lp:~gordallott/unity/lock-out-hud |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Needs Fixing | ||
Mirco Müller | Pending | ||
Review via email: mp+97831@code.launchpad.net |
This proposal has been superseded by a proposal from 2012-03-21.
Commit message
Description of the change
Changes the behaviour of the HUD/Launcher interaction in HideMode: Never
= The Problem =
See: https:/
= The Fix =
Modify the Launcher to accept a new LauncherIcon that will listen to a UBUS message dictating its icon
= Testing =
Manual test included, lock-out behaviour is not included in out AP tests so ensuring a valid AP test seems non trivial at this point, requires an AP test module that can modify compiz options
Tim Penhey (thumper) wrote : | # |
Didier Roche-Tolomelli (didrocks) wrote : | # |
we want that for this release isn't it? can someone review it and merge it with the manual test if anyone has the AP test for it?
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
This has some conflicts with trunk, also you're using some lambda functions to connect to sigc::signal's, but in that case you need to disconnect from them in destructor or use a sigc::mem_fun instead (this doesn't apply to the ubus callback functions, of course).
Plus, I'm not sure if that's wanted, but if enabling the launcher's audohide feature, when closing the HUD, the launcher reveals and then closes again.
42 + if (!g_strcmp0(
Why not using overlay_
launcher_
I guess you can just pass [&] and please follow what said above. Even if the hud view shouldn't be destroyed, I guess it's better to stay safe.
Tim Penhey (thumper) wrote : | # |
As well as the launcher popping out when you close the hud, if you do the following:
press Alt
press Super
You get the dash with a hidden launcher.
Also, you get a peaking icon when you start the hud with a hidden launcher.
I'm fixing these now. I have a branch that fixes everything so far except making sure the icon saturation is right at the right time.
Tim Penhey (thumper) wrote : | # |
Also worth noting I guess, this branch doesn't fix the bug around the icon size for the hud when you don't have a fixed launcher.
Preview Diff
1 | === modified file 'manual-tests/Hud.txt' | |||
2 | --- manual-tests/Hud.txt 2012-02-12 18:23:18 +0000 | |||
3 | +++ manual-tests/Hud.txt 2012-03-16 10:27:23 +0000 | |||
4 | @@ -56,3 +56,16 @@ | |||
5 | 56 | After pressing escape in step three, the text "test" should be removed from the hud search | 56 | After pressing escape in step three, the text "test" should be removed from the hud search |
6 | 57 | After step four, the hud should dismiss itself and not be present. | 57 | After step four, the hud should dismiss itself and not be present. |
7 | 58 | 58 | ||
8 | 59 | |||
9 | 60 | Hud Reveal Behaviour | ||
10 | 61 | --------- | ||
11 | 62 | This test ensures that the hud behaves correctly with a locked out launcher | ||
12 | 63 | |||
13 | 64 | #. Ensure the launchers hide mode is set to "Never" | ||
14 | 65 | #. Tap Alt | ||
15 | 66 | |||
16 | 67 | Outcome | ||
17 | 68 | The Launcher should stick be locked out. | ||
18 | 69 | The Launcher icons should be desaturated. | ||
19 | 70 | The top most Launcher icon should be an icon related the the focused window | ||
20 | 71 | The BFB should not be present | ||
21 | 59 | 72 | ||
22 | === modified file 'plugins/unityshell/src/BFBLauncherIcon.cpp' | |||
23 | --- plugins/unityshell/src/BFBLauncherIcon.cpp 2012-02-22 08:53:20 +0000 | |||
24 | +++ plugins/unityshell/src/BFBLauncherIcon.cpp 2012-03-16 10:27:23 +0000 | |||
25 | @@ -45,6 +45,25 @@ | |||
26 | 45 | background_color_ = nux::color::White; | 45 | background_color_ = nux::color::White; |
27 | 46 | 46 | ||
28 | 47 | mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL); }); | 47 | mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL); }); |
29 | 48 | ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::bind(sigc::mem_fun(this, &BFBLauncherIcon::OnOverlayShown), true)); | ||
30 | 49 | ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::bind(sigc::mem_fun(this, &BFBLauncherIcon::OnOverlayShown), false)); | ||
31 | 50 | } | ||
32 | 51 | |||
33 | 52 | void BFBLauncherIcon::OnOverlayShown(GVariant *data, bool visible) | ||
34 | 53 | { | ||
35 | 54 | unity::glib::String overlay_identity; | ||
36 | 55 | gboolean can_maximise = FALSE; | ||
37 | 56 | gint32 overlay_monitor = 0; | ||
38 | 57 | g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, | ||
39 | 58 | &overlay_identity, &can_maximise, &overlay_monitor); | ||
40 | 59 | |||
41 | 60 | |||
42 | 61 | if (!g_strcmp0(overlay_identity, "hud")) | ||
43 | 62 | { | ||
44 | 63 | // if the hud is open, we hide the BFB | ||
45 | 64 | SetQuirk(QUIRK_VISIBLE, !visible); | ||
46 | 65 | EmitNeedsRedraw(); | ||
47 | 66 | } | ||
48 | 48 | } | 67 | } |
49 | 49 | 68 | ||
50 | 50 | nux::Color BFBLauncherIcon::BackgroundColor() | 69 | nux::Color BFBLauncherIcon::BackgroundColor() |
51 | 51 | 70 | ||
52 | === modified file 'plugins/unityshell/src/BFBLauncherIcon.h' | |||
53 | --- plugins/unityshell/src/BFBLauncherIcon.h 2012-02-22 08:53:20 +0000 | |||
54 | +++ plugins/unityshell/src/BFBLauncherIcon.h 2012-03-16 10:27:23 +0000 | |||
55 | @@ -47,6 +47,7 @@ | |||
56 | 47 | std::string GetName() const; | 47 | std::string GetName() const; |
57 | 48 | 48 | ||
58 | 49 | private: | 49 | private: |
59 | 50 | void OnOverlayShown(GVariant *data, bool visible); | ||
60 | 50 | static void OnMenuitemActivated(DbusmenuMenuitem* item, int time, gchar* lens); | 51 | static void OnMenuitemActivated(DbusmenuMenuitem* item, int time, gchar* lens); |
61 | 51 | 52 | ||
62 | 52 | static unity::UBusManager ubus_manager_; | 53 | static unity::UBusManager ubus_manager_; |
63 | 53 | 54 | ||
64 | === modified file 'plugins/unityshell/src/HudController.cpp' | |||
65 | --- plugins/unityshell/src/HudController.cpp 2012-03-09 15:38:35 +0000 | |||
66 | +++ plugins/unityshell/src/HudController.cpp 2012-03-16 10:27:23 +0000 | |||
67 | @@ -39,7 +39,7 @@ | |||
68 | 39 | } | 39 | } |
69 | 40 | 40 | ||
70 | 41 | Controller::Controller() | 41 | Controller::Controller() |
72 | 42 | : launcher_width(66) | 42 | : launcher_width(65) |
73 | 43 | , hud_service_("com.canonical.hud", "/com/canonical/hud") | 43 | , hud_service_("com.canonical.hud", "/com/canonical/hud") |
74 | 44 | , window_(nullptr) | 44 | , window_(nullptr) |
75 | 45 | , visible_(false) | 45 | , visible_(false) |
76 | @@ -47,6 +47,7 @@ | |||
77 | 47 | , timeline_id_(0) | 47 | , timeline_id_(0) |
78 | 48 | , last_opacity_(0.0f) | 48 | , last_opacity_(0.0f) |
79 | 49 | , start_time_(0) | 49 | , start_time_(0) |
80 | 50 | , launcher_is_locked_out_(false) | ||
81 | 50 | , view_(nullptr) | 51 | , view_(nullptr) |
82 | 51 | { | 52 | { |
83 | 52 | LOG_DEBUG(logger) << "hud startup"; | 53 | LOG_DEBUG(logger) << "hud startup"; |
84 | @@ -69,6 +70,8 @@ | |||
85 | 69 | } | 70 | } |
86 | 70 | }); | 71 | }); |
87 | 71 | 72 | ||
88 | 73 | launcher_width.changed.connect([this] (int new_width) { Relayout(); }); | ||
89 | 74 | |||
90 | 72 | PluginAdapter::Default()->compiz_screen_ungrabbed.connect(sigc::mem_fun(this, &Controller::OnScreenUngrabbed)); | 75 | PluginAdapter::Default()->compiz_screen_ungrabbed.connect(sigc::mem_fun(this, &Controller::OnScreenUngrabbed)); |
91 | 73 | 76 | ||
92 | 74 | hud_service_.queries_updated.connect(sigc::mem_fun(this, &Controller::OnQueriesFinished)); | 77 | hud_service_.queries_updated.connect(sigc::mem_fun(this, &Controller::OnQueriesFinished)); |
93 | @@ -154,17 +157,23 @@ | |||
94 | 154 | 157 | ||
95 | 155 | nux::Geometry Controller::GetIdealWindowGeometry() | 158 | nux::Geometry Controller::GetIdealWindowGeometry() |
96 | 156 | { | 159 | { |
100 | 157 | UScreen *uscreen = UScreen::GetDefault(); | 160 | UScreen *uscreen = UScreen::GetDefault(); |
101 | 158 | int primary_monitor = uscreen->GetMonitorWithMouse(); | 161 | int primary_monitor = uscreen->GetMonitorWithMouse(); |
102 | 159 | auto monitor_geo = uscreen->GetMonitorGeometry(primary_monitor); | 162 | auto monitor_geo = uscreen->GetMonitorGeometry(primary_monitor); |
103 | 160 | 163 | ||
111 | 161 | // We want to cover as much of the screen as possible to grab any mouse events outside | 164 | // We want to cover as much of the screen as possible to grab any mouse events outside |
112 | 162 | // of our window | 165 | // of our window |
113 | 163 | panel::Style &panel_style = panel::Style::Instance(); | 166 | panel::Style &panel_style = panel::Style::Instance(); |
114 | 164 | return nux::Geometry (monitor_geo.x, | 167 | nux::Geometry geo(monitor_geo.x, |
115 | 165 | monitor_geo.y + panel_style.panel_height, | 168 | monitor_geo.y + panel_style.panel_height, |
116 | 166 | monitor_geo.width, | 169 | monitor_geo.width, |
117 | 167 | monitor_geo.height - panel_style.panel_height); | 170 | monitor_geo.height - panel_style.panel_height); |
118 | 171 | if (launcher_is_locked_out_) | ||
119 | 172 | { | ||
120 | 173 | geo.x += launcher_width; | ||
121 | 174 | geo.width -= launcher_width; | ||
122 | 175 | } | ||
123 | 176 | return geo; | ||
124 | 168 | } | 177 | } |
125 | 169 | 178 | ||
126 | 170 | void Controller::Relayout(GdkScreen*screen) | 179 | void Controller::Relayout(GdkScreen*screen) |
127 | @@ -224,6 +233,16 @@ | |||
128 | 224 | return visible_; | 233 | return visible_; |
129 | 225 | } | 234 | } |
130 | 226 | 235 | ||
131 | 236 | void Controller::SetLauncherIsLockedOut(bool launcher_is_locked_out) | ||
132 | 237 | { | ||
133 | 238 | launcher_is_locked_out_ = launcher_is_locked_out; | ||
134 | 239 | if (launcher_is_locked_out_) | ||
135 | 240 | view_->SetHideIcon(IconHideState::HIDE); | ||
136 | 241 | else | ||
137 | 242 | view_->SetHideIcon(IconHideState::SHOW); | ||
138 | 243 | Relayout(); | ||
139 | 244 | } | ||
140 | 245 | |||
141 | 227 | void Controller::ShowHud() | 246 | void Controller::ShowHud() |
142 | 228 | { | 247 | { |
143 | 229 | PluginAdapter* adaptor = PluginAdapter::Default(); | 248 | PluginAdapter* adaptor = PluginAdapter::Default(); |
144 | @@ -248,6 +267,7 @@ | |||
145 | 248 | focused_app_icon_ = view_icon.Str(); | 267 | focused_app_icon_ = view_icon.Str(); |
146 | 249 | 268 | ||
147 | 250 | LOG_DEBUG(logger) << "Taking application icon: " << focused_app_icon_; | 269 | LOG_DEBUG(logger) << "Taking application icon: " << focused_app_icon_; |
148 | 270 | ubus.SendMessage(UBUS_HUD_ICON_CHANGED, g_variant_new_string(focused_app_icon_.c_str())); | ||
149 | 251 | view_->SetIcon(focused_app_icon_); | 271 | view_->SetIcon(focused_app_icon_); |
150 | 252 | 272 | ||
151 | 253 | window_->ShowWindow(true); | 273 | window_->ShowWindow(true); |
152 | @@ -398,6 +418,7 @@ | |||
153 | 398 | { | 418 | { |
154 | 399 | LOG_DEBUG(logger) << "Selected query, " << query->formatted_text; | 419 | LOG_DEBUG(logger) << "Selected query, " << query->formatted_text; |
155 | 400 | view_->SetIcon(query->icon_name); | 420 | view_->SetIcon(query->icon_name); |
156 | 421 | ubus.SendMessage(UBUS_HUD_ICON_CHANGED, g_variant_new_string(query->icon_name.c_str())); | ||
157 | 401 | } | 422 | } |
158 | 402 | 423 | ||
159 | 403 | 424 | ||
160 | @@ -416,6 +437,7 @@ | |||
161 | 416 | 437 | ||
162 | 417 | LOG_DEBUG(logger) << "setting icon to - " << icon_name; | 438 | LOG_DEBUG(logger) << "setting icon to - " << icon_name; |
163 | 418 | view_->SetIcon(icon_name); | 439 | view_->SetIcon(icon_name); |
164 | 440 | ubus.SendMessage(UBUS_HUD_ICON_CHANGED, g_variant_new_string(icon_name.c_str())); | ||
165 | 419 | } | 441 | } |
166 | 420 | 442 | ||
167 | 421 | // Introspectable | 443 | // Introspectable |
168 | 422 | 444 | ||
169 | === modified file 'plugins/unityshell/src/HudController.h' | |||
170 | --- plugins/unityshell/src/HudController.h 2012-02-12 14:47:39 +0000 | |||
171 | +++ plugins/unityshell/src/HudController.h 2012-03-16 10:27:23 +0000 | |||
172 | @@ -54,6 +54,8 @@ | |||
173 | 54 | void ShowHud(); | 54 | void ShowHud(); |
174 | 55 | void HideHud(bool restore_focus = true); | 55 | void HideHud(bool restore_focus = true); |
175 | 56 | bool IsVisible(); | 56 | bool IsVisible(); |
176 | 57 | void SetLauncherIsLockedOut(bool launcher_is_locked_out); | ||
177 | 58 | |||
178 | 57 | protected: | 59 | protected: |
179 | 58 | std::string GetName() const; | 60 | std::string GetName() const; |
180 | 59 | void AddProperties(GVariantBuilder* builder); | 61 | void AddProperties(GVariantBuilder* builder); |
181 | @@ -99,6 +101,8 @@ | |||
182 | 99 | guint timeline_id_; | 101 | guint timeline_id_; |
183 | 100 | float last_opacity_; | 102 | float last_opacity_; |
184 | 101 | gint64 start_time_; | 103 | gint64 start_time_; |
185 | 104 | |||
186 | 105 | bool launcher_is_locked_out_; | ||
187 | 102 | 106 | ||
188 | 103 | View* view_; | 107 | View* view_; |
189 | 104 | guint ensure_id_; | 108 | guint ensure_id_; |
190 | 105 | 109 | ||
191 | === added file 'plugins/unityshell/src/HudLauncherIcon.cpp' | |||
192 | --- plugins/unityshell/src/HudLauncherIcon.cpp 1970-01-01 00:00:00 +0000 | |||
193 | +++ plugins/unityshell/src/HudLauncherIcon.cpp 2012-03-16 10:27:23 +0000 | |||
194 | @@ -0,0 +1,115 @@ | |||
195 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
196 | 2 | /* | ||
197 | 3 | * Copyright (C) 2011 Canonical Ltd | ||
198 | 4 | * | ||
199 | 5 | * This program is free software: you can redistribute it and/or modify | ||
200 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
201 | 7 | * published by the Free Software Foundation. | ||
202 | 8 | * | ||
203 | 9 | * This program is distributed in the hope that it will be useful, | ||
204 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
205 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
206 | 12 | * GNU General Public License for more details. | ||
207 | 13 | * | ||
208 | 14 | * You should have received a copy of the GNU General Public License | ||
209 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
210 | 16 | * | ||
211 | 17 | * Authored by: Gordon Allott <gord.allott@canonical.com> | ||
212 | 18 | */ | ||
213 | 19 | |||
214 | 20 | #include "HudLauncherIcon.h" | ||
215 | 21 | #include "Launcher.h" | ||
216 | 22 | #include "UnityCore/GLibWrapper.h" | ||
217 | 23 | #include <NuxCore/Logger.h> | ||
218 | 24 | |||
219 | 25 | #include "UBusMessages.h" | ||
220 | 26 | |||
221 | 27 | #include <glib/gi18n-lib.h> | ||
222 | 28 | |||
223 | 29 | namespace unity | ||
224 | 30 | { | ||
225 | 31 | namespace launcher | ||
226 | 32 | { | ||
227 | 33 | |||
228 | 34 | namespace | ||
229 | 35 | { | ||
230 | 36 | nux::logging::Logger logger("unity.launcher.hudlaunchericon"); | ||
231 | 37 | } | ||
232 | 38 | |||
233 | 39 | UBusManager HudLauncherIcon::ubus_manager_; | ||
234 | 40 | |||
235 | 41 | HudLauncherIcon::HudLauncherIcon() | ||
236 | 42 | : SimpleLauncherIcon() | ||
237 | 43 | { | ||
238 | 44 | tooltip_text = _("HUD"); | ||
239 | 45 | icon_name = PKGDATADIR"/launcher_bfb.png"; | ||
240 | 46 | SetQuirk(QUIRK_VISIBLE, false); | ||
241 | 47 | SetQuirk(QUIRK_RUNNING, false); | ||
242 | 48 | SetQuirk(QUIRK_ACTIVE, true); | ||
243 | 49 | SetIconType(TYPE_HOME); | ||
244 | 50 | |||
245 | 51 | background_color_ = nux::color::White; | ||
246 | 52 | |||
247 | 53 | ubus_manager_.RegisterInterest(UBUS_HUD_ICON_CHANGED, [&](GVariant *data) | ||
248 | 54 | { | ||
249 | 55 | LOG_DEBUG(logger) << "Hud icon change: " << g_variant_get_string(data, NULL); | ||
250 | 56 | glib::String hud_icon_name(g_strdup(g_variant_get_string(data, NULL))); | ||
251 | 57 | if (!hud_icon_name.Str().empty() | ||
252 | 58 | && hud_icon_name.Str() != icon_name()) | ||
253 | 59 | { | ||
254 | 60 | icon_name = hud_icon_name.Str(); | ||
255 | 61 | EmitNeedsRedraw(); | ||
256 | 62 | } | ||
257 | 63 | }); | ||
258 | 64 | |||
259 | 65 | ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown), true)); | ||
260 | 66 | ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::bind(sigc::mem_fun(this, &HudLauncherIcon::OnOverlayShown), false)); | ||
261 | 67 | |||
262 | 68 | mouse_enter.connect([&](int m) { ubus_manager_.SendMessage(UBUS_DASH_ABOUT_TO_SHOW, NULL); }); | ||
263 | 69 | } | ||
264 | 70 | |||
265 | 71 | void HudLauncherIcon::OnOverlayShown(GVariant *data, bool visible) | ||
266 | 72 | { | ||
267 | 73 | unity::glib::String overlay_identity; | ||
268 | 74 | gboolean can_maximise = FALSE; | ||
269 | 75 | gint32 overlay_monitor = 0; | ||
270 | 76 | g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, | ||
271 | 77 | &overlay_identity, &can_maximise, &overlay_monitor); | ||
272 | 78 | |||
273 | 79 | |||
274 | 80 | if (!g_strcmp0(overlay_identity, "hud")) | ||
275 | 81 | { | ||
276 | 82 | SetQuirk(QUIRK_VISIBLE, visible); | ||
277 | 83 | EmitNeedsRedraw(); | ||
278 | 84 | } | ||
279 | 85 | } | ||
280 | 86 | |||
281 | 87 | nux::Color HudLauncherIcon::BackgroundColor() | ||
282 | 88 | { | ||
283 | 89 | return background_color_; | ||
284 | 90 | } | ||
285 | 91 | |||
286 | 92 | nux::Color HudLauncherIcon::GlowColor() | ||
287 | 93 | { | ||
288 | 94 | return background_color_; | ||
289 | 95 | } | ||
290 | 96 | |||
291 | 97 | void HudLauncherIcon::ActivateLauncherIcon(ActionArg arg) | ||
292 | 98 | { | ||
293 | 99 | // wut? activate? noo we don't do that. | ||
294 | 100 | } | ||
295 | 101 | |||
296 | 102 | std::list<DbusmenuMenuitem*> HudLauncherIcon::GetMenus() | ||
297 | 103 | { | ||
298 | 104 | std::list<DbusmenuMenuitem*> result; | ||
299 | 105 | return result; | ||
300 | 106 | } | ||
301 | 107 | |||
302 | 108 | std::string HudLauncherIcon::GetName() const | ||
303 | 109 | { | ||
304 | 110 | return "HudLauncherIcon"; | ||
305 | 111 | } | ||
306 | 112 | |||
307 | 113 | } // namespace launcher | ||
308 | 114 | } // namespace unity | ||
309 | 115 | |||
310 | 0 | 116 | ||
311 | === added file 'plugins/unityshell/src/HudLauncherIcon.h' | |||
312 | --- plugins/unityshell/src/HudLauncherIcon.h 1970-01-01 00:00:00 +0000 | |||
313 | +++ plugins/unityshell/src/HudLauncherIcon.h 2012-03-16 10:27:23 +0000 | |||
314 | @@ -0,0 +1,56 @@ | |||
315 | 1 | // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*- | ||
316 | 2 | /* | ||
317 | 3 | * Copyright (C) 2011 Canonical Ltd | ||
318 | 4 | * | ||
319 | 5 | * This program is free software: you can redistribute it and/or modify | ||
320 | 6 | * it under the terms of the GNU General Public License version 3 as | ||
321 | 7 | * published by the Free Software Foundation. | ||
322 | 8 | * | ||
323 | 9 | * This program is distributed in the hope that it will be useful, | ||
324 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
325 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
326 | 12 | * GNU General Public License for more details. | ||
327 | 13 | * | ||
328 | 14 | * You should have received a copy of the GNU General Public License | ||
329 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
330 | 16 | * | ||
331 | 17 | * Authored by: Gordon Allott <gord.allott@gmail.com> | ||
332 | 18 | */ | ||
333 | 19 | |||
334 | 20 | #ifndef UNITYSHELL_HUDLAUNCHERICON_H | ||
335 | 21 | #define UNITYSHELL_HUDLAUNCHERICON_H | ||
336 | 22 | |||
337 | 23 | #include "SimpleLauncherIcon.h" | ||
338 | 24 | #include "UBusWrapper.h" | ||
339 | 25 | |||
340 | 26 | namespace unity | ||
341 | 27 | { | ||
342 | 28 | namespace launcher | ||
343 | 29 | { | ||
344 | 30 | |||
345 | 31 | class HudLauncherIcon : public SimpleLauncherIcon | ||
346 | 32 | { | ||
347 | 33 | |||
348 | 34 | public: | ||
349 | 35 | HudLauncherIcon(); | ||
350 | 36 | |||
351 | 37 | virtual nux::Color BackgroundColor(); | ||
352 | 38 | virtual nux::Color GlowColor(); | ||
353 | 39 | |||
354 | 40 | void ActivateLauncherIcon(ActionArg arg); | ||
355 | 41 | |||
356 | 42 | protected: | ||
357 | 43 | std::list<DbusmenuMenuitem*> GetMenus(); | ||
358 | 44 | std::string GetName() const; | ||
359 | 45 | |||
360 | 46 | private: | ||
361 | 47 | void OnOverlayShown(GVariant *data, bool visible); | ||
362 | 48 | |||
363 | 49 | static unity::UBusManager ubus_manager_; | ||
364 | 50 | nux::Color background_color_; | ||
365 | 51 | }; | ||
366 | 52 | |||
367 | 53 | } | ||
368 | 54 | } | ||
369 | 55 | |||
370 | 56 | #endif // UNITYSHELL_HUDLAUNCHERICON_H | ||
371 | 0 | 57 | ||
372 | === modified file 'plugins/unityshell/src/HudView.cpp' | |||
373 | --- plugins/unityshell/src/HudView.cpp 2012-03-02 02:00:18 +0000 | |||
374 | +++ plugins/unityshell/src/HudView.cpp 2012-03-16 10:27:23 +0000 | |||
375 | @@ -64,6 +64,7 @@ | |||
376 | 64 | , current_height_(0) | 64 | , current_height_(0) |
377 | 65 | , timeline_need_more_draw_(false) | 65 | , timeline_need_more_draw_(false) |
378 | 66 | , selected_button_(0) | 66 | , selected_button_(0) |
379 | 67 | , icon_state_(IconHideState::SHOW) | ||
380 | 67 | { | 68 | { |
381 | 68 | renderer_.SetOwner(this); | 69 | renderer_.SetOwner(this); |
382 | 69 | renderer_.need_redraw.connect([this] () { | 70 | renderer_.need_redraw.connect([this] () { |
383 | @@ -185,7 +186,6 @@ | |||
384 | 185 | layout_->SetMinimumWidth(content_geo_.width); | 186 | layout_->SetMinimumWidth(content_geo_.width); |
385 | 186 | layout_->SetMaximumWidth(content_geo_.width); | 187 | layout_->SetMaximumWidth(content_geo_.width); |
386 | 187 | layout_->SetMaximumHeight(content_geo_.height); | 188 | layout_->SetMaximumHeight(content_geo_.height); |
387 | 188 | //layout_->SetMinMaxSize(content_geo_.width, content_geo_.height); | ||
388 | 189 | 189 | ||
389 | 190 | QueueDraw(); | 190 | QueueDraw(); |
390 | 191 | } | 191 | } |
391 | @@ -274,6 +274,22 @@ | |||
392 | 274 | QueueDraw(); | 274 | QueueDraw(); |
393 | 275 | } | 275 | } |
394 | 276 | 276 | ||
395 | 277 | void View::SetHideIcon(IconHideState hide_icon) | ||
396 | 278 | { | ||
397 | 279 | LOG_DEBUG(logger) << "Hide icon called"; | ||
398 | 280 | if (hide_icon == icon_state_) | ||
399 | 281 | return; | ||
400 | 282 | |||
401 | 283 | icon_state_ = hide_icon; | ||
402 | 284 | |||
403 | 285 | if (icon_state_ == IconHideState::HIDE) | ||
404 | 286 | layout_->RemoveChildObject(dynamic_cast<nux::Area*>(icon_layout_.GetPointer())); | ||
405 | 287 | else | ||
406 | 288 | layout_->AddLayout(icon_layout_.GetPointer(), 0, nux::MINOR_POSITION_TOP, nux::MINOR_SIZE_MATCHCONTENT, 100.0f, nux::LayoutPosition::NUX_LAYOUT_BEGIN); | ||
407 | 289 | |||
408 | 290 | Relayout(); | ||
409 | 291 | } | ||
410 | 292 | |||
411 | 277 | // Gives us the width and height of the contents that will give us the best "fit", | 293 | // Gives us the width and height of the contents that will give us the best "fit", |
412 | 278 | // which means that the icons/views will not have uneccessary padding, everything will | 294 | // which means that the icons/views will not have uneccessary padding, everything will |
413 | 279 | // look tight | 295 | // look tight |
414 | @@ -284,7 +300,12 @@ | |||
415 | 284 | int width, height = 0; | 300 | int width, height = 0; |
416 | 285 | width = 1024; | 301 | width = 1024; |
417 | 286 | height = 276; | 302 | height = 276; |
419 | 287 | 303 | ||
420 | 304 | if (icon_state_ == IconHideState::HIDE) | ||
421 | 305 | { | ||
422 | 306 | width -= icon_layout_->GetGeometry().width; | ||
423 | 307 | } | ||
424 | 308 | |||
425 | 288 | LOG_DEBUG (logger) << "best fit is, " << width << ", " << height; | 309 | LOG_DEBUG (logger) << "best fit is, " << width << ", " << height; |
426 | 289 | 310 | ||
427 | 290 | return nux::Geometry(0, 0, width, height); | 311 | return nux::Geometry(0, 0, width, height); |
428 | @@ -324,11 +345,11 @@ | |||
429 | 324 | { | 345 | { |
430 | 325 | // fill icon layout with icon | 346 | // fill icon layout with icon |
431 | 326 | icon_ = new Icon("", icon_size, true); | 347 | icon_ = new Icon("", icon_size, true); |
433 | 327 | nux::Layout* icon_layout = new nux::VLayout(); | 348 | icon_layout_ = new nux::VLayout(); |
434 | 328 | { | 349 | { |
438 | 329 | icon_layout->SetVerticalExternalMargin(icon_vertical_margin); | 350 | icon_layout_->SetVerticalExternalMargin(icon_vertical_margin); |
439 | 330 | icon_layout->AddView(icon_.GetPointer(), 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL); | 351 | icon_layout_->AddView(icon_.GetPointer(), 0, nux::MINOR_POSITION_LEFT, nux::MINOR_SIZE_FULL); |
440 | 331 | layout_->AddLayout(icon_layout, 0, nux::MINOR_POSITION_TOP, nux::MINOR_SIZE_MATCHCONTENT); | 352 | layout_->AddLayout(icon_layout_.GetPointer(), 0, nux::MINOR_POSITION_TOP, nux::MINOR_SIZE_MATCHCONTENT); |
441 | 332 | } | 353 | } |
442 | 333 | 354 | ||
443 | 334 | // add padding to layout between icon and content | 355 | // add padding to layout between icon and content |
444 | 335 | 356 | ||
445 | === modified file 'plugins/unityshell/src/HudView.h' | |||
446 | --- plugins/unityshell/src/HudView.h 2012-03-02 02:00:18 +0000 | |||
447 | +++ plugins/unityshell/src/HudView.h 2012-03-16 10:27:23 +0000 | |||
448 | @@ -44,6 +44,12 @@ | |||
449 | 44 | namespace hud | 44 | namespace hud |
450 | 45 | { | 45 | { |
451 | 46 | 46 | ||
452 | 47 | enum IconHideState | ||
453 | 48 | { | ||
454 | 49 | HIDE, | ||
455 | 50 | SHOW | ||
456 | 51 | }; | ||
457 | 52 | |||
458 | 47 | class View : public nux::View, public unity::debug::Introspectable | 53 | class View : public nux::View, public unity::debug::Introspectable |
459 | 48 | { | 54 | { |
460 | 49 | NUX_DECLARE_OBJECT_TYPE(HudView, nux::View); | 55 | NUX_DECLARE_OBJECT_TYPE(HudView, nux::View); |
461 | @@ -59,7 +65,8 @@ | |||
462 | 59 | 65 | ||
463 | 60 | void SetQueries(Hud::Queries queries); | 66 | void SetQueries(Hud::Queries queries); |
464 | 61 | void SetIcon(std::string icon_name); | 67 | void SetIcon(std::string icon_name); |
466 | 62 | 68 | void SetHideIcon(IconHideState hide_icon); | |
467 | 69 | |||
468 | 63 | void AboutToShow(); | 70 | void AboutToShow(); |
469 | 64 | void AboutToHide(); | 71 | void AboutToHide(); |
470 | 65 | 72 | ||
471 | @@ -104,6 +111,7 @@ | |||
472 | 104 | //FIXME - replace with dash search bar once modifications to dash search bar land | 111 | //FIXME - replace with dash search bar once modifications to dash search bar land |
473 | 105 | SearchBar::Ptr search_bar_; | 112 | SearchBar::Ptr search_bar_; |
474 | 106 | Icon::Ptr icon_; | 113 | Icon::Ptr icon_; |
475 | 114 | nux::ObjectPtr<nux::Layout> icon_layout_; | ||
476 | 107 | bool visible_; | 115 | bool visible_; |
477 | 108 | 116 | ||
478 | 109 | Hud::Queries queries_; | 117 | Hud::Queries queries_; |
479 | @@ -118,6 +126,7 @@ | |||
480 | 118 | int current_height_; | 126 | int current_height_; |
481 | 119 | bool timeline_need_more_draw_; | 127 | bool timeline_need_more_draw_; |
482 | 120 | int selected_button_; | 128 | int selected_button_; |
483 | 129 | IconHideState icon_state_; | ||
484 | 121 | }; | 130 | }; |
485 | 122 | 131 | ||
486 | 123 | 132 | ||
487 | 124 | 133 | ||
488 | === modified file 'plugins/unityshell/src/Launcher.cpp' | |||
489 | --- plugins/unityshell/src/Launcher.cpp 2012-03-13 17:20:30 +0000 | |||
490 | +++ plugins/unityshell/src/Launcher.cpp 2012-03-16 10:27:23 +0000 | |||
491 | @@ -1320,19 +1320,16 @@ | |||
492 | 1320 | &overlay_identity, &can_maximise, &overlay_monitor); | 1320 | &overlay_identity, &can_maximise, &overlay_monitor); |
493 | 1321 | 1321 | ||
494 | 1322 | 1322 | ||
496 | 1323 | if (!g_strcmp0(overlay_identity, "dash")) | 1323 | if (overlay_monitor == monitor) |
497 | 1324 | { | 1324 | { |
509 | 1325 | if (overlay_monitor == monitor) | 1325 | LauncherModel::iterator it; |
510 | 1326 | { | 1326 | |
511 | 1327 | LauncherModel::iterator it; | 1327 | _dash_is_open = true; |
512 | 1328 | 1328 | bg_effect_helper_.enabled = true; | |
513 | 1329 | _dash_is_open = true; | 1329 | _hide_machine->SetQuirk(LauncherHideMachine::PLACES_VISIBLE, true); |
514 | 1330 | bg_effect_helper_.enabled = true; | 1330 | _hover_machine->SetQuirk(LauncherHoverMachine::PLACES_VISIBLE, true); |
515 | 1331 | _hide_machine->SetQuirk(LauncherHideMachine::PLACES_VISIBLE, true); | 1331 | |
516 | 1332 | _hover_machine->SetQuirk(LauncherHoverMachine::PLACES_VISIBLE, true); | 1332 | DesaturateIcons(); |
506 | 1333 | |||
507 | 1334 | DesaturateIcons(); | ||
508 | 1335 | } | ||
517 | 1336 | } | 1333 | } |
518 | 1337 | } | 1334 | } |
519 | 1338 | 1335 | ||
520 | @@ -1345,26 +1342,23 @@ | |||
521 | 1345 | g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, | 1342 | g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, |
522 | 1346 | &overlay_identity, &can_maximise, &overlay_monitor); | 1343 | &overlay_identity, &can_maximise, &overlay_monitor); |
523 | 1347 | 1344 | ||
544 | 1348 | if (!g_strcmp0(overlay_identity, "dash")) | 1345 | if (!_dash_is_open) |
545 | 1349 | { | 1346 | return; |
546 | 1350 | if (!_dash_is_open) | 1347 | |
547 | 1351 | return; | 1348 | LauncherModel::iterator it; |
548 | 1352 | 1349 | ||
549 | 1353 | LauncherModel::iterator it; | 1350 | _dash_is_open = false; |
550 | 1354 | 1351 | bg_effect_helper_.enabled = false; | |
551 | 1355 | _dash_is_open = false; | 1352 | _hide_machine->SetQuirk(LauncherHideMachine::PLACES_VISIBLE, false); |
552 | 1356 | bg_effect_helper_.enabled = false; | 1353 | _hover_machine->SetQuirk(LauncherHoverMachine::PLACES_VISIBLE, false); |
553 | 1357 | _hide_machine->SetQuirk(LauncherHideMachine::PLACES_VISIBLE, false); | 1354 | |
554 | 1358 | _hover_machine->SetQuirk(LauncherHoverMachine::PLACES_VISIBLE, false); | 1355 | // as the leave event is no more received when the place is opened |
555 | 1359 | 1356 | // FIXME: remove when we change the mouse grab strategy in nux | |
556 | 1360 | // as the leave event is no more received when the place is opened | 1357 | nux::Point pt = nux::GetWindowCompositor().GetMousePosition(); |
557 | 1361 | // FIXME: remove when we change the mouse grab strategy in nux | 1358 | |
558 | 1362 | nux::Point pt = nux::GetWindowCompositor().GetMousePosition(); | 1359 | SetStateMouseOverLauncher(GetAbsoluteGeometry().IsInside(pt)); |
559 | 1363 | 1360 | ||
560 | 1364 | SetStateMouseOverLauncher(GetAbsoluteGeometry().IsInside(pt)); | 1361 | SaturateIcons(); |
541 | 1365 | |||
542 | 1366 | SaturateIcons(); | ||
543 | 1367 | } | ||
561 | 1368 | } | 1362 | } |
562 | 1369 | 1363 | ||
563 | 1370 | void Launcher::OnActionDone(GVariant* data) | 1364 | void Launcher::OnActionDone(GVariant* data) |
564 | 1371 | 1365 | ||
565 | === modified file 'plugins/unityshell/src/LauncherController.cpp' | |||
566 | --- plugins/unityshell/src/LauncherController.cpp 2012-03-14 23:22:02 +0000 | |||
567 | +++ plugins/unityshell/src/LauncherController.cpp 2012-03-16 10:27:23 +0000 | |||
568 | @@ -32,6 +32,7 @@ | |||
569 | 32 | #include "DeviceLauncherIcon.h" | 32 | #include "DeviceLauncherIcon.h" |
570 | 33 | #include "DeviceLauncherSection.h" | 33 | #include "DeviceLauncherSection.h" |
571 | 34 | #include "FavoriteStore.h" | 34 | #include "FavoriteStore.h" |
572 | 35 | #include "HudLauncherIcon.h" | ||
573 | 35 | #include "Launcher.h" | 36 | #include "Launcher.h" |
574 | 36 | #include "LauncherController.h" | 37 | #include "LauncherController.h" |
575 | 37 | #include "LauncherEntryRemote.h" | 38 | #include "LauncherEntryRemote.h" |
576 | @@ -233,6 +234,7 @@ | |||
577 | 233 | FavoriteStore::GetDefault().reordered.connect(sigc::mem_fun(this, &Impl::OnFavoriteStoreReordered)); | 234 | FavoriteStore::GetDefault().reordered.connect(sigc::mem_fun(this, &Impl::OnFavoriteStoreReordered)); |
578 | 234 | 235 | ||
579 | 235 | RegisterIcon(AbstractLauncherIcon::Ptr(new BFBLauncherIcon())); | 236 | RegisterIcon(AbstractLauncherIcon::Ptr(new BFBLauncherIcon())); |
580 | 237 | RegisterIcon(AbstractLauncherIcon::Ptr(new HudLauncherIcon())); | ||
581 | 236 | desktop_icon_ = AbstractLauncherIcon::Ptr(new DesktopLauncherIcon()); | 238 | desktop_icon_ = AbstractLauncherIcon::Ptr(new DesktopLauncherIcon()); |
582 | 237 | 239 | ||
583 | 238 | uscreen->changed.connect(sigc::mem_fun(this, &Controller::Impl::OnScreenChanged)); | 240 | uscreen->changed.connect(sigc::mem_fun(this, &Controller::Impl::OnScreenChanged)); |
584 | 239 | 241 | ||
585 | === modified file 'plugins/unityshell/src/LauncherHideMachine.cpp' | |||
586 | --- plugins/unityshell/src/LauncherHideMachine.cpp 2012-02-08 16:43:47 +0000 | |||
587 | +++ plugins/unityshell/src/LauncherHideMachine.cpp 2012-03-16 10:27:23 +0000 | |||
588 | @@ -134,19 +134,19 @@ | |||
589 | 134 | { | 134 | { |
590 | 135 | bool should_hide; | 135 | bool should_hide; |
591 | 136 | 136 | ||
593 | 137 | // early check to see if we are locking to hidden | 137 | if (_mode == HIDE_NEVER) |
594 | 138 | { | ||
595 | 139 | SetShouldHide(false, skip_delay); | ||
596 | 140 | return; | ||
597 | 141 | } | ||
598 | 142 | |||
599 | 143 | // early check to see if we are locking to hidden - but only if we are in non HIDE_NEVER | ||
600 | 138 | if (GetQuirk(LOCK_HIDE)) | 144 | if (GetQuirk(LOCK_HIDE)) |
601 | 139 | { | 145 | { |
602 | 140 | SetShouldHide(true, true); | 146 | SetShouldHide(true, true); |
603 | 141 | return; | 147 | return; |
604 | 142 | } | 148 | } |
605 | 143 | 149 | ||
606 | 144 | if (_mode == HIDE_NEVER) | ||
607 | 145 | { | ||
608 | 146 | SetShouldHide(false, skip_delay); | ||
609 | 147 | return; | ||
610 | 148 | } | ||
611 | 149 | |||
612 | 150 | do | 150 | do |
613 | 151 | { | 151 | { |
614 | 152 | // first we check the condition where external DND is active and the push off has happened | 152 | // first we check the condition where external DND is active and the push off has happened |
615 | 153 | 153 | ||
616 | === modified file 'plugins/unityshell/src/UBusMessages.h' | |||
617 | --- plugins/unityshell/src/UBusMessages.h 2012-02-07 07:42:12 +0000 | |||
618 | +++ plugins/unityshell/src/UBusMessages.h 2012-03-16 10:27:23 +0000 | |||
619 | @@ -64,6 +64,9 @@ | |||
620 | 64 | // Signal to force the launcher into locked mode, (b) | 64 | // Signal to force the launcher into locked mode, (b) |
621 | 65 | #define UBUS_LAUNCHER_LOCK_HIDE "LAUNCHER_LOCK_HIDE" | 65 | #define UBUS_LAUNCHER_LOCK_HIDE "LAUNCHER_LOCK_HIDE" |
622 | 66 | 66 | ||
623 | 67 | // Signal to emit changes to the launcher hide mode behaviour (b), true = locked out, false = unlocked | ||
624 | 68 | #define UBUS_LAUNCHER_HIDE_MODE_CHANGE "LAUNCHER_HIDE_MODE_CHANGE" | ||
625 | 69 | |||
626 | 67 | // Signal sent when a quicklist is shown. | 70 | // Signal sent when a quicklist is shown. |
627 | 68 | #define UBUS_QUICKLIST_SHOWN "QUICKLIST_SHOWN" | 71 | #define UBUS_QUICKLIST_SHOWN "QUICKLIST_SHOWN" |
628 | 69 | 72 | ||
629 | @@ -78,6 +81,8 @@ | |||
630 | 78 | // FIXME - fix the nux focus api so we don't need this | 81 | // FIXME - fix the nux focus api so we don't need this |
631 | 79 | #define UBUS_RESULT_VIEW_KEYNAV_CHANGED "RESULT_VIEW_KEYNAV_CHANGED" | 82 | #define UBUS_RESULT_VIEW_KEYNAV_CHANGED "RESULT_VIEW_KEYNAV_CHANGED" |
632 | 80 | 83 | ||
633 | 84 | // Sends a string datatype containing the new icon name | ||
634 | 85 | #define UBUS_HUD_ICON_CHANGED "HUD_ICON_CHANGED" | ||
635 | 81 | #define UBUS_HUD_CLOSE_REQUEST "HUD_CLOSE_REQUEST" | 86 | #define UBUS_HUD_CLOSE_REQUEST "HUD_CLOSE_REQUEST" |
636 | 82 | 87 | ||
637 | 83 | // Signals sent when the switcher is shown, hidden or changes selection | 88 | // Signals sent when the switcher is shown, hidden or changes selection |
638 | 84 | 89 | ||
639 | === modified file 'plugins/unityshell/src/unityshell.cpp' | |||
640 | --- plugins/unityshell/src/unityshell.cpp 2012-03-14 13:05:59 +0000 | |||
641 | +++ plugins/unityshell/src/unityshell.cpp 2012-03-16 10:27:23 +0000 | |||
642 | @@ -2505,8 +2505,11 @@ | |||
643 | 2505 | break; | 2505 | break; |
644 | 2506 | } | 2506 | } |
645 | 2507 | case UnityshellOptions::LauncherHideMode: | 2507 | case UnityshellOptions::LauncherHideMode: |
646 | 2508 | { | ||
647 | 2508 | launcher_options->hide_mode = (unity::launcher::LauncherHideMode) optionGetLauncherHideMode(); | 2509 | launcher_options->hide_mode = (unity::launcher::LauncherHideMode) optionGetLauncherHideMode(); |
648 | 2510 | hud_controller_->SetLauncherIsLockedOut(launcher_options->hide_mode == unity::launcher::LauncherHideMode::LAUNCHER_HIDE_NEVER); | ||
649 | 2509 | break; | 2511 | break; |
650 | 2512 | } | ||
651 | 2510 | case UnityshellOptions::BacklightMode: | 2513 | case UnityshellOptions::BacklightMode: |
652 | 2511 | launcher_options->backlight_mode = (unity::launcher::BacklightMode) optionGetBacklightMode(); | 2514 | launcher_options->backlight_mode = (unity::launcher::BacklightMode) optionGetBacklightMode(); |
653 | 2512 | break; | 2515 | break; |
654 | @@ -2738,6 +2741,8 @@ | |||
655 | 2738 | 2741 | ||
656 | 2739 | /* Setup Hud */ | 2742 | /* Setup Hud */ |
657 | 2740 | hud_controller_.reset(new hud::Controller()); | 2743 | hud_controller_.reset(new hud::Controller()); |
658 | 2744 | auto hide_mode = (unity::launcher::LauncherHideMode) optionGetLauncherHideMode(); | ||
659 | 2745 | hud_controller_->SetLauncherIsLockedOut(hide_mode == unity::launcher::LauncherHideMode::LAUNCHER_HIDE_NEVER); | ||
660 | 2741 | AddChild(hud_controller_.get()); | 2746 | AddChild(hud_controller_.get()); |
661 | 2742 | LOG_INFO(logger) << "initLauncher-hud " << timer.ElapsedSeconds() << "s"; | 2747 | LOG_INFO(logger) << "initLauncher-hud " << timer.ElapsedSeconds() << "s"; |
662 | 2743 | 2748 |
Actually adding an autopilot test for this is trivial.
What we can do is to run the HUD AP tests with the launcher in each state, locked out and auto-hide. We already do something like this for launchers for each monitor. I'll tackle the HUD tests with thomi tomorrow.