diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-06-17 12:28:42 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2016-06-17 12:28:42 +0200 |
| commit | ddb1fbeeb4fca2ba40b75c227c4c49cbb1d3de67 (patch) | |
| tree | 2ad4aed2319394ccdb3afc15339268e77fa3bbc3 | |
| parent | 5ebf751e19d1a2a357dce6e159918dfab5b421b6 (diff) | |
| parent | fc82fb1744fcaf3c69879dbc710f3bed1eefacfd (diff) | |
Merging with trunk
(bzr r4119.1.3)
| -rw-r--r-- | UnityCore/GnomeSessionManager.cpp | 3 | ||||
| -rw-r--r-- | com.canonical.Unity.gschema.xml | 31 | ||||
| -rw-r--r-- | debian/changelog | 33 | ||||
| -rw-r--r-- | launcher/Launcher.cpp | 43 | ||||
| -rw-r--r-- | launcher/VolumeImp.cpp | 5 | ||||
| -rw-r--r-- | panel/PanelView.cpp | 10 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.cpp | 32 | ||||
| -rw-r--r-- | plugins/unityshell/src/unityshell.h | 6 | ||||
| -rw-r--r-- | unity-shared/GnomeKeyGrabber.cpp | 26 | ||||
| -rw-r--r-- | unity-shared/GnomeKeyGrabberImpl.h | 6 | ||||
| -rw-r--r-- | unity-shared/UnitySettings.cpp | 20 | ||||
| -rw-r--r-- | unity-shared/UnitySettings.h | 4 |
12 files changed, 187 insertions, 32 deletions
diff --git a/UnityCore/GnomeSessionManager.cpp b/UnityCore/GnomeSessionManager.cpp index 4fd67807f..4c59ece30 100644 --- a/UnityCore/GnomeSessionManager.cpp +++ b/UnityCore/GnomeSessionManager.cpp @@ -117,8 +117,9 @@ GnomeManager::Impl::Impl(GnomeManager* manager, bool test_mode) login_proxy_->ConnectProperty("Active", [this] (GVariant* variant) { bool active = glib::Variant(variant).GetBool(); - manager_->screensaver_requested.emit(!active); manager_->is_session_active.changed.emit(active); + if (active) + manager_->screensaver_requested.emit(false); }); manager_->is_session_active.SetGetterFunction([this] { diff --git a/com.canonical.Unity.gschema.xml b/com.canonical.Unity.gschema.xml index 74f0afbd4..01123274a 100644 --- a/com.canonical.Unity.gschema.xml +++ b/com.canonical.Unity.gschema.xml @@ -81,6 +81,18 @@ integrated menus are enabled), otherwise they will be shown only when the mouse cursor is over the relative mouse area.</description> </key> + <key type="as" name="whitelist-repeated-keys"> + <default>[ + 'XF86KbdBrightnessUp', + 'XF86KbdBrightnessDown', + 'XF86MonBrightnessUp', + 'XF86MonBrightnessDown', + 'XF86AudioRaiseVolume', + 'XF86AudioLowerVolume' + ]</default> + <summary>List of keycodes that should be processed even if auto-repated.</summary> + <description>These keycodes are processed even if they are auto-repeated.</description> + </key> </schema> <schema path="/com/canonical/unity/interface/" id="com.canonical.Unity.Interface" gettext-domain="unity"> <key type="d" name="text-scale-factor"> @@ -208,4 +220,23 @@ when clicking over unfocused menu entries</description> </key> </schema> + <schema path="/com/canonical/unity/gestures/" id="com.canonical.Unity.Gestures" gettext-domain="unity"> + <key type="b" name="launcher-drag"> + <default>true</default> + <summary>Multi-touch gesture to reveal the launcher.</summary> + <description>When this is enabled, a 4 finger swipe from left to right will reveal launcher, + provided that the launcher is set to auto-hide.</description> + </key> + <key type="b" name="dash-tap"> + <default>true</default> + <summary>Multi-touch gesture to open the dash.</summary> + <description>When this is enabled, a 4 finger tap will open the dash.</description> + </key> + <key type="b" name="windows-drag-pinch"> + <default>true</default> + <summary>Multi-touch gestures to manage the windows.</summary> + <description>When this is enabled, 3 finger gestures such as drag, and pinch, will + help manage the windows.</description> + </key> + </schema> </schemalist> diff --git a/debian/changelog b/debian/changelog index c2cfd1765..4aecaaaba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,36 @@ +unity (7.5.0+16.10.20160606.1-0ubuntu1) yakkety; urgency=medium + + [ Alberto Milone ] + * UnitySettings: Add dconf keys for disabling multitouch gestures (LP: + #1589520) + + [ Andrea Azzarone ] + * Do not trigger screensaver on session inactive. (LP: #1587507) + * Use SwitcherController::SetDetail instead of detail=... (LP: + #1587618) + + -- Marco Trevisan (Treviño) <mail@3v1n0.net> Mon, 06 Jun 2016 14:29:04 +0000 + +unity (7.5.0+16.10.20160602-0ubuntu1) yakkety; urgency=medium + + [ Andrea Azzarone ] + * Add whitelist for auto-repated keys. (LP: #1586491) + * Fix scale window activation if in show desktop mode. (LP: #1582056) + * Order matters in the rendering. Draw launcher shadow after the + background in all cases. (LP: #1586374) + * Fallback to volume name if no other identifier is available. (LP: + #1103593) + + -- Marco Trevisan (Treviño) <mail@3v1n0.net> Thu, 02 Jun 2016 01:02:19 +0000 + +unity (7.5.0+16.10.20160525-0ubuntu1) yakkety; urgency=medium + + [ Eleni Maria Stea ] + * PanelView: Don't draw it if the geo doesn't intersect the monitor + geo (as in ezoom) + + -- Marco Trevisan (Treviño) <mail@3v1n0.net> Wed, 25 May 2016 14:22:42 +0000 + unity (7.5.0+16.10.20160517-0ubuntu1) yakkety; urgency=medium [ Marco Trevisan (Treviño) ] diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp index 5634ff552..af030968d 100644 --- a/launcher/Launcher.cpp +++ b/launcher/Launcher.cpp @@ -2010,27 +2010,6 @@ void Launcher::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) icon_renderer_->PreprocessIcons(args, base); EventLogic(); - if (!IsOverlayOpen() && launcher_position_ == LauncherPosition::BOTTOM) - { - const double top_line_opacity = 0.15f * launcher_alpha; - - gPainter.Paint2DQuadColor(GfxContext, - nux::Geometry(bkg_box.x, - bkg_box.y, - bkg_box.width, - SIDE_LINE_WIDTH.CP(cv_)), - nux::color::White * top_line_opacity); - - gPainter.Paint2DQuadColor(GfxContext, - nux::Geometry(bkg_box.x, - bkg_box.y, - bkg_box.width, - 8), - nux::Color(0x70000000), - nux::Color(0x00000000), - nux::Color(0x00000000), - nux::Color(0x70000000)); - } /* draw launcher */ for (rev_it = args.rbegin(); rev_it != args.rend(); ++rev_it) @@ -2075,6 +2054,28 @@ void Launcher::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) nux::Color(0x70000000)); } + if (!IsOverlayOpen() && launcher_position_ == LauncherPosition::BOTTOM) + { + const double top_line_opacity = 0.15f * launcher_alpha; + + gPainter.Paint2DQuadColor(GfxContext, + nux::Geometry(bkg_box.x, + bkg_box.y, + bkg_box.width, + SIDE_LINE_WIDTH.CP(cv_)), + nux::color::White * top_line_opacity); + + gPainter.Paint2DQuadColor(GfxContext, + nux::Geometry(bkg_box.x, + bkg_box.y, + bkg_box.width, + 8), + nux::Color(0x70000000), + nux::Color(0x00000000), + nux::Color(0x00000000), + nux::Color(0x70000000)); + } + // FIXME: can be removed for a bgk_box->SetAlpha once implemented GfxContext.GetRenderStates().SetPremultipliedBlend(nux::DST_IN); nux::Color alpha_mask = nux::Color(0xFFAAAAAA) * launcher_alpha; diff --git a/launcher/VolumeImp.cpp b/launcher/VolumeImp.cpp index f9696823a..7e9957eea 100644 --- a/launcher/VolumeImp.cpp +++ b/launcher/VolumeImp.cpp @@ -86,7 +86,10 @@ public: glib::String label(g_volume_get_identifier(volume_, G_VOLUME_IDENTIFIER_KIND_LABEL)); glib::String uuid(g_volume_get_identifier(volume_, G_VOLUME_IDENTIFIER_KIND_UUID)); - return uuid.Str() + "-" + label.Str(); + if (!label && !uuid) + return GetName(); + else + return uuid.Str() + "-" + label.Str(); } std::string GetUnixDevicePath() const diff --git a/panel/PanelView.cpp b/panel/PanelView.cpp index 632b45431..af142dc05 100644 --- a/panel/PanelView.cpp +++ b/panel/PanelView.cpp @@ -300,10 +300,16 @@ void PanelView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) { nux::Geometry const& geo = GetGeometry(); + nux::Geometry const& mgeo = UScreen::GetDefault()->GetMonitorGeometry(monitor_); + nux::Geometry isect = mgeo.Intersect(geo); + + if(!isect.width || !isect.height) + return; + UpdateBackground(); bool overlay_mode = InOverlayMode(); - GfxContext.PushClippingRectangle(geo); + GfxContext.PushClippingRectangle(isect); if (IsTransparent()) { @@ -331,7 +337,7 @@ PanelView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) rop.SrcBlend = GL_ONE; rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA; - GfxContext.PushClippingRectangle(geo); + GfxContext.PushClippingRectangle(isect); #ifndef NUX_OPENGLES_20 if (GfxContext.UsingGLSLCodePath()) diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp index f0c24f340..70bf12937 100644 --- a/plugins/unityshell/src/unityshell.cpp +++ b/plugins/unityshell/src/unityshell.cpp @@ -221,6 +221,7 @@ UnityScreen::UnityScreen(CompScreen* screen) , key_nav_mode_requested_(false) , big_tick_(0) , back_buffer_age_(0) + , next_active_window_(0) { Timer timer; #ifndef USE_GLES @@ -445,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(); @@ -1214,6 +1216,8 @@ void UnityWindow::leaveShowDesktop () void UnityWindow::activate () { + uScreen->SetNextActiveWindow(window->id()); + ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ()); window->activate (); ShowdesktopHandler::AllowLeaveShowdesktopMode (window->id ()); @@ -2483,7 +2487,7 @@ bool UnityScreen::altTabNextWindowInitiate(CompAction* action, CompAction::State } else { - switcher_controller_->detail = true; + switcher_controller_->SetDetail(true); } action->setState(action->state() | CompAction::StateTermKey); @@ -4186,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 @@ -4209,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() @@ -4245,6 +4255,16 @@ void UnityScreen::ShowFirstRunHints() }); } +Window UnityScreen::GetNextActiveWindow() const +{ + return next_active_window_; +} + +void UnityScreen::SetNextActiveWindow(Window next_active_window) +{ + next_active_window_ = next_active_window; +} + /* Window init */ namespace @@ -4604,7 +4624,7 @@ void UnityWindow::OnTerminateSpread() if (IsInShowdesktopMode()) { - if (!(screen->activeWindow() == window->id())) + if (uScreen->GetNextActiveWindow() != window->id()) { if (!mShowdesktopHandler) mShowdesktopHandler.reset(new ShowdesktopHandler(static_cast <ShowdesktopHandlerWindowInterface *>(this), diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h index 8f3d89c08..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(); @@ -298,6 +299,9 @@ private: void SpreadAppWindows(bool anywhere); bool queryForShader(); + Window GetNextActiveWindow() const; + void SetNextActiveWindow(Window next_active_window); + /* We store these to avoid unecessary calls to ::get */ CompScreen* screen; CompositeScreen* cScreen; @@ -413,6 +417,8 @@ private: uint64_t big_tick_; unsigned int back_buffer_age_; + Window next_active_window_; + friend class UnityWindow; friend class debug::ScreenIntrospection; friend class decoration::Manager; diff --git a/unity-shared/GnomeKeyGrabber.cpp b/unity-shared/GnomeKeyGrabber.cpp index ca3a598d5..a9f82842e 100644 --- a/unity-shared/GnomeKeyGrabber.cpp +++ b/unity-shared/GnomeKeyGrabber.cpp @@ -59,6 +59,12 @@ R"(<node> </node>)"; } +namespace +{ +const std::string SETTINGS_NAME = "com.canonical.Unity"; +const std::string WHITELIST_KEY = "whitelist-repeated-keys"; +} + namespace testing { std::string const DBUS_NAME = "com.canonical.Unity.Test.GnomeKeyGrabber"; @@ -68,11 +74,18 @@ GnomeGrabber::Impl::Impl(Grabber* parent, bool test_mode) : parent_(parent) , screen_(screen) , shell_server_(test_mode ? testing::DBUS_NAME : shell::DBUS_NAME) + , settings_(g_settings_new(SETTINGS_NAME.c_str())) , current_action_id_(0) { shell_server_.AddObjects(shell::INTROSPECTION_XML, shell::DBUS_OBJECT_PATH); shell_object_ = shell_server_.GetObject(shell::DBUS_INTERFACE); shell_object_->SetMethodsCallsHandlerFull(sigc::mem_fun(this, &Impl::OnShellMethodCall)); + + whitelist_changed_signal_.Connect(settings_, "changed::" + WHITELIST_KEY, [this] (GSettings*, gchar*) { + UpdateWhitelist(); + }); + + UpdateWhitelist(); } GnomeGrabber::Impl::~Impl() @@ -235,7 +248,8 @@ uint32_t GnomeGrabber::Impl::GrabDBusAccelerator(std::string const& owner, std:: { action.setState(CompAction::StateInitKey); action.setInitiate([this, action_id](CompAction* action, CompAction::State state, CompOption::Vector& options) { - if (!CompOption::getBoolOptionNamed(options, "is_repeated")) + bool is_whitelisted = std::find(whitelist_.begin(), whitelist_.end(), action->keyToString()) != whitelist_.end(); + if (is_whitelisted || !CompOption::getBoolOptionNamed(options, "is_repeated")) { LOG_DEBUG(logger) << "pressed \"" << action->keyToString() << "\""; ActivateDBusAction(*action, action_id, 0, CompOption::getIntOptionNamed(options, "time")); @@ -328,6 +342,16 @@ bool GnomeGrabber::Impl::IsActionPostponed(CompAction const& action) const return keycode == 0 || modHandler->keycodeToModifiers(keycode) != 0; } +void GnomeGrabber::Impl::UpdateWhitelist() +{ + std::shared_ptr<gchar*> whitelist(g_settings_get_strv(settings_, WHITELIST_KEY.c_str()), g_strfreev); + auto whitelist_raw = whitelist.get(); + + whitelist_.clear(); + for (int i = 0; whitelist_raw[i]; ++i) + whitelist_.push_back(whitelist_raw[i]); +} + // Public implementation GnomeGrabber::GnomeGrabber() diff --git a/unity-shared/GnomeKeyGrabberImpl.h b/unity-shared/GnomeKeyGrabberImpl.h index aaf283c3b..650d1eb63 100644 --- a/unity-shared/GnomeKeyGrabberImpl.h +++ b/unity-shared/GnomeKeyGrabberImpl.h @@ -28,6 +28,7 @@ #include <UnityCore/GLibDBusProxy.h> #include <UnityCore/GLibDBusServer.h> #include <UnityCore/GLibDBusNameWatcher.h> +#include <UnityCore/GLibSignal.h> namespace unity { @@ -54,6 +55,7 @@ struct GnomeGrabber::Impl void ActivateDBusAction(CompAction const& action, uint32_t id, uint32_t device, uint32_t timestamp) const; bool IsActionPostponed(CompAction const& action) const; + void UpdateWhitelist(); Grabber* parent_; CompScreen* screen_; @@ -61,6 +63,10 @@ struct GnomeGrabber::Impl glib::DBusServer shell_server_; glib::DBusObject::Ptr shell_object_; + glib::Object<GSettings> settings_; + glib::Signal<void, GSettings*, gchar*> whitelist_changed_signal_; + std::list<std::string> whitelist_; + uint32_t current_action_id_; std::vector<uint32_t> actions_ids_; std::vector<uint32_t> actions_customers_; diff --git a/unity-shared/UnitySettings.cpp b/unity-shared/UnitySettings.cpp index 7109ebdf3..ec4d1374f 100644 --- a/unity-shared/UnitySettings.cpp +++ b/unity-shared/UnitySettings.cpp @@ -66,6 +66,11 @@ const std::string GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor"; const std::string REMOTE_CONTENT_SETTINGS = "com.canonical.Unity.Lenses"; const std::string REMOTE_CONTENT_KEY = "remote-content-search"; +const std::string GESTURES_SETTINGS = "com.canonical.Unity.Gestures"; +const std::string LAUNCHER_DRAG = "launcher-drag"; +const std::string DASH_TAP = "dash-tap"; +const std::string WINDOWS_DRAG_PINCH = "windows-drag-pinch"; + const int DEFAULT_LAUNCHER_SIZE = 64; const int MINIMUM_DESKTOP_HEIGHT = 800; const int GNOME_SETTINGS_CHANGED_WAIT_SECONDS = 1; @@ -83,6 +88,7 @@ public: , usettings_(g_settings_new(SETTINGS_NAME.c_str())) , launcher_settings_(g_settings_new(LAUNCHER_SETTINGS.c_str())) , lim_settings_(g_settings_new(LIM_SETTINGS.c_str())) + , gestures_settings_(g_settings_new(GESTURES_SETTINGS.c_str())) , ui_settings_(g_settings_new(UI_SETTINGS.c_str())) , ubuntu_ui_settings_(g_settings_new(UBUNTU_UI_SETTINGS.c_str())) , gnome_ui_settings_(g_settings_new(GNOME_UI_SETTINGS.c_str())) @@ -160,6 +166,10 @@ public: UpdateLimSetting(); }); + signals_.Add<void, GSettings*, const gchar*>(gestures_settings_, "changed", [this] (GSettings*, const gchar*) { + UpdateGesturesSetting(); + }); + signals_.Add<void, GSettings*, const gchar*>(remote_content_settings_, "changed::" + REMOTE_CONTENT_KEY, [this] (GSettings*, const gchar* t) { UpdateRemoteContentSearch(); }); @@ -168,6 +178,7 @@ public: // The order is important here, DPI is the last thing to be updated UpdateLimSetting(); + UpdateGesturesSetting(); UpdateTextScaleFactor(); UpdateCursorScaleFactor(); UpdateFontSize(); @@ -222,6 +233,14 @@ public: parent_->lim_unfocused_popup = g_settings_get_boolean(lim_settings_, UNFOCUSED_MENU_POPUP.c_str()); } + void UpdateGesturesSetting() + { + parent_->gestures_launcher_drag = g_settings_get_boolean(gestures_settings_, LAUNCHER_DRAG.c_str()); + parent_->gestures_dash_tap = g_settings_get_boolean(gestures_settings_, DASH_TAP.c_str()); + parent_->gestures_windows_drag_pinch = g_settings_get_boolean(gestures_settings_, WINDOWS_DRAG_PINCH.c_str()); + parent_->gestures_changed.emit(); + } + FormFactor GetFormFactor() const { return cached_form_factor_; @@ -384,6 +403,7 @@ public: glib::Object<GSettings> usettings_; glib::Object<GSettings> launcher_settings_; glib::Object<GSettings> lim_settings_; + glib::Object<GSettings> gestures_settings_; glib::Object<GSettings> ui_settings_; glib::Object<GSettings> ubuntu_ui_settings_; glib::Object<GSettings> gnome_ui_settings_; diff --git a/unity-shared/UnitySettings.h b/unity-shared/UnitySettings.h index 268cf3474..1081fef57 100644 --- a/unity-shared/UnitySettings.h +++ b/unity-shared/UnitySettings.h @@ -71,9 +71,13 @@ public: nux::Property<double> font_scaling; nux::ROProperty<bool> remote_content; nux::RWProperty<LauncherPosition> launcher_position; + nux::Property<bool> gestures_launcher_drag; + nux::Property<bool> gestures_dash_tap; + nux::Property<bool> gestures_windows_drag_pinch; sigc::signal<void> dpi_changed; sigc::signal<void> low_gfx_changed; + sigc::signal<void> gestures_changed; private: class Impl; |
