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
=== modified file 'com.canonical.Unity.gschema.xml'
--- com.canonical.Unity.gschema.xml 2016-03-18 01:47:08 +0000
+++ com.canonical.Unity.gschema.xml 2016-05-30 16:03:09 +0000
@@ -81,6 +81,16 @@
81 integrated menus are enabled), otherwise they will be shown only when81 integrated menus are enabled), otherwise they will be shown only when
82 the mouse cursor is over the relative mouse area.</description>82 the mouse cursor is over the relative mouse area.</description>
83 </key>83 </key>
84 <key type="as" name="whitelist-repeated-keys">
85 <default>[
86 'XF86MonBrightnessUp',
87 'XF86MonBrightnessDown',
88 'XF86AudioRaiseVolume',
89 'XF86AudioLowerVolume'
90 ]</default>
91 <summary>List of keycodes that should be processed even if auto-repated.</summary>
92 <description>These keycodes are processed even if they are auto-repeated.</description>
93 </key>
84 </schema>94 </schema>
85 <schema path="/com/canonical/unity/interface/" id="com.canonical.Unity.Interface" gettext-domain="unity">95 <schema path="/com/canonical/unity/interface/" id="com.canonical.Unity.Interface" gettext-domain="unity">
86 <key type="d" name="text-scale-factor">96 <key type="d" name="text-scale-factor">
8797
=== modified file 'debian/changelog'
--- debian/changelog 2016-05-14 23:01:37 +0000
+++ debian/changelog 2016-05-30 16:03:09 +0000
@@ -1,7 +1,35 @@
1unity (7.4.0-0ubuntu1) UNRELEASED; urgency=medium1unity (7.4.0+16.04.20160526-0ubuntu1) UNRELEASED; urgency=medium
22
3 [ Marco Trevisan (Treviño) ]
3 * Releasing Unity 7.4.04 * Releasing Unity 7.4.0
45
6 [ Andrea Azzarone ]
7 * Properly remove SoftwareCenterLauncherIcon in case of failure. (LP:
8 #1553165)
9 * Update ExpoLauncherIcon in case the quicklist is used to switch vp.
10 (LP: #1525685)
11 * GnomeKeyGrabber: do not activate an action if it's a repeated one.
12 (LP: #1572241)
13 * Properly calculate array indexes to avoid crashes. (LP: #1570843)
14 * Fallback to "background" class in case no background is specified
15 for title bars and top panel. (LP: #1575527)
16 * Do not reset the shortcut for icons that have their own shortcut.
17 (LP: #1562847)
18
19 [ Marco Trevisan (Treviño) ]
20 * SwitcherView: close the mouse-selected application on middle-click
21 (LP: #1574689)
22 * UnityScreen, UnityWindow: cleanup a little the code, and ensure
23 overridden CompositeWindow functions get actually called
24 * SwitcherController: don't try to get a window from empty selections
25 (LP: #1580211)
26 * DashStyle: ensure LazyLoadTexture disconnects from signals on
27 destruction (LP: #1580212)
28
29 [ handsome_feng ]
30 * Change the x_offset of expo when launcher position changed. (LP:
31 #1562348, LP: #1573897)
32
5 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Sun, 15 May 2016 01:00:09 +020033 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Sun, 15 May 2016 01:00:09 +0200
634
7unity (7.4.0+16.04.20160415-0ubuntu1) xenial; urgency=medium35unity (7.4.0+16.04.20160415-0ubuntu1) xenial; urgency=medium
836
=== modified file 'launcher/ExpoLauncherIcon.cpp'
--- launcher/ExpoLauncherIcon.cpp 2015-11-20 11:35:08 +0000
+++ launcher/ExpoLauncherIcon.cpp 2016-05-30 16:03:09 +0000
@@ -127,8 +127,9 @@
127 dbusmenu_menuitem_property_set_int(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED);127 dbusmenu_menuitem_property_set_int(menu_item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED);
128 }128 }
129129
130 signals_.Add(new ItemSignal(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, [h, v] (DbusmenuMenuitem*, int) {130 signals_.Add(new ItemSignal(menu_item, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, [this, h, v] (DbusmenuMenuitem*, int) {
131 WindowManager::Default().SetCurrentViewport({h, v});131 WindowManager::Default().SetCurrentViewport({h, v});
132 UpdateIcon();
132 }));133 }));
133 result.push_back(menu_item);134 result.push_back(menu_item);
134 }135 }
135136
=== modified file 'launcher/LauncherController.cpp'
--- launcher/LauncherController.cpp 2016-03-18 01:47:08 +0000
+++ launcher/LauncherController.cpp 2016-05-30 16:03:09 +0000
@@ -555,7 +555,7 @@
555 icon->SetShortcut(std::to_string(shortcut % 10)[0]);555 icon->SetShortcut(std::to_string(shortcut % 10)[0]);
556 ++shortcut;556 ++shortcut;
557 }557 }
558 else558 else if (isdigit(icon->GetShortcut()))
559 {559 {
560 // reset shortcut560 // reset shortcut
561 icon->SetShortcut(0);561 icon->SetShortcut(0);
562562
=== modified file 'launcher/LauncherIcon.cpp'
--- launcher/LauncherIcon.cpp 2016-03-18 01:47:08 +0000
+++ launcher/LauncherIcon.cpp 2016-05-30 16:03:09 +0000
@@ -42,6 +42,8 @@
42#include <UnityCore/GLibWrapper.h>42#include <UnityCore/GLibWrapper.h>
43#include <UnityCore/Variant.h>43#include <UnityCore/Variant.h>
4444
45#include <numeric>
46
45namespace unity47namespace unity
46{48{
47namespace launcher49namespace launcher
4850
=== modified file 'launcher/SoftwareCenterLauncherIcon.cpp'
--- launcher/SoftwareCenterLauncherIcon.cpp 2016-03-18 01:47:08 +0000
+++ launcher/SoftwareCenterLauncherIcon.cpp 2016-05-30 16:03:09 +0000
@@ -133,7 +133,7 @@
133 else133 else
134 {134 {
135 // failure condition, remove icon again135 // failure condition, remove icon again
136 UnStick();136 Remove();
137 }137 }
138138
139 aptdaemon_trans_.reset();139 aptdaemon_trans_.reset();
140140
=== modified file 'launcher/SwitcherController.cpp'
--- launcher/SwitcherController.cpp 2016-03-21 15:38:17 +0000
+++ launcher/SwitcherController.cpp 2016-05-30 16:03:09 +0000
@@ -453,10 +453,6 @@
453 view_->background_color = WindowManager::Default().average_color();453 view_->background_color = WindowManager::Default().average_color();
454 view_->monitor = obj_->monitor_;454 view_->monitor = obj_->monitor_;
455 view_->hide_request.connect(sigc::mem_fun(this, &Controller::Impl::Hide));455 view_->hide_request.connect(sigc::mem_fun(this, &Controller::Impl::Hide));
456 view_->switcher_mouse_up.connect([this] (int icon_index, int button) {
457 if (button == 3)
458 InitiateDetail(true);
459 });
460456
461 view_->switcher_mouse_move.connect([this] (int icon_index) {457 view_->switcher_mouse_move.connect([this] (int icon_index) {
462 if (icon_index >= 0)458 if (icon_index >= 0)
@@ -690,7 +686,10 @@
690 }686 }
691 else if (model_->SelectionIsActive())687 else if (model_->SelectionIsActive())
692 {688 {
693 window = model_->SelectionWindows().front();689 auto const& selection_windows = model_->SelectionWindows();
690
691 if (!selection_windows.empty())
692 window = selection_windows.front();
694 }693 }
695 }694 }
696 }695 }
697696
=== modified file 'launcher/SwitcherView.cpp'
--- launcher/SwitcherView.cpp 2016-03-21 15:38:17 +0000
+++ launcher/SwitcherView.cpp 2016-05-30 16:03:09 +0000
@@ -381,8 +381,6 @@
381 int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);381 int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);
382382
383 last_detail_icon_selected_ = detail_icon_index;383 last_detail_icon_selected_ = detail_icon_index;
384
385 switcher_mouse_down.emit(detail_icon_index, button);
386}384}
387385
388void SwitcherView::HandleMouseDown(int x, int y, int button)386void SwitcherView::HandleMouseDown(int x, int y, int button)
@@ -390,8 +388,6 @@
390 int icon_index = IconIndexAt(x,y);388 int icon_index = IconIndexAt(x,y);
391389
392 last_icon_selected_ = icon_index;390 last_icon_selected_ = icon_index;
393
394 switcher_mouse_down.emit(icon_index, button);
395}391}
396392
397void SwitcherView::RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long /*key_flags*/)393void SwitcherView::RecvMouseUp(int x, int y, unsigned long button_flags, unsigned long /*key_flags*/)
@@ -413,8 +409,6 @@
413 nux::Point const& mouse_pos = CalculateMouseMonitorOffset(x, y);409 nux::Point const& mouse_pos = CalculateMouseMonitorOffset(x, y);
414 int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);410 int detail_icon_index = DetailIconIdexAt(mouse_pos.x, mouse_pos.y);
415411
416 switcher_mouse_up.emit(detail_icon_index, button);
417
418 if (button == 1)412 if (button == 1)
419 {413 {
420 if (detail_icon_index >= 0 && detail_icon_index == last_detail_icon_selected_)414 if (detail_icon_index >= 0 && detail_icon_index == last_detail_icon_selected_)
@@ -437,14 +431,18 @@
437{431{
438 int icon_index = IconIndexAt(x,y);432 int icon_index = IconIndexAt(x,y);
439433
440 switcher_mouse_up.emit(icon_index, button);434 if (button == 1 || button == 2 || button == 3)
441
442 if (button == 1)
443 {435 {
444 if (icon_index >= 0 && icon_index == last_icon_selected_)436 if (icon_index >= 0 && icon_index == last_icon_selected_)
445 {437 {
446 model_->Select(icon_index);438 model_->Select(icon_index);
447 hide_request.emit(true);439
440 if (button == 1)
441 hide_request.emit(true);
442 else if (button == 2)
443 switcher_close_current.emit();
444 else if (button == 3)
445 switcher_start_detail.emit();
448 }446 }
449 }447 }
450}448}
451449
=== modified file 'launcher/SwitcherView.h'
--- launcher/SwitcherView.h 2015-11-02 18:28:31 +0000
+++ launcher/SwitcherView.h 2016-05-30 16:03:09 +0000
@@ -73,10 +73,6 @@
73 int IconIndexAt(int x, int y) const;73 int IconIndexAt(int x, int y) const;
74 int DetailIconIdexAt(int x, int y) const;74 int DetailIconIdexAt(int x, int y) const;
7575
76 /* void; int icon_index, int button*/
77 sigc::signal<void, int, int> switcher_mouse_down;
78 sigc::signal<void, int, int> switcher_mouse_up;
79
80 /* void; int icon_index */76 /* void; int icon_index */
81 sigc::signal<void, int> switcher_mouse_move;77 sigc::signal<void, int> switcher_mouse_move;
8278
8379
=== modified file 'plugins/unityshell/src/WindowMinimizeSpeedController.cpp'
--- plugins/unityshell/src/WindowMinimizeSpeedController.cpp 2013-11-14 03:00:29 +0000
+++ plugins/unityshell/src/WindowMinimizeSpeedController.cpp 2016-05-30 16:03:09 +0000
@@ -19,6 +19,7 @@
19 * not be able to re-use it if you want to use a different licence.19 * not be able to re-use it if you want to use a different licence.
20 */20 */
2121
22#include <cmath>
22#include <gio/gio.h>23#include <gio/gio.h>
23#include <NuxCore/Logger.h>24#include <NuxCore/Logger.h>
2425
2526
=== modified file 'plugins/unityshell/src/inputremover.cpp'
--- plugins/unityshell/src/inputremover.cpp 2016-03-09 17:25:16 +0000
+++ plugins/unityshell/src/inputremover.cpp 2016-05-30 16:03:09 +0000
@@ -354,7 +354,7 @@
354354
355 for (int i = 0; i < nInput; ++i)355 for (int i = 0; i < nInput; ++i)
356 {356 {
357 const unsigned int position = dataSize + (i * 4);357 const unsigned int position = headerSize + (i * 4);
358358
359 data[position + 0] = input[i].x;359 data[position + 0] = input[i].x;
360 data[position + 1] = input[i].y;360 data[position + 1] = input[i].y;
361361
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2016-03-31 05:57:11 +0000
+++ plugins/unityshell/src/unityshell.cpp 2016-05-30 16:03:09 +0000
@@ -203,8 +203,7 @@
203 , doShellRepaint(false)203 , doShellRepaint(false)
204 , didShellRepaint(false)204 , didShellRepaint(false)
205 , allowWindowPaint(false)205 , allowWindowPaint(false)
206 , _key_nav_mode_requested(false)206 , last_output_(nullptr)
207 , _last_output(nullptr)
208 , force_draw_countdown_(0)207 , force_draw_countdown_(0)
209 , firstWindowAboveShell(nullptr)208 , firstWindowAboveShell(nullptr)
210 , onboard_(nullptr)209 , onboard_(nullptr)
@@ -215,12 +214,13 @@
215 , first_menu_keypress_time_(0)214 , first_menu_keypress_time_(0)
216 , paint_panel_under_dash_(false)215 , paint_panel_under_dash_(false)
217 , scale_just_activated_(false)216 , scale_just_activated_(false)
218 , big_tick_(0)
219 , screen_introspection_(screen)217 , screen_introspection_(screen)
220 , ignore_redraw_request_(false)218 , ignore_redraw_request_(false)
221 , dirty_helpers_on_this_frame_(false)219 , dirty_helpers_on_this_frame_(false)
220 , is_desktop_active_(false)
221 , key_nav_mode_requested_(false)
222 , big_tick_(0)
222 , back_buffer_age_(0)223 , back_buffer_age_(0)
223 , is_desktop_active_(false)
224{224{
225 Timer timer;225 Timer timer;
226#ifndef USE_GLES226#ifndef USE_GLES
@@ -341,7 +341,7 @@
341 tick_source_.reset(new na::TickSource);341 tick_source_.reset(new na::TickSource);
342 animation_controller_.reset(new na::AnimationController(*tick_source_));342 animation_controller_.reset(new na::AnimationController(*tick_source_));
343343
344 wt->RedrawRequested.connect(sigc::mem_fun(this, &UnityScreen::onRedrawRequested));344 wt->RedrawRequested.connect(sigc::mem_fun(this, &UnityScreen::OnRedrawRequested));
345345
346 unity_a11y_init(wt.get());346 unity_a11y_init(wt.get());
347347
@@ -692,7 +692,7 @@
692 /* In some unknown place inside nux drawing we change the viewport without692 /* In some unknown place inside nux drawing we change the viewport without
693 * setting it back to the default one, so we need to restore it before allowing693 * setting it back to the default one, so we need to restore it before allowing
694 * compiz to take the scene */694 * compiz to take the scene */
695 auto* o = _last_output;695 auto* o = last_output_;
696 glViewport(o->x(), screen->height() - o->y2(), o->width(), o->height());696 glViewport(o->x(), screen->height() - o->y2(), o->width(), o->height());
697697
698 glDepthRange(0, 1);698 glDepthRange(0, 1);
@@ -748,7 +748,7 @@
748 if (WM.IsExpoActive())748 if (WM.IsExpoActive())
749 return;749 return;
750750
751 CompOutput* output = _last_output;751 CompOutput* output = last_output_;
752752
753 if (fullscreenRegion.contains(*output))753 if (fullscreenRegion.contains(*output))
754 return;754 return;
@@ -863,7 +863,7 @@
863863
864void UnityScreen::paintDisplay()864void UnityScreen::paintDisplay()
865{865{
866 CompOutput *output = _last_output;866 CompOutput *output = last_output_;
867867
868 DrawPanelUnderDash();868 DrawPanelUnderDash();
869869
@@ -990,7 +990,7 @@
990990
991 auto const& output_dev = screen->currentOutputDev();991 auto const& output_dev = screen->currentOutputDev();
992992
993 if (_last_output->id() != output_dev.id())993 if (last_output_->id() != output_dev.id())
994 return;994 return;
995995
996 auto graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine();996 auto graphics_engine = nux::GetGraphicsDisplay()->GetGraphicsEngine();
@@ -1485,7 +1485,7 @@
1485 );1485 );
14861486
1487 allowWindowPaint = true;1487 allowWindowPaint = true;
1488 _last_output = output;1488 last_output_ = output;
1489 paint_panel_under_dash_ = false;1489 paint_panel_under_dash_ = false;
14901490
1491 // CompRegion has no clear() method. So this is the fastest alternative.1491 // CompRegion has no clear() method. So this is the fastest alternative.
@@ -1522,7 +1522,7 @@
1522 * this output.1522 * this output.
1523 *1523 *
1524 * However, damaging nux has a side effect of notifying compiz1524 * However, damaging nux has a side effect of notifying compiz
1525 * through onRedrawRequested that we need to queue another frame.1525 * through OnRedrawRequested that we need to queue another frame.
1526 * In most cases that would be desirable, and in the case where1526 * In most cases that would be desirable, and in the case where
1527 * we did that in damageCutoff, it would not be a problem as compiz1527 * we did that in damageCutoff, it would not be a problem as compiz
1528 * does not queue up new frames for damage that can be processed1528 * does not queue up new frames for damage that can be processed
@@ -1687,7 +1687,7 @@
1687 wt->ForeignFrameEnded();1687 wt->ForeignFrameEnded();
16881688
1689 if (animation_controller_->HasRunningAnimations())1689 if (animation_controller_->HasRunningAnimations())
1690 onRedrawRequested();1690 OnRedrawRequested();
16911691
1692 for (auto it = ShowdesktopHandler::animating_windows.begin(); it != ShowdesktopHandler::animating_windows.end();)1692 for (auto it = ShowdesktopHandler::animating_windows.begin(); it != ShowdesktopHandler::animating_windows.end();)
1693 {1693 {
@@ -1813,7 +1813,7 @@
1813 else if (!screen->grabbed() && event->xfocus.mode == NotifyWhileGrabbed)1813 else if (!screen->grabbed() && event->xfocus.mode == NotifyWhileGrabbed)
1814 wm.OnScreenGrabbed();1814 wm.OnScreenGrabbed();
18151815
1816 if (_key_nav_mode_requested)1816 if (key_nav_mode_requested_)
1817 {1817 {
1818 // Close any overlay that is open.1818 // Close any overlay that is open.
1819 if (launcher_controller_->IsOverlayOpen())1819 if (launcher_controller_->IsOverlayOpen())
@@ -1821,7 +1821,7 @@
1821 dash_controller_->HideDash();1821 dash_controller_->HideDash();
1822 hud_controller_->HideHud();1822 hud_controller_->HideHud();
1823 }1823 }
1824 _key_nav_mode_requested = false;1824 key_nav_mode_requested_ = false;
1825 launcher_controller_->KeyNavGrab();1825 launcher_controller_->KeyNavGrab();
1826 }1826 }
1827 break;1827 break;
@@ -2343,7 +2343,7 @@
2343 else if (WM.IsExpoActive())2343 else if (WM.IsExpoActive())
2344 WM.TerminateExpo();2344 WM.TerminateExpo();
23452345
2346 _key_nav_mode_requested = true;2346 key_nav_mode_requested_ = true;
2347 return true;2347 return true;
2348}2348}
23492349
@@ -3542,7 +3542,7 @@
3542 LOG_INFO(logger) << "UnityScreen::InitNuxThread: " << timer.ElapsedSeconds() << "s";3542 LOG_INFO(logger) << "UnityScreen::InitNuxThread: " << timer.ElapsedSeconds() << "s";
3543}3543}
35443544
3545void UnityScreen::onRedrawRequested()3545void UnityScreen::OnRedrawRequested()
3546{3546{
3547 if (!ignore_redraw_request_)3547 if (!ignore_redraw_request_)
3548 cScreen->damagePending();3548 cScreen->damagePending();
@@ -3623,7 +3623,17 @@
36233623
3624 int scale_offset = (launcher_options->hide_mode == LAUNCHER_HIDE_NEVER) ? 0 : launcher_controller_->launcher().GetWidth();3624 int scale_offset = (launcher_options->hide_mode == LAUNCHER_HIDE_NEVER) ? 0 : launcher_controller_->launcher().GetWidth();
3625 CompOption::Value v(scale_offset);3625 CompOption::Value v(scale_offset);
3626 screen->setOptionForPlugin("scale", "x_offset", v);3626 CompOption::Value bv(0);
3627 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
3628 {
3629 screen->setOptionForPlugin("scale", "x_offset", v);
3630 screen->setOptionForPlugin("scale", "y_bottom_offset", bv);
3631 }
3632 else
3633 {
3634 screen->setOptionForPlugin("scale", "x_offset", bv);
3635 screen->setOptionForPlugin("scale", "y_bottom_offset", v);
3636 }
3627 break;3637 break;
3628 }3638 }
3629 case UnityshellOptions::BacklightMode:3639 case UnityshellOptions::BacklightMode:
@@ -3834,11 +3844,19 @@
3834 }3844 }
38353845
3836 auto max_bounds = NuxGeometryFromCompRect(output.workArea());3846 auto max_bounds = NuxGeometryFromCompRect(output.workArea());
3837 if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER && Settings::Instance().launcher_position() == LauncherPosition::LEFT)3847 if (launcher_controller_->options()->hide_mode != LAUNCHER_HIDE_NEVER)
3838 {3848 {
3839 int monitor_width = unity_settings_.LauncherSize(monitor);3849 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
3840 max_bounds.x += monitor_width;3850 {
3841 max_bounds.width -= monitor_width;3851 int monitor_width = unity_settings_.LauncherSize(monitor);
3852 max_bounds.x += monitor_width;
3853 max_bounds.width -= monitor_width;
3854 }
3855 else if (Settings::Instance().launcher_position() == LauncherPosition::BOTTOM)
3856 {
3857 int launcher_size = unity_settings_.LauncherSize(monitor);
3858 max_bounds.height -= launcher_size;
3859 }
3842 }3860 }
38433861
3844 nux::Geometry final_bounds;3862 nux::Geometry final_bounds;
@@ -4098,14 +4116,31 @@
4098 adjustment_x = launcher_size;4116 adjustment_x = launcher_size;
4099 shortcut_controller_->SetAdjustment(adjustment_x, panel_style_.PanelHeight(launcher->monitor));4117 shortcut_controller_->SetAdjustment(adjustment_x, panel_style_.PanelHeight(launcher->monitor));
41004118
4119 CompOption::Value v(launcher_size);
4101 if (launcher_position == LauncherPosition::LEFT)4120 if (launcher_position == LauncherPosition::LEFT)
4102 {4121 {
4103 CompOption::Value v(launcher_size);4122 screen->setOptionForPlugin("expo", "x_offset", v);
4104 screen->setOptionForPlugin("expo", "x_offset", v);4123
41054124 if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
4106 if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)4125 v.set(0);
4107 v.set(0);4126
41084127 screen->setOptionForPlugin("scale", "x_offset", v);
4128
4129 v.set(0);
4130 screen->setOptionForPlugin("expo", "y_bottom_offset", v);
4131 screen->setOptionForPlugin("scale", "y_bottom_offset", v);
4132 }
4133 else
4134 {
4135 screen->setOptionForPlugin("expo", "y_bottom_offset", v);
4136
4137 if (launcher_controller_->options()->hide_mode == LAUNCHER_HIDE_NEVER)
4138 v.set(0);
4139
4140 screen->setOptionForPlugin("scale", "y_bottom_offset", v);
4141
4142 v.set(0);
4143 screen->setOptionForPlugin("expo", "x_offset", v);
4109 screen->setOptionForPlugin("scale", "x_offset", v);4144 screen->setOptionForPlugin("scale", "x_offset", v);
4110 }4145 }
4111 };4146 };
@@ -4124,6 +4159,10 @@
4124 check_launchers_size();4159 check_launchers_size();
4125 });4160 });
41264161
4162 Settings::Instance().launcher_position.changed.connect([this, check_launchers_size] (LauncherPosition const&) {
4163 check_launchers_size();
4164 });
4165
4127 check_launchers_size();4166 check_launchers_size();
41284167
4129 launcher_controller_->options()->scroll_inactive_icons = optionGetScrollInactiveIcons();4168 launcher_controller_->options()->scroll_inactive_icons = optionGetScrollInactiveIcons();
@@ -4243,6 +4282,7 @@
4243{4282{
4244 WindowInterface::setHandler(window);4283 WindowInterface::setHandler(window);
4245 GLWindowInterface::setHandler(gWindow);4284 GLWindowInterface::setHandler(gWindow);
4285 CompositeWindowInterface::setHandler(cWindow);
4246 ScaleWindowInterface::setHandler(ScaleWindow::get(window));4286 ScaleWindowInterface::setHandler(ScaleWindow::get(window));
42474287
4248 PluginAdapter::Default().OnLeaveDesktop();4288 PluginAdapter::Default().OnLeaveDesktop();
@@ -4608,7 +4648,7 @@
4608void UnityWindow::paintThumbnail(nux::Geometry const& geo, float alpha, float parent_alpha, float scale_ratio, unsigned deco_height, bool selected)4648void UnityWindow::paintThumbnail(nux::Geometry const& geo, float alpha, float parent_alpha, float scale_ratio, unsigned deco_height, bool selected)
4609{4649{
4610 GLMatrix matrix;4650 GLMatrix matrix;
4611 matrix.toScreenSpace(uScreen->_last_output, -DEFAULT_Z_CAMERA);4651 matrix.toScreenSpace(uScreen->last_output_, -DEFAULT_Z_CAMERA);
4612 last_bound = geo;4652 last_bound = geo;
46134653
4614 GLWindowPaintAttrib attrib = gWindow->lastPaintAttrib();4654 GLWindowPaintAttrib attrib = gWindow->lastPaintAttrib();
46154655
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2016-03-31 03:59:33 +0000
+++ plugins/unityshell/src/unityshell.h 2016-05-30 16:03:09 +0000
@@ -2,7 +2,7 @@
2/* Compiz unity plugin2/* Compiz unity plugin
3 * unity.h3 * unity.h
4 *4 *
5 * Copyright (c) 2010-11 Canonical Ltd.5 * Copyright (c) 2010-16 Canonical Ltd.
6 *6 *
7 * This program is free software; you can redistribute it and/or7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License8 * modify it under the terms of the GNU General Public License
@@ -120,11 +120,58 @@
120 UnityScreen(CompScreen* s);120 UnityScreen(CompScreen* s);
121 ~UnityScreen();121 ~UnityScreen();
122122
123 /* We store these to avoid unecessary calls to ::get */123 switcher::Controller::Ptr switcher_controller();
124 CompScreen* screen;124 launcher::Controller::Ptr launcher_controller();
125 CompositeScreen* cScreen;125 lockscreen::Controller::Ptr lockscreen_controller();
126 GLScreen* gScreen;126
127 ScaleScreen* sScreen;127 void SetUpAndShowSwitcher(switcher::ShowMode show_mode = switcher::ShowMode::CURRENT_VIEWPORT);
128
129protected:
130 void damageCutoff() override;
131 void preparePaint(int ms) override;
132 void donePaint() override;
133
134 void handleCompizEvent(const char *pluginName, const char *eventName, CompOption::Vector &o) override;
135 void damageRegion(const CompRegion &region) override;
136
137 /* paint on top of all windows if we could not find a window
138 * to paint underneath */
139 bool glPaintOutput(const GLScreenPaintAttrib&, const GLMatrix&, const CompRegion&, CompOutput*, unsigned int) override;
140
141 /* paint in the special case that the output is transformed */
142 void glPaintTransformedOutput(const GLScreenPaintAttrib&, const GLMatrix&, const CompRegion&, CompOutput*, unsigned int) override;
143
144 /* handle X11 events */
145 void handleEvent(XEvent*) override;
146 void addSupportedAtoms(std::vector<Atom>&) override;
147
148 /* handle showdesktop */
149 void enterShowDesktopMode() override;
150 void leaveShowDesktopMode(CompWindow *w) override;
151
152 /* window scaling */
153 bool layoutSlotsAndAssignWindows() override;
154 bool getMipmap() override { return false; }
155
156 /* Handle changes in the number of workspaces by showing the switcher
157 * or not showing the switcher */
158 bool setOptionForPlugin(const char* plugin, const char* name, CompOption::Value& v) override;
159
160 /* init plugin actions for screen */
161 bool initPluginForScreen(CompPlugin* p) override;
162
163 void outputChangeNotify() override;
164
165 CompAction::Vector& getActions() override;
166
167 std::string GetName() const override;
168 void AddProperties(debug::IntrospectionData&) override;
169
170private:
171 static void InitNuxThread(nux::NThread* thread, void* data);
172 void InitUnityComponents();
173 bool InitPluginActions();
174 void InitAltTabNextWindow();
128175
129 /* prepares nux for drawing */176 /* prepares nux for drawing */
130 void nuxPrologue();177 void nuxPrologue();
@@ -135,46 +182,7 @@
135 void paintDisplay();182 void paintDisplay();
136 void paintPanelShadow(CompRegion const& clip);183 void paintPanelShadow(CompRegion const& clip);
137 void setPanelShadowMatrix(const GLMatrix& matrix);184 void setPanelShadowMatrix(const GLMatrix& matrix);
138
139 void updateBlurDamage();185 void updateBlurDamage();
140 void damageCutoff();
141 void preparePaint (int ms);
142 void donePaint ();
143
144 void RaiseInputWindows();
145
146 void
147 handleCompizEvent (const char *pluginName,
148 const char *eventName,
149 CompOption::Vector &o);
150
151 void damageRegion(const CompRegion &region);
152
153 /* paint on top of all windows if we could not find a window
154 * to paint underneath */
155 bool glPaintOutput(const GLScreenPaintAttrib&,
156 const GLMatrix&,
157 const CompRegion&,
158 CompOutput*,
159 unsigned int);
160
161 /* paint in the special case that the output is transformed */
162 void glPaintTransformedOutput(const GLScreenPaintAttrib&,
163 const GLMatrix&,
164 const CompRegion&,
165 CompOutput*,
166 unsigned int);
167
168 /* handle X11 events */
169 void handleEvent(XEvent*);
170 void addSupportedAtoms(std::vector<Atom>&);
171
172 /* handle showdesktop */
173 void enterShowDesktopMode ();
174 void leaveShowDesktopMode (CompWindow *w);
175
176 /* window scaling */
177 bool layoutSlotsAndAssignWindows();
178186
179 bool showMenuBarInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);187 bool showMenuBarInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
180 bool showMenuBarTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);188 bool showMenuBarTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
@@ -190,9 +198,7 @@
190 bool setKeyboardFocusKeyInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);198 bool setKeyboardFocusKeyInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
191199
192 bool altTabInitiateCommon(CompAction* action, switcher::ShowMode mode);200 bool altTabInitiateCommon(CompAction* action, switcher::ShowMode mode);
193 bool altTabTerminateCommon(CompAction* action,201 bool altTabTerminateCommon(CompAction* action, CompAction::State state, CompOption::Vector& options);
194 CompAction::State state,
195 CompOption::Vector& options);
196202
197 bool altTabForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);203 bool altTabForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
198 bool altTabPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);204 bool altTabPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
@@ -201,10 +207,9 @@
201 bool altTabNextWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);207 bool altTabNextWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
202 bool altTabPrevWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);208 bool altTabPrevWindowInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
203209
204 bool ShowHud();
205 /* handle hud key activations */
206 bool ShowHudInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);210 bool ShowHudInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
207 bool ShowHudTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);211 bool ShowHudTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
212
208 bool launcherSwitcherForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);213 bool launcherSwitcherForwardInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
209 bool launcherSwitcherPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);214 bool launcherSwitcherPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
210 bool launcherSwitcherTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);215 bool launcherSwitcherTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
@@ -214,56 +219,28 @@
214 /* handle option changes and change settings inside of the219 /* handle option changes and change settings inside of the
215 * panel and dock views */220 * panel and dock views */
216 void optionChanged(CompOption*, Options num);221 void optionChanged(CompOption*, Options num);
217222 void OnMinimizeDurationChanged();
218 /* Handle changes in the number of workspaces by showing the switcher223
219 * or not showing the switcher */
220 bool setOptionForPlugin(const char* plugin, const char* name,
221 CompOption::Value& v);
222
223 /* init plugin actions for screen */
224 bool initPluginForScreen(CompPlugin* p);
225
226 void outputChangeNotify();
227 void NeedsRelayout();224 void NeedsRelayout();
228 void ScheduleRelayout(guint timeout);225 void ScheduleRelayout(guint timeout);
229226
230 bool forcePaintOnTop ();227 bool forcePaintOnTop();
231
232 void SetUpAndShowSwitcher(switcher::ShowMode show_mode = switcher::ShowMode::CURRENT_VIEWPORT);
233
234 void OnMinimizeDurationChanged();
235228
236 void OnLockScreenRequested();229 void OnLockScreenRequested();
237 void OnScreenLocked();230 void OnScreenLocked();
238 void OnScreenUnlocked();231 void OnScreenUnlocked();
239 void SaveLockStamp(bool);232 void SaveLockStamp(bool);
240233
241 switcher::Controller::Ptr switcher_controller();
242 launcher::Controller::Ptr launcher_controller();
243 lockscreen::Controller::Ptr lockscreen_controller();
244
245 bool DoesPointIntersectUnityGeos(nux::Point const& pt);234 bool DoesPointIntersectUnityGeos(nux::Point const& pt);
246235
247 ui::LayoutWindow::Ptr GetSwitcherDetailLayoutWindow(Window window) const;236 ui::LayoutWindow::Ptr GetSwitcherDetailLayoutWindow(Window window) const;
248237
249 CompAction::Vector& getActions();
250
251protected:
252 std::string GetName() const;
253 void AddProperties(debug::IntrospectionData&);
254
255private:
256 enum CancelActionTarget238 enum CancelActionTarget
257 {239 {
258 LAUNCHER_SWITCHER,240 LAUNCHER_SWITCHER,
259 SHORTCUT_HINT241 SHORTCUT_HINT
260 };242 };
261243
262 static void InitNuxThread(nux::NThread* thread, void* data);
263 void InitUnityComponents();
264 bool InitPluginActions();
265 void InitAltTabNextWindow();
266
267 void SendExecuteCommand();244 void SendExecuteCommand();
268245
269 void EnsureSuperKeybindings();246 void EnsureSuperKeybindings();
@@ -273,21 +250,22 @@
273 void compizDamageNux(CompRegion const& region);250 void compizDamageNux(CompRegion const& region);
274 void determineNuxDamage(CompRegion &nux_damage);251 void determineNuxDamage(CompRegion &nux_damage);
275252
276 void onRedrawRequested();
277 void Relayout();253 void Relayout();
254 void RaiseInputWindows();
278255
279 static void OnStartKeyNav(GVariant* data, void* value);256 static void OnStartKeyNav(GVariant* data, void* value);
280 static void OnExitKeyNav(GVariant* data, void* value);257 static void OnExitKeyNav(GVariant* data, void* value);
281258
282 void restartLauncherKeyNav();259 void restartLauncherKeyNav();
283260
284 void OnDashRealized ();261 bool ShowHud();
285
286 void RaiseOSK();262 void RaiseOSK();
287263
264 void OnDashRealized();
288 void OnLauncherStartKeyNav(GVariant* data);265 void OnLauncherStartKeyNav(GVariant* data);
289 void OnLauncherEndKeyNav(GVariant* data);266 void OnLauncherEndKeyNav(GVariant* data);
290 void OnSwitcherDetailChanged(bool detail);267 void OnSwitcherDetailChanged(bool detail);
268 void OnRedrawRequested();
291269
292 void OnInitiateSpread();270 void OnInitiateSpread();
293 void OnTerminateSpread();271 void OnTerminateSpread();
@@ -307,20 +285,24 @@
307285
308 void DrawPanelUnderDash();286 void DrawPanelUnderDash();
309287
310 void FillShadowRectForOutput(CompRect &shadowRect,288 void FillShadowRectForOutput(CompRect &shadowRect, CompOutput const &output);
311 CompOutput const &output);
312 unsigned CompizModifiersToNux(unsigned input) const;289 unsigned CompizModifiersToNux(unsigned input) const;
313 unsigned XModifiersToNux(unsigned input) const;290 unsigned XModifiersToNux(unsigned input) const;
314291
315 void UpdateCloseWindowKey(CompAction::KeyBinding const&);292 void UpdateCloseWindowKey(CompAction::KeyBinding const&);
316 void UpdateActivateIndicatorsKey();293 void UpdateActivateIndicatorsKey();
317294
318 bool getMipmap () override { return false; }
319
320 void DamageBlurUpdateRegion(nux::Geometry const&);295 void DamageBlurUpdateRegion(nux::Geometry const&);
321296
322 void ShowFirstRunHints();297 void ShowFirstRunHints();
323 void SpreadAppWindows(bool anywhere);298 void SpreadAppWindows(bool anywhere);
299 bool queryForShader();
300
301 /* We store these to avoid unecessary calls to ::get */
302 CompScreen* screen;
303 CompositeScreen* cScreen;
304 GLScreen* gScreen;
305 ScaleScreen* sScreen;
324306
325 std::unique_ptr<na::TickSource> tick_source_;307 std::unique_ptr<na::TickSource> tick_source_;
326 std::unique_ptr<na::AnimationController> animation_controller_;308 std::unique_ptr<na::AnimationController> animation_controller_;
@@ -365,8 +347,8 @@
365 /* Subscription for gestures that manipulate windows. */347 /* Subscription for gestures that manipulate windows. */
366 std::unique_ptr<nux::GesturesSubscription> gestures_sub_windows_;348 std::unique_ptr<nux::GesturesSubscription> gestures_sub_windows_;
367349
368 bool needsRelayout;350 bool needsRelayout;
369 bool super_keypressed_;351 bool super_keypressed_;
370 typedef std::shared_ptr<CompAction> CompActionPtr;352 typedef std::shared_ptr<CompAction> CompActionPtr;
371 typedef std::vector<CompActionPtr> ShortcutActions;353 typedef std::vector<CompActionPtr> ShortcutActions;
372 ShortcutActions _shortcut_actions;354 ShortcutActions _shortcut_actions;
@@ -380,11 +362,10 @@
380 GLTexture::List _shadow_texture;362 GLTexture::List _shadow_texture;
381363
382 /* handle paint order */364 /* handle paint order */
383 bool doShellRepaint;365 bool doShellRepaint;
384 bool didShellRepaint;366 bool didShellRepaint;
385 bool allowWindowPaint;367 bool allowWindowPaint;
386 bool _key_nav_mode_requested;368 CompOutput* last_output_;
387 CompOutput* _last_output;
388369
389 /* a small count-down work-a-around370 /* a small count-down work-a-around
390 * to force full redraws of the shell371 * to force full redraws of the shell
@@ -400,16 +381,14 @@
400381
401 ::GLFramebufferObject *oldFbo;382 ::GLFramebufferObject *oldFbo;
402383
403 bool queryForShader ();
404
405 int overlay_monitor_;384 int overlay_monitor_;
406 CompScreen::GrabHandle grab_index_;385 CompScreen::GrabHandle grab_index_;
407 CompWindowList fullscreen_windows_;386 CompWindowList fullscreen_windows_;
408 bool painting_tray_;387 bool painting_tray_;
409 unsigned int tray_paint_mask_;388 unsigned int tray_paint_mask_;
410 unsigned int last_scroll_event_;389 unsigned int last_scroll_event_;
411 int hud_keypress_time_;390 int hud_keypress_time_;
412 int first_menu_keypress_time_;391 int first_menu_keypress_time_;
413392
414 GLMatrix panel_shadow_matrix_;393 GLMatrix panel_shadow_matrix_;
415394
@@ -418,9 +397,6 @@
418397
419 bool scale_just_activated_;398 bool scale_just_activated_;
420 WindowMinimizeSpeedController minimize_speed_controller_;399 WindowMinimizeSpeedController minimize_speed_controller_;
421
422 uint64_t big_tick_;
423
424 debug::ScreenIntrospection screen_introspection_;400 debug::ScreenIntrospection screen_introspection_;
425401
426 UBusManager ubus_manager_;402 UBusManager ubus_manager_;
@@ -430,13 +406,13 @@
430406
431 CompRegion buffered_compiz_damage_this_frame_;407 CompRegion buffered_compiz_damage_this_frame_;
432 CompRegion buffered_compiz_damage_last_frame_;408 CompRegion buffered_compiz_damage_last_frame_;
433 bool ignore_redraw_request_;409 bool ignore_redraw_request_;
434 bool dirty_helpers_on_this_frame_;410 bool dirty_helpers_on_this_frame_;
435411 bool is_desktop_active_;
412 bool key_nav_mode_requested_;
413 uint64_t big_tick_;
436 unsigned int back_buffer_age_;414 unsigned int back_buffer_age_;
437415
438 bool is_desktop_active_;
439
440 friend class UnityWindow;416 friend class UnityWindow;
441 friend class debug::ScreenIntrospection;417 friend class debug::ScreenIntrospection;
442 friend class decoration::Manager;418 friend class decoration::Manager;
@@ -445,6 +421,7 @@
445class UnityWindow :421class UnityWindow :
446 public WindowInterface,422 public WindowInterface,
447 public GLWindowInterface,423 public GLWindowInterface,
424 public CompositeWindowInterface,
448 public ShowdesktopHandlerWindowInterface,425 public ShowdesktopHandlerWindowInterface,
449 public compiz::WindowInputRemoverLockAcquireInterface,426 public compiz::WindowInputRemoverLockAcquireInterface,
450 public WrapableHandler<ScaleWindowInterface, 4>,427 public WrapableHandler<ScaleWindowInterface, 4>,
@@ -457,98 +434,91 @@
457 UnityWindow(CompWindow*);434 UnityWindow(CompWindow*);
458 ~UnityWindow();435 ~UnityWindow();
459436
460 CompWindow* window;437 void minimize() override;
461 CompositeWindow* cWindow;438 void unminimize() override;
462 GLWindow* gWindow;439 bool minimized() const override;
463440 bool focus() override;
464 nux::Geometry last_bound;441 void activate() override;
465442
466 void minimize();443 //! Emited when CompWindowNotifyBeforeDestroy is received
467 void unminimize();444 sigc::signal<void> being_destroyed;
468 bool minimized() const;445
469 bool focus();446protected:
470 void activate();447 void updateFrameRegion(CompRegion &region) override;
471448 void getOutputExtents(CompWindowExtents& output) override;
472 void updateFrameRegion(CompRegion &region);
473 void getOutputExtents(CompWindowExtents& output);
474449
475 /* occlusion detection450 /* occlusion detection
476 * and window hiding */451 * and window hiding */
477 bool glPaint(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask);452 bool glPaint(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask) override;
478453
479 /* basic window draw function */454 /* basic window draw function */
480 bool glDraw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask);455 bool glDraw(GLMatrix const&, GLWindowPaintAttrib const&, CompRegion const&, unsigned mask) override;
481456 bool damageRect(bool initial, CompRect const&) override;
482 bool damageRect(bool initial, CompRect const&);457
483458 void updateIconPos(int &wx, int &wy, int x, int y, float width, float height) override;
484 void updateIconPos (int &wx, int &wy, int x, int y, float width, float height);459 void windowNotify(CompWindowNotify n) override;
485 void windowNotify(CompWindowNotify n);460 void moveNotify(int x, int y, bool immediate) override;
486 void moveNotify(int x, int y, bool immediate);461 void resizeNotify(int x, int y, int w, int h) override;
487 void resizeNotify(int x, int y, int w, int h);462 void stateChangeNotify(unsigned int lastState) override;
488 void stateChangeNotify(unsigned int lastState);463
489464 bool place(CompPoint& pos) override;
490 bool place(CompPoint& pos);465 void scalePaintDecoration(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask) override;
466
467 std::string GetName() const override;
468 void AddProperties(debug::IntrospectionData&) override;
469
470private:
471 typedef compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow> UnityMinimizedHandler;
472 typedef std::shared_ptr<compiz_utils::PixmapTexture> PixmapTexturePtr;
473
474 void DoEnableFocus();
475 void DoDisableFocus();
476
477 bool IsOverrideRedirect();
478 bool IsManaged();
479 bool IsGrabbed();
480 bool IsDesktopOrDock();
481 bool IsSkipTaskbarOrPager();
482 bool IsHidden();
483 bool IsInShowdesktopMode();
484 bool IsShaded();
485 bool IsMinimized();
486 bool CanBypassLockScreen() const;
487 void DoOverrideFrameRegion(CompRegion &r);
488
489 void DoHide();
490 void DoNotifyHidden();
491 void DoShow();
492 void DoNotifyShown();
493
494 void OnInitiateSpread();
495 void OnTerminateSpread();
496
491 CompPoint tryNotIntersectUI(CompPoint& pos);497 CompPoint tryNotIntersectUI(CompPoint& pos);
492 nux::Geometry GetScaledGeometry();498 nux::Geometry GetScaledGeometry();
493 nux::Geometry GetLayoutWindowGeometry();499 nux::Geometry GetLayoutWindowGeometry();
494500
495 void paintThumbnail(nux::Geometry const& bounding, float parent_alpha, float alpha, float scale_ratio, unsigned deco_height, bool selected);
496
497 void enterShowDesktop();501 void enterShowDesktop();
498 void leaveShowDesktop();502 void leaveShowDesktop();
499 bool HandleAnimations(unsigned int ms);503 bool HandleAnimations(unsigned int ms);
500504
501 bool handleEvent(XEvent *event);505 bool handleEvent(XEvent *event);
502 void scalePaintDecoration(GLWindowPaintAttrib const&, GLMatrix const&, CompRegion const&, unsigned mask);506 void paintThumbnail(nux::Geometry const& bounding, float parent_alpha, float alpha, float scale_ratio, unsigned deco_height, bool selected);
503507
504 //! Emited when CompWindowNotifyBeforeDestroy is received508 void DoAddDamage();
505 sigc::signal<void> being_destroyed;509 ShowdesktopHandlerWindowInterface::PostPaintAction DoHandleAnimations(unsigned int ms);
506510
507511 void DoMoveFocusAway();
508protected:512
509 std::string GetName() const;513 void DoDeleteHandler();
510 void AddProperties(debug::IntrospectionData&);514
511515 unsigned int GetNoCoreInstanceMask();
512private:516
513 typedef compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow> UnityMinimizedHandler;517 compiz::WindowInputRemoverLock::Ptr GetInputRemover();
514 typedef std::shared_ptr<compiz_utils::PixmapTexture> PixmapTexturePtr;
515
516 void DoEnableFocus ();
517 void DoDisableFocus ();
518
519 bool IsOverrideRedirect ();
520 bool IsManaged ();
521 bool IsGrabbed ();
522 bool IsDesktopOrDock ();
523 bool IsSkipTaskbarOrPager ();
524 bool IsHidden ();
525 bool IsInShowdesktopMode ();
526 bool IsShaded ();
527 bool IsMinimized ();
528 bool CanBypassLockScreen() const;
529 void DoOverrideFrameRegion (CompRegion &r);
530
531 void DoHide ();
532 void DoNotifyHidden ();
533 void DoShow ();
534 void DoNotifyShown ();
535
536 void OnInitiateSpread();
537 void OnTerminateSpread();
538
539 void DoAddDamage ();
540 ShowdesktopHandlerWindowInterface::PostPaintAction DoHandleAnimations (unsigned int ms);
541
542 void DoMoveFocusAway ();
543
544 void DoDeleteHandler ();
545
546 unsigned int GetNoCoreInstanceMask ();
547
548 compiz::WindowInputRemoverLock::Ptr GetInputRemover ();
549518
550 void RenderDecoration(compiz_utils::CairoContext const&, double aspect = 1.0f);519 void RenderDecoration(compiz_utils::CairoContext const&, double aspect = 1.0f);
551 void RenderTitle(compiz_utils::CairoContext const&, int x, int y, int width, int height, double aspect = 1.0f);520 void RenderTitle(compiz_utils::CairoContext const&, int x, int y, int width,
521 int height, double aspect = 1.0f);
552 void DrawTexture(GLTexture::List const& textures, GLWindowPaintAttrib const&,522 void DrawTexture(GLTexture::List const& textures, GLWindowPaintAttrib const&,
553 GLMatrix const&, unsigned mask, int x, int y, double aspect = 1.0f);523 GLMatrix const&, unsigned mask, int x, int y, double aspect = 1.0f);
554524
@@ -565,7 +535,12 @@
565 std::unique_ptr <UnityMinimizedHandler> mMinimizeHandler;535 std::unique_ptr <UnityMinimizedHandler> mMinimizeHandler;
566536
567private:537private:
538 CompWindow* window;
539 CompositeWindow* cWindow;
540 GLWindow* gWindow;
541
568 std::unique_ptr <ShowdesktopHandler> mShowdesktopHandler;542 std::unique_ptr <ShowdesktopHandler> mShowdesktopHandler;
543 nux::Geometry last_bound;
569 PixmapTexturePtr decoration_tex_;544 PixmapTexturePtr decoration_tex_;
570 PixmapTexturePtr decoration_selected_tex_;545 PixmapTexturePtr decoration_selected_tex_;
571 std::string decoration_title_;546 std::string decoration_title_;
@@ -579,6 +554,7 @@
579 glib::Source::UniquePtr focus_desktop_timeout_;554 glib::Source::UniquePtr focus_desktop_timeout_;
580555
581 friend class UnityScreen;556 friend class UnityScreen;
557 friend UnityMinimizedHandler;
582};558};
583559
584560
585561
=== modified file 'tests/test_gnome_session_manager.cpp'
--- tests/test_gnome_session_manager.cpp 2015-11-23 09:24:10 +0000
+++ tests/test_gnome_session_manager.cpp 2016-05-30 16:03:09 +0000
@@ -256,9 +256,19 @@
256256
257 void TearDown()257 void TearDown()
258 {258 {
259 manager->have_other_open_sessions.changed.clear();
260 manager->is_locked.changed.clear();
261 manager->is_session_active.changed.clear();
262 manager->lock_requested.clear();
263 manager->unlock_requested.clear();
264 manager->prompt_lock_requested.clear();
265 manager->locked.clear();
266 manager->unlocked.clear();
259 manager->logout_requested.clear();267 manager->logout_requested.clear();
260 manager->reboot_requested.clear();268 manager->reboot_requested.clear();
261 manager->shutdown_requested.clear();269 manager->shutdown_requested.clear();
270 manager->presence_status_changed.clear();
271 manager->screensaver_requested.clear();
262 manager->cancel_requested.clear();272 manager->cancel_requested.clear();
263 shell_proxy_->DisconnectSignal();273 shell_proxy_->DisconnectSignal();
264274
265275
=== modified file 'tests/test_switcher_controller.cpp'
--- tests/test_switcher_controller.cpp 2015-11-04 09:42:55 +0000
+++ tests/test_switcher_controller.cpp 2016-05-30 16:03:09 +0000
@@ -278,7 +278,7 @@
278 Mock::VerifyAndClearExpectations(mock_window_.GetPointer());278 Mock::VerifyAndClearExpectations(mock_window_.GetPointer());
279}279}
280280
281TEST_F(TestSwitcherController, TestRightClickedReceived)281TEST_F(TestSwitcherController, TestDetailActivationRequest)
282{282{
283 controller_->Show(ShowMode::ALL, SortMode::LAUNCHER_ORDER, icons_);283 controller_->Show(ShowMode::ALL, SortMode::LAUNCHER_ORDER, icons_);
284284
@@ -287,8 +287,7 @@
287287
288 ASSERT_FALSE(model->detail_selection());288 ASSERT_FALSE(model->detail_selection());
289289
290 view->switcher_mouse_up.emit(-1, 3);290 view->switcher_start_detail.emit();
291 view->switcher_mouse_down.emit(-1, 3);
292291
293 ASSERT_TRUE(model->detail_selection());292 ASSERT_TRUE(model->detail_selection());
294}293}
295294
=== modified file 'unity-shared/DashStyle.cpp'
--- unity-shared/DashStyle.cpp 2016-03-31 05:53:05 +0000
+++ unity-shared/DashStyle.cpp 2016-05-30 16:03:09 +0000
@@ -95,7 +95,7 @@
95 *height = cairo_image_surface_get_height(surface) / h_scale;95 *height = cairo_image_surface_get_height(surface) / h_scale;
96}96}
9797
98class LazyLoadTexture98class LazyLoadTexture : public sigc::trackable
99{99{
100public:100public:
101 LazyLoadTexture(std::string const& filename, int size = -1);101 LazyLoadTexture(std::string const& filename, int size = -1);
102102
=== modified file 'unity-shared/DecorationStyle.cpp'
--- unity-shared/DecorationStyle.cpp 2016-02-09 17:14:55 +0000
+++ unity-shared/DecorationStyle.cpp 2016-05-30 16:03:09 +0000
@@ -369,6 +369,7 @@
369 void AddContextClasses(Side s, WidgetState ws, GtkStyleContext* ctx = nullptr)369 void AddContextClasses(Side s, WidgetState ws, GtkStyleContext* ctx = nullptr)
370 {370 {
371 ctx = ctx ? ctx : ctx_;371 ctx = ctx ? ctx : ctx_;
372 gtk_style_context_add_class(ctx, "background");
372 gtk_style_context_add_class(ctx, "gnome-panel-menu-bar");373 gtk_style_context_add_class(ctx, "gnome-panel-menu-bar");
373 if (s == Side::TOP) { gtk_style_context_add_class(ctx, "header-bar"); }374 if (s == Side::TOP) { gtk_style_context_add_class(ctx, "header-bar"); }
374 gtk_style_context_add_class(ctx, GetBorderClass(s).c_str());375 gtk_style_context_add_class(ctx, GetBorderClass(s).c_str());
375376
=== modified file 'unity-shared/DecorationStyle.h'
--- unity-shared/DecorationStyle.h 2016-02-25 14:16:17 +0000
+++ unity-shared/DecorationStyle.h 2016-05-30 16:03:09 +0000
@@ -25,6 +25,7 @@
25#include <cairo/cairo.h>25#include <cairo/cairo.h>
2626
27#include <memory>27#include <memory>
28#include <vector>
2829
29struct _GtkStyleContext;30struct _GtkStyleContext;
3031
3132
=== modified file 'unity-shared/GnomeKeyGrabber.cpp'
--- unity-shared/GnomeKeyGrabber.cpp 2015-12-13 10:35:58 +0000
+++ unity-shared/GnomeKeyGrabber.cpp 2016-05-30 16:03:09 +0000
@@ -59,6 +59,12 @@
59</node>)";59</node>)";
60}60}
6161
62namespace
63{
64const std::string SETTINGS_NAME = "com.canonical.Unity";
65const std::string WHITELIST_KEY = "whitelist-repeated-keys";
66}
67
62namespace testing68namespace testing
63{69{
64std::string const DBUS_NAME = "com.canonical.Unity.Test.GnomeKeyGrabber";70std::string const DBUS_NAME = "com.canonical.Unity.Test.GnomeKeyGrabber";
@@ -67,11 +73,18 @@
67GnomeGrabber::Impl::Impl(bool test_mode)73GnomeGrabber::Impl::Impl(bool test_mode)
68 : screen_(screen)74 : screen_(screen)
69 , shell_server_(test_mode ? testing::DBUS_NAME : shell::DBUS_NAME)75 , shell_server_(test_mode ? testing::DBUS_NAME : shell::DBUS_NAME)
76 , settings_(g_settings_new(SETTINGS_NAME.c_str()))
70 , current_action_id_(0)77 , current_action_id_(0)
71{78{
72 shell_server_.AddObjects(shell::INTROSPECTION_XML, shell::DBUS_OBJECT_PATH);79 shell_server_.AddObjects(shell::INTROSPECTION_XML, shell::DBUS_OBJECT_PATH);
73 shell_object_ = shell_server_.GetObject(shell::DBUS_INTERFACE);80 shell_object_ = shell_server_.GetObject(shell::DBUS_INTERFACE);
74 shell_object_->SetMethodsCallsHandlerFull(sigc::mem_fun(this, &Impl::OnShellMethodCall));81 shell_object_->SetMethodsCallsHandlerFull(sigc::mem_fun(this, &Impl::OnShellMethodCall));
82
83 whitelist_changed_signal_.Connect(settings_, "changed::" + WHITELIST_KEY, [this] (GSettings*, gchar*) {
84 UpdateWhitelist();
85 });
86
87 UpdateWhitelist();
75}88}
7689
77GnomeGrabber::Impl::~Impl()90GnomeGrabber::Impl::~Impl()
@@ -232,8 +245,12 @@
232 {245 {
233 action.setState(CompAction::StateInitKey);246 action.setState(CompAction::StateInitKey);
234 action.setInitiate([this, action_id](CompAction* action, CompAction::State state, CompOption::Vector& options) {247 action.setInitiate([this, action_id](CompAction* action, CompAction::State state, CompOption::Vector& options) {
235 LOG_DEBUG(logger) << "pressed \"" << action->keyToString() << "\"";248 bool is_whitelisted = std::find(whitelist_.begin(), whitelist_.end(), action->keyToString()) != whitelist_.end();
236 ActivateDBusAction(*action, action_id, 0, CompOption::getIntOptionNamed(options, "time"));249 if (is_whitelisted || !CompOption::getBoolOptionNamed(options, "is_repeated"))
250 {
251 LOG_DEBUG(logger) << "pressed \"" << action->keyToString() << "\"";
252 ActivateDBusAction(*action, action_id, 0, CompOption::getIntOptionNamed(options, "time"));
253 }
237 return true;254 return true;
238 });255 });
239 }256 }
@@ -323,6 +340,16 @@
323 return keycode == 0 || modHandler->keycodeToModifiers(keycode) != 0;340 return keycode == 0 || modHandler->keycodeToModifiers(keycode) != 0;
324}341}
325342
343void GnomeGrabber::Impl::UpdateWhitelist()
344{
345 std::shared_ptr<gchar*> whitelist(g_settings_get_strv(settings_, WHITELIST_KEY.c_str()), g_strfreev);
346 auto whitelist_raw = whitelist.get();
347
348 whitelist_.clear();
349 for (int i = 0; whitelist_raw[i]; ++i)
350 whitelist_.push_back(whitelist_raw[i]);
351}
352
326// Public implementation353// Public implementation
327354
328GnomeGrabber::GnomeGrabber()355GnomeGrabber::GnomeGrabber()
329356
=== modified file 'unity-shared/GnomeKeyGrabberImpl.h'
--- unity-shared/GnomeKeyGrabberImpl.h 2015-12-13 10:35:58 +0000
+++ unity-shared/GnomeKeyGrabberImpl.h 2016-05-30 16:03:09 +0000
@@ -28,6 +28,7 @@
28#include <UnityCore/GLibDBusProxy.h>28#include <UnityCore/GLibDBusProxy.h>
29#include <UnityCore/GLibDBusServer.h>29#include <UnityCore/GLibDBusServer.h>
30#include <UnityCore/GLibDBusNameWatcher.h>30#include <UnityCore/GLibDBusNameWatcher.h>
31#include <UnityCore/GLibSignal.h>
3132
32namespace unity33namespace unity
33{34{
@@ -55,11 +56,17 @@
5556
56 bool IsActionPostponed(CompAction const& action) const;57 bool IsActionPostponed(CompAction const& action) const;
5758
59 void UpdateWhitelist();
60
58 CompScreen* screen_;61 CompScreen* screen_;
5962
60 glib::DBusServer shell_server_;63 glib::DBusServer shell_server_;
61 glib::DBusObject::Ptr shell_object_;64 glib::DBusObject::Ptr shell_object_;
6265
66 glib::Object<GSettings> settings_;
67 glib::Signal<void, GSettings*, gchar*> whitelist_changed_signal_;
68 std::list<std::string> whitelist_;
69
63 uint32_t current_action_id_;70 uint32_t current_action_id_;
64 std::vector<uint32_t> actions_ids_;71 std::vector<uint32_t> actions_ids_;
65 std::vector<uint32_t> actions_customers_;72 std::vector<uint32_t> actions_customers_;
6673
=== modified file 'unity-shared/PanelStyle.cpp'
--- unity-shared/PanelStyle.cpp 2016-03-31 05:37:15 +0000
+++ unity-shared/PanelStyle.cpp 2016-05-30 16:03:09 +0000
@@ -85,6 +85,7 @@
85 gtk_widget_path_iter_set_name(widget_path.get(), -1, PANEL_STYLE_CSS_NAME.c_str());85 gtk_widget_path_iter_set_name(widget_path.get(), -1, PANEL_STYLE_CSS_NAME.c_str());
8686
87 gtk_style_context_set_path(style_context_, widget_path.get());87 gtk_style_context_set_path(style_context_, widget_path.get());
88 gtk_style_context_add_class(style_context_, "background");
88 gtk_style_context_add_class(style_context_, "gnome-panel-menu-bar");89 gtk_style_context_add_class(style_context_, "gnome-panel-menu-bar");
89 gtk_style_context_add_class(style_context_, "unity-panel");90 gtk_style_context_add_class(style_context_, "unity-panel");
9091

Subscribers

People subscribed via source and target branches

to all changes: