diff options
| author | Alberto Milone <alberto.milone@canonical.com> | 2016-06-06 14:28:29 +0000 |
|---|---|---|
| committer | Bileto Bot <ci-train-bot@canonical.com> | 2016-06-06 14:28:29 +0000 |
| commit | 3b3ba827546e7ca6eb214c2d266853fca9deb922 (patch) | |
| tree | edb487eb6e95ae805e29f1465b4074b48faa2930 /plugins | |
| parent | ab1b59be038eeeebcf66cd7baeb9a92222c9f5a5 (diff) | |
| parent | 082df51426e4c90113eeead38ea8cb9c13a81c56 (diff) | |
UnitySettings: Add dconf keys for disabling multitouch gestures (LP: #1589520)
(bzr r4129)
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 15 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.h | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 6fd134a32..70bf12937 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -446,6 +446,7 @@ UnityScreen::UnityScreen(CompScreen* screen) auto init_plugins_cb = sigc::mem_fun(this, &UnityScreen::InitPluginActions); sources_.Add(std::make_shared<glib::Idle>(init_plugins_cb, glib::Source::Priority::DEFAULT)); + Settings::Instance().gestures_changed.connect(sigc::mem_fun(this, &UnityScreen::UpdateGesturesSupport)); InitGesturesSupport(); LoadPanelShadowTexture(); @@ -4189,22 +4190,26 @@ lockscreen::Controller::Ptr UnityScreen::lockscreen_controller() return lockscreen_controller_; } +void UnityScreen::UpdateGesturesSupport() +{ + Settings::Instance().gestures_launcher_drag() ? gestures_sub_launcher_->Activate() : gestures_sub_launcher_->Deactivate(); + Settings::Instance().gestures_dash_tap() ? gestures_sub_dash_->Activate() : gestures_sub_dash_->Deactivate(); + Settings::Instance().gestures_windows_drag_pinch() ? gestures_sub_windows_->Activate() : gestures_sub_windows_->Deactivate(); +} + void UnityScreen::InitGesturesSupport() { std::unique_ptr<nux::GestureBroker> gesture_broker(new UnityGestureBroker); wt->GetWindowCompositor().SetGestureBroker(std::move(gesture_broker)); - gestures_sub_launcher_.reset(new nux::GesturesSubscription); gestures_sub_launcher_->SetGestureClasses(nux::DRAG_GESTURE); gestures_sub_launcher_->SetNumTouches(4); gestures_sub_launcher_->SetWindowId(GDK_ROOT_WINDOW()); - gestures_sub_launcher_->Activate(); gestures_sub_dash_.reset(new nux::GesturesSubscription); gestures_sub_dash_->SetGestureClasses(nux::TAP_GESTURE); gestures_sub_dash_->SetNumTouches(4); gestures_sub_dash_->SetWindowId(GDK_ROOT_WINDOW()); - gestures_sub_dash_->Activate(); gestures_sub_windows_.reset(new nux::GesturesSubscription); gestures_sub_windows_->SetGestureClasses(nux::TOUCH_GESTURE @@ -4212,7 +4217,9 @@ void UnityScreen::InitGesturesSupport() | nux::PINCH_GESTURE); gestures_sub_windows_->SetNumTouches(3); gestures_sub_windows_->SetWindowId(GDK_ROOT_WINDOW()); - gestures_sub_windows_->Activate(); + + // Apply the user's settings + UpdateGesturesSupport(); } CompAction::Vector& UnityScreen::getActions() diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h index 202654d2b..b1dfda5b0 100644 --- a/plugins/unityshell/src/unityshell.h +++ b/plugins/unityshell/src/unityshell.h @@ -282,6 +282,7 @@ private: void OnDecorationStyleChanged(); void InitGesturesSupport(); + void UpdateGesturesSupport(); void DrawPanelUnderDash(); |
