diff options
| author | Alberto Milone <alberto.milone@canonical.com> | 2016-06-06 16:05:18 +0200 |
|---|---|---|
| committer | Alberto Milone <alberto.milone@canonical.com> | 2016-06-06 16:05:18 +0200 |
| commit | fd8bd6aebd962c5b30a986f3d50c72e01548a7ee (patch) | |
| tree | 190f7e04f7baa418d72e1836702a494ec6ccad96 /plugins/unityshell | |
| parent | b4abdf57f50cf44e34dcd882d9ff5ce902d6197e (diff) | |
Add dconf keys for disabling multitouch gestures. (LP: #1589520)
(bzr r4126.1.1)
Diffstat (limited to 'plugins/unityshell')
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 11 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index 9cc93bae1..93e182909 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,11 +4190,17 @@ 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); @@ -4213,6 +4220,8 @@ void UnityScreen::InitGesturesSupport() 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(); |
