Merge lp:~3v1n0/unity/panel-p-core into lp:~3v1n0/unity/panel-p-window-manager
- panel-p-core
- Merge into panel-p-window-manager
Proposed by
Marco Trevisan (Treviño)
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | no longer in the source branch. |
Merge reported by: | Marco Trevisan (Treviño) |
Merged at revision: | not available |
Proposed branch: | lp:~3v1n0/unity/panel-p-core |
Merge into: | lp:~3v1n0/unity/panel-p-window-manager |
Diff against target: |
641 lines (+206/-101) 10 files modified
UnityCore/Variant.cpp (+31/-2) UnityCore/Variant.h (+6/-1) plugins/unityshell/src/DashController.cpp (+5/-3) plugins/unityshell/src/DashController.h (+1/-0) plugins/unityshell/src/LauncherController.cpp (+51/-8) plugins/unityshell/src/PanelController.cpp (+27/-20) plugins/unityshell/src/PanelController.h (+2/-4) plugins/unityshell/src/SwitcherController.cpp (+9/-2) plugins/unityshell/src/UBusMessages.h (+1/-0) plugins/unityshell/src/unityshell.cpp (+73/-61) |
To merge this branch: | bzr merge lp:~3v1n0/unity/panel-p-core |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Penhey (community) | Approve | ||
Marco Trevisan (Treviño) | Pending | ||
Review via email: mp+100127@code.launchpad.net |
Commit message
Description of the change
Misc unity changes needed for panel, see https:/
To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'UnityCore/Variant.cpp' |
2 | --- UnityCore/Variant.cpp 2012-03-21 12:31:11 +0000 |
3 | +++ UnityCore/Variant.cpp 2012-04-04 20:31:30 +0000 |
4 | @@ -142,15 +142,44 @@ |
5 | return *this; |
6 | } |
7 | |
8 | -BuilderWrapper& BuilderWrapper::add(char const* name, unsigned value) |
9 | +BuilderWrapper& BuilderWrapper::add(char const* name, long int value) |
10 | +{ |
11 | + g_variant_builder_add(builder_, "{sv}", name, g_variant_new_int64(value)); |
12 | + return *this; |
13 | +} |
14 | + |
15 | +BuilderWrapper& BuilderWrapper::add(char const* name, long long int value) |
16 | +{ |
17 | + g_variant_builder_add(builder_, "{sv}", name, g_variant_new_int64(value)); |
18 | + return *this; |
19 | +} |
20 | + |
21 | +BuilderWrapper& BuilderWrapper::add(char const* name, unsigned int value) |
22 | { |
23 | g_variant_builder_add(builder_, "{sv}", name, g_variant_new_uint32(value)); |
24 | return *this; |
25 | } |
26 | |
27 | +BuilderWrapper& BuilderWrapper::add(char const* name, long unsigned int value) |
28 | +{ |
29 | + g_variant_builder_add(builder_, "{sv}", name, g_variant_new_uint64(value)); |
30 | + return *this; |
31 | +} |
32 | + |
33 | +BuilderWrapper& BuilderWrapper::add(char const* name, long long unsigned int value) |
34 | +{ |
35 | + g_variant_builder_add(builder_, "{sv}", name, g_variant_new_uint64(value)); |
36 | + return *this; |
37 | +} |
38 | + |
39 | BuilderWrapper& BuilderWrapper::add(char const* name, float value) |
40 | { |
41 | - // floats get promoted to doubles automatically |
42 | + g_variant_builder_add(builder_, "{sv}", name, g_variant_new_double(value)); |
43 | + return *this; |
44 | +} |
45 | + |
46 | +BuilderWrapper& BuilderWrapper::add(char const* name, double value) |
47 | +{ |
48 | g_variant_builder_add(builder_, "{sv}", name, g_variant_new_double(value)); |
49 | return *this; |
50 | } |
51 | |
52 | === modified file 'UnityCore/Variant.h' |
53 | --- UnityCore/Variant.h 2012-03-21 12:31:11 +0000 |
54 | +++ UnityCore/Variant.h 2012-04-04 20:31:30 +0000 |
55 | @@ -73,8 +73,13 @@ |
56 | BuilderWrapper& add(char const* name, char const* value); |
57 | BuilderWrapper& add(char const* name, std::string const& value); |
58 | BuilderWrapper& add(char const* name, int value); |
59 | - BuilderWrapper& add(char const* name, unsigned value); |
60 | + BuilderWrapper& add(char const* name, long int value); |
61 | + BuilderWrapper& add(char const* name, long long int value); |
62 | + BuilderWrapper& add(char const* name, unsigned int value); |
63 | + BuilderWrapper& add(char const* name, long unsigned int value); |
64 | + BuilderWrapper& add(char const* name, long long unsigned int value); |
65 | BuilderWrapper& add(char const* name, float value); |
66 | + BuilderWrapper& add(char const* name, double value); |
67 | BuilderWrapper& add(char const* name, GVariant* value); |
68 | BuilderWrapper& add(nux::Rect const& value); |
69 | |
70 | |
71 | === modified file 'plugins/unityshell/src/DashController.cpp' |
72 | --- plugins/unityshell/src/DashController.cpp 2012-03-21 12:31:11 +0000 |
73 | +++ plugins/unityshell/src/DashController.cpp 2012-04-04 20:31:30 +0000 |
74 | @@ -40,6 +40,7 @@ |
75 | Controller::Controller() |
76 | : launcher_width(64) |
77 | , use_primary(false) |
78 | + , monitor_(0) |
79 | , window_(0) |
80 | , visible_(false) |
81 | , need_show_(false) |
82 | @@ -126,7 +127,7 @@ |
83 | g_variant_get(data, UBUS_OVERLAY_FORMAT_STRING, &overlay_identity, &can_maximise, &overlay_monitor); |
84 | |
85 | // hide if something else is coming up |
86 | - if (g_strcmp0(overlay_identity, "dash")) |
87 | + if (overlay_identity.Str() != "dash") |
88 | { |
89 | HideDash(true); |
90 | } |
91 | @@ -272,7 +273,8 @@ |
92 | |
93 | StartShowHideTimeline(); |
94 | |
95 | - GVariant* info = g_variant_new(UBUS_OVERLAY_FORMAT_STRING, "dash", TRUE, GetIdealMonitor()); |
96 | + monitor_ = GetIdealMonitor(); |
97 | + GVariant* info = g_variant_new(UBUS_OVERLAY_FORMAT_STRING, "dash", TRUE, monitor_); |
98 | ubus_manager_.SendMessage(UBUS_OVERLAY_SHOWN, info); |
99 | } |
100 | |
101 | @@ -298,7 +300,7 @@ |
102 | |
103 | StartShowHideTimeline(); |
104 | |
105 | - GVariant* info = g_variant_new(UBUS_OVERLAY_FORMAT_STRING, "dash", TRUE, GetIdealMonitor()); |
106 | + GVariant* info = g_variant_new(UBUS_OVERLAY_FORMAT_STRING, "dash", TRUE, monitor_); |
107 | ubus_manager_.SendMessage(UBUS_OVERLAY_HIDDEN, info); |
108 | } |
109 | |
110 | |
111 | === modified file 'plugins/unityshell/src/DashController.h' |
112 | --- plugins/unityshell/src/DashController.h 2012-03-27 22:34:53 +0000 |
113 | +++ plugins/unityshell/src/DashController.h 2012-04-04 20:31:30 +0000 |
114 | @@ -89,6 +89,7 @@ |
115 | private: |
116 | glib::SignalManager sig_manager_; |
117 | UBusManager ubus_manager_; |
118 | + int monitor_; |
119 | |
120 | nux::BaseWindow* window_; |
121 | bool visible_; |
122 | |
123 | === modified file 'plugins/unityshell/src/LauncherController.cpp' |
124 | --- plugins/unityshell/src/LauncherController.cpp 2012-03-30 04:00:05 +0000 |
125 | +++ plugins/unityshell/src/LauncherController.cpp 2012-04-04 20:31:30 +0000 |
126 | @@ -1075,9 +1075,9 @@ |
127 | void Controller::KeyNavGrab() |
128 | { |
129 | pimpl->ubus.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST); |
130 | + pimpl->launcher_grabbed = true; |
131 | KeyNavActivate(); |
132 | pimpl->keyboard_launcher_->GrabKeyboard(); |
133 | - pimpl->launcher_grabbed = true; |
134 | |
135 | pimpl->launcher_key_press_connection_ = |
136 | pimpl->keyboard_launcher_->key_down.connect(sigc::mem_fun(pimpl, &Controller::Impl::ReceiveLauncherKeyPress)); |
137 | @@ -1098,18 +1098,50 @@ |
138 | pimpl->keyboard_launcher_->EnterKeyNavMode(); |
139 | pimpl->model_->SetSelection(0); |
140 | |
141 | - pimpl->ubus.SendMessage(UBUS_LAUNCHER_START_KEY_SWTICHER, g_variant_new_boolean(true)); |
142 | - pimpl->ubus.SendMessage(UBUS_LAUNCHER_START_KEY_NAV, NULL); |
143 | + if (pimpl->launcher_grabbed) |
144 | + { |
145 | + pimpl->ubus.SendMessage(UBUS_LAUNCHER_START_KEY_NAV, |
146 | + g_variant_new_int32(pimpl->keyboard_launcher_->monitor)); |
147 | + } |
148 | + else |
149 | + { |
150 | + pimpl->ubus.SendMessage(UBUS_LAUNCHER_START_KEY_SWTICHER, |
151 | + g_variant_new_int32(pimpl->keyboard_launcher_->monitor)); |
152 | + } |
153 | + |
154 | + AbstractLauncherIcon::Ptr const& selected = pimpl->model_->Selection(); |
155 | + |
156 | + if (selected) |
157 | + { |
158 | + pimpl->ubus.SendMessage(UBUS_LAUNCHER_SELECTION_CHANGED, |
159 | + g_variant_new_string(selected->tooltip_text().c_str())); |
160 | + } |
161 | } |
162 | |
163 | void Controller::KeyNavNext() |
164 | { |
165 | pimpl->model_->SelectNext(); |
166 | + |
167 | + AbstractLauncherIcon::Ptr const& selected = pimpl->model_->Selection(); |
168 | + |
169 | + if (selected) |
170 | + { |
171 | + pimpl->ubus.SendMessage(UBUS_LAUNCHER_SELECTION_CHANGED, |
172 | + g_variant_new_string(selected->tooltip_text().c_str())); |
173 | + } |
174 | } |
175 | |
176 | void Controller::KeyNavPrevious() |
177 | { |
178 | pimpl->model_->SelectPrevious(); |
179 | + |
180 | + AbstractLauncherIcon::Ptr const& selected = pimpl->model_->Selection(); |
181 | + |
182 | + if (selected) |
183 | + { |
184 | + pimpl->ubus.SendMessage(UBUS_LAUNCHER_SELECTION_CHANGED, |
185 | + g_variant_new_string(selected->tooltip_text().c_str())); |
186 | + } |
187 | } |
188 | |
189 | void Controller::KeyNavTerminate(bool activate) |
190 | @@ -1117,13 +1149,28 @@ |
191 | if (!pimpl->launcher_keynav) |
192 | return; |
193 | |
194 | + if (activate && pimpl->keynav_restore_window_) |
195 | + { |
196 | + /* If the selected icon is running, we must not restore the input to the old */ |
197 | + AbstractLauncherIcon::Ptr const& icon = pimpl->model_->Selection(); |
198 | + pimpl->keynav_restore_window_ = !icon->GetQuirk(AbstractLauncherIcon::QUIRK_RUNNING); |
199 | + } |
200 | + |
201 | pimpl->keyboard_launcher_->ExitKeyNavMode(); |
202 | + |
203 | if (pimpl->launcher_grabbed) |
204 | { |
205 | pimpl->keyboard_launcher_->UnGrabKeyboard(); |
206 | pimpl->launcher_key_press_connection_.disconnect(); |
207 | pimpl->launcher_event_outside_connection_.disconnect(); |
208 | pimpl->launcher_grabbed = false; |
209 | + pimpl->ubus.SendMessage(UBUS_LAUNCHER_END_KEY_NAV, |
210 | + g_variant_new_boolean(pimpl->keynav_restore_window_)); |
211 | + } |
212 | + else |
213 | + { |
214 | + pimpl->ubus.SendMessage(UBUS_LAUNCHER_END_KEY_SWTICHER, |
215 | + g_variant_new_boolean(pimpl->keynav_restore_window_)); |
216 | } |
217 | |
218 | if (activate) |
219 | @@ -1132,9 +1179,6 @@ |
220 | pimpl->launcher_keynav = false; |
221 | if (!pimpl->launcher_open) |
222 | pimpl->keyboard_launcher_.Release(); |
223 | - |
224 | - pimpl->ubus.SendMessage(UBUS_LAUNCHER_END_KEY_SWTICHER, g_variant_new_boolean(true)); |
225 | - pimpl->ubus.SendMessage(UBUS_LAUNCHER_END_KEY_NAV, g_variant_new_boolean(pimpl->keynav_restore_window_)); |
226 | } |
227 | |
228 | bool Controller::KeyNavIsActive() const |
229 | @@ -1234,8 +1278,7 @@ |
230 | // <RETURN> (start/activate currently selected icon) |
231 | case NUX_VK_ENTER: |
232 | case NUX_KP_ENTER: |
233 | - model_->Selection()->Activate(ActionArg(ActionArg::LAUNCHER, 0)); |
234 | - parent_->KeyNavTerminate(false); |
235 | + parent_->KeyNavTerminate(true); |
236 | break; |
237 | |
238 | default: |
239 | |
240 | === modified file 'plugins/unityshell/src/PanelController.cpp' |
241 | --- plugins/unityshell/src/PanelController.cpp 2012-03-22 19:33:10 +0000 |
242 | +++ plugins/unityshell/src/PanelController.cpp 2012-04-04 20:31:30 +0000 |
243 | @@ -26,6 +26,7 @@ |
244 | |
245 | #include "UScreen.h" |
246 | #include "PanelView.h" |
247 | +#include "PanelStyle.h" |
248 | |
249 | namespace unity |
250 | { |
251 | @@ -46,8 +47,8 @@ |
252 | void FirstMenuShow(); |
253 | void QueueRedraw(); |
254 | |
255 | - unsigned int GetTrayXid(); |
256 | - std::list <nux::Geometry> GetGeometries(); |
257 | + std::vector<Window> GetTrayXids() const; |
258 | + std::vector<nux::Geometry> GetGeometries() const; |
259 | |
260 | // NOTE: nux::Property maybe? |
261 | void SetOpacity(float opacity); |
262 | @@ -60,7 +61,7 @@ |
263 | |
264 | void OnScreenChanged(int primary_monitor, std::vector<nux::Geometry>& monitors, Introspectable *iobj); |
265 | private: |
266 | - unity::PanelView* ViewForWindow(nux::BaseWindow* window); |
267 | + unity::PanelView* ViewForWindow(nux::BaseWindow* window) const; |
268 | |
269 | static void WindowConfigureCallback(int window_width, |
270 | int window_height, |
271 | @@ -98,17 +99,21 @@ |
272 | } |
273 | } |
274 | |
275 | -unsigned int Controller::Impl::GetTrayXid() |
276 | +std::vector<Window> Controller::Impl::GetTrayXids() const |
277 | { |
278 | - if (!windows_.empty()) |
279 | - return ViewForWindow(windows_.front())->GetTrayXid(); |
280 | - else |
281 | - return 0; |
282 | + std::vector<Window> xids; |
283 | + |
284 | + for (auto window: windows_) |
285 | + { |
286 | + xids.push_back(ViewForWindow(window)->GetTrayXid()); |
287 | + } |
288 | + |
289 | + return xids; |
290 | } |
291 | |
292 | -std::list<nux::Geometry> Controller::Impl::GetGeometries() |
293 | +std::vector<nux::Geometry> Controller::Impl::GetGeometries() const |
294 | { |
295 | - std::list<nux::Geometry> geometries; |
296 | + std::vector<nux::Geometry> geometries; |
297 | |
298 | for (auto window : windows_) |
299 | { |
300 | @@ -171,7 +176,7 @@ |
301 | } |
302 | } |
303 | |
304 | -PanelView* Controller::Impl::ViewForWindow(nux::BaseWindow* window) |
305 | +PanelView* Controller::Impl::ViewForWindow(nux::BaseWindow* window) const |
306 | { |
307 | nux::Layout* layout = window->GetLayout(); |
308 | std::list<nux::Area*>::iterator it = layout->GetChildren().begin(); |
309 | @@ -198,8 +203,9 @@ |
310 | (*it)->InputWindowEnableStruts(false); |
311 | |
312 | nux::Geometry geo = monitors[i]; |
313 | - geo.height = 24; |
314 | + geo.height = panel::Style::Instance().panel_height; |
315 | (*it)->SetGeometry(geo); |
316 | + (*it)->SetMinMaxSize(geo.width, geo.height); |
317 | |
318 | view = ViewForWindow(*it); |
319 | view->SetPrimary(i == primary_monitor); |
320 | @@ -224,7 +230,7 @@ |
321 | nux::HLayout* layout = new nux::HLayout(NUX_TRACKER_LOCATION); |
322 | |
323 | PanelView* view = new PanelView(); |
324 | - view->SetMaximumHeight(24); |
325 | + view->SetMaximumHeight(panel::Style::Instance().panel_height); |
326 | view->SetOpacity(opacity_); |
327 | view->SetOpacityMaximizedToggle(opacity_maximized_toggle_); |
328 | view->SetMenuShowTimings(menus_fadein_, menus_fadeout_, menus_discovery_, |
329 | @@ -238,17 +244,18 @@ |
330 | layout->SetHorizontalExternalMargin(0); |
331 | |
332 | nux::BaseWindow* window = new nux::BaseWindow(""); |
333 | + nux::Geometry geo = monitors[i]; |
334 | + geo.height = panel::Style::Instance().panel_height; |
335 | + |
336 | window->SinkReference(); |
337 | window->SetConfigureNotifyCallback(&Impl::WindowConfigureCallback, window); |
338 | - window->SetLayout(layout); |
339 | window->SetBackgroundColor(nux::Color(0.0f, 0.0f, 0.0f, 0.0f)); |
340 | window->ShowWindow(true); |
341 | window->EnableInputWindow(true, "panel", false, false); |
342 | window->InputWindowEnableStruts(true); |
343 | - |
344 | - nux::Geometry geo = monitors[i]; |
345 | - geo.height = 24; |
346 | window->SetGeometry(geo); |
347 | + window->SetMinMaxSize(geo.width, geo.height); |
348 | + window->SetLayout(layout); |
349 | |
350 | windows_.push_back(window); |
351 | |
352 | @@ -325,12 +332,12 @@ |
353 | pimpl->QueueRedraw(); |
354 | } |
355 | |
356 | -unsigned int Controller::GetTrayXid() |
357 | +std::vector<Window> Controller::GetTrayXids() const |
358 | { |
359 | - return pimpl->GetTrayXid(); |
360 | + return pimpl->GetTrayXids(); |
361 | } |
362 | |
363 | -std::list<nux::Geometry> Controller::GetGeometries() |
364 | +std::vector<nux::Geometry> Controller::GetGeometries() const |
365 | { |
366 | return pimpl->GetGeometries(); |
367 | } |
368 | |
369 | === modified file 'plugins/unityshell/src/PanelController.h' |
370 | --- plugins/unityshell/src/PanelController.h 2012-03-22 19:33:10 +0000 |
371 | +++ plugins/unityshell/src/PanelController.h 2012-04-04 20:31:30 +0000 |
372 | @@ -20,9 +20,7 @@ |
373 | #ifndef _PANEL_CONTROLLER_H_ |
374 | #define _PANEL_CONTROLLER_H_ |
375 | |
376 | -#include <list> |
377 | #include <memory> |
378 | - |
379 | #include <Nux/Nux.h> |
380 | |
381 | #include "Introspectable.h" |
382 | @@ -42,8 +40,8 @@ |
383 | void FirstMenuShow(); |
384 | void QueueRedraw(); |
385 | |
386 | - unsigned int GetTrayXid (); |
387 | - std::list<nux::Geometry> GetGeometries (); |
388 | + std::vector<Window> GetTrayXids() const; |
389 | + std::vector<nux::Geometry> GetGeometries() const; |
390 | |
391 | // NOTE: nux::Property maybe? |
392 | void SetOpacity(float opacity); |
393 | |
394 | === modified file 'plugins/unityshell/src/SwitcherController.cpp' |
395 | --- plugins/unityshell/src/SwitcherController.cpp 2012-03-27 22:39:56 +0000 |
396 | +++ plugins/unityshell/src/SwitcherController.cpp 2012-04-04 20:31:30 +0000 |
397 | @@ -140,7 +140,7 @@ |
398 | } |
399 | |
400 | ubus_manager_.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST); |
401 | - ubus_manager_.SendMessage(UBUS_SWITCHER_SHOWN, g_variant_new_boolean(true)); |
402 | + ubus_manager_.SendMessage(UBUS_SWITCHER_SHOWN, g_variant_new("(bi)", true, monitor_)); |
403 | } |
404 | |
405 | void Controller::Select(int index) |
406 | @@ -172,8 +172,15 @@ |
407 | } |
408 | |
409 | if (icon) |
410 | + { |
411 | + if (!visible_) |
412 | + { |
413 | + ubus_manager_.SendMessage(UBUS_SWITCHER_SHOWN, g_variant_new("(bi)", true, monitor_)); |
414 | + } |
415 | + |
416 | ubus_manager_.SendMessage(UBUS_SWITCHER_SELECTION_CHANGED, |
417 | g_variant_new_string(icon->tooltip_text().c_str())); |
418 | + } |
419 | } |
420 | |
421 | void Controller::ShowView() |
422 | @@ -298,7 +305,7 @@ |
423 | g_source_remove(detail_timer_); |
424 | detail_timer_ = 0; |
425 | |
426 | - ubus_manager_.SendMessage(UBUS_SWITCHER_SHOWN, g_variant_new_boolean(false)); |
427 | + ubus_manager_.SendMessage(UBUS_SWITCHER_SHOWN, g_variant_new("(bi)", false, monitor_)); |
428 | |
429 | view_.Release(); |
430 | } |
431 | |
432 | === modified file 'plugins/unityshell/src/UBusMessages.h' |
433 | --- plugins/unityshell/src/UBusMessages.h 2012-03-21 14:44:41 +0000 |
434 | +++ plugins/unityshell/src/UBusMessages.h 2012-04-04 20:31:30 +0000 |
435 | @@ -48,6 +48,7 @@ |
436 | #define UBUS_LAUNCHER_END_KEY_NAV "LAUNCHER_END_KEY_NAV" |
437 | #define UBUS_LAUNCHER_START_KEY_SWTICHER "LAUNCHER_START_KEY_SWITCHER" |
438 | #define UBUS_LAUNCHER_END_KEY_SWTICHER "LAUNCHER_END_KEY_SWITCHER" |
439 | +#define UBUS_LAUNCHER_SELECTION_CHANGED "LAUNCHER_ICON_SELECTION_CHANGED" |
440 | #define UBUS_LAUNCHER_ICON_URGENT_CHANGED "LAUNCHER_ICON_URGENT_CHANGED" |
441 | #define UBUS_QUICKLIST_START_KEY_NAV "QUICKLIST_START_KEY_NAV" |
442 | #define UBUS_QUICKLIST_END_KEY_NAV "QUICKLIST_END_KEY_NAV" |
443 | |
444 | === modified file 'plugins/unityshell/src/unityshell.cpp' |
445 | --- plugins/unityshell/src/unityshell.cpp 2012-03-30 04:00:05 +0000 |
446 | +++ plugins/unityshell/src/unityshell.cpp 2012-04-04 20:31:30 +0000 |
447 | @@ -343,9 +343,15 @@ |
448 | ubus_manager_.RegisterInterest(UBUS_LAUNCHER_START_KEY_NAV, |
449 | sigc::mem_fun(this, &UnityScreen::OnLauncherStartKeyNav)); |
450 | |
451 | + ubus_manager_.RegisterInterest(UBUS_LAUNCHER_START_KEY_SWTICHER, |
452 | + sigc::mem_fun(this, &UnityScreen::OnLauncherStartKeyNav)); |
453 | + |
454 | ubus_manager_.RegisterInterest(UBUS_LAUNCHER_END_KEY_NAV, |
455 | sigc::mem_fun(this, &UnityScreen::OnLauncherEndKeyNav)); |
456 | |
457 | + ubus_manager_.RegisterInterest(UBUS_LAUNCHER_END_KEY_SWTICHER, |
458 | + sigc::mem_fun(this, &UnityScreen::OnLauncherEndKeyNav)); |
459 | + |
460 | g_idle_add_full (G_PRIORITY_DEFAULT, &UnityScreen::initPluginActions, this, NULL); |
461 | super_keypressed_ = false; |
462 | |
463 | @@ -539,7 +545,7 @@ |
464 | float vc[4]; |
465 | float h = 20.0f; |
466 | float w = 1.0f; |
467 | - float panel_h = 24.0f; |
468 | + float panel_h = panel_style_.panel_height; |
469 | |
470 | float x1 = output->x(); |
471 | float y1 = output->y() + panel_h; |
472 | @@ -722,7 +728,6 @@ |
473 | #endif |
474 | { |
475 | CompOutput *output = _last_output; |
476 | - Window tray_xid = panel_controller_->GetTrayXid (); |
477 | |
478 | #ifndef USE_GLES |
479 | bool was_bound = _fbo->bound (); |
480 | @@ -768,64 +773,67 @@ |
481 | _in_paint = false; |
482 | nuxEpilogue(); |
483 | |
484 | - if (tray_xid && !allowWindowPaint) |
485 | + for (Window tray_xid : panel_controller_->GetTrayXids()) |
486 | { |
487 | - CompWindow *tray = screen->findWindow (tray_xid); |
488 | - |
489 | - if (tray) |
490 | + if (tray_xid && !allowWindowPaint) |
491 | { |
492 | - GLMatrix oTransform; |
493 | - UnityWindow *uTrayWindow = UnityWindow::get (tray); |
494 | -#ifndef USE_GLES |
495 | - GLFragment::Attrib attrib (uTrayWindow->gWindow->lastPaintAttrib()); |
496 | -#else |
497 | - GLWindowPaintAttrib attrib (uTrayWindow->gWindow->lastPaintAttrib()); |
498 | -#endif |
499 | - unsigned int oldGlAddGeometryIndex = uTrayWindow->gWindow->glAddGeometryGetCurrentIndex (); |
500 | - unsigned int oldGlDrawIndex = uTrayWindow->gWindow->glDrawGetCurrentIndex (); |
501 | -#ifndef USE_GLES |
502 | - unsigned int oldGlDrawGeometryIndex = uTrayWindow->gWindow->glDrawGeometryGetCurrentIndex (); |
503 | -#endif |
504 | - |
505 | -#ifndef USE_GLES |
506 | - attrib.setOpacity (OPAQUE); |
507 | - attrib.setBrightness (BRIGHT); |
508 | - attrib.setSaturation (COLOR); |
509 | -#else |
510 | - attrib.opacity = OPAQUE; |
511 | - attrib.brightness = BRIGHT; |
512 | - attrib.saturation = COLOR; |
513 | -#endif |
514 | - |
515 | - oTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA); |
516 | - |
517 | -#ifndef USE_GLES |
518 | - glPushMatrix (); |
519 | - glLoadMatrixf (oTransform.getMatrix ()); |
520 | -#endif |
521 | - |
522 | - painting_tray_ = true; |
523 | - |
524 | - /* force the use of the core functions */ |
525 | - uTrayWindow->gWindow->glDrawSetCurrentIndex (MAXSHORT); |
526 | - uTrayWindow->gWindow->glAddGeometrySetCurrentIndex ( MAXSHORT); |
527 | -#ifndef USE_GLES |
528 | - uTrayWindow->gWindow->glDrawGeometrySetCurrentIndex (MAXSHORT); |
529 | -#endif |
530 | - uTrayWindow->gWindow->glDraw (oTransform, attrib, infiniteRegion, |
531 | - PAINT_WINDOW_TRANSFORMED_MASK | |
532 | - PAINT_WINDOW_BLEND_MASK | |
533 | - PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK); |
534 | -#ifndef USE_GLES |
535 | - uTrayWindow->gWindow->glDrawGeometrySetCurrentIndex (oldGlDrawGeometryIndex); |
536 | -#endif |
537 | - uTrayWindow->gWindow->glAddGeometrySetCurrentIndex (oldGlAddGeometryIndex); |
538 | - uTrayWindow->gWindow->glDrawSetCurrentIndex (oldGlDrawIndex); |
539 | - painting_tray_ = false; |
540 | - |
541 | -#ifndef USE_GLES |
542 | - glPopMatrix (); |
543 | -#endif |
544 | + CompWindow *tray = screen->findWindow (tray_xid); |
545 | + |
546 | + if (tray) |
547 | + { |
548 | + GLMatrix oTransform; |
549 | + UnityWindow *uTrayWindow = UnityWindow::get (tray); |
550 | +#ifndef USE_GLES |
551 | + GLFragment::Attrib attrib (uTrayWindow->gWindow->lastPaintAttrib()); |
552 | +#else |
553 | + GLWindowPaintAttrib attrib (uTrayWindow->gWindow->lastPaintAttrib()); |
554 | +#endif |
555 | + unsigned int oldGlAddGeometryIndex = uTrayWindow->gWindow->glAddGeometryGetCurrentIndex (); |
556 | + unsigned int oldGlDrawIndex = uTrayWindow->gWindow->glDrawGetCurrentIndex (); |
557 | +#ifndef USE_GLES |
558 | + unsigned int oldGlDrawGeometryIndex = uTrayWindow->gWindow->glDrawGeometryGetCurrentIndex (); |
559 | +#endif |
560 | + |
561 | +#ifndef USE_GLES |
562 | + attrib.setOpacity (OPAQUE); |
563 | + attrib.setBrightness (BRIGHT); |
564 | + attrib.setSaturation (COLOR); |
565 | +#else |
566 | + attrib.opacity = OPAQUE; |
567 | + attrib.brightness = BRIGHT; |
568 | + attrib.saturation = COLOR; |
569 | +#endif |
570 | + |
571 | + oTransform.toScreenSpace (output, -DEFAULT_Z_CAMERA); |
572 | + |
573 | +#ifndef USE_GLES |
574 | + glPushMatrix (); |
575 | + glLoadMatrixf (oTransform.getMatrix ()); |
576 | +#endif |
577 | + |
578 | + painting_tray_ = true; |
579 | + |
580 | + /* force the use of the core functions */ |
581 | + uTrayWindow->gWindow->glDrawSetCurrentIndex (MAXSHORT); |
582 | + uTrayWindow->gWindow->glAddGeometrySetCurrentIndex ( MAXSHORT); |
583 | +#ifndef USE_GLES |
584 | + uTrayWindow->gWindow->glDrawGeometrySetCurrentIndex (MAXSHORT); |
585 | +#endif |
586 | + uTrayWindow->gWindow->glDraw (oTransform, attrib, infiniteRegion, |
587 | + PAINT_WINDOW_TRANSFORMED_MASK | |
588 | + PAINT_WINDOW_BLEND_MASK | |
589 | + PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK); |
590 | +#ifndef USE_GLES |
591 | + uTrayWindow->gWindow->glDrawGeometrySetCurrentIndex (oldGlDrawGeometryIndex); |
592 | +#endif |
593 | + uTrayWindow->gWindow->glAddGeometrySetCurrentIndex (oldGlAddGeometryIndex); |
594 | + uTrayWindow->gWindow->glDrawSetCurrentIndex (oldGlDrawIndex); |
595 | + painting_tray_ = false; |
596 | + |
597 | +#ifndef USE_GLES |
598 | + glPopMatrix (); |
599 | +#endif |
600 | + } |
601 | } |
602 | } |
603 | |
604 | @@ -1551,7 +1559,7 @@ |
605 | int width = 970; |
606 | int height = 680; |
607 | int launcher_width = optionGetIconSize() + 18; |
608 | - int panel_height = 24; |
609 | + int panel_height = panel_style_.panel_height; |
610 | int x = monitor_geo.x + launcher_width + (monitor_geo.width - launcher_width- width) / 2; |
611 | int y = monitor_geo.y + panel_height + (monitor_geo.height - panel_height - height) / 2; |
612 | |
613 | @@ -1624,6 +1632,7 @@ |
614 | * keyboard and the Alt key is still pressed */ |
615 | action->setState(action->state() | CompAction::StateTermKey); |
616 | panel_controller_->FirstMenuShow(); |
617 | + |
618 | return true; |
619 | } |
620 | |
621 | @@ -2153,7 +2162,9 @@ |
622 | mask |= mShowdesktopHandler->getPaintMask (); |
623 | } |
624 | |
625 | - if (uScreen->panel_controller_->GetTrayXid () == window->id () && !uScreen->allowWindowPaint) |
626 | + std::vector<Window> const& tray_xids = uScreen->panel_controller_->GetTrayXids(); |
627 | + if (std::find(tray_xids.begin(), tray_xids.end(), window->id()) != tray_xids.end() && |
628 | + !uScreen->allowWindowPaint) |
629 | { |
630 | if (!uScreen->painting_tray_) |
631 | { |
632 | @@ -2215,7 +2226,8 @@ |
633 | |
634 | bool ret = gWindow->glDraw(matrix, attrib, region, mask); |
635 | |
636 | - if ((active_window == 0 || active_window == window->id()) && (window->type() == CompWindowTypeDesktopMask)) |
637 | + if ((active_window == 0 || active_window == window->id()) && |
638 | + (window->type() == CompWindowTypeDesktopMask)) |
639 | { |
640 | uScreen->paintPanelShadow(matrix); |
641 | } |