summaryrefslogtreecommitdiff
diff options
-rw-r--r--CMakeLists.txt2
-rw-r--r--dash/DashView.cpp7
-rw-r--r--debian/control4
-rw-r--r--hud/HudView.cpp6
-rw-r--r--hud/HudView.h1
-rw-r--r--launcher/Launcher.cpp3
-rw-r--r--plugins/unityshell/src/unityshell.cpp11
-rw-r--r--plugins/unityshell/src/unityshell.h2
-rw-r--r--plugins/unityshell/unityshell.xml.in6
-rw-r--r--shutdown/SessionController.cpp5
-rw-r--r--shutdown/SessionController.h2
-rw-r--r--tests/autopilot/unity/tests/xim/test_gcin.py4
-rw-r--r--tests/test_launcher.cpp22
13 files changed, 66 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 228a3156a..d5cf1f70a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -231,7 +231,7 @@ set(UNITY_PLUGIN_SHARED_DEPS
gnome-desktop-3.0
libnotify
libstartup-notification-1.0
- nux-4.0>=4.0.4
+ nux-4.0>=4.0.5
sigc++-2.0
unity-misc>=0.4.0
xpathselect=1.4
diff --git a/dash/DashView.cpp b/dash/DashView.cpp
index 0a6a68a79..32b74d690 100644
--- a/dash/DashView.cpp
+++ b/dash/DashView.cpp
@@ -475,7 +475,6 @@ void DashView::AboutToShow()
ClosePreview();
}
-
overlay_window_buttons_->Show();
renderer_.UpdateBlurBackgroundSize(content_geo_, GetRenderAbsoluteGeometry(), false);
@@ -484,6 +483,12 @@ void DashView::AboutToShow()
void DashView::AboutToHide()
{
+ if (BackgroundEffectHelper::blur_type == BLUR_STATIC)
+ {
+ content_geo_ = {0, 0, 0, 0};
+ renderer_.UpdateBlurBackgroundSize(content_geo_, GetRenderAbsoluteGeometry(), false);
+ }
+
visible_ = false;
renderer_.AboutToHide();
diff --git a/debian/control b/debian/control
index 2993d4895..7f03e17f0 100644
--- a/debian/control
+++ b/debian/control
@@ -36,7 +36,7 @@ Build-Depends: cmake,
libnih-dbus-dev,
libnih-dev,
libnotify-dev,
- libnux-4.0-dev (>= 4.0.4),
+ libnux-4.0-dev (>= 4.0.5),
libpango1.0-dev,
libsigc++-2.0-dev,
libstartup-notification0-dev,
@@ -148,7 +148,7 @@ Depends: ${misc:Depends},
libunity-core-6.0-8 (= ${binary:Version}),
libglib2.0-dev,
libsigc++-2.0-dev,
- libnux-4.0-dev (>= 4.0.4),
+ libnux-4.0-dev (>= 4.0.5),
libunity-dev (>= 7.1.0~),
libdee-dev,
Description: Core library for the Unity interface - development files
diff --git a/hud/HudView.cpp b/hud/HudView.cpp
index e73775dd2..3bfd327c1 100644
--- a/hud/HudView.cpp
+++ b/hud/HudView.cpp
@@ -353,6 +353,12 @@ void View::AboutToShow()
void View::AboutToHide()
{
+ if (BackgroundEffectHelper::blur_type == BLUR_STATIC)
+ {
+ nux::Geometry geo = {0, 0, 0, 0};
+ renderer_.UpdateBlurBackgroundSize(geo, GetAbsoluteGeometry(), true);
+ }
+
visible_ = false;
overlay_window_buttons_->Hide();
renderer_.AboutToHide();
diff --git a/hud/HudView.h b/hud/HudView.h
index 1cf9eb13c..20610eb25 100644
--- a/hud/HudView.h
+++ b/hud/HudView.h
@@ -28,6 +28,7 @@
#include "HudIcon.h"
#include "HudButton.h"
#include "HudAbstractView.h"
+#include "unity-shared/BackgroundEffectHelper.h"
#include "unity-shared/OverlayRenderer.h"
#include "unity-shared/OverlayWindowButtons.h"
#include "unity-shared/SearchBar.h"
diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp
index 72d3aead5..d7270e0ab 100644
--- a/launcher/Launcher.cpp
+++ b/launcher/Launcher.cpp
@@ -1395,8 +1395,9 @@ void Launcher::HandleUrgentIcon(AbstractLauncherIcon::Ptr const& icon)
// If the Launcher is hidden, then add a timer to wiggle the urgent icons at
// certain intervals (1m, 2m, 4m, 8m, 16m, & 32m).
- if (!urgent_timer_running && !animating)
+ if (!urgent_timer_running)
{
+ urgent_animation_period_ = 0;
urgent_ack_needed_ = true;
SetUrgentTimer(BASE_URGENT_ANIMATION_PERIOD);
}
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 8c6e229a6..3601ffbb8 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -301,6 +301,8 @@ UnityScreen::UnityScreen(CompScreen* screen)
wt->Run(NULL);
uScreen = this;
+ optionSetLockScreenInitiate(boost::bind(&UnityScreen::LockScreenInitiate, this, _1, _2, _3));
+
optionSetShowHudInitiate(boost::bind(&UnityScreen::ShowHudInitiate, this, _1, _2, _3));
optionSetShowHudTerminate(boost::bind(&UnityScreen::ShowHudTerminate, this, _1, _2, _3));
optionSetBackgroundColorNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
@@ -2435,6 +2437,15 @@ bool UnityScreen::ShowHudTerminate(CompAction* action,
return ShowHud();
}
+bool UnityScreen::LockScreenInitiate(CompAction* action,
+ CompAction::State state,
+ CompOption::Vector& options)
+{
+ session_controller_->LockScreen();
+ return true;
+}
+
+
unsigned UnityScreen::CompizModifiersToNux(unsigned input) const
{
unsigned modifiers = 0;
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index 2aa5b72f5..56b389b4b 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -180,6 +180,8 @@ public:
bool launcherSwitcherPrevInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
bool launcherSwitcherTerminate(CompAction* action, CompAction::State state, CompOption::Vector& options);
+ bool LockScreenInitiate(CompAction* action, CompAction::State state, CompOption::Vector& options);
+
/* handle option changes and change settings inside of the
* panel and dock views */
void optionChanged(CompOption*, Options num);
diff --git a/plugins/unityshell/unityshell.xml.in b/plugins/unityshell/unityshell.xml.in
index 565ecbdba..c46bc6891 100644
--- a/plugins/unityshell/unityshell.xml.in
+++ b/plugins/unityshell/unityshell.xml.in
@@ -44,6 +44,12 @@
<group>
<_short>General</_short>
+ <option name="lock_screen" type="key">
+ <_short>Key to lock the screen.</_short>
+ <_long>Pressing this key will lock the current session.</_long>
+ <default>&lt;Super&gt;l</default>
+ </option>
+
<option name="show_hud" type="key">
<_short>Key to show the HUD</_short>
<_long>A tap on this key summons the HUD.</_long>
diff --git a/shutdown/SessionController.cpp b/shutdown/SessionController.cpp
index 01b363144..5fc04a363 100644
--- a/shutdown/SessionController.cpp
+++ b/shutdown/SessionController.cpp
@@ -74,6 +74,11 @@ void Controller::Show(View::Mode mode)
Show(mode, false);
}
+void Controller::LockScreen() const
+{
+ manager_->LockScreen();
+}
+
void Controller::Show(View::Mode mode, bool inhibitors)
{
EnsureView();
diff --git a/shutdown/SessionController.h b/shutdown/SessionController.h
index 95770abc5..3c5ab97ce 100644
--- a/shutdown/SessionController.h
+++ b/shutdown/SessionController.h
@@ -49,6 +49,8 @@ public:
bool Visible() const;
+ void LockScreen() const;
+
protected:
// Introspectable
std::string GetName() const;
diff --git a/tests/autopilot/unity/tests/xim/test_gcin.py b/tests/autopilot/unity/tests/xim/test_gcin.py
index 936b99f38..81420cd86 100644
--- a/tests/autopilot/unity/tests/xim/test_gcin.py
+++ b/tests/autopilot/unity/tests/xim/test_gcin.py
@@ -30,10 +30,6 @@ class GcinTestCase(UnityTestCase):
if 'gcin' not in running_process:
self.skip("gcin is not an active process, please start 'gcin' before running these tests.")
- if 'ibus' in running_process:
- self.skip("IBus is currently running, please close 'ibus-daemon' before running these tests.")
-
-
class GcinTestHangul(GcinTestCase):
"""Tests the Dash and Hud with gcin in hangul mode."""
diff --git a/tests/test_launcher.cpp b/tests/test_launcher.cpp
index 14cd1e853..b10bb4686 100644
--- a/tests/test_launcher.cpp
+++ b/tests/test_launcher.cpp
@@ -721,6 +721,28 @@ TEST_F(TestLauncher, UrgentIconTimerTimeout)
EXPECT_THAT(launcher_->sources_.GetSource("urgent-timeout"), NotNull());
}
+TEST_F(TestLauncher, UrgentIconTimerReset)
+{
+ auto icon = AddMockIcons(1).front();
+ launcher_->SetHidden(true);
+ icon->SetQuirk(AbstractLauncherIcon::Quirk::URGENT, true);
+ ASSERT_EQ(launcher_->urgent_animation_period_, 0);
+
+ launcher_->HandleUrgentIcon(icon);
+ launcher_->OnUrgentTimeout();
+
+ ASSERT_THAT(launcher_->urgent_animation_period_, Gt(0));
+
+ icon->SetQuirk(AbstractLauncherIcon::Quirk::URGENT, false);
+ launcher_->HandleUrgentIcon(icon);
+
+ icon->SetQuirk(AbstractLauncherIcon::Quirk::URGENT, true);
+ launcher_->HandleUrgentIcon(icon);
+
+ EXPECT_EQ(launcher_->urgent_animation_period_, 0);
+}
+
+
TEST_F(TestLauncher, UrgentIconsAnimateAfterLauncherIsRevealed)
{
auto icons = AddMockIcons(5);