diff -Nru unity-7.4.0+16.04.20160526.1/com.canonical.Unity.gschema.xml unity-7.4.0+16.04.20160715/com.canonical.Unity.gschema.xml
--- unity-7.4.0+16.04.20160526.1/com.canonical.Unity.gschema.xml 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/com.canonical.Unity.gschema.xml 2016-07-15 10:14:23.000000000 +0000
@@ -81,6 +81,25 @@
integrated menus are enabled), otherwise they will be shown only when
the mouse cursor is over the relative mouse area.
+
+ [
+ 'XF86KbdBrightnessUp',
+ 'XF86KbdBrightnessDown',
+ 'XF86MonBrightnessUp',
+ 'XF86MonBrightnessDown',
+ 'XF86AudioRaiseVolume',
+ 'XF86AudioLowerVolume'
+ ]
+ List of keycodes that should be processed even if auto-repated.
+ These keycodes are processed even if they are auto-repeated.
+
+
+ false
+ Enable/Disable PAM account checking
+ Whether PAM should check the result of account modules
+ when authenticating. Only do this if you have account
+ configured properly on your system.
+
@@ -208,4 +227,23 @@
when clicking over unfocused menu entries
+
+
+ true
+ Multi-touch gesture to reveal the launcher.
+ When this is enabled, a 4 finger swipe from left to right will reveal launcher,
+ provided that the launcher is set to auto-hide.
+
+
+ true
+ Multi-touch gesture to open the dash.
+ When this is enabled, a 4 finger tap will open the dash.
+
+
+ true
+ Multi-touch gestures to manage the windows.
+ When this is enabled, 3 finger gestures such as drag, and pinch, will
+ help manage the windows.
+
+
diff -Nru unity-7.4.0+16.04.20160526.1/dash/DashController.cpp unity-7.4.0+16.04.20160715/dash/DashController.cpp
--- unity-7.4.0+16.04.20160526.1/dash/DashController.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/DashController.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -43,7 +43,8 @@
namespace
{
-unsigned const PRELOAD_TIMEOUT_LENGTH = 40;
+const unsigned PRELOAD_TIMEOUT_LENGTH = 40;
+const unsigned FADE_DURATION = 90;
namespace dbus
{
@@ -68,7 +69,7 @@
, visible_(false)
, dbus_server_(dbus::BUS_NAME)
, ensure_timeout_(PRELOAD_TIMEOUT_LENGTH)
- , timeline_animator_(90)
+ , timeline_animator_(Settings::Instance().low_gfx() ? 0 : FADE_DURATION)
{
RegisterUBusInterests();
@@ -91,6 +92,9 @@
SetupWindow();
UScreen::GetDefault()->changed.connect(sigc::mem_fun(this, &Controller::OnMonitorChanged));
Settings::Instance().launcher_position.changed.connect(sigc::hide(sigc::mem_fun(this, &Controller::Relayout)));
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ timeline_animator_.SetDuration(low_gfx ? 0 : FADE_DURATION);
+ }, *this));
form_factor_changed_ = Settings::Instance().form_factor.changed.connect([this] (FormFactor)
{
diff -Nru unity-7.4.0+16.04.20160526.1/dash/DashView.cpp unity-7.4.0+16.04.20160715/dash/DashView.cpp
--- unity-7.4.0+16.04.20160526.1/dash/DashView.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/DashView.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -313,13 +313,15 @@
preview_animation_.reset();
preview_container_animation_.reset();
+ double anim_length = Settings::Instance().low_gfx() ? 0 : PREVIEW_ANIMATION_LENGTH;
+
// Dash Split Open Animation
split_animation_.reset(new na::AnimateValue());
- split_animation_->SetDuration((1.0f - animate_split_value_) * PREVIEW_ANIMATION_LENGTH);
+ split_animation_->SetDuration((1.0f - animate_split_value_) * anim_length);
split_animation_->SetStartValue(animate_split_value_);
split_animation_->SetFinishValue(1.0f);
split_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
- split_animation_->updated.connect([this](float const& linear_split_animate_value)
+ split_animation_->updated.connect([this, anim_length](float const& linear_split_animate_value)
{
static na::EasingCurve split_animation_curve(na::EasingCurve::Type::InQuad);
@@ -331,11 +333,11 @@
{
// Preview Container Close Animation
preview_container_animation_.reset(new na::AnimateValue());
- preview_container_animation_->SetDuration((1.0f - animate_preview_container_value_) * PREVIEW_ANIMATION_LENGTH);
+ preview_container_animation_->SetDuration((1.0f - animate_preview_container_value_) * anim_length);
preview_container_animation_->SetStartValue(animate_preview_container_value_);
preview_container_animation_->SetFinishValue(1.0f);
preview_container_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
- preview_container_animation_->updated.connect([this](float const& linear_preview_container_animate_value)
+ preview_container_animation_->updated.connect([this, anim_length](float const& linear_preview_container_animate_value)
{
static na::EasingCurve preview_container_animation_curve(na::EasingCurve::Type::InQuad);
@@ -347,7 +349,7 @@
{
// Preview Close Animation
preview_animation_.reset(new na::AnimateValue());
- preview_animation_->SetDuration((1.0f - animate_preview_value_) * PREVIEW_ANIMATION_LENGTH);
+ preview_animation_->SetDuration((1.0f - animate_preview_value_) * anim_length);
preview_animation_->SetStartValue(animate_preview_value_);
preview_animation_->SetFinishValue(1.0f);
preview_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
@@ -382,13 +384,15 @@
split_animation_.reset();
preview_container_animation_.reset();
+ double anim_length = Settings::Instance().low_gfx() ? 0 : PREVIEW_ANIMATION_LENGTH;
+
// Preview Close Animation
preview_animation_.reset(new na::AnimateValue());
- preview_animation_->SetDuration(animate_preview_value_ * PREVIEW_ANIMATION_LENGTH);
+ preview_animation_->SetDuration(animate_preview_value_ * anim_length);
preview_animation_->SetStartValue(1.0f - animate_preview_value_);
preview_animation_->SetFinishValue(1.0f);
preview_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
- preview_animation_->updated.connect([this](float const& preview_value)
+ preview_animation_->updated.connect([this, anim_length](float const& preview_value)
{
animate_preview_value_ = 1.0f - preview_value;
QueueDraw();
@@ -398,11 +402,11 @@
{
// Preview Container Close Animation
preview_container_animation_.reset(new na::AnimateValue());
- preview_container_animation_->SetDuration(animate_preview_container_value_ * PREVIEW_ANIMATION_LENGTH);
+ preview_container_animation_->SetDuration(animate_preview_container_value_ * anim_length);
preview_container_animation_->SetStartValue(1.0f - animate_preview_container_value_);
preview_container_animation_->SetFinishValue(1.0f);
preview_container_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
- preview_container_animation_->updated.connect([this](float const& linear_preview_container_animate_value)
+ preview_container_animation_->updated.connect([this, anim_length](float const& linear_preview_container_animate_value)
{
static na::EasingCurve preview_container_animation_curve(na::EasingCurve::Type::InQuad);
@@ -413,7 +417,7 @@
{
// Dash Split Close Animation
split_animation_.reset(new na::AnimateValue());
- split_animation_->SetDuration(animate_split_value_ * PREVIEW_ANIMATION_LENGTH);
+ split_animation_->SetDuration(animate_split_value_ * anim_length);
split_animation_->SetStartValue(1.0f - animate_split_value_);
split_animation_->SetFinishValue(1.0f);
split_animation_->SetEasingCurve(na::EasingCurve(na::EasingCurve::Type::Linear));
diff -Nru unity-7.4.0+16.04.20160526.1/dash/previews/PreviewContainer.cpp unity-7.4.0+16.04.20160715/dash/previews/PreviewContainer.cpp
--- unity-7.4.0+16.04.20160526.1/dash/previews/PreviewContainer.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/previews/PreviewContainer.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -23,11 +23,13 @@
#include "PreviewContainer.h"
#include
+#include "unity-shared/AnimationUtils.h"
#include "unity-shared/IntrospectableWrappers.h"
#include "unity-shared/TimeUtil.h"
#include "unity-shared/PreviewStyle.h"
#include "unity-shared/DashStyle.h"
#include "unity-shared/GraphicsUtils.h"
+#include "unity-shared/UnitySettings.h"
#include "PreviewNavigator.h"
#include
#include "config.h"
@@ -49,7 +51,6 @@
const int ANIM_DURATION_LONG = 500;
const int PREVIEW_SPINNER_WAIT = 2000;
-const std::string ANIMATION_IDLE = "animation-idle";
const RawPixel CHILDREN_SPACE = 6_em;
}
@@ -113,7 +114,7 @@
StopPreviewWait();
// the parents layout will not change based on the previews.
preview->SetReconfigureParentLayoutOnGeometryChange(false);
-
+
AddChild(preview.GetPointer());
AddView(preview.GetPointer());
preview->SetVisible(false);
@@ -409,23 +410,21 @@
, scale(1.0)
, preview_layout_(nullptr)
, nav_disabled_(Navigation::NONE)
- , navigation_progress_speed_(0.0)
- , navigation_count_(0)
+ , animation_(Settings::Instance().low_gfx() ? 0 : ANIM_DURATION_LONG)
{
SetAcceptKeyNavFocusOnMouseDown(false);
SetAcceptKeyNavFocusOnMouseEnter(false);
SetupViews();
- last_progress_time_.tv_sec = 0;
- last_progress_time_.tv_nsec = 0;
key_down.connect(sigc::mem_fun(this, &PreviewContainer::OnKeyDown));
mouse_click.connect(sigc::mem_fun(this, &PreviewContainer::OnMouseDown));
scale.changed.connect(sigc::mem_fun(this, &PreviewContainer::UpdateScale));
-}
+ animation_.updated.connect(sigc::mem_fun(this, &PreviewContainer::QueueAnimation));
-PreviewContainer::~PreviewContainer()
-{
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_LONG);
+ }, *this));
}
void PreviewContainer::Preview(dash::Preview::Ptr preview_model, Navigation direction)
@@ -503,28 +502,22 @@
layout->AddSpace(0, 1);
- preview_layout_->start_navigation.connect([this]()
+ preview_layout_->start_navigation.connect([this]
{
- // reset animation clock.
- if (navigation_count_ == 0)
- clock_gettime(CLOCK_MONOTONIC, &last_progress_time_);
+ if (animation_.CurrentState() == na::Animation::State::Running)
+ preview_layout_->UpdateAnimationProgress(1, 1);
- float navigation_progress_remaining = CLAMP((1.0 - preview_layout_->GetAnimationProgress()) + navigation_count_, 1.0f, 10.0f);
- navigation_count_++;
-
- navigation_progress_speed_ = navigation_progress_remaining / ANIM_DURATION_LONG;
- QueueAnimation();
+ animation::Start(animation_, animation::Direction::FORWARD);
});
- preview_layout_->continue_navigation.connect([this]()
+ preview_layout_->continue_navigation.connect([this]
{
- QueueAnimation();
+ QueueAnimation(animation_.GetCurrentValue());
});
- preview_layout_->end_navigation.connect([this]()
+ preview_layout_->end_navigation.connect([this]
{
- navigation_count_ = 0;
- navigation_progress_speed_ = 0;
+ animation_.Stop();
});
navigate_right.connect( [this]() { preview_layout_->StartPreviewWait(); } );
@@ -551,17 +544,6 @@
gfx_engine.QRP_Color(GetX(), GetY(), GetWidth(), GetHeight(), nux::Color(0.0f, 0.0f, 0.0f, 0.0f));
}
- // rely on the compiz event loop to come back to us in a nice throttling
- if (AnimationInProgress())
- {
- if (!animation_timer_)
- animation_timer_.reset(new glib::Timeout(1000/60, sigc::mem_fun(this, &PreviewContainer::QueueAnimation)));
- }
- else if (preview_layout_ && preview_layout_->IsAnimating())
- {
- preview_layout_->UpdateAnimationProgress(1.0f, 1.0f);
- }
-
// Paint using ProcessDraw2. ProcessDraw is overrided by empty impl so we can control z order.
if (preview_layout_)
{
@@ -573,23 +555,9 @@
gfx_engine.PopClippingRectangle();
}
-bool PreviewContainer::AnimationInProgress()
+namespace
{
- // short circuit to avoid unneeded calculations
- struct timespec current;
- clock_gettime(CLOCK_MONOTONIC, ¤t);
-
- if (preview_layout_ == nullptr)
- return false;
-
- // hover in animation
- if (navigation_progress_speed_ > 0)
- return true;
-
- return false;
-}
-
-static float easeInOutQuart(float t)
+double easeInOutQuart(double t)
{
t = CLAMP(t, 0.0, 1.0);
t*=2.0f;
@@ -599,28 +567,19 @@
return -0.5f * (pow(t, 4)- 2);
}
}
+}
-float PreviewContainer::GetSwipeAnimationProgress(struct timespec const& current) const
+double PreviewContainer::GetSwipeAnimationProgress(struct timespec const& current) const
{
- DeltaTime time_delta = TimeUtil::TimeDelta(¤t, &last_progress_time_);
- float progress = preview_layout_->GetAnimationProgress() + (navigation_progress_speed_ * time_delta);
-
- return progress;
+ return preview_layout_ ? preview_layout_->GetAnimationProgress() : 0 + animation_.GetCurrentValue();
}
-bool PreviewContainer::QueueAnimation()
+void PreviewContainer::QueueAnimation(double progress)
{
- animation_timer_.reset();
-
- timespec current;
- clock_gettime(CLOCK_MONOTONIC, ¤t);
- float progress = GetSwipeAnimationProgress(current);
if (preview_layout_)
preview_layout_->UpdateAnimationProgress(progress, easeInOutQuart(progress)); // ease in/out.
- last_progress_time_ = current;
QueueDraw();
- return false;
}
bool PreviewContainer::AcceptKeyNavFocus()
diff -Nru unity-7.4.0+16.04.20160526.1/dash/previews/PreviewContainer.h unity-7.4.0+16.04.20160715/dash/previews/PreviewContainer.h
--- unity-7.4.0+16.04.20160526.1/dash/previews/PreviewContainer.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/previews/PreviewContainer.h 2016-07-15 10:14:23.000000000 +0000
@@ -26,6 +26,7 @@
#include
#include
#include
+#include
#include
#include "Preview.h"
#include "unity-shared/Introspectable.h"
@@ -57,7 +58,6 @@
NUX_DECLARE_OBJECT_TYPE(PreviewContainer, nux::View);
PreviewContainer(NUX_FILE_LINE_PROTO);
- virtual ~PreviewContainer();
void Preview(dash::Preview::Ptr preview_model, Navigation direction);
@@ -98,10 +98,8 @@
private:
void SetupViews();
- bool AnimationInProgress();
- float GetSwipeAnimationProgress(struct timespec const& current) const;
-
- bool QueueAnimation();
+ void QueueAnimation(double progress);
+ double GetSwipeAnimationProgress(struct timespec const& current) const;
private:
void UpdateScale(double scale);
@@ -114,11 +112,8 @@
Navigation nav_disabled_;
// Animation
- struct timespec last_progress_time_;
- float navigation_progress_speed_;
- int navigation_count_;
+ nux::animation::AnimateValue animation_;
- glib::Source::UniquePtr animation_timer_;
friend class PreviewContent;
};
diff -Nru unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneApplicationPreview.cpp unity-7.4.0+16.04.20160715/dash/previews/StandaloneApplicationPreview.cpp
--- unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneApplicationPreview.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/previews/StandaloneApplicationPreview.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -21,10 +21,12 @@
#include "config.h"
#include "Nux/Nux.h"
+#include "Nux/NuxTimerTickSource.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include
+#include
#include
#include
#include
@@ -341,6 +343,9 @@
&TestRunner::InitWindowThread,
test_runner);
+ nux::NuxTimerTickSource tick_source;
+ nux::animation::AnimationController animation_controller(tick_source);
+
wt->Run (NULL);
delete wt;
return 0;
diff -Nru unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneErrorPreview.cpp unity-7.4.0+16.04.20160715/dash/previews/StandaloneErrorPreview.cpp
--- unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneErrorPreview.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/previews/StandaloneErrorPreview.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -24,6 +24,8 @@
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
+#include "Nux/NuxTimerTickSource.h"
+#include
#include
#include
#include
@@ -228,6 +230,9 @@
&TestRunner::InitWindowThread,
test_runner);
+ nux::NuxTimerTickSource tick_source;
+ nux::animation::AnimationController animation_controller(tick_source);
+
wt->Run (NULL);
delete wt;
return 0;
diff -Nru unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneMoviePreview.cpp unity-7.4.0+16.04.20160715/dash/previews/StandaloneMoviePreview.cpp
--- unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneMoviePreview.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/previews/StandaloneMoviePreview.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -20,10 +20,12 @@
#include
#include "Nux/Nux.h"
+#include "Nux/NuxTimerTickSource.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include
+#include
#include
#include
#include
@@ -257,6 +259,9 @@
&TestRunner::InitWindowThread,
test_runner);
+ nux::NuxTimerTickSource tick_source;
+ nux::animation::AnimationController animation_controller(tick_source);
+
wt->Run (NULL);
delete wt;
return 0;
diff -Nru unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneMusicPaymentPreview.cpp unity-7.4.0+16.04.20160715/dash/previews/StandaloneMusicPaymentPreview.cpp
--- unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneMusicPaymentPreview.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/previews/StandaloneMusicPaymentPreview.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -21,9 +21,11 @@
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
+#include "Nux/NuxTimerTickSource.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include
+#include
#include
#include
#include
@@ -232,6 +234,9 @@
&TestRunner::InitWindowThread,
test_runner);
+ nux::NuxTimerTickSource tick_source;
+ nux::animation::AnimationController animation_controller(tick_source);
+
wt->Run (NULL);
delete wt;
return 0;
diff -Nru unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneSocialPreview.cpp unity-7.4.0+16.04.20160715/dash/previews/StandaloneSocialPreview.cpp
--- unity-7.4.0+16.04.20160526.1/dash/previews/StandaloneSocialPreview.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/previews/StandaloneSocialPreview.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -20,10 +20,12 @@
#include "config.h"
#include "Nux/Nux.h"
+#include "Nux/NuxTimerTickSource.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include
+#include
#include
#include
#include
@@ -291,6 +293,9 @@
&TestRunner::InitWindowThread,
test_runner);
+ nux::NuxTimerTickSource tick_source;
+ nux::animation::AnimationController animation_controller(tick_source);
+
wt->Run (NULL);
delete wt;
return 0;
diff -Nru unity-7.4.0+16.04.20160526.1/dash/StandaloneDash.cpp unity-7.4.0+16.04.20160715/dash/StandaloneDash.cpp
--- unity-7.4.0+16.04.20160526.1/dash/StandaloneDash.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/dash/StandaloneDash.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -93,6 +93,7 @@
{
gtk_init (&argc, &argv);
+ unity::Settings settings;
unity::BGHash bghash;
unity::FontSettings font_settings;
@@ -100,7 +101,6 @@
nux::logging::configure_logging(::getenv("UNITY_LOG_SEVERITY"));
// The instances for the pseudo-singletons.
unity::ThumbnailGenerator thumb_generator;
- unity::Settings settings;
unity::dash::Style dash_style;
unity::panel::Style panel_style;
diff -Nru unity-7.4.0+16.04.20160526.1/debian/changelog unity-7.4.0+16.04.20160715/debian/changelog
--- unity-7.4.0+16.04.20160526.1/debian/changelog 2016-07-18 11:20:21.000000000 +0000
+++ unity-7.4.0+16.04.20160715/debian/changelog 2016-07-18 11:20:22.000000000 +0000
@@ -1,3 +1,50 @@
+unity (7.4.0+16.04.20160715-0ubuntu1) xenial; urgency=medium
+
+ [ Eleni Maria Stea ]
+ * PanelView: Don't draw it if the geo doesn't intersect the monitor
+ geo (as in ezoom)
+ * speeds up the showdesktop plugin in lowgfx mode
+
+ [ 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)
+ * Do not trigger screensaver on session inactive. (LP: #1587507)
+ * Use SwitcherController::SetDetail instead of detail=... (LP:
+ #1587618)
+ * UnitySettings: Add an option to enable/disable pam account checking.
+ (LP: #1460649)
+ * Lockscreen: Make sure warning and errors are properly shown to the
+ user (LP: #1593696)
+ * Add missing header to fix compilation error with -Duse_pch=OFF.
+ * Filter out fullscreen window in show desktop mode. (LP: #1597706)
+ * Make sure file manager icon is not removed when unpinned. (LP:
+ #1578792)
+ * Properly calculate the intersection geometry in PanelView::Draw.
+ This is needed to properly call SyncGeometries and to avoid problems
+ such as lp:1595698. (LP: #1595698)
+
+ [ Alberto Milone ]
+ * UnitySettings: Add dconf keys for disabling multitouch gestures (LP:
+ #1589520)
+
+ [ Marco Trevisan (Treviño) ]
+ * LockScreenAcceleratorController: use key::Grabber to handle allowed
+ bindings (LP: #1438754)
+ * LockScreenAcceleratorController: check if a setting key is available
+ instead of crashing
+ * ApplicationLauncherIcon: ensure quirks are properly set on icon
+ initialization
+ * Views: Toggle animators durations based on low-gfx setting (LP:
+ #1598770)
+ * unity7.conf: use different compiz profile based on
+ unity_support_test result (LP: #1598770)
+
+ -- Marco Trevisan (Treviño) Fri, 15 Jul 2016 10:14:41 +0000
+
unity (7.4.0+16.04.20160526.1-0ubuntu1) xenial; urgency=medium
[ Marco Trevisan (Treviño) ]
diff -Nru unity-7.4.0+16.04.20160526.1/debian/unity7.conf unity-7.4.0+16.04.20160715/debian/unity7.conf
--- unity-7.4.0+16.04.20160526.1/debian/unity7.conf 2016-07-18 11:20:21.000000000 +0000
+++ unity-7.4.0+16.04.20160715/debian/unity7.conf 2016-07-18 11:20:22.000000000 +0000
@@ -1,7 +1,7 @@
description "Unity Shell v7"
-author "Ted Gould "
+author "Ted Gould , Marco Trevisan "
-start on xsession SESSION=ubuntu and (started gnome-settings-daemon or started unity-settings-daemon)
+start on xsession SESSION=ubuntu and started unity-settings-daemon
stop on desktop-end
pre-start script
@@ -12,11 +12,16 @@
echo "GNOME Session is starting Compiz"
stop ; exit 0
fi
-end script
-env COMPIZ_CONFIG_PROFILE="ubuntu"
-export COMPIZ_CONFIG_PROFILE
+ compiz_profile="ubuntu"
+
+ if ! /usr/lib/nux/unity_support_test -p; then
+ compiz_profile="ubuntu-lowgfx"
+ fi
+
+ echo "Using compiz profile '$compiz_profile'"
+ initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"
+end script
respawn
exec compiz
-
diff -Nru unity-7.4.0+16.04.20160526.1/hud/HudController.cpp unity-7.4.0+16.04.20160715/hud/HudController.cpp
--- unity-7.4.0+16.04.20160526.1/hud/HudController.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/hud/HudController.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -40,8 +40,11 @@
{
namespace hud
{
-
+namespace
+{
DECLARE_LOGGER(logger, "unity.hud.controller");
+const unsigned FADE_DURATION = 90;
+}
Controller::Controller(Controller::ViewCreator const& create_view,
Controller::WindowCreator const& create_window)
@@ -54,7 +57,7 @@
, monitor_index_(0)
, create_view_(create_view)
, create_window_(create_window)
- , timeline_animator_(90)
+ , timeline_animator_(Settings::Instance().low_gfx() ? 0 : FADE_DURATION)
{
LOG_DEBUG(logger) << "hud startup";
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/ApplicationLauncherIcon.cpp unity-7.4.0+16.04.20160715/launcher/ApplicationLauncherIcon.cpp
--- unity-7.4.0+16.04.20160526.1/launcher/ApplicationLauncherIcon.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/ApplicationLauncherIcon.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -42,7 +42,6 @@
DECLARE_LOGGER(logger, "unity.launcher.icon.application");
// We use the "application-" prefix since the manager is protected, to avoid name clash
-const std::string ICON_REMOVE_TIMEOUT = "application-icon-remove";
const std::string DEFAULT_ICON = "application-default-icon";
enum MenuItemType
@@ -109,14 +108,13 @@
app_->visible.changed.emit(app_->visible());
app_->active.changed.emit(app_->active());
app_->running.changed.emit(app_->running());
+ app_->urgent.changed.emit(app_->urgent());
+ app_->starting.changed.emit(app_->starting() || GetQuirk(Quirk::STARTING));
app_->desktop_file.changed.emit(app_->desktop_file());
// Make sure we set the LauncherIcon stick bit too...
if (app_->sticky() || was_sticky)
Stick(false); // don't emit the signal
-
- if (app_->starting())
- SetQuirk(Quirk::STARTING, true);
}
void ApplicationLauncherIcon::UnsetApplication()
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/ApplicationLauncherIcon.h unity-7.4.0+16.04.20160715/launcher/ApplicationLauncherIcon.h
--- unity-7.4.0+16.04.20160526.1/launcher/ApplicationLauncherIcon.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/ApplicationLauncherIcon.h 2016-07-15 10:14:23.000000000 +0000
@@ -54,6 +54,9 @@
void UnStick() override;
protected:
+ // This must be defined here as it's used both in ApplicationLauncherIcon and in FileManagerLauncherIcon.
+ static constexpr const char* ICON_REMOVE_TIMEOUT = "application-icon-remove";
+
void SetApplication(ApplicationPtr const& app);
ApplicationPtr GetApplication() const;
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/CairoBaseWindow.cpp unity-7.4.0+16.04.20160715/launcher/CairoBaseWindow.cpp
--- unity-7.4.0+16.04.20160526.1/launcher/CairoBaseWindow.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/CairoBaseWindow.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -44,13 +44,17 @@
CairoBaseWindow::CairoBaseWindow(int monitor)
: cv_(Settings::Instance().em(monitor))
- , use_blurred_background_(!Settings::Instance().GetLowGfxMode())
+ , use_blurred_background_(!Settings::Instance().low_gfx())
, compute_blur_bkg_(use_blurred_background_)
- , fade_animator_(FADE_DURATION)
+ , fade_animator_(Settings::Instance().low_gfx() ? 0 : FADE_DURATION)
{
SetWindowSizeMatchLayout(true);
sigVisible.connect([this] (BaseWindow*) { compute_blur_bkg_ = true; });
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ fade_animator_.SetDuration(low_gfx ? 0 : FADE_DURATION);
+ }, *this));
+
fade_animator_.updated.connect(sigc::mem_fun(this, &BaseWindow::SetOpacity));
fade_animator_.finished.connect([this] {
if (animation::GetDirection(fade_animator_) == animation::Direction::BACKWARD)
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/FileManagerLauncherIcon.cpp unity-7.4.0+16.04.20160715/launcher/FileManagerLauncherIcon.cpp
--- unity-7.4.0+16.04.20160526.1/launcher/FileManagerLauncherIcon.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/FileManagerLauncherIcon.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -67,6 +67,14 @@
icon_name = (icon.empty() ? DEFAULT_ICON : icon);
}));
+ signals_conn_.Add(app_->running.changed.connect([this](bool running) {
+ LOG_DEBUG(logger) << tooltip_text() << " running now " << (running ? "true" : "false");
+
+ if (running)
+ _source_manager.Remove(ICON_REMOVE_TIMEOUT);
+ }));
+
+
UpdateStorageWindows();
}
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/LauncherController.cpp unity-7.4.0+16.04.20160715/launcher/LauncherController.cpp
--- unity-7.4.0+16.04.20160526.1/launcher/LauncherController.cpp 2016-05-26 00:03:20.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/LauncherController.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -156,14 +156,10 @@
WindowManager& wm = WindowManager::Default();
wm.window_focus_changed.connect(sigc::mem_fun(this, &Controller::Impl::OnWindowFocusChanged));
-#if SIGCXX_MAJOR_VERSION >= 2 && SIGCXX_MINOR_VERSION >= 5
wm.viewport_layout_changed.connect(sigc::track_obj([this] (int w, int h) { UpdateNumWorkspaces(w * h); }, *this));
-#else
- wm.viewport_layout_changed.connect(sigc::group(sigc::mem_fun(this, &Controller::Impl::UpdateNumWorkspaces), sigc::_1 * sigc::_2));
-#endif
- average_color_connection_ = wm.average_color.changed.connect([this] (nux::Color const& color) {
+ wm.average_color.changed.connect(sigc::track_obj([this] (nux::Color const& color) {
parent_->options()->background_color = color;
- });
+ }, *this));
ubus.RegisterInterest(UBUS_QUICKLIST_END_KEY_NAV, [this](GVariant * args) {
reactivate_index = model_->SelectionIndex();
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/LauncherControllerPrivate.h unity-7.4.0+16.04.20160715/launcher/LauncherControllerPrivate.h
--- unity-7.4.0+16.04.20160526.1/launcher/LauncherControllerPrivate.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/LauncherControllerPrivate.h 2016-07-15 10:14:23.000000000 +0000
@@ -151,7 +151,6 @@
connection::Wrapper launcher_key_press_connection_;
connection::Wrapper launcher_event_outside_connection_;
connection::Wrapper launcher_key_nav_terminate_;
- connection::Wrapper average_color_connection_;
};
} // launcher namespace
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/Launcher.cpp unity-7.4.0+16.04.20160715/launcher/Launcher.cpp
--- unity-7.4.0+16.04.20160526.1/launcher/Launcher.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/Launcher.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -72,6 +72,7 @@
const int ANIM_DURATION_SHORT_SHORT = 100;
const int ANIM_DURATION = 200;
const int ANIM_DURATION_LONG = 350;
+const int ANIM_DURATION_DASH_SHOWING = 90;
const int START_DRAGICON_DURATION = 250;
const RawPixel DEFAULT_ICON_SIZE = 48_em;
@@ -137,14 +138,14 @@
, drag_action_(nux::DNDACTION_NONE)
, bg_effect_helper_(this)
, launcher_position_(unity::Settings::Instance().launcher_position())
- , auto_hide_animation_(ANIM_DURATION_SHORT)
- , hover_animation_(ANIM_DURATION)
- , drag_over_animation_(ANIM_DURATION_LONG)
- , drag_out_animation_(ANIM_DURATION_SHORT)
- , drag_icon_animation_(ANIM_DURATION_SHORT)
- , dnd_hide_animation_(ANIM_DURATION * 3)
- , dash_showing_animation_(90)
- , cv_(unity::Settings::Instance().em(monitor))
+ , auto_hide_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_SHORT)
+ , hover_animation_(Settings::Instance().low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION)
+ , drag_over_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_LONG)
+ , drag_out_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_SHORT)
+ , drag_icon_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_SHORT)
+ , dnd_hide_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION * 3)
+ , dash_showing_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_DASH_SHOWING)
+ , cv_(Settings::Instance().em(monitor))
{
icon_renderer_->monitor = monitor();
icon_renderer_->scale = cv_->DPIScale();
@@ -197,7 +198,17 @@
QueueDraw();
});
- unity::Settings::Instance().dpi_changed.connect(sigc::mem_fun(this, &Launcher::OnDPIChanged));
+ Settings::Instance().dpi_changed.connect(sigc::mem_fun(this, &Launcher::OnDPIChanged));
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ auto_hide_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
+ hover_animation_.SetDuration(low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION);
+ drag_over_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_LONG);
+ drag_out_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
+ drag_icon_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
+ dnd_hide_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION * 3);
+ dash_showing_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_DASH_SHOWING);
+ QueueDraw();
+ }, *this));
auto_hide_animation_.updated.connect(redraw_cb);
hover_animation_.updated.connect(redraw_cb);
@@ -1847,7 +1858,7 @@
GfxContext.PushClippingRectangle(base);
gPainter.PushDrawColorLayer(GfxContext, base, clear_colour, true, ROP);
- if (Settings::Instance().GetLowGfxMode() == false)
+ if (Settings::Instance().low_gfx() == false)
{
GfxContext.GetRenderStates().SetBlend(true);
GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
@@ -1899,7 +1910,7 @@
pressure_color);
}
- if (!Settings::Instance().GetLowGfxMode())
+ if (!Settings::Instance().low_gfx())
{
if (IsOverlayOpen() && bg_effect_helper_.enabled)
{
@@ -2010,27 +2021,6 @@
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)
@@ -2066,6 +2056,28 @@
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));
+ }
+
+ 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),
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/SwitcherController.cpp unity-7.4.0+16.04.20160715/launcher/SwitcherController.cpp
--- unity-7.4.0+16.04.20160526.1/launcher/SwitcherController.cpp 2016-05-26 00:03:20.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/SwitcherController.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -25,6 +25,7 @@
#include "unity-shared/UBusMessages.h"
#include "unity-shared/WindowManager.h"
#include "unity-shared/IconRenderer.h"
+#include "unity-shared/UnitySettings.h"
#include "unity-shared/UScreen.h"
#include "SwitcherController.h"
@@ -270,7 +271,7 @@
, create_window_(create_window)
, icon_renderer_(std::make_shared())
, main_layout_(nullptr)
- , fade_animator_(FADE_DURATION)
+ , fade_animator_(Settings::Instance().low_gfx() ? 0 : FADE_DURATION)
{
WindowManager::Default().average_color.changed.connect(sigc::mem_fun(this, &Impl::OnBackgroundUpdate));
@@ -291,6 +292,10 @@
HideWindow();
}
});
+
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ fade_animator_.SetDuration(low_gfx ? 0 : FADE_DURATION);
+ }, *this));
}
void Controller::Impl::OnBackgroundUpdate(nux::Color const& new_color)
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/SwitcherView.cpp unity-7.4.0+16.04.20160715/launcher/SwitcherView.cpp
--- unity-7.4.0+16.04.20160526.1/launcher/SwitcherView.cpp 2016-05-26 00:03:20.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/SwitcherView.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -23,6 +23,7 @@
#include "unity-shared/AnimationUtils.h"
#include "unity-shared/IconRenderer.h"
#include "unity-shared/TimeUtil.h"
+#include "unity-shared/UnitySettings.h"
#include "unity-shared/UScreen.h"
#include "unity-shared/XKeyboardUtil.h"
@@ -248,6 +249,7 @@
render_targets_.clear();
}
+ animation_.SetDuration(Settings::Instance().low_gfx() ? 0 : animation_length);
SaveLast();
}
@@ -258,6 +260,7 @@
delta_tracker_.ResetState();
+ animation_.SetDuration(animation_length);
SaveLast();
}
diff -Nru unity-7.4.0+16.04.20160526.1/launcher/VolumeImp.cpp unity-7.4.0+16.04.20160715/launcher/VolumeImp.cpp
--- unity-7.4.0+16.04.20160526.1/launcher/VolumeImp.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/launcher/VolumeImp.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -86,7 +86,10 @@
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 -Nru unity-7.4.0+16.04.20160526.1/lockscreen/CMakeLists.txt unity-7.4.0+16.04.20160715/lockscreen/CMakeLists.txt
--- unity-7.4.0+16.04.20160526.1/lockscreen/CMakeLists.txt 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/CMakeLists.txt 2016-07-15 10:14:23.000000000 +0000
@@ -23,6 +23,7 @@
KylinLockScreenShield.cpp
LockScreenController.cpp
LockScreenBaseShield.cpp
+ LockScreenButton.cpp
LockScreenSettings.cpp
LockScreenShield.cpp
LockScreenShieldFactory.cpp
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenAcceleratorController.cpp unity-7.4.0+16.04.20160715/lockscreen/LockScreenAcceleratorController.cpp
--- unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenAcceleratorController.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/LockScreenAcceleratorController.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -1,6 +1,6 @@
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
/*
- * Copyright (C) 2014 Canonical Ltd
+ * Copyright (C) 2014-2016 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
@@ -15,10 +15,14 @@
* along with this program. If not, see .
*
* Authored by: William Hua
+ * Marco Trevisan
*/
#include "LockScreenAcceleratorController.h"
+#include
+
+#include
#include
namespace unity
@@ -28,159 +32,174 @@
namespace
{
-const char* const MEDIA_KEYS_SCHEMA = "org.gnome.settings-daemon.plugins.media-keys";
-const char* const MEDIA_KEYS_KEY_VOLUME_MUTE = "volume-mute";
-const char* const MEDIA_KEYS_KEY_VOLUME_DOWN = "volume-down";
-const char* const MEDIA_KEYS_KEY_VOLUME_UP = "volume-up";
-
-const char* const POWER_SCHEMA = "org.gnome.settings-daemon.plugins.power";
-const char* const SUSPEND_BUTTON_ACTION_KEY = "button-suspend";
-const char* const SLEEP_BUTTON_ACTION_KEY = "button-sleep";
-const char* const HIBERNATE_BUTTON_ACTION_KEY = "button-hibernate";
-const char* const POWER_BUTTON_ACTION_KEY = "button-power";
-const char* const POWER_KEY_SUSPEND = "XF86Suspend";
-const char* const POWER_KEY_SLEEP = "XF86Sleep";
-const char* const POWER_KEY_HIBERNATE = "XF86Hibernate";
-const char* const POWER_KEY_POWEROFF = "XF86PowerOff";
-
-const char* const INPUT_SWITCH_SCHEMA = "org.gnome.desktop.wm.keybindings";
-const char* const INPUT_SWITCH_KEY_PREVIOUS_SOURCE = "switch-input-source-backward";
-const char* const INPUT_SWITCH_KEY_NEXT_SOURCE = "switch-input-source";
-
-const char* const INDICATOR_INTERFACE_ACTIONS = "org.gtk.Actions";
-const char* const INDICATOR_METHOD_ACTIVATE = "Activate";
-const char* const INDICATOR_SOUND_BUS_NAME = "com.canonical.indicator.sound";
-const char* const INDICATOR_SOUND_OBJECT_PATH = "/com/canonical/indicator/sound";
-const char* const INDICATOR_SOUND_ACTION_MUTE = "mute";
-const char* const INDICATOR_SOUND_ACTION_SCROLL = "scroll";
-const char* const INDICATOR_KEYBOARD_BUS_NAME = "com.canonical.indicator.keyboard";
-const char* const INDICATOR_KEYBOARD_OBJECT_PATH = "/com/canonical/indicator/keyboard";
-const char* const INDICATOR_KEYBOARD_ACTION_SCROLL = "locked_scroll";
-
-void ActivateIndicator(std::string const& bus_name,
- std::string const& object_path,
- std::string const& action_name,
- glib::Variant const& parameters = glib::Variant())
-{
- GVariantBuilder builder;
-
- g_variant_builder_init(&builder, G_VARIANT_TYPE("(sava{sv})"));
- g_variant_builder_add(&builder, "s", action_name.c_str());
-
- if (parameters)
- g_variant_builder_add_parsed(&builder, "[%v]", static_cast(parameters));
- else
- g_variant_builder_add_parsed(&builder, "@av []");
-
- g_variant_builder_add_parsed(&builder, "@a{sv} []");
-
- auto proxy = std::make_shared(bus_name, object_path, INDICATOR_INTERFACE_ACTIONS);
- proxy->CallBegin(INDICATOR_METHOD_ACTIVATE, g_variant_builder_end(&builder), [proxy] (GVariant*, glib::Error const&) {});
-}
-
-void MuteIndicatorSound()
-{
- ActivateIndicator(INDICATOR_SOUND_BUS_NAME,
- INDICATOR_SOUND_OBJECT_PATH,
- INDICATOR_SOUND_ACTION_MUTE);
-}
-
-void ScrollIndicatorSound(int offset)
-{
- ActivateIndicator(INDICATOR_SOUND_BUS_NAME,
- INDICATOR_SOUND_OBJECT_PATH,
- INDICATOR_SOUND_ACTION_SCROLL,
- g_variant_new_int32(offset));
-}
-
-void ScrollIndicatorKeyboard(int offset)
-{
- ActivateIndicator(INDICATOR_KEYBOARD_BUS_NAME,
- INDICATOR_KEYBOARD_OBJECT_PATH,
- INDICATOR_KEYBOARD_ACTION_SCROLL,
- g_variant_new_int32(-offset));
-}
-
-void PowerAction(session::Manager::Ptr const& session, const char *action_key)
-{
- glib::Object settings(g_settings_new(POWER_SCHEMA));
- auto const& action = glib::String(g_settings_get_string(settings, action_key)).Str();
-
- if (action == "interactive")
- session->shutdown_requested.emit(session->HasInhibitors());
- else if (action == "shutdown")
- session->reboot_requested.emit(session->HasInhibitors());
- else if (action == "suspend")
- session->Suspend();
- else if (action == "hibernate")
- session->Hibernate();
- else if (action == "blank")
- session->ScreenSaverActivate();
-}
-} // namespace
+DECLARE_LOGGER(logger, "unity.lockscreen.accelerator.controller");
-AcceleratorController::AcceleratorController(session::Manager::Ptr const& session)
- : accelerators_(new Accelerators)
-{
- auto settings = glib::Object(g_settings_new(MEDIA_KEYS_SCHEMA));
+const std::string MEDIA_KEYS_SCHEMA = "org.gnome.settings-daemon.plugins.media-keys";
+const std::vector ALLOWED_MEDIA_KEYS = {
+ "logout",
+ "magnifier",
+ "on-screen-keyboard",
+ "magnifier-zoom-in",
+ "screenreader",
+ "pause",
+ "stop",
+ "toggle-contrast",
+ "video-out",
+ "volume-down",
+ "volume-mute",
+ "volume-up",
+};
+
+const std::string WM_KEYS_SCHEMA = "org.gnome.desktop.wm.keybindings";
+const std::vector ALLOWED_WM_KEYS = {
+ "switch-input-source",
+ "switch-input-source-backward",
+};
+
+const std::vector ALLOWED_XF86_KEYS = {
+ "XF86ScreenSaver",
+ "XF86Sleep",
+ "XF86Standby",
+ "XF86Suspend",
+ "XF86Hibernate",
+ "XF86PowerOff",
+ "XF86MonBrightnessUp",
+ "XF86MonBrightnessDown",
+ "XF86KbdBrightnessUp",
+ "XF86KbdBrightnessDown",
+ "XF86KbdLightOnOff",
+ "XF86AudioMicMute",
+ "XF86Touchpad",
+};
- auto accelerator = std::make_shared(glib::String(g_settings_get_string(settings, MEDIA_KEYS_KEY_VOLUME_MUTE)));
- accelerator->activated.connect(std::function(MuteIndicatorSound));
- accelerators_->Add(accelerator);
+bool IsSettingKeyAvailable(glib::Object const& settings, std::string const& key)
+{
+ bool available = false;
+ GSettingsSchema* schema;
- accelerator = std::make_shared(glib::String(g_settings_get_string(settings, MEDIA_KEYS_KEY_VOLUME_DOWN)));
- accelerator->activated.connect(std::bind(ScrollIndicatorSound, -1));
- accelerators_->Add(accelerator);
+ g_object_get(glib::object_cast(settings), "settings-schema", &schema, nullptr);
- accelerator = std::make_shared(glib::String(g_settings_get_string(settings, MEDIA_KEYS_KEY_VOLUME_UP)));
- accelerator->activated.connect(std::bind(ScrollIndicatorSound, +1));
- accelerators_->Add(accelerator);
+ if (schema)
+ {
+ available = g_settings_schema_has_key(schema, key.c_str());
+ g_settings_schema_unref(schema);
+ }
- accelerator = std::make_shared(POWER_KEY_SUSPEND);
- accelerator->activated.connect(std::bind(PowerAction, session, SUSPEND_BUTTON_ACTION_KEY));
- accelerators_->Add(accelerator);
+ return available;
+}
- accelerator = std::make_shared(POWER_KEY_SLEEP);
- accelerator->activated.connect(std::bind(PowerAction, session, SLEEP_BUTTON_ACTION_KEY));
- accelerators_->Add(accelerator);
+bool IsKeyBindingAllowed(std::string const& key)
+{
+ if (std::find(begin(ALLOWED_XF86_KEYS), end(ALLOWED_XF86_KEYS), key) != end(ALLOWED_XF86_KEYS))
+ return true;
- accelerator = std::make_shared(POWER_KEY_HIBERNATE);
- accelerator->activated.connect(std::bind(PowerAction, session, HIBERNATE_BUTTON_ACTION_KEY));
- accelerators_->Add(accelerator);
+ glib::Object media_settings(g_settings_new(MEDIA_KEYS_SCHEMA.c_str()));
+ Accelerator key_accelerator(key);
- accelerator = std::make_shared(POWER_KEY_POWEROFF);
- accelerator->activated.connect(std::bind(PowerAction, session, POWER_BUTTON_ACTION_KEY));
- accelerators_->Add(accelerator);
+ for (auto const& setting : ALLOWED_MEDIA_KEYS)
+ {
+ if (!IsSettingKeyAvailable(media_settings, setting))
+ continue;
- settings = glib::Object(g_settings_new(INPUT_SWITCH_SCHEMA));
+ Accelerator media_key(glib::String(g_settings_get_string(media_settings, setting.c_str())).Str());
+ if (media_key == key_accelerator)
+ return true;
+ }
- auto variant = glib::Variant(g_settings_get_value(settings, INPUT_SWITCH_KEY_PREVIOUS_SOURCE), glib::StealRef());
+ glib::Object wm_settings(g_settings_new(WM_KEYS_SCHEMA.c_str()));
- if (g_variant_n_children(variant) > 0)
+ for (auto const& setting : ALLOWED_WM_KEYS)
{
- const gchar* string;
+ if (!IsSettingKeyAvailable(wm_settings, setting))
+ continue;
- g_variant_get_child(variant, 0, "&s", &string);
+ glib::Variant accels(g_settings_get_value(wm_settings, setting.c_str()), glib::StealRef());
+ auto children = g_variant_n_children(accels);
- accelerator = std::make_shared(string);
- accelerator->activated.connect(std::bind(ScrollIndicatorKeyboard, -1));
- accelerators_->Add(accelerator);
+ if (children > 0)
+ {
+ glib::String value;
+
+ for (auto i = 0u; i < children; ++i)
+ {
+ g_variant_get_child(accels, 0, "s", &value);
+
+ if (Accelerator(value.Str()) == key_accelerator)
+ return true;
+ }
+ }
}
- variant = glib::Variant(g_settings_get_value(settings, INPUT_SWITCH_KEY_NEXT_SOURCE), glib::StealRef());
+ return false;
+}
+
+} // namespace
+
+AcceleratorController::AcceleratorController(key::Grabber::Ptr const& key_grabber)
+ : accelerators_(new Accelerators)
+{
+ for (auto const& action : key_grabber->GetActions())
+ AddAction(action);
+
+ key_grabber->action_added.connect(sigc::mem_fun(this, &AcceleratorController::AddAction));
+ key_grabber->action_removed.connect(sigc::mem_fun(this, &AcceleratorController::RemoveAction));
+}
- if (g_variant_n_children(variant) > 0)
+void AcceleratorController::AddAction(CompAction const& action)
+{
+ if (action.type() != CompAction::BindingTypeKey)
+ return;
+
+ auto const& key = action.keyToString();
+
+ if (!IsKeyBindingAllowed(key))
{
- const gchar* string;
+ LOG_DEBUG(logger) << "Action not allowed " << key;
+ return;
+ }
+
+ auto accelerator = std::make_shared(key);
+ accelerator->activated.connect(sigc::bind(sigc::mem_fun(this, &AcceleratorController::OnActionActivated), action));
+ accelerators_->Add(accelerator);
+ actions_accelerators_.push_back({action, accelerator});
- g_variant_get_child(variant, 0, "&s", &string);
+ LOG_DEBUG(logger) << "Action added " << key;
+}
+
+void AcceleratorController::RemoveAction(CompAction const& action)
+{
+ if (action.type() != CompAction::BindingTypeKey)
+ return;
- accelerator = std::make_shared(string);
- accelerator->activated.connect(std::bind(ScrollIndicatorKeyboard, +1));
- accelerators_->Add(accelerator);
+ LOG_DEBUG(logger) << "Removing action " << action.keyToString();
+
+ for (auto it = begin(actions_accelerators_); it != end(actions_accelerators_);)
+ {
+ if (it->first == action)
+ {
+ accelerators_->Remove(it->second);
+ it = actions_accelerators_.erase(it);
+ }
+ else
+ {
+ ++it;
+ }
}
}
+void AcceleratorController::OnActionActivated(CompAction& action)
+{
+ LOG_DEBUG(logger) << "Activating action " << action.keyToString();
+
+ CompOption::Vector options;
+
+ if (action.state() & CompAction::StateInitKey)
+ action.initiate()(&action, 0, options);
+
+ if (action.state() & CompAction::StateTermKey)
+ action.terminate()(&action, CompAction::StateTermTapped, options);
+}
+
Accelerators::Ptr const& AcceleratorController::GetAccelerators() const
{
return accelerators_;
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenAcceleratorController.h unity-7.4.0+16.04.20160715/lockscreen/LockScreenAcceleratorController.h
--- unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenAcceleratorController.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/LockScreenAcceleratorController.h 2016-07-15 10:14:23.000000000 +0000
@@ -20,7 +20,7 @@
#ifndef UNITY_LOCKSCREEN_ACCELERATOR_CONTROLLER
#define UNITY_LOCKSCREEN_ACCELERATOR_CONTROLLER
-#include "UnityCore/SessionManager.h"
+#include "unity-shared/KeyGrabber.h"
#include "LockScreenAccelerators.h"
namespace unity
@@ -28,16 +28,21 @@
namespace lockscreen
{
-class AcceleratorController
+class AcceleratorController : public sigc::trackable
{
public:
typedef std::shared_ptr Ptr;
- AcceleratorController(session::Manager::Ptr const&);
+ AcceleratorController(key::Grabber::Ptr const&);
Accelerators::Ptr const& GetAccelerators() const;
private:
+ void AddAction(CompAction const&);
+ void RemoveAction(CompAction const&);
+ void OnActionActivated(CompAction&);
+
+ std::vector> actions_accelerators_;
Accelerators::Ptr accelerators_;
};
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenAccelerators.cpp unity-7.4.0+16.04.20160715/lockscreen/LockScreenAccelerators.cpp
--- unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenAccelerators.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/LockScreenAccelerators.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -417,6 +417,11 @@
{
}
+Accelerators::Vector Accelerators::GetAccelerators() const
+{
+ return accelerators_;
+}
+
void Accelerators::Clear()
{
accelerators_.clear();
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenAccelerators.h unity-7.4.0+16.04.20160715/lockscreen/LockScreenAccelerators.h
--- unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenAccelerators.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/LockScreenAccelerators.h 2016-07-15 10:14:23.000000000 +0000
@@ -69,9 +69,11 @@
{
public:
typedef std::shared_ptr Ptr;
+ typedef std::vector Vector;
Accelerators();
+ Accelerators::Vector GetAccelerators() const;
void Clear();
void Add(Accelerator::Ptr const& accelerator);
@@ -83,7 +85,7 @@
unsigned int modifiers);
private:
- std::vector accelerators_;
+ Accelerators::Vector accelerators_;
PressedState pressed_state_;
};
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenButton.cpp unity-7.4.0+16.04.20160715/lockscreen/LockScreenButton.cpp
--- unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenButton.cpp 1970-01-01 00:00:00.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/LockScreenButton.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2016 Canonical Ltd.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 3, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranties of
+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the applicable version of the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of both the GNU Lesser General Public
+ * License version 3 along with this program. If not, see
+ *
+ *
+ * Authored by: Andrea Azzarone
+ *
+ */
+
+#include "LockScreenButton.h"
+
+#include
+
+#include "unity-shared/DashStyle.h"
+#include "unity-shared/IconTexture.h"
+#include "LockScreenSettings.h"
+
+namespace unity
+{
+namespace lockscreen
+{
+
+namespace
+{
+const RawPixel HLAYOUT_RIGHT_PADDING = 10_em;
+const int FONT_PX_SIZE = 17;
+}
+
+NUX_IMPLEMENT_OBJECT_TYPE(LockScreenButton);
+
+LockScreenButton::LockScreenButton(std::string const& label, NUX_FILE_LINE_DECL)
+ : nux::Button(NUX_FILE_LINE_PARAM)
+ , scale(1.0)
+ , label_(label)
+{
+ hlayout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
+ hlayout_->SetLeftAndRightPadding(0, HLAYOUT_RIGHT_PADDING.CP(scale));
+ hlayout_->SetContentDistribution(nux::MAJOR_POSITION_END);
+ SetLayout(hlayout_);
+
+ activator_ = new IconTexture(dash::Style::Instance().GetLockScreenActivator(scale()));
+ hlayout_->AddView(activator_, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
+
+ InitTheme();
+
+ scale.changed.connect([this] (double scale) {
+ activator_->SetTexture(dash::Style::Instance().GetLockScreenActivator(scale));
+ hlayout_->SetLeftAndRightPadding(0, HLAYOUT_RIGHT_PADDING.CP(scale));
+ InitTheme();
+ });
+
+ key_down.connect([this] (unsigned long, unsigned long, unsigned long, const char*, unsigned short) {
+ state_change.emit(this);
+ });
+}
+
+void LockScreenButton::InitTheme()
+{
+ SetMinimumHeight(Settings::GRID_SIZE.CP(scale));
+ SetMaximumHeight(Settings::GRID_SIZE.CP(scale));
+
+ nux::Geometry const& geo = GetGeometry();
+ normal_.reset(new nux::CairoWrapper(geo, sigc::mem_fun(this, &LockScreenButton::RedrawTheme)));
+}
+
+void LockScreenButton::RedrawTheme(nux::Geometry const& geom, cairo_t* cr)
+{
+ cairo_surface_set_device_scale(cairo_get_target(cr), scale, scale);
+ dash::Style::Instance().LockScreenButton(cr, label_, FONT_PX_SIZE);
+}
+
+long LockScreenButton::ComputeContentSize()
+{
+ long ret = nux::Button::ComputeContentSize();
+ nux::Geometry const& geo = GetGeometry();
+
+ if (cached_geometry_ != geo)
+ {
+ normal_->Invalidate(geo);
+ cached_geometry_ = geo;
+ }
+
+ return ret;
+}
+
+void LockScreenButton::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw)
+{
+ if (IsFullRedraw())
+ {
+ GfxContext.PushClippingRectangle(GetGeometry());
+ hlayout_->ProcessDraw(GfxContext, force_draw);
+ GfxContext.PopClippingRectangle();
+ }
+}
+
+void LockScreenButton::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
+{
+ nux::Geometry const& geo = GetGeometry();
+ GfxContext.PushClippingRectangle(geo);
+ gPainter.PaintBackground(GfxContext, geo);
+
+ nux::TexCoordXForm texxform;
+ texxform.SetWrap(nux::TEXWRAP_CLAMP, nux::TEXWRAP_CLAMP);
+ texxform.SetTexCoordType(nux::TexCoordXForm::OFFSET_COORD);
+
+ unsigned int alpha = 0, src = 0, dest = 0;
+ GfxContext.GetRenderStates().GetBlend(alpha, src, dest);
+ GfxContext.GetRenderStates().SetPremultipliedBlend(nux::SRC_OVER);
+ GfxContext.GetRenderStates().SetBlend(true);
+
+ nux::Color col(nux::color::Black);
+ col.alpha = 0;
+ GfxContext.QRP_Color(geo.x, geo.y,
+ geo.width, geo.height,
+ col);
+
+ nux::BaseTexture* texture = normal_->GetTexture();
+ GfxContext.QRP_1Tex(geo.x, geo.y,
+ texture->GetWidth(), texture->GetHeight(),
+ texture->GetDeviceTexture(),
+ texxform, nux::color::White);
+
+ GfxContext.GetRenderStates().SetBlend(alpha, src, dest);
+ GfxContext.PopClippingRectangle();
+}
+
+bool LockScreenButton::InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character)
+{
+ if ((eventType == nux::NUX_KEYDOWN) && (key_sym == NUX_VK_ENTER))
+ return true;
+ else
+ return false;
+}
+
+} // namespace lockscreen
+} // namespace unity
\ No newline at end of file
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenButton.h unity-7.4.0+16.04.20160715/lockscreen/LockScreenButton.h
--- unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenButton.h 1970-01-01 00:00:00.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/LockScreenButton.h 2016-07-15 10:14:23.000000000 +0000
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2016 Canonical Ltd.
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License version 3, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranties of
+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the applicable version of the GNU Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of both the GNU Lesser General Public
+ * License version 3 along with this program. If not, see
+ *
+ *
+ * Authored by: Andrea Azzarone
+ *
+ */
+
+#ifndef UNITY_LOCKSCREEN_BUTTON_H
+#define UNITY_LOCKSCREEN_BUTTON_H
+
+#include
+#include
+#include
+
+namespace unity
+{
+
+class IconTexture;
+
+namespace lockscreen
+{
+
+class LockScreenButton : public nux::Button
+{
+ NUX_DECLARE_OBJECT_TYPE(LockScreenButton, nux::Button);
+
+public:
+ LockScreenButton(std::string const&, NUX_FILE_LINE_PROTO);
+
+ nux::Property scale;
+
+protected:
+ long ComputeContentSize() override;
+ void Draw(nux::GraphicsEngine&, bool) override;
+ void DrawContent(nux::GraphicsEngine&, bool) override;
+ bool InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character) override;
+
+private:
+ void InitTheme();
+ void RedrawTheme(nux::Geometry const&, cairo_t*);
+
+ typedef std::unique_ptr NuxCairoPtr;
+
+ std::string label_;
+ nux::Geometry cached_geometry_;
+
+ NuxCairoPtr normal_;
+
+ nux::HLayout* hlayout_;
+ IconTexture* activator_;
+};
+
+} // namespace lockscreen
+} // namespace unity
+
+#endif
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenController.cpp unity-7.4.0+16.04.20160715/lockscreen/LockScreenController.cpp
--- unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenController.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/LockScreenController.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -28,6 +28,7 @@
#include "LockScreenShield.h"
#include "LockScreenSettings.h"
#include "unity-shared/AnimationUtils.h"
+#include "unity-shared/UnitySettings.h"
#include "unity-shared/UScreen.h"
#include "unity-shared/WindowManager.h"
@@ -54,16 +55,18 @@
Controller::Controller(DBusManager::Ptr const& dbus_manager,
session::Manager::Ptr const& session_manager,
+ key::Grabber::Ptr const& key_grabber,
UpstartWrapper::Ptr const& upstart_wrapper,
ShieldFactoryInterface::Ptr const& shield_factory,
bool test_mode)
: opacity([this] { return fade_animator_.GetCurrentValue(); })
, dbus_manager_(dbus_manager)
, session_manager_(session_manager)
+ , key_grabber_(key_grabber)
, upstart_wrapper_(upstart_wrapper)
, shield_factory_(shield_factory)
, suspend_inhibitor_manager_(std::make_shared())
- , fade_animator_(LOCK_FADE_DURATION)
+ , fade_animator_(unity::Settings::Instance().low_gfx() ? 0 : LOCK_FADE_DURATION)
, blank_window_animator_(IDLE_FADE_DURATION)
, test_mode_(test_mode)
, prompt_activation_(false)
@@ -81,6 +84,7 @@
});
hidden_window_connection_->block();
+ suspend_inhibitor_manager_->connected.connect(sigc::mem_fun(this, &Controller::SyncInhibitor));
suspend_inhibitor_manager_->about_to_suspend.connect([this] () {
if (Settings::Instance().lock_on_suspend())
session_manager_->PromptLockScreen();
@@ -88,7 +92,9 @@
Settings::Instance().lock_on_suspend.changed.connect(sigc::hide(sigc::mem_fun(this, &Controller::SyncInhibitor)));
Settings::Instance().use_legacy.changed.connect(sigc::hide(sigc::mem_fun(this, &Controller::SyncInhibitor)));
- suspend_inhibitor_manager_->connected.connect(sigc::mem_fun(this, &Controller::SyncInhibitor));
+ unity::Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ fade_animator_.SetDuration(low_gfx ? 0 : LOCK_FADE_DURATION);
+ }, *this));
dbus_manager_->simulate_activity.connect(sigc::mem_fun(this, &Controller::SimulateActivity));
session_manager_->screensaver_requested.connect(sigc::mem_fun(this, &Controller::OnScreenSaverActivationRequest));
@@ -459,7 +465,7 @@
indicators_ = std::make_shared();
upstart_wrapper_->Emit("desktop-lock");
- accelerator_controller_ = std::make_shared(session_manager_);
+ accelerator_controller_ = std::make_shared(key_grabber_);
auto activate_key = WindowManager::Default().activate_indicators_key();
auto accelerator = std::make_shared(activate_key.second, 0, activate_key.first);
accelerator->activated.connect(std::bind(std::mem_fn(&Controller::ActivatePanel), this));
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenController.h unity-7.4.0+16.04.20160715/lockscreen/LockScreenController.h
--- unity-7.4.0+16.04.20160526.1/lockscreen/LockScreenController.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/LockScreenController.h 2016-07-15 10:14:23.000000000 +0000
@@ -30,6 +30,7 @@
#include "SuspendInhibitorManager.h"
#include "ScreenSaverDBusManager.h"
#include "unity-shared/BackgroundEffectHelper.h"
+#include "unity-shared/KeyGrabber.h"
#include "unity-shared/UpstartWrapper.h"
namespace unity
@@ -44,7 +45,7 @@
public:
typedef std::shared_ptr Ptr;
- Controller(DBusManager::Ptr const&, session::Manager::Ptr const&,
+ Controller(DBusManager::Ptr const&, session::Manager::Ptr const&, key::Grabber::Ptr const&,
UpstartWrapper::Ptr const& upstart_wrapper = std::make_shared(),
ShieldFactoryInterface::Ptr const& shield_factory = std::make_shared(),
bool test_mode = false);
@@ -84,6 +85,7 @@
DBusManager::Ptr dbus_manager_;
session::Manager::Ptr session_manager_;
+ key::Grabber::Ptr key_grabber_;
indicator::Indicators::Ptr indicators_;
AcceleratorController::Ptr accelerator_controller_;
UpstartWrapper::Ptr upstart_wrapper_;
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/UserAuthenticatorPam.cpp unity-7.4.0+16.04.20160715/lockscreen/UserAuthenticatorPam.cpp
--- unity-7.4.0+16.04.20160526.1/lockscreen/UserAuthenticatorPam.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/UserAuthenticatorPam.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -22,6 +22,7 @@
// let's just fallcback to lightdm.
#include "UserAuthenticatorPam.h"
+#include "unity-shared/UnitySettings.h"
#include
#include
@@ -52,13 +53,21 @@
g_task_run_in_thread(task, [] (GTask* task, gpointer, gpointer data, GCancellable*) {
auto self = static_cast(data);
+
self->status_ = pam_authenticate(self->pam_handle_, 0);
+
if (self->status_ == PAM_SUCCESS)
- self->status_ = pam_acct_mgmt(self->pam_handle_, 0);
- if (self->status_ == PAM_NEW_AUTHTOK_REQD)
- self->status_ = pam_chauthtok(self->pam_handle_, PAM_CHANGE_EXPIRED_AUTHTOK);
- if (self->status_ == PAM_SUCCESS)
+ {
+ int status2 = pam_acct_mgmt(self->pam_handle_, 0);
+
+ if (status2 == PAM_NEW_AUTHTOK_REQD)
+ status2 = pam_chauthtok(self->pam_handle_, PAM_CHANGE_EXPIRED_AUTHTOK);
+
+ if (unity::Settings::Instance().pam_check_account_type())
+ self->status_ = status2;
+
pam_setcred (self->pam_handle_, PAM_REINITIALIZE_CRED);
+ }
});
return true;
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/UserPromptView.cpp unity-7.4.0+16.04.20160715/lockscreen/UserPromptView.cpp
--- unity-7.4.0+16.04.20160526.1/lockscreen/UserPromptView.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/UserPromptView.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -26,6 +26,7 @@
#include
#include "LockScreenSettings.h"
+#include "LockScreenButton.h"
#include "unity-shared/CairoTexture.h"
#include "unity-shared/TextInput.h"
#include "unity-shared/StaticCairoText.h"
@@ -41,6 +42,7 @@
const RawPixel LAYOUT_MARGIN = 10_em;
const RawPixel MSG_LAYOUT_MARGIN = 15_em;
const RawPixel PROMPT_LAYOUT_MARGIN = 5_em;
+const RawPixel BUTTON_LAYOUT_MARGIN = 5_em;
const int PROMPT_FONT_SIZE = 13;
nux::AbstractPaintLayer* CrateBackgroundLayer(double width, double height, double scale)
@@ -105,20 +107,29 @@
, username_(nullptr)
, msg_layout_(nullptr)
, prompt_layout_(nullptr)
+ , button_layout_(nullptr)
+ , prompted_(false)
+ , unacknowledged_messages_(false)
{
user_authenticator_.echo_on_requested.connect([this](std::string const& message, PromiseAuthCodePtr const& promise){
+ prompted_ = true;
+ unacknowledged_messages_ = false;
AddPrompt(message, /* visible */ true, promise);
});
user_authenticator_.echo_off_requested.connect([this](std::string const& message, PromiseAuthCodePtr const& promise){
+ prompted_ = true;
+ unacknowledged_messages_ = false;
AddPrompt(message, /* visible */ false, promise);
});
user_authenticator_.message_requested.connect([this](std::string const& message){
+ unacknowledged_messages_ = true;
AddMessage(message, nux::color::White);
});
user_authenticator_.error_requested.connect([this](std::string const& message){
+ unacknowledged_messages_ = true;
AddMessage(message, nux::color::Red);
});
@@ -131,8 +142,7 @@
UpdateSize();
ResetLayout();
- user_authenticator_.AuthenticateStart(session_manager_->UserName(),
- sigc::mem_fun(this, &UserPromptView::AuthenticationCb));
+ StartAuthentication();
}
void UserPromptView::UpdateSize()
@@ -178,6 +188,19 @@
}
}
+ if (button_layout_)
+ {
+ button_layout_->SetVerticalInternalMargin(BUTTON_LAYOUT_MARGIN.CP(scale));
+
+ for (auto* area : button_layout_->GetChildren())
+ {
+ auto* button = static_cast(area);
+ button->SetMinimumHeight(Settings::GRID_SIZE.CP(scale));
+ button->SetMaximumHeight(Settings::GRID_SIZE.CP(scale));
+ button->scale = scale();
+ }
+ }
+
bg_layer_.reset();
ComputeContentSize();
@@ -200,8 +223,13 @@
void UserPromptView::ResetLayout()
{
+ bool keep_msg_layout = msg_layout_ && (!prompted_ || unacknowledged_messages_);
+
focus_queue_.clear();
+ if (keep_msg_layout)
+ msg_layout_->Reference();
+
SetLayout(new nux::VLayout());
GetLayout()->SetLeftAndRightPadding(PADDING.CP(scale));
@@ -216,34 +244,54 @@
username_->SetFont("Ubuntu "+std::to_string(PROMPT_FONT_SIZE));
GetLayout()->AddView(username_);
- msg_layout_ = new nux::VLayout();
- msg_layout_->SetVerticalInternalMargin(MSG_LAYOUT_MARGIN.CP(scale));
- msg_layout_->SetReconfigureParentLayoutOnGeometryChange(true);
+ if (!keep_msg_layout)
+ {
+ msg_layout_ = new nux::VLayout();
+ msg_layout_->SetVerticalInternalMargin(MSG_LAYOUT_MARGIN.CP(scale));
+ msg_layout_->SetReconfigureParentLayoutOnGeometryChange(true);
+ }
+
GetLayout()->AddLayout(msg_layout_);
+ if (keep_msg_layout)
+ msg_layout_->UnReference();
+
prompt_layout_ = new nux::VLayout();
prompt_layout_->SetVerticalInternalMargin(PROMPT_LAYOUT_MARGIN.CP(scale));
prompt_layout_->SetReconfigureParentLayoutOnGeometryChange(true);
GetLayout()->AddLayout(prompt_layout_);
+ button_layout_ = new nux::VLayout();
+ button_layout_->SetVerticalInternalMargin(BUTTON_LAYOUT_MARGIN.CP(scale));
+ button_layout_->SetReconfigureParentLayoutOnGeometryChange(true);
+
QueueRelayout();
QueueDraw();
}
-void UserPromptView::AuthenticationCb(bool authenticated)
+void UserPromptView::AuthenticationCb(bool is_authenticated)
{
ResetLayout();
- if (authenticated)
+ if (is_authenticated)
{
- session_manager_->unlock_requested.emit();
+ if (prompted_ && !unacknowledged_messages_)
+ DoUnlock();
+ else
+ ShowAuthenticated(true);
}
else
{
- AddMessage(_("Invalid password, please try again"), nux::color::Red);
-
- user_authenticator_.AuthenticateStart(session_manager_->UserName(),
- sigc::mem_fun(this, &UserPromptView::AuthenticationCb));
+ if (prompted_)
+ {
+ AddMessage(_("Invalid password, please try again"), nux::color::Red);
+ StartAuthentication();
+ }
+ else
+ {
+ AddMessage(_("Failed to authenticate"), nux::color::Red);
+ ShowAuthenticated(false);
+ }
}
}
@@ -299,7 +347,16 @@
nux::View* UserPromptView::focus_view()
{
if (focus_queue_.empty())
- return nullptr;
+ {
+ if (button_layout_ && button_layout_->GetChildren().size() > 0)
+ {
+ return static_cast(button_layout_->GetChildren().front());
+ }
+ else
+ {
+ return nullptr;
+ }
+ }
for (auto* view : focus_queue_)
if (view->text_entry()->HasKeyboardFocus())
@@ -378,5 +435,48 @@
QueueDraw();
}
+void UserPromptView::AddButton(std::string const& text, std::function const& cb)
+{
+ auto* button = new LockScreenButton (text, NUX_TRACKER_LOCATION);
+ button->scale = scale();
+ button_layout_->AddView(button, 1, nux::MINOR_POSITION_START, nux::MINOR_SIZE_FULL);
+
+ button->state_change.connect ([cb] (nux::View*) {
+ cb();
+ });
+
+ GetLayout()->ComputeContentPosition(0, 0);
+ ComputeContentSize();
+ QueueRelayout();
+ QueueDraw();
+}
+
+void UserPromptView::ShowAuthenticated(bool successful)
+{
+ prompted_ = true;
+ unacknowledged_messages_ = false;
+
+ if (successful)
+ AddButton(_("Unlock"), sigc::mem_fun(this, &UserPromptView::DoUnlock));
+ else
+ AddButton(_("Retry"), sigc::mem_fun(this, &UserPromptView::StartAuthentication));
+
+ GetLayout()->AddLayout(button_layout_);
+}
+
+void UserPromptView::StartAuthentication()
+{
+ prompted_ = false;
+ unacknowledged_messages_ = false;
+
+ user_authenticator_.AuthenticateStart(session_manager_->UserName(),
+ sigc::mem_fun(this, &UserPromptView::AuthenticationCb));
+}
+
+void UserPromptView::DoUnlock()
+{
+ session_manager_->unlock_requested.emit();
+}
+
}
}
diff -Nru unity-7.4.0+16.04.20160526.1/lockscreen/UserPromptView.h unity-7.4.0+16.04.20160715/lockscreen/UserPromptView.h
--- unity-7.4.0+16.04.20160526.1/lockscreen/UserPromptView.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/lockscreen/UserPromptView.h 2016-07-15 10:14:23.000000000 +0000
@@ -52,6 +52,7 @@
nux::View* focus_view();
+ void AddButton(std::string const& text, std::function const& cb);
void AddPrompt(std::string const& message, bool visible, PromiseAuthCodePtr const&);
void AddMessage(std::string const& message, nux::Color const& color);
void AuthenticationCb(bool authenticated);
@@ -59,13 +60,16 @@
protected:
void Draw(nux::GraphicsEngine& graphics_engine, bool force_draw) override;
void DrawContent(nux::GraphicsEngine& graphics_engine, bool force_draw) override;
+ bool InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character) override;
private:
void ResetLayout();
void UpdateSize();
void EnsureBGLayer();
- bool InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character);
+ void ShowAuthenticated(bool successful);
+ void StartAuthentication();
+ void DoUnlock();
session::Manager::Ptr session_manager_;
UserAuthenticatorPam user_authenticator_;
@@ -73,9 +77,13 @@
StaticCairoText* username_;
nux::VLayout* msg_layout_;
nux::VLayout* prompt_layout_;
+ nux::VLayout* button_layout_;
std::deque focus_queue_;
nux::Geometry cached_focused_geo_;
+
+ bool prompted_;
+ bool unacknowledged_messages_;
};
}
diff -Nru unity-7.4.0+16.04.20160526.1/panel/PanelView.cpp unity-7.4.0+16.04.20160715/panel/PanelView.cpp
--- unity-7.4.0+16.04.20160526.1/panel/PanelView.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/panel/PanelView.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -64,7 +64,7 @@
auto& wm = WindowManager::Default();
panel::Style::Instance().changed.connect(sigc::mem_fun(this, &PanelView::ForceUpdateBackground));
Settings::Instance().dpi_changed.connect(sigc::mem_fun(this, &PanelView::Resize));
- Settings::Instance().low_gfx_changed.connect(sigc::mem_fun(this, &PanelView::OnLowGfxChanged));
+ Settings::Instance().low_gfx.changed.connect(sigc::hide(sigc::mem_fun(this, &PanelView::OnLowGfxChanged)));
wm.average_color.changed.connect(sigc::mem_fun(this, &PanelView::OnBackgroundUpdate));
wm.initiate_spread.connect(sigc::mem_fun(this, &PanelView::OnSpreadInitiate));
@@ -76,7 +76,7 @@
rop.Blend = true;
nux::Color darken_colour = nux::Color(0.9f, 0.9f, 0.9f, 1.0f);
- if (!Settings::Instance().GetLowGfxMode())
+ if (!Settings::Instance().low_gfx())
{
rop.SrcBlend = GL_ZERO;
rop.DstBlend = GL_SRC_COLOR;
@@ -258,7 +258,7 @@
void PanelView::OnLowGfxChanged()
{
- if (!Settings::Instance().GetLowGfxMode())
+ if (!Settings::Instance().low_gfx())
{
nux::ROPConfig rop;
@@ -300,15 +300,20 @@
PanelView::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
{
nux::Geometry const& geo = GetGeometry();
+ nux::Geometry const& geo_absolute = GetAbsoluteGeometry();
+ nux::Geometry const& mgeo = UScreen::GetDefault()->GetMonitorGeometry(monitor_);
+ nux::Geometry isect = mgeo.Intersect(geo_absolute);
+
+ if(!isect.width || !isect.height)
+ return;
+
UpdateBackground();
bool overlay_mode = InOverlayMode();
- GfxContext.PushClippingRectangle(geo);
+ GfxContext.PushClippingRectangle(isect);
if (IsTransparent())
{
- nux::Geometry const& geo_absolute = GetAbsoluteGeometry();
-
if (BackgroundEffectHelper::blur_type != BLUR_NONE)
{
bg_blur_texture_ = bg_effect_helper_.GetBlurRegion();
@@ -331,7 +336,7 @@
rop.SrcBlend = GL_ONE;
rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
- GfxContext.PushClippingRectangle(geo);
+ GfxContext.PushClippingRectangle(isect);
#ifndef NUX_OPENGLES_20
if (GfxContext.UsingGLSLCodePath())
@@ -362,7 +367,7 @@
GfxContext.PopClippingRectangle();
}
- if (overlay_mode && !Settings::Instance().GetLowGfxMode())
+ if (overlay_mode && !Settings::Instance().low_gfx())
{
nux::GetPainter().RenderSinglePaintLayer(GfxContext, geo, bg_darken_layer_.get());
@@ -456,7 +461,7 @@
if (overlay_mode)
{
- if (Settings::Instance().GetLowGfxMode())
+ if (Settings::Instance().low_gfx())
{
rop.Blend = false;
auto const& bg_color = WindowManager::Default().average_color();
@@ -475,7 +480,7 @@
refine_geo.x = refine_x_pos;
refine_geo.width = bg_refine_tex_->GetWidth();
- if (!Settings::Instance().GetLowGfxMode())
+ if (!Settings::Instance().low_gfx())
{
nux::GetPainter().PushLayer(GfxContext, refine_geo, bg_refine_layer_.get());
bgs++;
@@ -491,7 +496,7 @@
if (!overlay_mode || !GfxContext.UsingGLSLCodePath())
gPainter.PushLayer(GfxContext, geo, bg_layer_.get());
- if (overlay_mode && !Settings::Instance().GetLowGfxMode())
+ if (overlay_mode && !Settings::Instance().low_gfx())
{
// apply the shine
nux::TexCoordXForm texxform;
diff -Nru unity-7.4.0+16.04.20160526.1/plugins/unityshell/src/unityshell.cpp unity-7.4.0+16.04.20160715/plugins/unityshell/src/unityshell.cpp
--- unity-7.4.0+16.04.20160526.1/plugins/unityshell/src/unityshell.cpp 2016-05-26 00:03:20.000000000 +0000
+++ unity-7.4.0+16.04.20160715/plugins/unityshell/src/unityshell.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -221,6 +221,7 @@
, key_nav_mode_requested_(false)
, big_tick_(0)
, back_buffer_age_(0)
+ , next_active_window_(0)
{
Timer timer;
#ifndef USE_GLES
@@ -300,12 +301,12 @@
(getenv("UNITY_LOW_GFX_MODE") != NULL && atoi(getenv("UNITY_LOW_GFX_MODE")) == 1) ||
optionGetLowGraphicsMode())
{
- unity_settings_.SetLowGfxMode(true);
+ unity_settings_.low_gfx = true;
}
if (getenv("UNITY_LOW_GFX_MODE") != NULL && atoi(getenv("UNITY_LOW_GFX_MODE")) == 0)
{
- unity_settings_.SetLowGfxMode(false);
+ unity_settings_.low_gfx = false;
}
#endif
@@ -445,6 +446,7 @@
auto init_plugins_cb = sigc::mem_fun(this, &UnityScreen::InitPluginActions);
sources_.Add(std::make_shared(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::activate ()
{
+ uScreen->SetNextActiveWindow(window->id());
+
ShowdesktopHandler::InhibitLeaveShowdesktopMode (window->id ());
window->activate ();
ShowdesktopHandler::AllowLeaveShowdesktopMode (window->id ());
@@ -2483,7 +2487,7 @@
}
else
{
- switcher_controller_->detail = true;
+ switcher_controller_->SetDetail(true);
}
action->setState(action->state() | CompAction::StateTermKey);
@@ -2982,7 +2986,7 @@
uScreen->windows_for_monitor_[monitor] = 1;
if (!(mask & nonOcclusionBits) &&
- (window->state() & CompWindowStateFullscreenMask && !window->minimized()) &&
+ (window->state() & CompWindowStateFullscreenMask && !window->minimized() && !window->inShowDesktopMode()) &&
uScreen->windows_for_monitor_[monitor] == 1)
// And I've been advised to test other things, but they don't work:
// && (attrib.opacity == OPAQUE)) <-- Doesn't work; Only set in glDraw
@@ -3723,7 +3727,7 @@
else
BackgroundEffectHelper::blur_type = (unity::BlurType)optionGetDashBlurExperimental();
- unity::Settings::Instance().SetLowGfxMode(optionGetLowGraphicsMode());
+ unity::Settings::Instance().low_gfx = optionGetLowGraphicsMode();
break;
case UnityshellOptions::DecayRate:
launcher_options->edge_decay_rate = optionGetDecayRate() * 100;
@@ -4077,24 +4081,24 @@
ShowFirstRunHints();
// Setup Session Controller
- auto manager = std::make_shared();
- manager->lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested));
- manager->prompt_lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested));
- manager->locked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenLocked));
- manager->unlocked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenUnlocked));
- session_dbus_manager_ = std::make_shared(manager);
- session_controller_ = std::make_shared(manager);
+ auto session = std::make_shared();
+ session->lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested));
+ session->prompt_lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested));
+ session->locked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenLocked));
+ session->unlocked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenUnlocked));
+ session_dbus_manager_ = std::make_shared(session);
+ session_controller_ = std::make_shared(session);
LOG_INFO(logger) << "InitUnityComponents-Session " << timer.ElapsedSeconds() << "s";
Introspectable::AddChild(session_controller_.get());
// Setup Lockscreen Controller
- screensaver_dbus_manager_ = std::make_shared(manager);
- lockscreen_controller_ = std::make_shared(screensaver_dbus_manager_, manager);
+ screensaver_dbus_manager_ = std::make_shared(session);
+ lockscreen_controller_ = std::make_shared(screensaver_dbus_manager_, session, menus_->KeyGrabber());
UpdateActivateIndicatorsKey();
LOG_INFO(logger) << "InitUnityComponents-Lockscreen " << timer.ElapsedSeconds() << "s";
if (g_file_test((DesktopUtilities::GetUserRuntimeDirectory()+local::LOCKED_STAMP).c_str(), G_FILE_TEST_EXISTS))
- manager->PromptLockScreen();
+ session->PromptLockScreen();
auto on_launcher_size_changed = [this] (nux::Area* area, int w, int h) {
/* The launcher geometry includes 1px used to draw the right/top margin
@@ -4186,22 +4190,26 @@
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 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 @@
| 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 @@
});
}
+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 @@
if (IsInShowdesktopMode())
{
- if (!(screen->activeWindow() == window->id()))
+ if (uScreen->GetNextActiveWindow() != window->id())
{
if (!mShowdesktopHandler)
mShowdesktopHandler.reset(new ShowdesktopHandler(static_cast (this),
diff -Nru unity-7.4.0+16.04.20160526.1/plugins/unityshell/src/unityshell.h unity-7.4.0+16.04.20160715/plugins/unityshell/src/unityshell.h
--- unity-7.4.0+16.04.20160526.1/plugins/unityshell/src/unityshell.h 2016-05-26 00:03:20.000000000 +0000
+++ unity-7.4.0+16.04.20160715/plugins/unityshell/src/unityshell.h 2016-07-15 10:14:23.000000000 +0000
@@ -282,6 +282,7 @@
void OnDecorationStyleChanged();
void InitGesturesSupport();
+ void UpdateGesturesSupport();
void DrawPanelUnderDash();
@@ -298,6 +299,9 @@
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 @@
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 -Nru unity-7.4.0+16.04.20160526.1/plugins/unityshell/src/UnityShowdesktopHandler.cpp unity-7.4.0+16.04.20160715/plugins/unityshell/src/UnityShowdesktopHandler.cpp
--- unity-7.4.0+16.04.20160526.1/plugins/unityshell/src/UnityShowdesktopHandler.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/plugins/unityshell/src/UnityShowdesktopHandler.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -21,6 +21,7 @@
#include
#include "UnityShowdesktopHandler.h"
+#include "unity-shared/UnitySettings.h"
namespace unity
{
@@ -99,7 +100,7 @@
return;
state_ = ShowdesktopHandler::StateFadeOut;
- progress_ = 0.0f;
+ progress_ = Settings::Instance().low_gfx() ? 1.0f : 0.0f;
was_hidden_ = showdesktop_handler_window_interface_->Hidden();
@@ -143,7 +144,7 @@
if (state_ == ShowdesktopHandler::StateFadeOut)
{
- progress_ += inc;
+ progress_ = Settings::Instance().low_gfx() ? 1.0f : progress_ + inc;
if (progress_ >= 1.0f)
{
progress_ = 1.0f;
@@ -152,7 +153,7 @@
}
else if (state_ == StateFadeIn)
{
- progress_ -= inc;
+ progress_ = Settings::Instance().low_gfx() ? 0.0f : progress_ - inc;
if (progress_ <= 0.0f)
{
progress_ = 0.0f;
diff -Nru unity-7.4.0+16.04.20160526.1/shortcuts/ShortcutController.cpp unity-7.4.0+16.04.20160715/shortcuts/ShortcutController.cpp
--- unity-7.4.0+16.04.20160526.1/shortcuts/ShortcutController.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/shortcuts/ShortcutController.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -22,6 +22,7 @@
#include "unity-shared/AnimationUtils.h"
#include "unity-shared/UBusMessages.h"
+#include "unity-shared/UnitySettings.h"
#include "unity-shared/UScreen.h"
#include "unity-shared/WindowManager.h"
@@ -42,7 +43,7 @@
, base_window_raiser_(base_window_raiser)
, visible_(false)
, enabled_(true)
- , fade_animator_(FADE_DURATION)
+ , fade_animator_(Settings::Instance().low_gfx() ? 0 : FADE_DURATION)
{
ubus_manager_.RegisterInterest(UBUS_LAUNCHER_START_KEY_SWITCHER, [this] (GVariant*)
{ SetEnabled(false); });
@@ -57,6 +58,11 @@
if (animation::GetDirection(fade_animator_) == animation::Direction::BACKWARD)
view_window_->ShowWindow(false);
});
+
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ fade_animator_.SetDuration(low_gfx ? 0 : FADE_DURATION);
+ }, *this));
+
modeller_->model_changed.connect(sigc::mem_fun(this, &Controller::OnModelUpdated));
}
diff -Nru unity-7.4.0+16.04.20160526.1/shutdown/SessionController.cpp unity-7.4.0+16.04.20160715/shutdown/SessionController.cpp
--- unity-7.4.0+16.04.20160526.1/shutdown/SessionController.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/shutdown/SessionController.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -20,9 +20,10 @@
#include "SessionController.h"
#include "unity-shared/AnimationUtils.h"
-#include "unity-shared/UScreen.h"
#include "unity-shared/UBusMessages.h"
#include "unity-shared/UBusWrapper.h"
+#include "unity-shared/UnitySettings.h"
+#include "unity-shared/UScreen.h"
#include "unity-shared/WindowManager.h"
namespace na = nux::animation;
@@ -38,7 +39,7 @@
Controller::Controller(session::Manager::Ptr const& manager)
: manager_(manager)
- , fade_animator_(FADE_DURATION)
+ , fade_animator_(Settings::Instance().low_gfx() ? 0 : FADE_DURATION)
{
manager_->reboot_requested.connect([this] (bool inhibitors) {
Show(View::Mode::SHUTDOWN, inhibitors);
@@ -61,6 +62,10 @@
if (animation::GetDirection(fade_animator_) == animation::Direction::BACKWARD)
CloseWindow();
});
+
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ fade_animator_.SetDuration(low_gfx ? 0 : FADE_DURATION);
+ }, *this));
}
void Controller::OnBackgroundUpdate(nux::Color const& new_color)
diff -Nru unity-7.4.0+16.04.20160526.1/tests/test_lockscreen_controller.cpp unity-7.4.0+16.04.20160715/tests/test_lockscreen_controller.cpp
--- unity-7.4.0+16.04.20160526.1/tests/test_lockscreen_controller.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/tests/test_lockscreen_controller.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -33,6 +33,7 @@
#include "unity-shared/DashStyle.h"
#include "unity-shared/PanelStyle.h"
#include "unity-shared/UScreen.h"
+#include "mock_key_grabber.h"
#include "test_mock_session_manager.h"
#include "test_uscreen_mock.h"
#include "test_utils.h"
@@ -80,19 +81,21 @@
TestLockScreenController()
: animation_controller(tick_source)
, session_manager(std::make_shared>())
+ , key_grabber(std::make_shared())
, dbus_manager(std::make_shared(session_manager))
, upstart_wrapper(std::make_shared())
, shield_factory(std::make_shared())
- , controller(dbus_manager, session_manager, upstart_wrapper, shield_factory)
+ , controller(dbus_manager, session_manager, key_grabber, upstart_wrapper, shield_factory)
{}
struct ControllerWrap : Controller
{
ControllerWrap(DBusManager::Ptr const& dbus_manager,
session::Manager::Ptr const& session_manager,
+ key::Grabber::Ptr const& key_grabber,
UpstartWrapper::Ptr const& upstart_wrapper,
ShieldFactoryInterface::Ptr const& shield_factory)
- : Controller(dbus_manager, session_manager, upstart_wrapper, shield_factory, /* test_mode */ true)
+ : Controller(dbus_manager, session_manager, key_grabber, upstart_wrapper, shield_factory, /* test_mode */ true)
{}
using Controller::shields_;
@@ -107,6 +110,7 @@
unity::panel::Style panel_style;
unity::lockscreen::Settings lockscreen_settings;
session::MockManager::Ptr session_manager;
+ key::MockGrabber::Ptr key_grabber;
DBusManager::Ptr dbus_manager;
unity::UpstartWrapper::Ptr upstart_wrapper;
@@ -123,7 +127,7 @@
{
size_t before = uscreen.changed.size();
{
- Controller dummy(dbus_manager, session_manager);
+ Controller dummy(dbus_manager, session_manager, key_grabber);
}
ASSERT_EQ(before, uscreen.changed.size());
@@ -135,7 +139,7 @@
{
size_t before = session_manager->unlock_requested.size();
{
- Controller dummy(dbus_manager, session_manager);
+ Controller dummy(dbus_manager, session_manager, key_grabber);
}
ASSERT_EQ(before, session_manager->unlock_requested.size());
diff -Nru unity-7.4.0+16.04.20160526.1/UnityCore/GnomeSessionManager.cpp unity-7.4.0+16.04.20160715/UnityCore/GnomeSessionManager.cpp
--- unity-7.4.0+16.04.20160526.1/UnityCore/GnomeSessionManager.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/UnityCore/GnomeSessionManager.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -117,8 +117,9 @@
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 -Nru unity-7.4.0+16.04.20160526.1/unity-shared/BackgroundEffectHelper.cpp unity-7.4.0+16.04.20160715/unity-shared/BackgroundEffectHelper.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/BackgroundEffectHelper.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/BackgroundEffectHelper.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -51,7 +51,7 @@
TextureCache::GetDefault().themed_invalidated.connect(sigc::mem_fun(this, &BackgroundEffectHelper::LoadTextures));
LoadTextures();
- if (Settings::Instance().GetLowGfxMode())
+ if (Settings::Instance().low_gfx())
blur_type = BLUR_NONE;
}
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/BGHash.cpp unity-7.4.0+16.04.20160715/unity-shared/BGHash.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/BGHash.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/BGHash.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -20,6 +20,7 @@
#include "BGHash.h"
#include
#include
+#include "unity-shared/UnitySettings.h"
#include "unity-shared/WindowManager.h"
#ifndef XA_STRING
@@ -38,13 +39,17 @@
}
BGHash::BGHash()
- : transition_animator_(TRANSITION_DURATION)
+ : transition_animator_(Settings::Instance().low_gfx() ? 0 : TRANSITION_DURATION)
, override_color_(nux::color::Transparent)
{
COLORS_ATOM = gdk_x11_get_xatom_by_name("_GNOME_BACKGROUND_REPRESENTATIVE_COLORS");
transition_animator_.updated.connect(sigc::mem_fun(this, &BGHash::OnTransitionUpdated));
WindowManager::Default().average_color = unity::colors::Aubergine;
RefreshColor(/* skip_animation */ true);
+
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ transition_animator_.SetDuration(low_gfx ? 0 : TRANSITION_DURATION);
+ }, *this));
}
uint64_t BGHash::ColorAtomId() const
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/BGHash.h unity-7.4.0+16.04.20160715/unity-shared/BGHash.h
--- unity-7.4.0+16.04.20160526.1/unity-shared/BGHash.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/BGHash.h 2016-07-15 10:14:23.000000000 +0000
@@ -30,7 +30,7 @@
namespace unity
{
- class BGHash
+ class BGHash : public sigc::trackable
{
public:
BGHash();
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/DashStyle.cpp unity-7.4.0+16.04.20160715/unity-shared/DashStyle.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/DashStyle.cpp 2016-05-26 00:03:20.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/DashStyle.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -1672,6 +1672,41 @@
return true;
}
+bool Style::LockScreenButton(cairo_t* cr, std::string const& label,
+ int font_px_size)
+{
+ if (cairo_status(cr) != CAIRO_STATUS_SUCCESS)
+ return false;
+
+ if (cairo_surface_get_type(cairo_get_target(cr)) != CAIRO_SURFACE_TYPE_IMAGE)
+ return false;
+
+ double w, h;
+ get_actual_cairo_size(cr, &w, &h);
+
+ cairo_set_line_width(cr, 1);
+
+ double radius = 5.0;
+ RoundedRect(cr, 1.0, 0.5, 0.5, radius, w - 1.0, h - 1.0);
+
+ cairo_set_source_rgba(cr, 0.0f, 0.0f, 0.0f, 0.35f);
+ cairo_fill_preserve(cr);
+
+ cairo_set_source_rgba(cr, 1.0f, 1.0f, 1.0f, 0.7f);
+ cairo_stroke(cr);
+
+ static double internal_padding = 10.0f;
+
+ pimpl->Text(cr,
+ nux::color::White,
+ label,
+ font_px_size,
+ internal_padding,
+ dash::Alignment::LEFT);
+
+ return true;
+}
+
nux::AbstractPaintLayer* Style::FocusOverlay(int width, int height)
{
nux::CairoGraphics cg(CAIRO_FORMAT_ARGB32, width, height);
@@ -2211,6 +2246,10 @@
return pimpl->LoadScaledTexture("search_spin", scale);
}
+BaseTexturePtr Style::GetLockScreenActivator(double scale) const
+{
+ return pimpl->LoadScaledTexture("arrow_right", scale);
+}
RawPixel Style::GetButtonGarnishSize() const
{
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/DashStyle.h unity-7.4.0+16.04.20160715/unity-shared/DashStyle.h
--- unity-7.4.0+16.04.20160526.1/unity-shared/DashStyle.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/DashStyle.h 2016-07-15 10:14:23.000000000 +0000
@@ -98,6 +98,9 @@
static Style& Instance();
+ virtual bool LockScreenButton(cairo_t* cr, std::string const& label,
+ int font_px_size);
+
virtual bool Button(cairo_t* cr, nux::ButtonVisualState state,
std::string const& label, int font_px_size=-1,
Alignment alignment = Alignment::CENTER,
@@ -196,6 +199,8 @@
BaseTexturePtr GetSearchCloseIcon(double scale) const;
BaseTexturePtr GetSearchSpinIcon(double scale) const;
+ BaseTexturePtr GetLockScreenActivator(double scale) const;
+
BaseTexturePtr const& GetGroupUnexpandIcon() const;
BaseTexturePtr const& GetGroupExpandIcon() const;
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/GnomeKeyGrabber.cpp unity-7.4.0+16.04.20160715/unity-shared/GnomeKeyGrabber.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/GnomeKeyGrabber.cpp 2016-05-26 00:03:20.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/GnomeKeyGrabber.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -59,19 +59,33 @@
)";
}
+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";
}
-GnomeGrabber::Impl::Impl(bool test_mode)
- : screen_(screen)
+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()
@@ -110,6 +124,7 @@
actions_ids_.push_back(action_id);
actions_.push_back(action);
actions_customers_.push_back(1);
+ parent_->action_added.emit(action);
return true;
}
@@ -165,6 +180,7 @@
LOG_DEBUG(logger) << "RemoveAction (\"" << action->keyToString() << "\")";
screen_->removeAction(action);
+ parent_->action_removed.emit(*action);
actions_.erase(actions_.begin() + index);
actions_ids_.erase(actions_ids_.begin() + index);
actions_customers_.erase(actions_customers_.begin() + index);
@@ -232,7 +248,8 @@
{
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"));
@@ -245,7 +262,6 @@
action.setState(CompAction::StateInitKey | CompAction::StateTermKey);
action.setTerminate([this, action_id](CompAction* action, CompAction::State state, CompOption::Vector& options) {
auto key = action->keyToString();
-
LOG_DEBUG(logger) << "released \"" << key << "\"";
if (state & CompAction::StateTermTapped)
@@ -326,14 +342,24 @@
return keycode == 0 || modHandler->keycodeToModifiers(keycode) != 0;
}
+void GnomeGrabber::Impl::UpdateWhitelist()
+{
+ std::shared_ptr 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()
- : impl_(new Impl())
+ : impl_(new Impl(this))
{}
GnomeGrabber::GnomeGrabber(TestMode const& dummy)
- : impl_(new Impl(true))
+ : impl_(new Impl(this, true))
{}
GnomeGrabber::~GnomeGrabber()
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/GnomeKeyGrabberImpl.h unity-7.4.0+16.04.20160715/unity-shared/GnomeKeyGrabberImpl.h
--- unity-7.4.0+16.04.20160526.1/unity-shared/GnomeKeyGrabberImpl.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/GnomeKeyGrabberImpl.h 2016-07-15 10:14:23.000000000 +0000
@@ -28,6 +28,7 @@
#include
#include
#include
+#include
namespace unity
{
@@ -36,7 +37,7 @@
struct GnomeGrabber::Impl
{
- Impl(bool test_mode = false);
+ Impl(Grabber*, bool test_mode = false);
~Impl();
uint32_t NextActionID();
@@ -54,12 +55,18 @@
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_;
glib::DBusServer shell_server_;
glib::DBusObject::Ptr shell_object_;
+ glib::Object settings_;
+ glib::Signal whitelist_changed_signal_;
+ std::list whitelist_;
+
uint32_t current_action_id_;
std::vector actions_ids_;
std::vector actions_customers_;
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/KeyGrabber.h unity-7.4.0+16.04.20160715/unity-shared/KeyGrabber.h
--- unity-7.4.0+16.04.20160526.1/unity-shared/KeyGrabber.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/KeyGrabber.h 2016-07-15 10:14:23.000000000 +0000
@@ -21,6 +21,7 @@
#define __UNITY_KEY_GRABBER__
#include
+#include
namespace unity
{
@@ -36,6 +37,9 @@
virtual bool RemoveAction(CompAction const&) = 0;
virtual bool RemoveAction(uint32_t id) = 0;
+ sigc::signal action_added;
+ sigc::signal action_removed;
+
virtual CompAction::Vector& GetActions() = 0;
};
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/OverlayRenderer.cpp unity-7.4.0+16.04.20160715/unity-shared/OverlayRenderer.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/OverlayRenderer.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/OverlayRenderer.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -119,7 +119,7 @@
parent->scale = Settings::Instance().em()->DPIScale();
parent->scale.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
parent->owner_type.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
- Settings::Instance().low_gfx_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures));
+ Settings::Instance().low_gfx.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures)));
Settings::Instance().launcher_position.changed.connect(sigc::hide(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures)));
dash::Style::Instance().textures_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::UpdateTextures));
dash::Style::Instance().textures_changed.connect(sigc::mem_fun(this, &OverlayRendererImpl::LoadScaledTextures));
@@ -157,7 +157,7 @@
bg_layer_->SetColor(new_color);
//When we are in low gfx mode then our darken layer will act as a background.
- if (Settings::Instance().GetLowGfxMode())
+ if (Settings::Instance().low_gfx())
{
bg_darken_layer_->SetColor(new_color);
}
@@ -172,7 +172,7 @@
rop.SrcBlend = GL_ONE;
rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
- if (Settings::Instance().GetLowGfxMode() || !nux::GetWindowThread()->GetGraphicsEngine().UsingGLSLCodePath())
+ if (Settings::Instance().low_gfx() || !nux::GetWindowThread()->GetGraphicsEngine().UsingGLSLCodePath())
{
auto& avg_color = WindowManager::Default().average_color;
bg_layer_ = std::make_shared(avg_color(), true, rop);
@@ -185,7 +185,7 @@
nux::Color darken_colour = nux::Color(0.9f, 0.9f, 0.9f, 1.0f);
//When we are in low gfx mode then our darken layer will act as a background.
- if (Settings::Instance().GetLowGfxMode())
+ if (Settings::Instance().low_gfx())
{
rop.Blend = false;
rop.SrcBlend = GL_ONE;
@@ -565,7 +565,7 @@
bg_darken_layer_->SetGeometry(larger_content_geo);
nux::GetPainter().RenderSinglePaintLayer(gfx_context, larger_content_geo, bg_darken_layer_.get());
- if (!settings.GetLowGfxMode())
+ if (!settings.low_gfx())
{
#ifndef NUX_OPENGLES_20
if (!gfx_context.UsingGLSLCodePath())
@@ -984,7 +984,7 @@
bgs++;
//Only apply shine if we aren't in low gfx mode.
- if (!Settings::Instance().GetLowGfxMode())
+ if (!Settings::Instance().low_gfx())
{
#ifndef NUX_OPENGLES_20
if (!gfx_context.UsingGLSLCodePath())
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/PlacesOverlayVScrollBar.cpp unity-7.4.0+16.04.20160715/unity-shared/PlacesOverlayVScrollBar.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/PlacesOverlayVScrollBar.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/PlacesOverlayVScrollBar.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -23,6 +23,7 @@
#include "AnimationUtils.h"
#include "DashStyle.h"
#include "PlacesOverlayVScrollBar.h"
+#include "UnitySettings.h"
namespace unity
{
@@ -124,7 +125,7 @@
void PlacesOverlayVScrollBar::PerformPageNavigation(ScrollDir dir)
{
- StartScrollAnimation(dir, _slider->GetBaseHeight(), PAGE_SCROLL_ANIMATION);
+ StartScrollAnimation(dir, _slider->GetBaseHeight(), Settings::Instance().low_gfx() ? 0 : PAGE_SCROLL_ANIMATION);
}
void PlacesOverlayVScrollBar::StartScrollAnimation(ScrollDir dir, int stop, unsigned duration)
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/SpreadFilter.cpp unity-7.4.0+16.04.20160715/unity-shared/SpreadFilter.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/SpreadFilter.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/SpreadFilter.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -49,7 +49,7 @@
}
Filter::Filter()
- : fade_animator_(FADE_DURATION)
+ : fade_animator_(Settings::Instance().low_gfx() ? 0 : FADE_DURATION)
{
auto& wm = WindowManager::Default();
auto& settings = Settings::Instance();
@@ -110,6 +110,10 @@
}
});
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ fade_animator_.SetDuration(low_gfx ? 0 : FADE_DURATION);
+ }, *this));
+
ApplicationManager::Default().window_opened.connect(sigc::hide(sigc::mem_fun(this, &Filter::OnWindowChanged)));
}
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/UnitySettings.cpp unity-7.4.0+16.04.20160715/unity-shared/UnitySettings.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/UnitySettings.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/UnitySettings.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -39,6 +39,7 @@
const std::string FORM_FACTOR = "form-factor";
const std::string DOUBLE_CLICK_ACTIVATE = "double-click-activate";
const std::string DESKTOP_TYPE = "desktop-type";
+const std::string PAM_CHECK_ACCOUNT_TYPE = "pam-check-account-type";
const std::string LAUNCHER_SETTINGS = "com.canonical.Unity.Launcher";
const std::string LAUNCHER_POSITION = "launcher-position";
@@ -66,6 +67,11 @@
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 +89,7 @@
, 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()))
@@ -93,7 +100,6 @@
, cursor_scale_(1.0)
, cached_double_click_activate_(true)
, changing_gnome_settings_(false)
- , lowGfx_(false)
, remote_content_enabled_(true)
{
parent_->form_factor.SetGetterFunction(sigc::mem_fun(this, &Impl::GetFormFactor));
@@ -103,6 +109,7 @@
parent_->launcher_position.SetGetterFunction(sigc::mem_fun(this, &Impl::GetLauncherPosition));
parent_->launcher_position.SetSetterFunction(sigc::mem_fun(this, &Impl::SetLauncherPosition));
parent_->desktop_type.SetGetterFunction(sigc::mem_fun(this, &Impl::GetDesktopType));
+ parent_->pam_check_account_type.SetGetterFunction(sigc::mem_fun(this, &Impl::GetPamCheckAccountType));
for (unsigned i = 0; i < monitors::MAX; ++i)
em_converters_.emplace_back(std::make_shared());
@@ -160,6 +167,10 @@
UpdateLimSetting();
});
+ signals_.Add(gestures_settings_, "changed", [this] (GSettings*, const gchar*) {
+ UpdateGesturesSetting();
+ });
+
signals_.Add(remote_content_settings_, "changed::" + REMOTE_CONTENT_KEY, [this] (GSettings*, const gchar* t) {
UpdateRemoteContentSearch();
});
@@ -168,6 +179,7 @@
// The order is important here, DPI is the last thing to be updated
UpdateLimSetting();
+ UpdateGesturesSetting();
UpdateTextScaleFactor();
UpdateCursorScaleFactor();
UpdateFontSize();
@@ -222,6 +234,14 @@
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_;
@@ -254,6 +274,11 @@
return static_cast(g_settings_get_enum(usettings_, DESKTOP_TYPE.c_str()));
}
+ bool GetPamCheckAccountType() const
+ {
+ return g_settings_get_boolean(usettings_, PAM_CHECK_ACCOUNT_TYPE.c_str());
+ }
+
int GetFontSize() const
{
gint font_size;
@@ -384,6 +409,7 @@
glib::Object usettings_;
glib::Object launcher_settings_;
glib::Object lim_settings_;
+ glib::Object gestures_settings_;
glib::Object ui_settings_;
glib::Object ubuntu_ui_settings_;
glib::Object gnome_ui_settings_;
@@ -397,7 +423,6 @@
double cursor_scale_;
bool cached_double_click_activate_;
bool changing_gnome_settings_;
- bool lowGfx_;
bool remote_content_enabled_;
};
@@ -406,7 +431,8 @@
//
Settings::Settings()
- : is_standalone(false)
+ : low_gfx(false)
+ , is_standalone(false)
, pimpl(new Impl(this))
{
if (settings_instance)
@@ -434,21 +460,6 @@
return *settings_instance;
}
-bool Settings::GetLowGfxMode() const
-{
- return pimpl->lowGfx_;
-}
-
-void Settings::SetLowGfxMode(const bool low_gfx)
-{
- if (pimpl->lowGfx_ != low_gfx)
- {
- pimpl->lowGfx_ = low_gfx;
-
- low_gfx_changed.emit();
- }
-}
-
EMConverter::Ptr const& Settings::em(int monitor) const
{
return pimpl->em(monitor);
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/UnitySettings.h unity-7.4.0+16.04.20160715/unity-shared/UnitySettings.h
--- unity-7.4.0+16.04.20160526.1/unity-shared/UnitySettings.h 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/UnitySettings.h 2016-07-15 10:14:23.000000000 +0000
@@ -54,16 +54,16 @@
~Settings();
static Settings& Instance();
- bool GetLowGfxMode() const;
- void SetLowGfxMode(const bool low_gfx);
EMConverter::Ptr const& em(int monitor = 0) const;
void SetLauncherSize(int launcher_size, int monitor);
int LauncherSize(int mointor) const;
+ nux::Property low_gfx;
nux::RWProperty form_factor;
nux::Property is_standalone;
nux::ROProperty desktop_type;
+ nux::ROProperty pam_check_account_type;
nux::ROProperty double_click_activate;
nux::Property lim_movement_thresold;
nux::Property lim_double_click_wait;
@@ -71,9 +71,13 @@
nux::Property font_scaling;
nux::ROProperty remote_content;
nux::RWProperty launcher_position;
+ nux::Property gestures_launcher_drag;
+ nux::Property gestures_dash_tap;
+ nux::Property gestures_windows_drag_pinch;
sigc::signal dpi_changed;
sigc::signal low_gfx_changed;
+ sigc::signal gestures_changed;
private:
class Impl;
diff -Nru unity-7.4.0+16.04.20160526.1/unity-shared/UnityWindowView.cpp unity-7.4.0+16.04.20160715/unity-shared/UnityWindowView.cpp
--- unity-7.4.0+16.04.20160526.1/unity-shared/UnityWindowView.cpp 2016-05-26 00:03:09.000000000 +0000
+++ unity-7.4.0+16.04.20160715/unity-shared/UnityWindowView.cpp 2016-07-15 10:14:23.000000000 +0000
@@ -282,7 +282,7 @@
auto temp_background_color = background_color();
auto blend_mode = nux::LAYER_BLEND_MODE_OVERLAY;
- if (Settings::Instance().GetLowGfxMode() || BackgroundEffectHelper::blur_type == BLUR_NONE)
+ if (Settings::Instance().low_gfx() || BackgroundEffectHelper::blur_type == BLUR_NONE)
{
temp_background_color.alpha = 1.0f;
blend_mode = nux::LAYER_BLEND_MODE_NORMAL;