Merge lp:unity/5.0 into lp:~ubuntu-desktop/unity/precise

Proposed by Chris J Arges on 2013-01-09
Status: Work in progress
Proposed branch: lp:unity/5.0
Merge into: lp:~ubuntu-desktop/unity/precise
Diff against target: 888 lines (+278/-96)
20 files modified
plugins/unityshell/src/DashController.cpp (+17/-3)
plugins/unityshell/src/DashController.h (+3/-0)
plugins/unityshell/src/DashStyle.cpp (+0/-3)
plugins/unityshell/src/DashView.cpp (+14/-9)
plugins/unityshell/src/HudController.cpp (+12/-3)
plugins/unityshell/src/HudController.h (+2/-0)
plugins/unityshell/src/HudView.cpp (+13/-0)
plugins/unityshell/src/IconRenderer.cpp (+36/-10)
plugins/unityshell/src/PluginAdapter.cpp (+1/-1)
plugins/unityshell/src/SwitcherController.cpp (+7/-5)
plugins/unityshell/src/SwitcherController.h (+0/-1)
plugins/unityshell/src/SwitcherModel.h (+2/-2)
plugins/unityshell/src/WindowManager.h (+4/-0)
plugins/unityshell/src/unity-util-accessible.cpp (+2/-2)
plugins/unityshell/src/unityshell.cpp (+96/-51)
plugins/unityshell/src/unityshell.h (+5/-5)
services/panel-indicator-entry-accessible.c (+26/-1)
services/panel-service.c (+20/-0)
tests/autopilot/autopilot/tests/test_dash.py (+9/-0)
tests/autopilot/autopilot/tests/test_hud.py (+9/-0)
To merge this branch: bzr merge lp:unity/5.0
Reviewer Review Type Date Requested Status
Timo Jyrinki Disapprove on 2013-01-28
Didier Roche 2013-01-09 Pending
Review via email: mp+142509@code.launchpad.net

Description of the change

[ Brandon Schaefer ]
  * Change TimeUtil to use int64, so the buffer wont overflow within
    our lifetimes. (LP: #806248)

To post a comment you must log in.
Timo Jyrinki (timo-jyrinki) wrote :

Looks correct and already released to Ubuntu 12.10 users.

review: Approve
Timo Jyrinki (timo-jyrinki) wrote :
review: Disapprove
lp:unity/5.0 updated on 2013-10-17
2413. By Marco Trevisan (Treviño) on 2013-01-31

ResultRendererTile: fix a crash if row.renderer<TextureContainer*>() is null

2414. By Andrea Azzarone on 2013-02-18

Backport fix for 991637.

Merged branch lp:~andyrock/unity/fix-991637-5.0

2415. By Łukasz Zemczak on 2013-04-03

Partial backport of Unity trunk revno. 2901 to fix where window decorations are being drawn when they should not be (LP: #1122478) (LP: #1083186).

2416. By Marco Trevisan (Treviño) on 2013-04-04

UnityWindow: properly draw the panel shadow when a Nux window is focused or during WS switch

If a nux window is the active one, compiz won't draw it, so the code that is doing the
panelShadow drawing is excluded. We need to make sure that this will be executed
also in this case.

2417. By Timo Jyrinki on 2013-04-12

Release\ 5.20.0

2418. By Łukasz Zemczak on 2013-04-12

Add a manual test checking the fix for LP: #1122478. We need a manual-test because there is no infrastructure for real testing.. Fixes: . Approved by Christopher Townsend.

2419. By Marco Trevisan (Treviño) on 2013-04-23

SwitcherController: use again the SwitcherView as non-input window

Otherwise it could only lead to focusing troubles.
Added utilities to manage the WindowManager default close-window keybinding and using
it in our views.

2420. By Christopher Townsend on 2013-06-21

Fixes issue where minimizing a full screen window would not draw the Launcher and Panel after minimization. This is a backport of lp:unity revno. 3320.

2421. By Brandon Schaefer on 2013-07-11

We needs to set the focus of the base windows to the Dash/Hud (which ever one is focused), so XIM will accept events to those windows. Allowing XIM to work when this branch lands: lp:~brandontschaefer/nux/xim-support-12-04-SRU

2422. By Christopher Townsend on 2013-07-11

Check to see if the window is supposed to have decorations instead of the window actually being decorated when Undecorate() is called. This fixes a race condition where windows opened maximized upon login would sometimes have extra decorations. (LP: #1195730)

2423. By Stephen M. Webb on 2013-09-02

DashStyle: removed debug output thatcould cause a potential security problem (lp: #1051921)

2424. By Andrew Gaul <email address hidden> on 2013-09-20

PanelService: Disconnect signals connected in on_entry_added

This addresses a memory leak observed in lp:1203607

2425. By Christopher Townsend on 2013-10-17

Reference the menu in the accessible object. Backport of revno. 2775 of lp:unity. (LP: #913324)

Unmerged revisions

2425. By Christopher Townsend on 2013-10-17

Reference the menu in the accessible object. Backport of revno. 2775 of lp:unity. (LP: #913324)

2424. By Andrew Gaul <email address hidden> on 2013-09-20

PanelService: Disconnect signals connected in on_entry_added

This addresses a memory leak observed in lp:1203607

2423. By Stephen M. Webb on 2013-09-02

DashStyle: removed debug output thatcould cause a potential security problem (lp: #1051921)

2422. By Christopher Townsend on 2013-07-11

Check to see if the window is supposed to have decorations instead of the window actually being decorated when Undecorate() is called. This fixes a race condition where windows opened maximized upon login would sometimes have extra decorations. (LP: #1195730)

2421. By Brandon Schaefer on 2013-07-11

We needs to set the focus of the base windows to the Dash/Hud (which ever one is focused), so XIM will accept events to those windows. Allowing XIM to work when this branch lands: lp:~brandontschaefer/nux/xim-support-12-04-SRU

2420. By Christopher Townsend on 2013-06-21

Fixes issue where minimizing a full screen window would not draw the Launcher and Panel after minimization. This is a backport of lp:unity revno. 3320.

2419. By Marco Trevisan (Treviño) on 2013-04-23

SwitcherController: use again the SwitcherView as non-input window

Otherwise it could only lead to focusing troubles.
Added utilities to manage the WindowManager default close-window keybinding and using
it in our views.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'plugins/unityshell/resources/launcher_pip_large_ltr.png'
2Binary files plugins/unityshell/resources/launcher_pip_large_ltr.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/launcher_pip_large_ltr.png 2013-10-17 21:01:26 +0000 differ
3=== added file 'plugins/unityshell/resources/launcher_pip_large_rtl.png'
4Binary files plugins/unityshell/resources/launcher_pip_large_rtl.png 1970-01-01 00:00:00 +0000 and plugins/unityshell/resources/launcher_pip_large_rtl.png 2013-10-17 21:01:26 +0000 differ
5=== modified file 'plugins/unityshell/src/DashController.cpp'
6--- plugins/unityshell/src/DashController.cpp 2012-07-18 15:25:17 +0000
7+++ plugins/unityshell/src/DashController.cpp 2013-10-17 21:01:26 +0000
8@@ -272,18 +272,18 @@
9 }
10
11 view_->AboutToShow();
12+ visible_ = true;
13
14 window_->ShowWindow(true);
15- window_->PushToFront();
16 window_->EnableInputWindow(true, "Dash", true, false);
17- window_->SetInputFocus();
18+ FocusInput();
19+
20 window_->CaptureMouseDownAnyWhereElse(true);
21 window_->QueueDraw();
22
23 nux::GetWindowCompositor().SetKeyFocusArea(view_->default_focus());
24
25 need_show_ = false;
26- visible_ = true;
27
28 StartShowHideTimeline();
29
30@@ -292,6 +292,15 @@
31 ubus_manager_.SendMessage(UBUS_OVERLAY_SHOWN, info);
32 }
33
34+void Controller::FocusInput()
35+{
36+ if (visible_)
37+ {
38+ window_->PushToFront();
39+ window_->SetInputFocus();
40+ }
41+}
42+
43 void Controller::HideDash(bool restore)
44 {
45 if (!visible_)
46@@ -364,6 +373,11 @@
47 return TRUE;
48 }
49
50+bool Controller::IsVisible() const
51+{
52+ return visible_;
53+}
54+
55 void Controller::OnActivateRequest(GVariant* variant)
56 {
57 EnsureDash();
58
59=== modified file 'plugins/unityshell/src/DashController.h'
60--- plugins/unityshell/src/DashController.h 2012-04-12 13:23:29 +0000
61+++ plugins/unityshell/src/DashController.h 2013-10-17 21:01:26 +0000
62@@ -58,6 +58,9 @@
63
64 void HideDash(bool restore_focus = true);
65
66+ void FocusInput();
67+ bool IsVisible() const;
68+
69 protected:
70 std::string GetName() const;
71 void AddProperties(GVariantBuilder* builder);
72
73=== modified file 'plugins/unityshell/src/DashStyle.cpp'
74--- plugins/unityshell/src/DashStyle.cpp 2012-06-06 13:18:59 +0000
75+++ plugins/unityshell/src/DashStyle.cpp 2013-10-17 21:01:26 +0000
76@@ -1504,7 +1504,6 @@
77
78 // blur and blend overlay onto initial image-surface
79 Blur(blurred_cr, blurSize);
80- //cairo_surface_write_to_png(surface, "/tmp/overlay-surface.png");
81 cairo_set_source_surface(cr, surface, 0.0, 0.0);
82 old = SetBlendMode(cr, mode);
83 cairo_paint_with_alpha(cr, opacity);
84@@ -1724,8 +1723,6 @@
85 42.0 + 10.0,
86 alignment);
87
88- cairo_surface_write_to_png(cairo_get_target(cr), "/tmp/wut.png");
89-
90 return true;
91 }
92
93
94=== modified file 'plugins/unityshell/src/DashView.cpp'
95--- plugins/unityshell/src/DashView.cpp 2012-06-28 08:49:20 +0000
96+++ plugins/unityshell/src/DashView.cpp 2013-10-17 21:01:26 +0000
97@@ -33,6 +33,7 @@
98 #include "DashSettings.h"
99 #include "UBusMessages.h"
100 #include "KeyboardUtil.h"
101+#include "WindowManager.h"
102
103 namespace unity
104 {
105@@ -494,7 +495,7 @@
106 });
107
108 // global search done is handled by the home lens, no need to connect to it
109- // BUT, we will special case global search finished coming from
110+ // BUT, we will special case global search finished coming from
111 // the applications lens, because we want to be able to launch applications
112 // immediately without waiting for the search finished signal which will
113 // be delayed by all the lenses we're searching
114@@ -808,6 +809,10 @@
115 unsigned long x11_key_code,
116 unsigned long special_keys_state)
117 {
118+ // Only care about states of Alt, Ctrl, Super, Shift, not the lock keys
119+ special_keys_state &= (nux::NUX_STATE_ALT | nux::NUX_STATE_CTRL |
120+ nux::NUX_STATE_SUPER | nux::NUX_STATE_SHIFT);
121+
122 // Do what nux::View does, but if the event isn't a key navigation,
123 // designate the text entry to process it.
124
125@@ -841,15 +846,15 @@
126 // Not sure if Enter should be a navigation key
127 direction = KEY_NAV_ENTER;
128 break;
129- case NUX_VK_F4:
130- // Maybe we should not do it here, but it needs to be checked where
131- // we are able to know if alt is pressed.
132- if (special_keys_state & NUX_STATE_ALT)
133- {
134- ubus_manager_.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
135- }
136- break;
137 default:
138+ auto const& close_key = WindowManager::Default()->close_window_key();
139+
140+ if (close_key.first == special_keys_state && close_key.second == x11_key_code)
141+ {
142+ ubus_manager_.SendMessage(UBUS_PLACE_VIEW_CLOSE_REQUEST);
143+ return nullptr;
144+ }
145+
146 direction = KEY_NAV_NONE;
147 }
148
149
150=== modified file 'plugins/unityshell/src/HudController.cpp'
151--- plugins/unityshell/src/HudController.cpp 2012-06-19 16:58:14 +0000
152+++ plugins/unityshell/src/HudController.cpp 2013-10-17 21:01:26 +0000
153@@ -359,17 +359,17 @@
154 LOG_DEBUG(logger) << "Taking application icon: " << focused_app_icon_;
155 SetIcon(focused_app_icon_);
156
157+ visible_ = true;
158+
159 window_->ShowWindow(true);
160- window_->PushToFront();
161 window_->EnableInputWindow(true, "Hud", true, false);
162- window_->SetInputFocus();
163+ FocusInput();
164 window_->CaptureMouseDownAnyWhereElse(true);
165 view_->CaptureMouseDownAnyWhereElse(true);
166 window_->QueueDraw();
167
168 view_->ResetToDefault();
169 need_show_ = true;
170- visible_ = true;
171
172 StartShowHideTimeline();
173 view_->SetWindowGeometry(window_->GetAbsoluteGeometry(), window_->GetGeometry());
174@@ -384,6 +384,15 @@
175 window_->SetEnterFocusInputArea(view_->default_focus());
176 }
177
178+void Controller::FocusInput()
179+{
180+ if (visible_)
181+ {
182+ window_->PushToFront();
183+ window_->SetInputFocus();
184+ }
185+}
186+
187 void Controller::HideHud(bool restore)
188 {
189 LOG_DEBUG (logger) << "hiding the hud";
190
191=== modified file 'plugins/unityshell/src/HudController.h'
192--- plugins/unityshell/src/HudController.h 2012-06-15 18:09:57 +0000
193+++ plugins/unityshell/src/HudController.h 2013-10-17 21:01:26 +0000
194@@ -59,6 +59,8 @@
195 void HideHud(bool restore_focus = true);
196 bool IsVisible();
197
198+ void FocusInput();
199+
200 protected:
201 // Introspectable
202 std::string GetName() const;
203
204=== modified file 'plugins/unityshell/src/HudView.cpp'
205--- plugins/unityshell/src/HudView.cpp 2012-08-20 14:52:48 +0000
206+++ plugins/unityshell/src/HudView.cpp 2013-10-17 21:01:26 +0000
207@@ -29,6 +29,7 @@
208
209 #include "UBusMessages.h"
210 #include "DashStyle.h"
211+#include "WindowManager.h"
212
213 namespace unity
214 {
215@@ -563,6 +564,10 @@
216 unsigned long x11_key_code,
217 unsigned long special_keys_state)
218 {
219+ // Only care about states of Alt, Ctrl, Super, Shift, not the lock keys
220+ special_keys_state &= (nux::NUX_STATE_ALT | nux::NUX_STATE_CTRL |
221+ nux::NUX_STATE_SUPER | nux::NUX_STATE_SHIFT);
222+
223 nux::KeyNavDirection direction = nux::KEY_NAV_NONE;
224 switch (x11_key_code)
225 {
226@@ -590,6 +595,14 @@
227 direction = nux::KEY_NAV_ENTER;
228 break;
229 default:
230+ auto const& close_key = WindowManager::Default()->close_window_key();
231+
232+ if (close_key.first == special_keys_state && close_key.second == x11_key_code)
233+ {
234+ ubus.SendMessage(UBUS_HUD_CLOSE_REQUEST);
235+ return nullptr;
236+ }
237+
238 direction = nux::KEY_NAV_NONE;
239 break;
240 }
241
242=== modified file 'plugins/unityshell/src/IconRenderer.cpp'
243--- plugins/unityshell/src/IconRenderer.cpp 2012-10-17 17:46:12 +0000
244+++ plugins/unityshell/src/IconRenderer.cpp 2013-10-17 21:01:26 +0000
245@@ -188,6 +188,8 @@
246 nux::BaseTexture* progress_bar_fill = 0;
247 nux::BaseTexture* pip_ltr = 0;
248 nux::BaseTexture* pip_rtl = 0;
249+nux::BaseTexture* large_pip_ltr = 0;
250+nux::BaseTexture* large_pip_rtl = 0;
251 nux::BaseTexture* arrow_ltr = 0;
252 nux::BaseTexture* arrow_rtl = 0;
253 nux::BaseTexture* arrow_empty_ltr = 0;
254@@ -871,8 +873,8 @@
255 if (running > 0)
256 {
257 int scale = 1;
258-
259 int markerX;
260+
261 if (pip_style == OUTSIDE_TILE)
262 {
263 markerX = geo.x;
264@@ -880,8 +882,7 @@
265 else
266 {
267 auto bounds = arg.icon->GetTransform(ui::IconTextureSource::TRANSFORM_TILE, monitor);
268- markerX = bounds[0].x + 2;
269- scale = 2;
270+ markerX = bounds[0].x + 1;
271 }
272
273 nux::TexCoordXForm texxform;
274@@ -902,26 +903,47 @@
275
276 if (!arg.running_on_viewport)
277 {
278+ scale = (pip_style == OUTSIDE_TILE) ? 1 : 2;
279 markers[0] = markerCenter;
280 texture = local::arrow_empty_ltr;
281 }
282 else if (running == 1)
283 {
284+ scale = (pip_style == OUTSIDE_TILE) ? 1 : 2;
285 markers[0] = markerCenter;
286 texture = local::arrow_ltr;
287 }
288 else if (running == 2)
289 {
290- markers[0] = markerCenter - 2 * scale;
291- markers[1] = markerCenter + 2 * scale;
292- texture = local::pip_ltr;
293+ if (pip_style == OUTSIDE_TILE)
294+ {
295+ texture = local::pip_ltr;
296+ markers[0] = markerCenter - 2;
297+ markers[1] = markerCenter + 2;
298+ }
299+ else
300+ {
301+ texture = local::large_pip_ltr;
302+ markers[0] = markerCenter - 4;
303+ markers[1] = markerCenter + 4;
304+ }
305 }
306 else
307 {
308- markers[0] = markerCenter - 4 * scale;
309- markers[1] = markerCenter;
310- markers[2] = markerCenter + 4 * scale;
311- texture = local::pip_ltr;
312+ if (pip_style == OUTSIDE_TILE)
313+ {
314+ texture = local::pip_ltr;
315+ markers[0] = markerCenter - 4;
316+ markers[1] = markerCenter;
317+ markers[2] = markerCenter + 4;
318+ }
319+ else
320+ {
321+ texture = local::large_pip_ltr;
322+ markers[0] = markerCenter - 8;
323+ markers[1] = markerCenter;
324+ markers[2] = markerCenter + 8;
325+ }
326 }
327
328
329@@ -1218,10 +1240,12 @@
330 squircle_shine = load_texture(PKGDATADIR"/squircle_shine_54.png");
331
332 pip_ltr = load_texture(PKGDATADIR"/launcher_pip_ltr.png");
333+ large_pip_ltr = load_texture(PKGDATADIR"/launcher_pip_large_ltr.png");
334 arrow_ltr = load_texture(PKGDATADIR"/launcher_arrow_ltr.png");
335 arrow_empty_ltr = load_texture(PKGDATADIR"/launcher_arrow_outline_ltr.png");
336
337 pip_rtl = load_texture(PKGDATADIR"/launcher_pip_rtl.png");
338+ large_pip_rtl = load_texture(PKGDATADIR"/launcher_pip_large_rt.png");
339 arrow_rtl = load_texture(PKGDATADIR"/launcher_arrow_rtl.png");
340 arrow_empty_rtl = load_texture(PKGDATADIR"/launcher_arrow_outline_rtl.png");
341
342@@ -1248,6 +1272,8 @@
343 progress_bar_fill->UnReference();
344 pip_ltr->UnReference();
345 pip_rtl->UnReference();
346+ large_pip_ltr->UnReference();
347+ large_pip_rtl->UnReference();
348 arrow_ltr->UnReference();
349 arrow_rtl->UnReference();
350 arrow_empty_ltr->UnReference();
351
352=== modified file 'plugins/unityshell/src/PluginAdapter.cpp'
353--- plugins/unityshell/src/PluginAdapter.cpp 2013-04-12 08:54:24 +0000
354+++ plugins/unityshell/src/PluginAdapter.cpp 2013-10-17 21:01:26 +0000
355@@ -1118,7 +1118,7 @@
356 void
357 PluginAdapter::Undecorate(guint32 xid)
358 {
359- if (!IsWindowDecorated(xid))
360+ if (!HasWindowDecorations(xid))
361 return;
362
363 MotifWmHints hints = { 0 };
364
365=== modified file 'plugins/unityshell/src/SwitcherController.cpp'
366--- plugins/unityshell/src/SwitcherController.cpp 2012-07-18 15:25:17 +0000
367+++ plugins/unityshell/src/SwitcherController.cpp 2013-10-17 21:01:26 +0000
368@@ -40,7 +40,7 @@
369 }
370
371 Controller::Controller(unsigned int load_timeout)
372- : timeout_length(75)
373+ : timeout_length(50)
374 , detail_on_timeout(true)
375 , detail_timeout_length(500)
376 , initial_detail_timeout_length(1500)
377@@ -91,12 +91,15 @@
378 void Controller::Show(ShowMode show, SortMode sort, bool reverse,
379 std::vector<AbstractLauncherIcon::Ptr> results)
380 {
381+ if (results.empty() || visible_)
382+ return;
383+
384 if (sort == SortMode::FOCUS_ORDER)
385 {
386 std::sort(results.begin(), results.end(), CompareSwitcherItemsPriority);
387 }
388
389- model_.reset(new SwitcherModel(results));
390+ model_ = std::make_shared<SwitcherModel>(results);
391 AddChild(model_.get());
392 model_->selection_changed.connect(sigc::mem_fun(this, &Controller::OnModelSelectionChanged));
393 model_->only_detail_on_viewport = (show == ShowMode::CURRENT_VIEWPORT);
394@@ -192,7 +195,8 @@
395
396 ubus_manager_.SendMessage(UBUS_SWITCHER_START);
397
398- if (view_window_) {
399+ if (view_window_)
400+ {
401 view_window_->ShowWindow(true);
402 view_window_->PushToFront();
403 view_window_->SetOpacity(1.0f);
404@@ -218,7 +222,6 @@
405 view_window_->SetLayout(main_layout_);
406 view_window_->SetBackgroundColor(nux::Color(0x00000000));
407 view_window_->SetGeometry(workarea_);
408- view_window_->EnableInputWindow(true, "Switcher", false, false);
409 }
410 }
411
412@@ -303,7 +306,6 @@
413 view_window_->SetOpacity(0.0f);
414 view_window_->ShowWindow(false);
415 view_window_->PushToBack();
416- view_window_->EnableInputWindow(false);
417 }
418
419 if (show_timer_)
420
421=== modified file 'plugins/unityshell/src/SwitcherController.h'
422--- plugins/unityshell/src/SwitcherController.h 2012-06-25 23:18:15 +0000
423+++ plugins/unityshell/src/SwitcherController.h 2013-10-17 21:01:26 +0000
424@@ -29,7 +29,6 @@
425 #include "SwitcherView.h"
426 #include "UBusWrapper.h"
427
428-#include <boost/shared_ptr.hpp>
429 #include <sigc++/sigc++.h>
430
431 #include <Nux/Nux.h>
432
433=== modified file 'plugins/unityshell/src/SwitcherModel.h'
434--- plugins/unityshell/src/SwitcherModel.h 2012-08-15 18:26:01 +0000
435+++ plugins/unityshell/src/SwitcherModel.h 2013-10-17 21:01:26 +0000
436@@ -27,7 +27,7 @@
437
438 #include "Introspectable.h"
439
440-#include <boost/shared_ptr.hpp>
441+#include <memory>
442 #include <sigc++/sigc++.h>
443
444 namespace unity
445@@ -39,7 +39,7 @@
446 {
447
448 public:
449- typedef boost::shared_ptr<SwitcherModel> Ptr;
450+ typedef std::shared_ptr<SwitcherModel> Ptr;
451
452 typedef std::vector<launcher::AbstractLauncherIcon::Ptr> Base;
453 typedef Base::iterator iterator;
454
455=== modified file 'plugins/unityshell/src/WindowManager.h'
456--- plugins/unityshell/src/WindowManager.h 2013-04-12 08:54:24 +0000
457+++ plugins/unityshell/src/WindowManager.h 2013-10-17 21:01:26 +0000
458@@ -20,6 +20,7 @@
459 #define WINDOW_MANAGER_H
460
461 #include <Nux/Nux.h>
462+#include <NuxCore/Property.h>
463 #include <gdk/gdkx.h>
464 #include <core/core.h>
465
466@@ -110,6 +111,9 @@
467 virtual bool saveInputFocus() = 0;
468 virtual bool restoreInputFocus() = 0;
469
470+ // Nux Modifiers, Nux Keycode (= X11 KeySym)
471+ nux::Property<std::pair<unsigned, unsigned>> close_window_key;
472+
473 // Signals
474 sigc::signal<void, guint32> window_mapped;
475 sigc::signal<void, guint32> window_unmapped;
476
477=== modified file 'plugins/unityshell/src/unity-util-accessible.cpp'
478--- plugins/unityshell/src/unity-util-accessible.cpp 2012-01-04 01:54:41 +0000
479+++ plugins/unityshell/src/unity-util-accessible.cpp 2013-10-17 21:01:26 +0000
480@@ -324,9 +324,9 @@
481 }
482
483 atk_event->string = NULL;
484- if (event->text && event->text[0])
485+ if (event->dtext && event->dtext[0])
486 {
487- key_unichar = g_utf8_get_char(event->text);
488+ key_unichar = g_utf8_get_char(event->dtext);
489
490 if (g_unichar_validate(key_unichar) && g_unichar_isgraph(key_unichar))
491 {
492
493=== modified file 'plugins/unityshell/src/unityshell.cpp'
494--- plugins/unityshell/src/unityshell.cpp 2013-04-12 08:54:24 +0000
495+++ plugins/unityshell/src/unityshell.cpp 2013-10-17 21:01:26 +0000
496@@ -351,12 +351,6 @@
497 ubus_manager_.RegisterInterest(UBUS_LAUNCHER_END_KEY_SWTICHER,
498 sigc::mem_fun(this, &UnityScreen::OnLauncherEndKeyNav));
499
500- ubus_manager_.RegisterInterest(UBUS_SWITCHER_START,
501- sigc::mem_fun(this, &UnityScreen::OnSwitcherStart));
502-
503- ubus_manager_.RegisterInterest(UBUS_SWITCHER_END,
504- sigc::mem_fun(this, &UnityScreen::OnSwitcherEnd));
505-
506 g_idle_add_full (G_PRIORITY_DEFAULT, &UnityScreen::initPluginActions, this, NULL);
507 super_keypressed_ = false;
508
509@@ -944,7 +938,7 @@
510 {
511 /* Create a new keybinding for the Escape key and the current modifiers,
512 * compiz will take of the ref-counting of the repeated actions */
513- KeyCode escape = XKeysymToKeycode(screen->dpy(), XStringToKeysym("Escape"));
514+ KeyCode escape = XKeysymToKeycode(screen->dpy(), XK_Escape);
515 CompAction::KeyBinding binding(escape, modifiers);
516
517 CompActionPtr &escape_action = _escape_actions[target];
518@@ -1604,6 +1598,16 @@
519 break;
520 }
521 }
522+ else if (switcher_controller_->Visible())
523+ {
524+ auto const& close_key = PluginAdapter::Default()->close_window_key();
525+
526+ if (key_sym == close_key.second && XModifiersToNux(event->xkey.state) == close_key.first)
527+ {
528+ switcher_controller_->Hide(false);
529+ skip_other_plugins = true;
530+ }
531+ }
532
533 if (result > 0)
534 {
535@@ -1673,10 +1677,9 @@
536 }
537
538 if (!skip_other_plugins &&
539- screen->otherGrabExist("deco", "move", "switcher", "resize", NULL) &&
540- !switcher_controller_->Visible())
541+ screen->otherGrabExist("deco", "move", "switcher", "resize", "unity-switcher", nullptr))
542 {
543- wt->ProcessForeignEvent(event, NULL);
544+ wt->ProcessForeignEvent(event, nullptr);
545 }
546 }
547
548@@ -2105,41 +2108,10 @@
549
550 void UnityScreen::OnLauncherEndKeyNav(GVariant* data)
551 {
552- RestoreWindow(data);
553-}
554-
555-void UnityScreen::OnSwitcherStart(GVariant* data)
556-{
557- if (switcher_controller_->Visible())
558- {
559- newFocusedWindow = screen->findWindow(switcher_controller_->GetSwitcherInputWindowId());
560-
561- if (switcher_controller_->GetSwitcherInputWindowId() != screen->activeWindow())
562- PluginAdapter::Default()->saveInputFocus();
563-
564- if (newFocusedWindow)
565- newFocusedWindow->moveInputFocusTo();
566- }
567-}
568-
569-void UnityScreen::OnSwitcherEnd(GVariant* data)
570-{
571- RestoreWindow(data);
572-}
573-
574-void UnityScreen::RestoreWindow(GVariant* data)
575-{
576- bool preserve_focus = false;
577-
578- if (data)
579- {
580- preserve_focus = g_variant_get_boolean(data);
581- }
582-
583 // Return input-focus to previously focused window (before key-nav-mode was
584 // entered)
585- if (preserve_focus)
586- PluginAdapter::Default ()->restoreInputFocus ();
587+ if (data && g_variant_get_boolean(data))
588+ PluginAdapter::Default()->restoreInputFocus();
589 }
590
591 bool UnityScreen::ShowHud()
592@@ -2226,9 +2198,70 @@
593 return ShowHud();
594 }
595
596+unsigned UnityScreen::CompizModifiersToNux(unsigned input) const
597+{
598+ unsigned modifiers = 0;
599+
600+ if (input & CompAltMask)
601+ {
602+ input &= ~CompAltMask;
603+ input |= Mod1Mask;
604+ }
605+
606+ if (modifiers & CompSuperMask)
607+ {
608+ input &= ~CompSuperMask;
609+ input |= Mod4Mask;
610+ }
611+
612+ return XModifiersToNux(input);
613+}
614+
615+unsigned UnityScreen::XModifiersToNux(unsigned input) const
616+{
617+ unsigned modifiers = 0;
618+
619+ if (input & Mod1Mask)
620+ modifiers |= nux::KEY_MODIFIER_ALT;
621+
622+ if (input & ShiftMask)
623+ modifiers |= nux::KEY_MODIFIER_SHIFT;
624+
625+ if (input & ControlMask)
626+ modifiers |= nux::KEY_MODIFIER_CTRL;
627+
628+ if (input & Mod4Mask)
629+ modifiers |= nux::KEY_MODIFIER_SUPER;
630+
631+ return modifiers;
632+}
633+
634+void UnityScreen::UpdateCloseWindowKey(CompAction::KeyBinding const& keybind)
635+{
636+ KeySym keysym = XkbKeycodeToKeysym(screen->dpy(), keybind.keycode(), 0, 0);
637+ unsigned modifiers = CompizModifiersToNux(keybind.modifiers());
638+
639+ WindowManager::Default()->close_window_key = std::make_pair(modifiers, keysym);
640+}
641+
642 gboolean UnityScreen::initPluginActions(gpointer data)
643 {
644- CompPlugin* p = CompPlugin::find("expo");
645+ CompPlugin* p = CompPlugin::find("core");
646+ auto self = static_cast<UnityScreen*>(data);
647+
648+ if (p)
649+ {
650+ for (CompOption& option : p->vTable->getOptions())
651+ {
652+ if (option.name() == "close_window_key")
653+ {
654+ self->UpdateCloseWindowKey(option.value().action().key());
655+ break;
656+ }
657+ }
658+ }
659+
660+ p = CompPlugin::find("expo");
661
662 if (p)
663 {
664@@ -2398,7 +2431,7 @@
665 PAINT_WINDOW_TRANSFORMED_MASK |
666 PAINT_WINDOW_NO_CORE_INSTANCE_MASK;
667 if (!(mask & nonOcclusionBits) &&
668- (window->state() & CompWindowStateFullscreenMask))
669+ (window->state() & CompWindowStateFullscreenMask && !window->minimized()))
670 // And I've been advised to test other things, but they don't work:
671 // && (attrib.opacity == OPAQUE)) <-- Doesn't work; Only set in glDraw
672 // && !window->alpha() <-- Doesn't work; Opaque windows often have alpha
673@@ -2639,12 +2672,17 @@
674 if (n == CompWindowNotifyFocusChange)
675 {
676 UnityScreen* us = UnityScreen::get(screen);
677- CompWindow *lw;
678
679- if (us->launcher_controller_->IsOverlayOpen())
680+ if (us)
681 {
682- lw = screen->findWindow(us->launcher_controller_->LauncherWindowId(0));
683- lw->moveInputFocusTo();
684+ if (us->dash_controller_->IsVisible())
685+ {
686+ us->dash_controller_->FocusInput();
687+ }
688+ else if(us->hud_controller_->IsVisible())
689+ {
690+ us->hud_controller_->FocusInput();
691+ }
692 }
693 }
694 }
695@@ -2995,9 +3033,16 @@
696 bool status = screen->setOptionForPlugin(plugin, name, v);
697 if (status)
698 {
699- if (strcmp(plugin, "core") == 0 && strcmp(name, "hsize") == 0)
700+ if (strcmp(plugin, "core") == 0)
701 {
702- launcher_controller_->UpdateNumWorkspaces(screen->vpSize().width() * screen->vpSize().height());
703+ if (strcmp(name, "hsize") == 0 || strcmp(name, "vsize") == 0)
704+ {
705+ launcher_controller_->UpdateNumWorkspaces(screen->vpSize().width() * screen->vpSize().height());
706+ }
707+ else if (strcmp(name, "close_window_key") == 0)
708+ {
709+ UpdateCloseWindowKey(v.action().key());
710+ }
711 }
712 }
713 return status;
714
715=== modified file 'plugins/unityshell/src/unityshell.h'
716--- plugins/unityshell/src/unityshell.h 2013-04-12 08:54:24 +0000
717+++ plugins/unityshell/src/unityshell.h 2013-10-17 21:01:26 +0000
718@@ -232,15 +232,15 @@
719 void OnLauncherStartKeyNav(GVariant* data);
720 void OnLauncherEndKeyNav(GVariant* data);
721
722- void OnSwitcherStart(GVariant* data);
723- void OnSwitcherEnd(GVariant* data);
724-
725- void RestoreWindow(GVariant* data);
726-
727 void InitHints();
728
729 void OnPanelStyleChanged();
730
731+ unsigned CompizModifiersToNux(unsigned input) const;
732+ unsigned XModifiersToNux(unsigned input) const;
733+
734+ void UpdateCloseWindowKey(CompAction::KeyBinding const&);
735+
736 dash::Settings dash_settings_;
737 dash::Style dash_style_;
738 panel::Style panel_style_;
739
740=== modified file 'services/panel-indicator-entry-accessible.c'
741--- services/panel-indicator-entry-accessible.c 2012-03-23 12:26:38 +0000
742+++ services/panel-indicator-entry-accessible.c 2013-10-17 21:01:26 +0000
743@@ -30,6 +30,7 @@
744 struct _PanelIndicatorEntryAccessiblePrivate
745 {
746 IndicatorObjectEntry *entry;
747+ GtkMenu *menu;
748 PanelService *service;
749 gint x;
750 gint y;
751@@ -111,6 +112,25 @@
752 }
753
754 static void
755+panel_indicator_entry_accessible_dispose (GObject *object)
756+{
757+ PanelIndicatorEntryAccessible *piea;
758+
759+ g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (object));
760+
761+ piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (object);
762+
763+ if (piea->priv != NULL)
764+ {
765+ piea->priv->entry = NULL;
766+ g_clear_object(&piea->priv->menu);
767+ }
768+
769+ G_OBJECT_CLASS (panel_indicator_entry_accessible_parent_class)->dispose (object);
770+ return;
771+}
772+
773+static void
774 panel_indicator_entry_accessible_finalize (GObject *object)
775 {
776 PanelIndicatorEntryAccessible *piea;
777@@ -136,6 +156,7 @@
778
779 /* GObject */
780 object_class = G_OBJECT_CLASS (klass);
781+ object_class->dispose = panel_indicator_entry_accessible_dispose;
782 object_class->finalize = panel_indicator_entry_accessible_finalize;
783
784 /* AtkObject */
785@@ -225,6 +246,10 @@
786
787 piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible);
788 piea->priv->entry = (IndicatorObjectEntry *) data;
789+ if (piea->priv->entry->menu != NULL)
790+ {
791+ piea->priv->menu = g_object_ref(piea->priv->entry->menu);
792+ }
793
794 if (GTK_IS_LABEL (piea->priv->entry->label))
795 {
796@@ -253,7 +278,7 @@
797
798 piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible);
799
800- if (piea->priv->entry->parent_object && GTK_IS_MENU (piea->priv->entry->menu))
801+ if (piea->priv->entry != NULL && piea->priv->entry->parent_object && piea->priv->menu != NULL && GTK_IS_MENU (piea->priv->menu))
802 n_children = 1;
803
804 return n_children;
805
806=== modified file 'services/panel-service.c'
807--- services/panel-service.c 2012-04-27 11:42:56 +0000
808+++ services/panel-service.c 2013-10-17 21:01:26 +0000
809@@ -609,6 +609,16 @@
810 gpointer key, value;
811
812 entry = l->data;
813+
814+ if (GTK_IS_LABEL (entry->label))
815+ {
816+ g_signal_handlers_disconnect_by_data (entry->label, indicator);
817+ }
818+ if (GTK_IS_IMAGE (entry->image))
819+ {
820+ g_signal_handlers_disconnect_by_data (entry->image, indicator);
821+ }
822+
823 entry_id = get_indicator_entry_id_by_entry (entry);
824 g_hash_table_remove (self->priv->id2entry_hash, entry_id);
825 g_free (entry_id);
826@@ -635,6 +645,7 @@
827 g_object_ref_sink (G_OBJECT (indicator));
828 }
829
830+ g_signal_handlers_disconnect_by_data (indicator, self);
831 g_object_unref (G_OBJECT (indicator));
832 }
833
834@@ -882,6 +893,15 @@
835 * FIXME this in libappmenu.so to avoid to send an "entry-removed" signal
836 * when switching the focus from a window to one of its dialog children */
837
838+ if (GTK_IS_LABEL (entry->label))
839+ {
840+ g_signal_handlers_disconnect_by_data (entry->label, object);
841+ }
842+ if (GTK_IS_IMAGE (entry->image))
843+ {
844+ g_signal_handlers_disconnect_by_data (entry->image, object);
845+ }
846+
847 gchar *entry_id = get_indicator_entry_id_by_entry (entry);
848 g_hash_table_remove (self->priv->id2entry_hash, entry_id);
849 g_free (entry_id);
850
851=== modified file 'tests/autopilot/autopilot/tests/test_dash.py'
852--- tests/autopilot/autopilot/tests/test_dash.py 2012-06-27 01:19:32 +0000
853+++ tests/autopilot/autopilot/tests/test_dash.py 2013-10-17 21:01:26 +0000
854@@ -60,6 +60,15 @@
855 self.keyboard.press_and_release("Alt+F4")
856 self.assertThat(self.dash.visible, Eventually(Equals(False)))
857
858+ def test_alt_f4_close_dash_with_capslock_on(self):
859+ """Dash must close on Alt+F4 even when the capslock is turned on."""
860+ self.keyboard.press_and_release("Caps_Lock")
861+ self.addCleanup(self.keyboard.press_and_release, "Caps_Lock")
862+
863+ self.dash.ensure_visible()
864+ self.keyboard.press_and_release("Alt+F4")
865+ self.assertThat(self.dash.visible, Eventually(Equals(False)))
866+
867 def test_dash_closes_on_spread(self):
868 """This test shows that when the spread is initiated, the dash closes."""
869 self.dash.ensure_visible()
870
871=== modified file 'tests/autopilot/autopilot/tests/test_hud.py'
872--- tests/autopilot/autopilot/tests/test_hud.py 2012-06-25 22:02:54 +0000
873+++ tests/autopilot/autopilot/tests/test_hud.py 2013-10-17 21:01:26 +0000
874@@ -266,6 +266,15 @@
875
876 self.assertThat(self.hud.visible, Eventually(Equals(False)))
877
878+ def test_alt_f4_close_hud_with_capslock_on(self):
879+ """Hud must close on Alt+F4 even when the capslock is turned on."""
880+ self.keyboard.press_and_release("Caps_Lock")
881+ self.addCleanup(self.keyboard.press_and_release, "Caps_Lock")
882+
883+ self.hud.ensure_visible()
884+ self.keyboard.press_and_release("Alt+F4")
885+ self.assertThat(self.hud.visible, Eventually(Equals(False)))
886+
887
888 class HudLauncherInteractionsTests(HudTestsBase):
889

Subscribers

People subscribed via source and target branches

to all changes: