Merge lp:~azzar1/unity/whitelist-repated-keys-sru into lp:unity/7.4

Proposed by Andrea Azzarone on 2016-05-30
Status: Superseded
Proposed branch: lp:~azzar1/unity/whitelist-repated-keys-sru
Merge into: lp:unity/7.4
Diff against target: 1214 lines (+342/-245)
21 files modified
com.canonical.Unity.gschema.xml (+10/-0)
debian/changelog (+29/-1)
launcher/ExpoLauncherIcon.cpp (+2/-1)
launcher/LauncherController.cpp (+1/-1)
launcher/LauncherIcon.cpp (+2/-0)
launcher/SoftwareCenterLauncherIcon.cpp (+1/-1)
launcher/SwitcherController.cpp (+4/-5)
launcher/SwitcherView.cpp (+8/-10)
launcher/SwitcherView.h (+0/-4)
plugins/unityshell/src/WindowMinimizeSpeedController.cpp (+1/-0)
plugins/unityshell/src/inputremover.cpp (+1/-1)
plugins/unityshell/src/unityshell.cpp (+68/-28)
plugins/unityshell/src/unityshell.h (+163/-187)
tests/test_gnome_session_manager.cpp (+10/-0)
tests/test_switcher_controller.cpp (+2/-3)
unity-shared/DashStyle.cpp (+1/-1)
unity-shared/DecorationStyle.cpp (+1/-0)
unity-shared/DecorationStyle.h (+1/-0)
unity-shared/GnomeKeyGrabber.cpp (+29/-2)
unity-shared/GnomeKeyGrabberImpl.h (+7/-0)
unity-shared/PanelStyle.cpp (+1/-0)
To merge this branch: bzr merge lp:~azzar1/unity/whitelist-repated-keys-sru
Reviewer Review Type Date Requested Status
Unity Team 2016-05-30 Pending
Review via email: mp+296055@code.launchpad.net

This proposal has been superseded by a proposal from 2016-05-30.

Commit message

Add whitelist for auto-repated keys.

Description of the change

Add whitelist for auto-repated keys.

To post a comment you must log in.
4120. By Andrea Azzarone on 2016-05-30

Fix spaces.

4121. By Andrea Azzarone on 2016-05-30

Add XF86KbdBrightnessDown and XF86KbdBrightnessUp to the whitelist.

Unmerged revisions

4121. By Andrea Azzarone on 2016-05-30

Add XF86KbdBrightnessDown and XF86KbdBrightnessUp to the whitelist.

4120. By Andrea Azzarone on 2016-05-30

Fix spaces.

4119. By Andrea Azzarone on 2016-05-30

Add whitelist for auto-repated keys.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'com.canonical.Unity.gschema.xml'
2--- com.canonical.Unity.gschema.xml 2016-03-18 01:47:08 +0000
3+++ com.canonical.Unity.gschema.xml 2016-05-30 16:03:09 +0000
4@@ -81,6 +81,16 @@
5 integrated menus are enabled), otherwise they will be shown only when
6 the mouse cursor is over the relative mouse area.</description>
7 </key>
8+ <key type="as" name="whitelist-repeated-keys">
9+ <default>[
10+ 'XF86MonBrightnessUp',
11+ 'XF86MonBrightnessDown',
12+ 'XF86AudioRaiseVolume',
13+ 'XF86AudioLowerVolume'
14+ ]</default>
15+ <summary>List of keycodes that should be processed even if auto-repated.</summary>
16+ <description>These keycodes are processed even if they are auto-repeated.</description>
17+ </key>
18 </schema>
19 <schema path="/com/canonical/unity/interface/" id="com.canonical.Unity.Interface" gettext-domain="unity">
20 <key type="d" name="text-scale-factor">
21
22=== modified file 'debian/changelog'
23--- debian/changelog 2016-05-14 23:01:37 +0000
24+++ debian/changelog 2016-05-30 16:03:09 +0000
25@@ -1,7 +1,35 @@
26-unity (7.4.0-0ubuntu1) UNRELEASED; urgency=medium
27+unity (7.4.0+16.04.20160526-0ubuntu1) UNRELEASED; urgency=medium
28
29+ [ Marco Trevisan (Treviño) ]
30 * Releasing Unity 7.4.0
31
32+ [ Andrea Azzarone ]
33+ * Properly remove SoftwareCenterLauncherIcon in case of failure. (LP:
34+ #1553165)
35+ * Update ExpoLauncherIcon in case the quicklist is used to switch vp.
36+ (LP: #1525685)
37+ * GnomeKeyGrabber: do not activate an action if it's a repeated one.
38+ (LP: #1572241)
39+ * Properly calculate array indexes to avoid crashes. (LP: #1570843)
40+ * Fallback to "background" class in case no background is specified
41+ for title bars and top panel. (LP: #1575527)
42+ * Do not reset the shortcut for icons that have their own shortcut.
43+ (LP: #1562847)
44+
45+ [ Marco Trevisan (Treviño) ]
46+ * SwitcherView: close the mouse-selected application on middle-click
47+ (LP: #1574689)
48+ * UnityScreen, UnityWindow: cleanup a little the code, and ensure
49+ overridden CompositeWindow functions get actually called
50+ * SwitcherController: don't try to get a window from empty selections
51+ (LP: #1580211)
52+ * DashStyle: ensure LazyLoadTexture disconnects from signals on
53+ destruction (LP: #1580212)
54+
55+ [ handsome_feng ]
56+ * Change the x_offset of expo when launcher position changed. (LP:
57+ #1562348, LP: #1573897)
58+
59 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Sun, 15 May 2016 01:00:09 +0200
60
61 unity (7.4.0+16.04.20160415-0ubuntu1) xenial; urgency=medium
62
63=== modified file 'launcher/ExpoLauncherIcon.cpp'
64--- launcher/ExpoLauncherIcon.cpp 2015-11-20 11:35:08 +0000
65+++ launcher/ExpoLauncherIcon.cpp 2016-05-30 16:03:09 +0000
66@@ -127,8 +127,9 @@
67 dbusmenu_menuitem_property_set_int(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED);
68 }
69
70- signals_.Add(new ItemSignal(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, [h, v] (DbusmenuMenuitem*, int) {
71+ signals_.Add(new ItemSignal(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, [this, h, v] (DbusmenuMenuitem*, int) {
72 WindowManager::Default().SetCurrentViewport({h, v});
73+ UpdateIcon();
74 }));
75 result.push_back(menu_item);
76 }
77
78=== modified file 'launcher/LauncherController.cpp'
79--- launcher/LauncherController.cpp 2016-03-18 01:47:08 +0000
80+++ launcher/LauncherController.cpp 2016-05-30 16:03:09 +0000
81@@ -555,7 +555,7 @@
82 icon->SetShortcut(std::to_string(shortcut % 10)[0]);
83 ++shortcut;
84 }
85- else
86+ else if (isdigit(icon->GetShortcut()))
87 {
88 // reset shortcut
89 icon->SetShortcut(0);
90
91=== modified file 'launcher/LauncherIcon.cpp'
92--- launcher/LauncherIcon.cpp 2016-03-18 01:47:08 +0000
93+++ launcher/LauncherIcon.cpp 2016-05-30 16:03:09 +0000
94@@ -42,6 +42,8 @@
95 #include <UnityCore/GLibWrapper.h>
96 #include <UnityCore/Variant.h>
97
98+#include <numeric>
99+
100 namespace unity
101 {
102 namespace launcher
103
104=== modified file 'launcher/SoftwareCenterLauncherIcon.cpp'
105--- launcher/SoftwareCenterLauncherIcon.cpp 2016-03-18 01:47:08 +0000
106+++ launcher/SoftwareCenterLauncherIcon.cpp 2016-05-30 16:03:09 +0000
107@@ -133,7 +133,7 @@
108 else
109 {
110 // failure condition, remove icon again
111- UnStick();
112+ Remove();
113 }
114
115 aptdaemon_trans_.reset();
116
117=== modified file 'launcher/SwitcherController.cpp'
118--- launcher/SwitcherController.cpp 2016-03-21 15:38:17 +0000
119+++ launcher/SwitcherController.cpp 2016-05-30 16:03:09 +0000
120@@ -453,10 +453,6 @@
121 view_->background_color = WindowManager::Default().average_color();
122 view_->monitor = obj_->monitor_;
123 view_->hide_request.connect(sigc::mem_fun(this, &Controller::Impl::Hide));
124- view_->switcher_mouse_up.connect([this] (int icon_index, int button) {
125- if (button == 3)
126- InitiateDetail(true);
127- });
128
129 view_->switcher_mouse_move.connect([this] (int icon_index) {
130 if (icon_index >= 0)
131@@ -690,7 +686,10 @@
132 }
133 else if (model_->SelectionIsActive())
134 {
135- window = model_->SelectionWindows().front();
136+ auto const& selection_windows = model_->SelectionWindows();
137+
138+ if (!selection_windows.empty())
139+ window = selection_windows.front();
140 }
141 }
142 }
143
144=== modified file 'launcher/SwitcherView.cpp'
145--- launcher/SwitcherView.cpp 2016-03-21 15:38:17 +0000
146+++ launcher/SwitcherView.cpp 2016-05-30 16:03:09 +0000
147@@ -381,8 +381,6 @@
148 int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);
149
150 last_detail_icon_selected_ = detail_icon_index;
151-
152- switcher_mouse_down.emit(detail_icon_index, button);
153 }
154
155 void SwitcherView::HandleMouseDown(int x, int y, int button)
156@@ -390,8 +388,6 @@
157 int icon_index = IconIndexAt(x,y);
158
159 last_icon_selected_ = icon_index;
160-
161- switcher_mouse_down.emit(icon_index, button);
162 }
163
164 void SwitcherView::RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long /*key_flags*/)
165@@ -413,8 +409,6 @@
166 nux::Point const& mouse_pos = CalculateMouseMonitorOffset(x, y);
167 int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);
168
169- switcher_mouse_up.emit(detail_icon_index, button);
170-
171 if (button == 1)
172 {
173 if (detail_icon_index >= 0 && detail_icon_index == last_detail_icon_selected_)
174@@ -437,14 +431,18 @@
175 {
176 int icon_index = IconIndexAt(x,y);
177
178- switcher_mouse_up.emit(icon_index, button);
179-
180- if (button == 1)
181+ if (button == 1 || button == 2 || button == 3)
182 {
183 if (icon_index >= 0 && icon_index == last_icon_selected_)
184 {
185 model_->Select(icon_index);
186- hide_request.emit(true);
187+
188+ if (button == 1)
189+ hide_request.emit(true);
190+ else if (button == 2)
191+ switcher_close_current.emit();
192+ else if (button == 3)
193+ switcher_start_detail.emit();
194 }
195 }
196 }
197
198=== modified file 'launcher/SwitcherView.h'
199--- launcher/SwitcherView.h 2015-11-02 18:28:31 +0000
200+++ launcher/SwitcherView.h 2016-05-30 16:03:09 +0000
201@@ -73,10 +73,6 @@
202 int IconIndexAt(int x, int y) const;
203 int DetailIconIdexAt(int x, int y) const;
204
205- /* void; int icon_index, int button*/
206- sigc::signal<void, int, int> switcher_mouse_down;
207- sigc::signal<void, int, int> switcher_mouse_up;
208-
209 /* void; int icon_index */
210 sigc::signal<void, int> switcher_mouse_move;
211
212
213=== modified file 'plugins/unityshell/src/WindowMinimizeSpeedController.cpp'
214--- plugins/unityshell/src/WindowMinimizeSpeedController.cpp 2013-11-14 03:00:29 +0000
215+++ plugins/unityshell/src/WindowMinimizeSpeedController.cpp 2016-05-30 16:03:09 +0000
216@@ -19,6 +19,7 @@
217 * not be able to re-use it if you want to use a different licence.
218 */
219
220+#include <cmath>
221 #include <gio/gio.h>
222 #include <NuxCore/Logger.h>
223
224
225=== modified file 'plugins/unityshell/src/inputremover.cpp'
226--- plugins/unityshell/src/inputremover.cpp 2016-03-09 17:25:16 +0000
227+++ plugins/unityshell/src/inputremover.cpp 2016-05-30 16:03:09 +0000
228@@ -354,7 +354,7 @@
229
230 for (int i = 0; i < nInput; ++i)
231 {
232- const unsigned int position = dataSize + (i * 4);
233+ const unsigned int position = headerSize + (i * 4);
234
235 data[position + 0] = input[i].x;
236 data[position + 1] = input[i].y;
237
238=== modified file 'plugins/unityshell/src/unityshell.cpp'
239--- plugins/unityshell/src/unityshell.cpp 2016-03-31 05:57:11 +0000
240+++ plugins/unityshell/src/unityshell.cpp 2016-05-30 16:03:09 +0000
241@@ -203,8 +203,7 @@
242 , doShellRepaint(false)
243 , didShellRepaint(false)
244 , allowWindowPaint(false)
245- , _key_nav_mode_requested(false)
246- , _last_output(nullptr)
247+ , last_output_(nullptr)
248 , force_draw_countdown_(0)
249 , firstWindowAboveShell(nullptr)
250 , onboard_(nullptr)
251@@ -215,12 +214,13 @@
252 , first_menu_keypress_time_(0)
253 , paint_panel_under_dash_(false)
254 , scale_just_activated_(false)
255- , big_tick_(0)
256 , screen_introspection_(screen)
257 , ignore_redraw_request_(false)
258 , dirty_helpers_on_this_frame_(false)
259+ , is_desktop_active_(false)
260+ , key_nav_mode_requested_(false)
261+ , big_tick_(0)
262 , back_buffer_age_(0)
263- , is_desktop_active_(false)
264 {
265 Timer timer;
266 #ifndef USE_GLES
267@@ -341,7 +341,7 @@
268 tick_source_.reset(new na::TickSource);
269 animation_controller_.reset(new na::AnimationController(*tick_source_));
270
271- wt->RedrawRequested.connect(sigc::mem_fun(this, &UnityScreen::onRedrawRequested));
272+ wt->RedrawRequested.connect(sigc::mem_fun(this, &UnityScreen::OnRedrawRequested));
273
274 unity_a11y_init(wt.get());
275
276@@ -692,7 +692,7 @@
277 /* In some unknown place inside nux drawing we change the viewport without
278 * setting it back to the default one, so we need to restore it before allowing
279 * compiz to take the scene */
280- auto* o = _last_output;
281+ auto* o = last_output_;
282 glViewport(o->x(), screen->height() - o->y2(), o->width(), o->height());
283
284 glDepthRange(0, 1);
285@@ -748,7 +748,7 @@
286 if (WM.IsExpoActive())
287 return;
288
289- CompOutput* output = _last_output;
290+ CompOutput* output = last_output_;
291
292 if (fullscreenRegion.contains(*output))
293 return;
294@@ -863,7 +863,7 @@
295
296 void UnityScreen::paintDisplay()
297 {
298- CompOutput *output = _last_output;
299+ CompOutput *output = last_output_;
300
301 DrawPanelUnderDash();
302
303@@ -990,7 +990,7 @@
304
305 auto const& output_dev = screen->currentOutputDev();
306
307- if (_last_output->id() != output_dev.id())
308+ if (last_output_->id() != output_dev.id())
309 return;
310
311 auto graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine();
312@@ -1485,7 +1485,7 @@
313 );
314
315 allowWindowPaint = true;
316- _last_output = output;
317+ last_output_ = output;
318 paint_panel_under_dash_ = false;
319
320 // CompRegion has no clear() method. So this is the fastest alternative.
321@@ -1522,7 +1522,7 @@
322 * this output.
323 *
324 * However, damaging nux has a side effect of notifying compiz
325- * through onRedrawRequested that we need to queue another frame.
326+ * through OnRedrawRequested that we need to queue another frame.
327 * In most cases that would be desirable, and in the case where
328 * we did that in damageCutoff, it would not be a problem as compiz
329 * does not queue up new frames for damage that can be processed
330@@ -1687,7 +1687,7 @@
331 wt->ForeignFrameEnded();
332
333 if (animation_controller_->HasRunningAnimations())
334- onRedrawRequested();
335+ OnRedrawRequested();
336
337 for (auto it = ShowdesktopHandler::animating_windows.begin(); it != ShowdesktopHandler::animating_windows.end();)
338 {
339@@ -1813,7 +1813,7 @@
340 else if (!screen->grabbed() && event->xfocus.mode == NotifyWhileGrabbed)
341 wm.OnScreenGrabbed();
342
343- if (_key_nav_mode_requested)
344+ if (key_nav_mode_requested_)
345 {
346 // Close any overlay that is open.
347 if (launcher_controller_->IsOverlayOpen())
348@@ -1821,7 +1821,7 @@
349 dash_controller_->HideDash();
350 hud_controller_->HideHud();
351 }
352- _key_nav_mode_requested = false;
353+ key_nav_mode_requested_ = false;
354 launcher_controller_->KeyNavGrab();
355 }
356 break;
357@@ -2343,7 +2343,7 @@
358 else if (WM.IsExpoActive())
359 WM.TerminateExpo();
360
361- _key_nav_mode_requested = true;
362+ key_nav_mode_requested_ = true;
363 return true;
364 }
365
366@@ -3542,7 +3542,7 @@
367 LOG_INFO(logger) << "UnityScreen::InitNuxThread: " << timer.ElapsedSeconds() << "s";
368 }
369
370-void UnityScreen::onRedrawRequested()
371+void UnityScreen::OnRedrawRequested()
372 {
373 if (!ignore_redraw_request_)
374 cScreen->damagePending();
375@@ -3623,7 +3623,17 @@
376
377 int scale_offset = (launcher_options->hide_mode == LAUNCHER_HIDE_NEVER) ? 0 : launcher_controller_->launcher().GetWidth();
378 CompOption::Value v(scale_offset);
379- screen->setOptionForPlugin("scale", "x_offset", v);
380+ CompOption::Value bv(0);
381+ if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
382+ {
383+ screen->setOptionForPlugin("scale", "x_offset", v);
384+ screen->setOptionForPlugin("scale", "y_bottom_offset", bv);
385+ }
386+ else
387+ {
388+ screen->setOptionForPlugin("scale", "x_offset", bv);
389+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
390+ }
391 break;
392 }
393 case UnityshellOptions::BacklightMode:
394@@ -3834,11 +3844,19 @@
395 }
396
397 auto max_bounds = NuxGeometryFromCompRect(output.workArea());
398- if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER && Settings::Instance().launcher_position() == LauncherPosition::LEFT)
399+ if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER)
400 {
401- int monitor_width = unity_settings_.LauncherSize(monitor);
402- max_bounds.x += monitor_width;
403- max_bounds.width -= monitor_width;
404+ if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
405+ {
406+ int monitor_width = unity_settings_.LauncherSize(monitor);
407+ max_bounds.x += monitor_width;
408+ max_bounds.width -= monitor_width;
409+ }
410+ else if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
411+ {
412+ int launcher_size = unity_settings_.LauncherSize(monitor);
413+ max_bounds.height -= launcher_size;
414+ }
415 }
416
417 nux::Geometry final_bounds;
418@@ -4098,14 +4116,31 @@
419 adjustment_x = launcher_size;
420 shortcut_controller_->SetAdjustment(adjustment_x, panel_style_.PanelHeight(launcher->monitor));
421
422+ CompOption::Value v(launcher_size);
423 if (launcher_position == LauncherPosition::LEFT)
424 {
425- CompOption::Value v(launcher_size);
426- screen->setOptionForPlugin("expo", "x_offset", v);
427-
428- if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
429- v.set(0);
430-
431+ screen->setOptionForPlugin("expo", "x_offset", v);
432+
433+ if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
434+ v.set(0);
435+
436+ screen->setOptionForPlugin("scale", "x_offset", v);
437+
438+ v.set(0);
439+ screen->setOptionForPlugin("expo", "y_bottom_offset", v);
440+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
441+ }
442+ else
443+ {
444+ screen->setOptionForPlugin("expo", "y_bottom_offset", v);
445+
446+ if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
447+ v.set(0);
448+
449+ screen->setOptionForPlugin("scale", "y_bottom_offset", v);
450+
451+ v.set(0);
452+ screen->setOptionForPlugin("expo", "x_offset", v);
453 screen->setOptionForPlugin("scale", "x_offset", v);
454 }
455 };
456@@ -4124,6 +4159,10 @@
457 check_launchers_size();
458 });
459
460+ Settings::Instance().launcher_position.changed.connect([this, check_launchers_size] (LauncherPosition const&) {
461+ check_launchers_size();
462+ });
463+
464 check_launchers_size();
465
466 launcher_controller_->options()->scroll_inactive_icons = optionGetScrollInactiveIcons();
467@@ -4243,6 +4282,7 @@
468 {
469 WindowInterface::setHandler(window);
470 GLWindowInterface::setHandler(gWindow);
471+ CompositeWindowInterface::setHandler(cWindow);
472 ScaleWindowInterface::setHandler(ScaleWindow::get(window));
473
474 PluginAdapter::Default().OnLeaveDesktop();
475@@ -4608,7 +4648,7 @@
476 void UnityWindow::paintThumbnail(nux::Geometry const& geo, float alpha, float parent_alpha, float scale_ratio, unsigned deco_height, bool selected)
477 {
478 GLMatrix matrix;
479- matrix.toScreenSpace(uScreen->_last_output, -DEFAULT_Z_CAMERA);
480+ matrix.toScreenSpace(uScreen->last_output_, -DEFAULT_Z_CAMERA);
481 last_bound = geo;
482
483 GLWindowPaintAttrib attrib = gWindow->lastPaintAttrib();
484
485=== modified file 'plugins/unityshell/src/unityshell.h'
486--- plugins/unityshell/src/unityshell.h 2016-03-31 03:59:33 +0000
487+++ plugins/unityshell/src/unityshell.h 2016-05-30 16:03:09 +0000
488@@ -2,7 +2,7 @@
489 /* Compiz unity plugin
490 * unity.h
491 *
492- * Copyright (c) 2010-11 Canonical Ltd.
493+ * Copyright (c) 2010-16 Canonical Ltd.
494 *
495 * This program is free software; you can redistribute it and/or
496 * modify it under the terms of the GNU General Public License
497@@ -120,11 +120,58 @@
498 UnityScreen(CompScreen* s);
499 ~UnityScreen();
500
501- /* We store these to avoid unecessary calls to ::get */
502- CompScreen* screen;
503- CompositeScreen* cScreen;
504- GLScreen* gScreen;
505- ScaleScreen* sScreen;
506+ switcher::Controller::Ptr switcher_controller();
507+ launcher::Controller::Ptr launcher_controller();
508+ lockscreen::Controller::Ptr lockscreen_controller();
509+
510+ void SetUpAndShowSwitcher(switcher::ShowMode show_mode = switcher::ShowMode::CURRENT_VIEWPORT);
511+
512+protected:
513+ void damageCutoff() override;
514+ void preparePaint(int ms) override;
515+ void donePaint() override;
516+
517+ void handleCompizEvent(const char *pluginName, const char *eventName, CompOption::Vector &o) override;
518+ void damageRegion(const CompRegion &region) override;
519+
520+ /* paint on top of all windows if we could not find a window
521+ * to paint underneath */
522+ bool glPaintOutput(const GLScreenPaintAttrib&, const GLMatrix&, const CompRegion&, CompOutput*, unsigned int) override;
523+
524+ /* paint in the special case that the output is transformed */
525+ void glPaintTransformedOutput(const GLScreenPaintAttrib&, const GLMatrix&, const CompRegion&, CompOutput*, unsigned int) override;
526+
527+ /* handle X11 events */
528+ void handleEvent(XEvent*) override;
529+ void addSupportedAtoms(std::vector<Atom>&) override;
530+
531+ /* handle showdesktop */
532+ void enterShowDesktopMode() override;
533+ void leaveShowDesktopMode(CompWindow *w) override;
534+
535+ /* window scaling */
536+ bool layoutSlotsAndAssignWindows() override;
537+ bool getMipmap() override { return false; }
538+
539+ /* Handle changes in the number of workspaces by showing the switcher
540+ * or not showing the switcher */
541+ bool setOptionForPlugin(const char* plugin, const char* name, CompOption::Value& v) override;
542+
543+ /* init plugin actions for screen */
544+ bool initPluginForScreen(CompPlugin* p) override;
545+
546+ void outputChangeNotify() override;
547+
548+ CompAction::Vector& getActions() override;
549+
550+ std::string GetName() const override;
551+ void AddProperties(debug::IntrospectionData&) override;
552+
553+private:
554+ static void InitNuxThread(nux::NThread* thread, void* data);
555+ void InitUnityComponents();
556+ bool InitPluginActions();
557+ void InitAltTabNextWindow();
558
559 /* prepares nux for drawing */
560 void nuxPrologue();
561@@ -135,46 +182,7 @@
562 void paintDisplay();
563 void paintPanelShadow(CompRegion const& clip);
564 void setPanelShadowMatrix(const GLMatrix& matrix);
565-
566 void updateBlurDamage();
567- void damageCutoff();
568- void preparePaint (int ms);
569- void donePaint ();
570-
571- void RaiseInputWindows();
572-
573- void
574- handleCompizEvent (const char *pluginName,
575- const char *eventName,
576- CompOption::Vector &o);
577-
578- void damageRegion(const CompRegion &region);
579-
580- /* paint on top of all windows if we could not find a window
581- * to paint underneath */
582- bool glPaintOutput(const GLScreenPaintAttrib&,
583- const GLMatrix&,
584- const CompRegion&,
585- CompOutput*,
586- unsigned int);
587-
588- /* paint in the special case that the output is transformed */
589- void glPaintTransformedOutput(const GLScreenPaintAttrib&,
590- const GLMatrix&,
591- const CompRegion&,
592- CompOutput*,
593- unsigned int);
594-
595- /* handle X11 events */
596- void handleEvent(XEvent*);
597- void addSupportedAtoms(std::vector<Atom>&);
598-
599- /* handle showdesktop */
600- void enterShowDesktopMode ();
601- void leaveShowDesktopMode (CompWindow *w);
602-
603- /* window scaling */
604- bool layoutSlotsAndAssignWindows();
605
606 bool showMenuBarInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
607 bool showMenuBarTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
608@@ -190,9 +198,7 @@
609 bool setKeyboardFocusKeyInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
610
611 bool altTabInitiateCommon(CompAction* action, switcher::ShowMode mode);
612- bool altTabTerminateCommon(CompAction* action,
613- CompAction::State state,
614- CompOption::Vector& options);
615+ bool altTabTerminateCommon(CompAction* action, CompAction::State state, CompOption::Vector& options);
616
617 bool altTabForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
618 bool altTabPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
619@@ -201,10 +207,9 @@
620 bool altTabNextWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
621 bool altTabPrevWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
622
623- bool ShowHud();
624- /* handle hud key activations */
625 bool ShowHudInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
626 bool ShowHudTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
627+
628 bool launcherSwitcherForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
629 bool launcherSwitcherPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
630 bool launcherSwitcherTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
631@@ -214,56 +219,28 @@
632 /* handle option changes and change settings inside of the
633 * panel and dock views */
634 void optionChanged(CompOption*, Options num);
635-
636- /* Handle changes in the number of workspaces by showing the switcher
637- * or not showing the switcher */
638- bool setOptionForPlugin(const char* plugin, const char* name,
639- CompOption::Value& v);
640-
641- /* init plugin actions for screen */
642- bool initPluginForScreen(CompPlugin* p);
643-
644- void outputChangeNotify();
645+ void OnMinimizeDurationChanged();
646+
647 void NeedsRelayout();
648 void ScheduleRelayout(guint timeout);
649
650- bool forcePaintOnTop ();
651-
652- void SetUpAndShowSwitcher(switcher::ShowMode show_mode = switcher::ShowMode::CURRENT_VIEWPORT);
653-
654- void OnMinimizeDurationChanged();
655+ bool forcePaintOnTop();
656
657 void OnLockScreenRequested();
658 void OnScreenLocked();
659 void OnScreenUnlocked();
660 void SaveLockStamp(bool);
661
662- switcher::Controller::Ptr switcher_controller();
663- launcher::Controller::Ptr launcher_controller();
664- lockscreen::Controller::Ptr lockscreen_controller();
665-
666 bool DoesPointIntersectUnityGeos(nux::Point const& pt);
667
668 ui::LayoutWindow::Ptr GetSwitcherDetailLayoutWindow(Window window) const;
669
670- CompAction::Vector& getActions();
671-
672-protected:
673- std::string GetName() const;
674- void AddProperties(debug::IntrospectionData&);
675-
676-private:
677 enum CancelActionTarget
678 {
679 LAUNCHER_SWITCHER,
680 SHORTCUT_HINT
681 };
682
683- static void InitNuxThread(nux::NThread* thread, void* data);
684- void InitUnityComponents();
685- bool InitPluginActions();
686- void InitAltTabNextWindow();
687-
688 void SendExecuteCommand();
689
690 void EnsureSuperKeybindings();
691@@ -273,21 +250,22 @@
692 void compizDamageNux(CompRegion const& region);
693 void determineNuxDamage(CompRegion &nux_damage);
694
695- void onRedrawRequested();
696 void Relayout();
697+ void RaiseInputWindows();
698
699 static void OnStartKeyNav(GVariant* data, void* value);
700 static void OnExitKeyNav(GVariant* data, void* value);
701
702 void restartLauncherKeyNav();
703
704- void OnDashRealized ();
705-
706+ bool ShowHud();
707 void RaiseOSK();
708
709+ void OnDashRealized();
710 void OnLauncherStartKeyNav(GVariant* data);
711 void OnLauncherEndKeyNav(GVariant* data);
712 void OnSwitcherDetailChanged(bool detail);
713+ void OnRedrawRequested();
714
715 void OnInitiateSpread();
716 void OnTerminateSpread();
717@@ -307,20 +285,24 @@
718
719 void DrawPanelUnderDash();
720
721- void FillShadowRectForOutput(CompRect &shadowRect,
722- CompOutput const &output);
723+ void FillShadowRectForOutput(CompRect &shadowRect, CompOutput const &output);
724 unsigned CompizModifiersToNux(unsigned input) const;
725 unsigned XModifiersToNux(unsigned input) const;
726
727 void UpdateCloseWindowKey(CompAction::KeyBinding const&);
728 void UpdateActivateIndicatorsKey();
729
730- bool getMipmap () override { return false; }
731-
732 void DamageBlurUpdateRegion(nux::Geometry const&);
733
734 void ShowFirstRunHints();
735 void SpreadAppWindows(bool anywhere);
736+ bool queryForShader();
737+
738+ /* We store these to avoid unecessary calls to ::get */
739+ CompScreen* screen;
740+ CompositeScreen* cScreen;
741+ GLScreen* gScreen;
742+ ScaleScreen* sScreen;
743
744 std::unique_ptr<na::TickSource> tick_source_;
745 std::unique_ptr<na::AnimationController> animation_controller_;
746@@ -365,8 +347,8 @@
747 /* Subscription for gestures that manipulate windows. */
748 std::unique_ptr<nux::GesturesSubscription> gestures_sub_windows_;
749
750- bool needsRelayout;
751- bool super_keypressed_;
752+ bool needsRelayout;
753+ bool super_keypressed_;
754 typedef std::shared_ptr<CompAction> CompActionPtr;
755 typedef std::vector<CompActionPtr> ShortcutActions;
756 ShortcutActions _shortcut_actions;
757@@ -380,11 +362,10 @@
758 GLTexture::List _shadow_texture;
759
760 /* handle paint order */
761- bool doShellRepaint;
762- bool didShellRepaint;
763- bool allowWindowPaint;
764- bool _key_nav_mode_requested;
765- CompOutput* _last_output;
766+ bool doShellRepaint;
767+ bool didShellRepaint;
768+ bool allowWindowPaint;
769+ CompOutput* last_output_;
770
771 /* a small count-down work-a-around
772 * to force full redraws of the shell
773@@ -400,16 +381,14 @@
774
775 ::GLFramebufferObject *oldFbo;
776
777- bool queryForShader ();
778-
779 int overlay_monitor_;
780 CompScreen::GrabHandle grab_index_;
781- CompWindowList fullscreen_windows_;
782- bool painting_tray_;
783- unsigned int tray_paint_mask_;
784- unsigned int last_scroll_event_;
785- int hud_keypress_time_;
786- int first_menu_keypress_time_;
787+ CompWindowList fullscreen_windows_;
788+ bool painting_tray_;
789+ unsigned int tray_paint_mask_;
790+ unsigned int last_scroll_event_;
791+ int hud_keypress_time_;
792+ int first_menu_keypress_time_;
793
794 GLMatrix panel_shadow_matrix_;
795
796@@ -418,9 +397,6 @@
797
798 bool scale_just_activated_;
799 WindowMinimizeSpeedController minimize_speed_controller_;
800-
801- uint64_t big_tick_;
802-
803 debug::ScreenIntrospection screen_introspection_;
804
805 UBusManager ubus_manager_;
806@@ -430,13 +406,13 @@
807
808 CompRegion buffered_compiz_damage_this_frame_;
809 CompRegion buffered_compiz_damage_last_frame_;
810- bool ignore_redraw_request_;
811- bool dirty_helpers_on_this_frame_;
812-
813+ bool ignore_redraw_request_;
814+ bool dirty_helpers_on_this_frame_;
815+ bool is_desktop_active_;
816+ bool key_nav_mode_requested_;
817+ uint64_t big_tick_;
818 unsigned int back_buffer_age_;
819
820- bool is_desktop_active_;
821-
822 friend class UnityWindow;
823 friend class debug::ScreenIntrospection;
824 friend class decoration::Manager;
825@@ -445,6 +421,7 @@
826 class UnityWindow :
827 public WindowInterface,
828 public GLWindowInterface,
829+ public CompositeWindowInterface,
830 public ShowdesktopHandlerWindowInterface,
831 public compiz::WindowInputRemoverLockAcquireInterface,
832 public WrapableHandler<ScaleWindowInterface, 4>,
833@@ -457,98 +434,91 @@
834 UnityWindow(CompWindow*);
835 ~UnityWindow();
836
837- CompWindow* window;
838- CompositeWindow* cWindow;
839- GLWindow* gWindow;
840-
841- nux::Geometry last_bound;
842-
843- void minimize();
844- void unminimize();
845- bool minimized() const;
846- bool focus();
847- void activate();
848-
849- void updateFrameRegion(CompRegion &region);
850- void getOutputExtents(CompWindowExtents& output);
851+ void minimize() override;
852+ void unminimize() override;
853+ bool minimized() const override;
854+ bool focus() override;
855+ void activate() override;
856+
857+ //! Emited when CompWindowNotifyBeforeDestroy is received
858+ sigc::signal<void> being_destroyed;
859+
860+protected:
861+ void updateFrameRegion(CompRegion &region) override;
862+ void getOutputExtents(CompWindowExtents& output) override;
863
864 /* occlusion detection
865 * and window hiding */
866- bool glPaint(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask);
867+ bool glPaint(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask) override;
868
869 /* basic window draw function */
870- bool glDraw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);
871-
872- bool damageRect(bool initial, CompRect const&);
873-
874- void updateIconPos (int &wx, int &wy, int x, int y, float width, float height);
875- void windowNotify(CompWindowNotify n);
876- void moveNotify(int x, int y, bool immediate);
877- void resizeNotify(int x, int y, int w, int h);
878- void stateChangeNotify(unsigned int lastState);
879-
880- bool place(CompPoint& pos);
881+ bool glDraw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask) override;
882+ bool damageRect(bool initial, CompRect const&) override;
883+
884+ void updateIconPos(int &wx, int &wy, int x, int y, float width, float height) override;
885+ void windowNotify(CompWindowNotify n) override;
886+ void moveNotify(int x, int y, bool immediate) override;
887+ void resizeNotify(int x, int y, int w, int h) override;
888+ void stateChangeNotify(unsigned int lastState) override;
889+
890+ bool place(CompPoint& pos) override;
891+ void scalePaintDecoration(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask) override;
892+
893+ std::string GetName() const override;
894+ void AddProperties(debug::IntrospectionData&) override;
895+
896+private:
897+ typedef compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow> UnityMinimizedHandler;
898+ typedef std::shared_ptr<compiz_utils::PixmapTexture> PixmapTexturePtr;
899+
900+ void DoEnableFocus();
901+ void DoDisableFocus();
902+
903+ bool IsOverrideRedirect();
904+ bool IsManaged();
905+ bool IsGrabbed();
906+ bool IsDesktopOrDock();
907+ bool IsSkipTaskbarOrPager();
908+ bool IsHidden();
909+ bool IsInShowdesktopMode();
910+ bool IsShaded();
911+ bool IsMinimized();
912+ bool CanBypassLockScreen() const;
913+ void DoOverrideFrameRegion(CompRegion &r);
914+
915+ void DoHide();
916+ void DoNotifyHidden();
917+ void DoShow();
918+ void DoNotifyShown();
919+
920+ void OnInitiateSpread();
921+ void OnTerminateSpread();
922+
923 CompPoint tryNotIntersectUI(CompPoint& pos);
924 nux::Geometry GetScaledGeometry();
925 nux::Geometry GetLayoutWindowGeometry();
926
927- void paintThumbnail(nux::Geometry const& bounding, float parent_alpha, float alpha, float scale_ratio, unsigned deco_height, bool selected);
928-
929 void enterShowDesktop();
930 void leaveShowDesktop();
931 bool HandleAnimations(unsigned int ms);
932
933 bool handleEvent(XEvent *event);
934- void scalePaintDecoration(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask);
935-
936- //! Emited when CompWindowNotifyBeforeDestroy is received
937- sigc::signal<void> being_destroyed;
938-
939-
940-protected:
941- std::string GetName() const;
942- void AddProperties(debug::IntrospectionData&);
943-
944-private:
945- typedef compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow> UnityMinimizedHandler;
946- typedef std::shared_ptr<compiz_utils::PixmapTexture> PixmapTexturePtr;
947-
948- void DoEnableFocus ();
949- void DoDisableFocus ();
950-
951- bool IsOverrideRedirect ();
952- bool IsManaged ();
953- bool IsGrabbed ();
954- bool IsDesktopOrDock ();
955- bool IsSkipTaskbarOrPager ();
956- bool IsHidden ();
957- bool IsInShowdesktopMode ();
958- bool IsShaded ();
959- bool IsMinimized ();
960- bool CanBypassLockScreen() const;
961- void DoOverrideFrameRegion (CompRegion &r);
962-
963- void DoHide ();
964- void DoNotifyHidden ();
965- void DoShow ();
966- void DoNotifyShown ();
967-
968- void OnInitiateSpread();
969- void OnTerminateSpread();
970-
971- void DoAddDamage ();
972- ShowdesktopHandlerWindowInterface::PostPaintAction DoHandleAnimations (unsigned int ms);
973-
974- void DoMoveFocusAway ();
975-
976- void DoDeleteHandler ();
977-
978- unsigned int GetNoCoreInstanceMask ();
979-
980- compiz::WindowInputRemoverLock::Ptr GetInputRemover ();
981+ void paintThumbnail(nux::Geometry const& bounding, float parent_alpha, float alpha, float scale_ratio, unsigned deco_height, bool selected);
982+
983+ void DoAddDamage();
984+ ShowdesktopHandlerWindowInterface::PostPaintAction DoHandleAnimations(unsigned int ms);
985+
986+ void DoMoveFocusAway();
987+
988+ void DoDeleteHandler();
989+
990+ unsigned int GetNoCoreInstanceMask();
991+
992+ compiz::WindowInputRemoverLock::Ptr GetInputRemover();
993
994 void RenderDecoration(compiz_utils::CairoContext const&, double aspect = 1.0f);
995- void RenderTitle(compiz_utils::CairoContext const&, int x, int y, int width, int height, double aspect = 1.0f);
996+ void RenderTitle(compiz_utils::CairoContext const&, int x, int y, int width,
997+ int height, double aspect = 1.0f);
998 void DrawTexture(GLTexture::List const& textures, GLWindowPaintAttrib const&,
999 GLMatrix const&, unsigned mask, int x, int y, double aspect = 1.0f);
1000
1001@@ -565,7 +535,12 @@
1002 std::unique_ptr <UnityMinimizedHandler> mMinimizeHandler;
1003
1004 private:
1005+ CompWindow* window;
1006+ CompositeWindow* cWindow;
1007+ GLWindow* gWindow;
1008+
1009 std::unique_ptr <ShowdesktopHandler> mShowdesktopHandler;
1010+ nux::Geometry last_bound;
1011 PixmapTexturePtr decoration_tex_;
1012 PixmapTexturePtr decoration_selected_tex_;
1013 std::string decoration_title_;
1014@@ -579,6 +554,7 @@
1015 glib::Source::UniquePtr focus_desktop_timeout_;
1016
1017 friend class UnityScreen;
1018+ friend UnityMinimizedHandler;
1019 };
1020
1021
1022
1023=== modified file 'tests/test_gnome_session_manager.cpp'
1024--- tests/test_gnome_session_manager.cpp 2015-11-23 09:24:10 +0000
1025+++ tests/test_gnome_session_manager.cpp 2016-05-30 16:03:09 +0000
1026@@ -256,9 +256,19 @@
1027
1028 void TearDown()
1029 {
1030+ manager->have_other_open_sessions.changed.clear();
1031+ manager->is_locked.changed.clear();
1032+ manager->is_session_active.changed.clear();
1033+ manager->lock_requested.clear();
1034+ manager->unlock_requested.clear();
1035+ manager->prompt_lock_requested.clear();
1036+ manager->locked.clear();
1037+ manager->unlocked.clear();
1038 manager->logout_requested.clear();
1039 manager->reboot_requested.clear();
1040 manager->shutdown_requested.clear();
1041+ manager->presence_status_changed.clear();
1042+ manager->screensaver_requested.clear();
1043 manager->cancel_requested.clear();
1044 shell_proxy_->DisconnectSignal();
1045
1046
1047=== modified file 'tests/test_switcher_controller.cpp'
1048--- tests/test_switcher_controller.cpp 2015-11-04 09:42:55 +0000
1049+++ tests/test_switcher_controller.cpp 2016-05-30 16:03:09 +0000
1050@@ -278,7 +278,7 @@
1051 Mock::VerifyAndClearExpectations(mock_window_.GetPointer());
1052 }
1053
1054-TEST_F(TestSwitcherController, TestRightClickedReceived)
1055+TEST_F(TestSwitcherController, TestDetailActivationRequest)
1056 {
1057 controller_->Show(ShowMode::ALL, SortMode::LAUNCHER_ORDER, icons_);
1058
1059@@ -287,8 +287,7 @@
1060
1061 ASSERT_FALSE(model->detail_selection());
1062
1063- view->switcher_mouse_up.emit(-1, 3);
1064- view->switcher_mouse_down.emit(-1, 3);
1065+ view->switcher_start_detail.emit();
1066
1067 ASSERT_TRUE(model->detail_selection());
1068 }
1069
1070=== modified file 'unity-shared/DashStyle.cpp'
1071--- unity-shared/DashStyle.cpp 2016-03-31 05:53:05 +0000
1072+++ unity-shared/DashStyle.cpp 2016-05-30 16:03:09 +0000
1073@@ -95,7 +95,7 @@
1074 *height = cairo_image_surface_get_height(surface) / h_scale;
1075 }
1076
1077-class LazyLoadTexture
1078+class LazyLoadTexture : public sigc::trackable
1079 {
1080 public:
1081 LazyLoadTexture(std::string const& filename, int size = -1);
1082
1083=== modified file 'unity-shared/DecorationStyle.cpp'
1084--- unity-shared/DecorationStyle.cpp 2016-02-09 17:14:55 +0000
1085+++ unity-shared/DecorationStyle.cpp 2016-05-30 16:03:09 +0000
1086@@ -369,6 +369,7 @@
1087 void AddContextClasses(Side s, WidgetState ws, GtkStyleContext* ctx = nullptr)
1088 {
1089 ctx = ctx ? ctx : ctx_;
1090+ gtk_style_context_add_class(ctx, "background");
1091 gtk_style_context_add_class(ctx, "gnome-panel-menu-bar");
1092 if (s == Side::TOP) { gtk_style_context_add_class(ctx, "header-bar"); }
1093 gtk_style_context_add_class(ctx, GetBorderClass(s).c_str());
1094
1095=== modified file 'unity-shared/DecorationStyle.h'
1096--- unity-shared/DecorationStyle.h 2016-02-25 14:16:17 +0000
1097+++ unity-shared/DecorationStyle.h 2016-05-30 16:03:09 +0000
1098@@ -25,6 +25,7 @@
1099 #include <cairo/cairo.h>
1100
1101 #include <memory>
1102+#include <vector>
1103
1104 struct _GtkStyleContext;
1105
1106
1107=== modified file 'unity-shared/GnomeKeyGrabber.cpp'
1108--- unity-shared/GnomeKeyGrabber.cpp 2015-12-13 10:35:58 +0000
1109+++ unity-shared/GnomeKeyGrabber.cpp 2016-05-30 16:03:09 +0000
1110@@ -59,6 +59,12 @@
1111 </node>)";
1112 }
1113
1114+namespace
1115+{
1116+const std::string SETTINGS_NAME = "com.canonical.Unity";
1117+const std::string WHITELIST_KEY = "whitelist-repeated-keys";
1118+}
1119+
1120 namespace testing
1121 {
1122 std::string const DBUS_NAME = "com.canonical.Unity.Test.GnomeKeyGrabber";
1123@@ -67,11 +73,18 @@
1124 GnomeGrabber::Impl::Impl(bool test_mode)
1125 : screen_(screen)
1126 , shell_server_(test_mode ? testing::DBUS_NAME : shell::DBUS_NAME)
1127+ , settings_(g_settings_new(SETTINGS_NAME.c_str()))
1128 , current_action_id_(0)
1129 {
1130 shell_server_.AddObjects(shell::INTROSPECTION_XML, shell::DBUS_OBJECT_PATH);
1131 shell_object_ = shell_server_.GetObject(shell::DBUS_INTERFACE);
1132 shell_object_->SetMethodsCallsHandlerFull(sigc::mem_fun(this, &Impl::OnShellMethodCall));
1133+
1134+ whitelist_changed_signal_.Connect(settings_, "changed::" + WHITELIST_KEY, [this] (GSettings*, gchar*) {
1135+ UpdateWhitelist();
1136+ });
1137+
1138+ UpdateWhitelist();
1139 }
1140
1141 GnomeGrabber::Impl::~Impl()
1142@@ -232,8 +245,12 @@
1143 {
1144 action.setState(CompAction::StateInitKey);
1145 action.setInitiate([this, action_id](CompAction* action, CompAction::State state, CompOption::Vector& options) {
1146- LOG_DEBUG(logger) << "pressed \"" << action->keyToString() << "\"";
1147- ActivateDBusAction(*action, action_id, 0, CompOption::getIntOptionNamed(options, "time"));
1148+ bool is_whitelisted = std::find(whitelist_.begin(), whitelist_.end(), action->keyToString()) != whitelist_.end();
1149+ if (is_whitelisted || !CompOption::getBoolOptionNamed(options, "is_repeated"))
1150+ {
1151+ LOG_DEBUG(logger) << "pressed \"" << action->keyToString() << "\"";
1152+ ActivateDBusAction(*action, action_id, 0, CompOption::getIntOptionNamed(options, "time"));
1153+ }
1154 return true;
1155 });
1156 }
1157@@ -323,6 +340,16 @@
1158 return keycode == 0 || modHandler->keycodeToModifiers(keycode) != 0;
1159 }
1160
1161+void GnomeGrabber::Impl::UpdateWhitelist()
1162+{
1163+ std::shared_ptr<gchar*> whitelist(g_settings_get_strv(settings_, WHITELIST_KEY.c_str()), g_strfreev);
1164+ auto whitelist_raw = whitelist.get();
1165+
1166+ whitelist_.clear();
1167+ for (int i = 0; whitelist_raw[i]; ++i)
1168+ whitelist_.push_back(whitelist_raw[i]);
1169+}
1170+
1171 // Public implementation
1172
1173 GnomeGrabber::GnomeGrabber()
1174
1175=== modified file 'unity-shared/GnomeKeyGrabberImpl.h'
1176--- unity-shared/GnomeKeyGrabberImpl.h 2015-12-13 10:35:58 +0000
1177+++ unity-shared/GnomeKeyGrabberImpl.h 2016-05-30 16:03:09 +0000
1178@@ -28,6 +28,7 @@
1179 #include <UnityCore/GLibDBusProxy.h>
1180 #include <UnityCore/GLibDBusServer.h>
1181 #include <UnityCore/GLibDBusNameWatcher.h>
1182+#include <UnityCore/GLibSignal.h>
1183
1184 namespace unity
1185 {
1186@@ -55,11 +56,17 @@
1187
1188 bool IsActionPostponed(CompAction const& action) const;
1189
1190+ void UpdateWhitelist();
1191+
1192 CompScreen* screen_;
1193
1194 glib::DBusServer shell_server_;
1195 glib::DBusObject::Ptr shell_object_;
1196
1197+ glib::Object<GSettings> settings_;
1198+ glib::Signal<void, GSettings*, gchar*> whitelist_changed_signal_;
1199+ std::list<std::string> whitelist_;
1200+
1201 uint32_t current_action_id_;
1202 std::vector<uint32_t> actions_ids_;
1203 std::vector<uint32_t> actions_customers_;
1204
1205=== modified file 'unity-shared/PanelStyle.cpp'
1206--- unity-shared/PanelStyle.cpp 2016-03-31 05:37:15 +0000
1207+++ unity-shared/PanelStyle.cpp 2016-05-30 16:03:09 +0000
1208@@ -85,6 +85,7 @@
1209 gtk_widget_path_iter_set_name(widget_path.get(), -1, PANEL_STYLE_CSS_NAME.c_str());
1210
1211 gtk_style_context_set_path(style_context_, widget_path.get());
1212+ gtk_style_context_add_class(style_context_, "background");
1213 gtk_style_context_add_class(style_context_, "gnome-panel-menu-bar");
1214 gtk_style_context_add_class(style_context_, "unity-panel");
1215

Subscribers

People subscribed via source and target branches

to all changes: