Merge lp:~azzar1/unity/lock-autologin into lp:unity

Proposed by Andrea Azzarone on 2016-07-14
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2017-01-09
Approved revision: 4218
Merged at revision: 4216
Proposed branch: lp:~azzar1/unity/lock-autologin
Merge into: lp:unity
Diff against target: 262 lines (+88/-16)
8 files modified
UnityCore/GnomeSessionManager.cpp (+45/-0)
UnityCore/GnomeSessionManager.h (+1/-0)
UnityCore/GnomeSessionManagerImpl.h (+1/-0)
UnityCore/SessionManager.h (+1/-0)
plugins/unityshell/src/unityshell.cpp (+34/-16)
plugins/unityshell/src/unityshell.h (+4/-0)
shutdown/StandaloneSession.cpp (+1/-0)
tests/test_mock_session_manager.h (+1/-0)
To merge this branch: bzr merge lp:~azzar1/unity/lock-autologin
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2016-07-14 Approve on 2017-01-09
PS Jenkins bot continuous-integration Pending
Review via email: mp+300119@code.launchpad.net

Commit message

Keep the screen locked if rebooting with autologin.

To post a comment you must log in.
lp:~azzar1/unity/lock-autologin updated on 2016-07-15
4152. By Eleni Maria Stea on 2016-07-15

Reverts fix for multimonitor because of problems in nvidia cards (see bug: #1602901) (LP: #1602901)

Approved by: Andrea Azzarone

4153. By CI Train Bot Account on 2016-07-15

Releasing 7.5.0+16.10.20160715-0ubuntu1

Marco Trevisan (Treviño) (3v1n0) wrote :

Nice work, some stuff to cleanup...

lp:~azzar1/unity/lock-autologin updated on 2016-08-06
4154. By Andrea Azzarone on 2016-07-27

[LockSceen] Remove numlock warning. (LP: #1526322)

Approved by: Marco Trevisan (Treviño)

4155. By Andrea Azzarone on 2016-07-27

Make sure initiate and terminate callbacks are not empty before calling them. (LP: #1605012)

Approved by: Marco Trevisan (Treviño)

4156. By Andrea Azzarone on 2016-07-27

Properly destroy close_button_ to properly disconnect lambda. (LP: #1605010)

Approved by: Marco Trevisan (Treviño)

4157. By Andrea Azzarone on 2016-07-27

Use the standard notification-device-eject in the "device eject" notification. This allows us to scale it properly on high-dpi setups. (LP: #1605231)

Approved by: Marco Trevisan (Treviño)

4158. By Andrea Azzarone on 2016-07-27

Add tools to enforce unityshell plugin for the current profile and add "move" and "resize" plugins as requirements. (LP: #1506023, #1605007)

Approved by: Marco Trevisan (Treviño)

4159. By Andrea Azzarone on 2016-07-27

When locked discard damages from windows below lockscreen. (LP: #1605180)

Approved by: Marco Trevisan (Treviño)

4160. By Marco Trevisan (Treviño) on 2016-07-27

LockScreenAcceleratorController: ensure callbacks are valid before calling them (LP: #1605012)

Approved by: Andrea Azzarone

4161. By Eleni Maria Stea on 2016-07-27

DecoratedWindow: Added shadows for shaped windows

Approved by: Marco Trevisan (Treviño), PS Jenkins bot

4162. By Marco Trevisan (Treviño) on 2016-07-27

DecoratedWindow: Cleanup shadows for shaped windows, reduce recomputation

Approved by: Andrea Azzarone

4163. By CI Train Bot Account on 2016-07-27

Releasing 7.5.0+16.10.20160727-0ubuntu1

4164. By Marco Trevisan (Treviño) on 2016-08-06

DecoratedWindow: avoid deferencing an invalid shadow texture ptr, and split functions (LP: #1608464)

Approved by: Andrea Azzarone

4165. By Marco Trevisan (Treviño) on 2016-08-06

UnityWindowView: don't try to deference close_button_ if its' null

It could happen when manually triggering a signal

Approved by: Andrea Azzarone

4166. By Andrea Azzarone on 2016-08-06

DecoratedWindow: display unmaximize button if the window is vertically or horizontally maximized (LP: #1608480)

Approved by: Andrea Azzarone, Marco Trevisan (Treviño)

4167. By Marco Trevisan (Treviño) on 2016-08-06

DecorationsForceQuitDialog: make CSS selectors work with gtk 3.20

4168. By CI Train Bot Account on 2016-08-06

Releasing 7.5.0+16.10.20160806-0ubuntu1

review: Needs Fixing
lp:~azzar1/unity/lock-autologin updated on 2016-08-19
4169. By Andrea Azzarone on 2016-08-17

Make sure the switcher detail view is properly scaled. Also scale the xy_offset to make sure the switcher and launcher do not overlap. (LP: #1605256)

Approved by: Marco Trevisan (Treviño)

4170. By Andrea Azzarone on 2016-08-17

Close session dialog on first ESC. (LP: #1521116)

Approved by: Marco Trevisan (Treviño)

4171. By Marco Trevisan (Treviño) on 2016-08-17

OverlayRenderer: properly decorate launcher/panel when the launcher is at the bottom (LP: #1611694)

Approved by: Eleni Maria Stea

4172. By Marco Trevisan (Treviño) on 2016-08-17

UserAuthenticatorPam: ensure pam_handle_ is null initialized and don't proceed if not set (LP: #1611668)

Approved by: Andrea Azzarone

4173. By Marco Trevisan (Treviño) on 2016-08-17

OverlayRenderer: don't use rotated textures, just rotate them at rendering time

So removing duplicated data, since we can do this at code level

Approved by: Andrea Azzarone, Eleni Maria Stea

4174. By Marco Trevisan (Treviño) on 2016-08-17

DecorationStyle: set css name for Gtk 3.20

Approved by: Andrea Azzarone

4175. By Marco Trevisan (Treviño) on 2016-08-17

SpreadWidgets: add container for spread filter and new spread decorations

Now when windows are spread, launcher and panel aren't "naked" anymore (LP: #1283314)

4176. By Andrea Azzarone on 2016-08-17

Filter out scrolling envents for FilterExpanderLabel. (LP: #1604632)

Approved by: Marco Trevisan (Treviño)

4177. By CI Train Bot Account on 2016-08-17

Releasing 7.5.0+16.10.20160817.1-0ubuntu1

4178. By Andrea Azzarone on 2016-08-19

Use compiz::Window::serverNext instead of compiz::Window::next in IsWindowObscured as the latter can be outdated just after scale/spread terminates. (LP: #1614116)

Approved by: Marco Trevisan (Treviño)

4179. By CI Train Bot Account on 2016-08-19

Releasing 7.5.0+16.10.20160819-0ubuntu1

Marco Trevisan (Treviño) (3v1n0) wrote :

Hey, could you please clean this up?

lp:~azzar1/unity/lock-autologin updated on 2017-01-04
4180. By Andrea Azzarone on 2016-09-01

Disable menu discovery animation if MenusDiscoveryDuration is 0. (LP: #942962)

4181. By Andrea Azzarone on 2016-09-01

Redraw fake decorations on window resize. (LP: #940470)

Approved by: Marco Trevisan (Treviño)

4182. By Marco Trevisan (Treviño) on 2016-09-01

InputMonitor: add an unity class that monitors XInput2 events and converts them to XEvent

Clients of this class can register event handlers, and when an interested event will hit
our event filter function (that is set only if we have handlers), then we notify them
with a standard XEvent struct, converted from the XIDeviceEvent cookie.

The nice thing of this monitor is that it always reports events, despite the X grabs.

Approved by: Andrea Azzarone

4183. By Marco Trevisan (Treviño) on 2016-09-01

EdgeBarrierController: use InputMonitor to get the barrier events instead of relying on its implementation

Also disable the input barrier if we don't really need it

Approved by: Andrea Azzarone

4184. By Marco Trevisan (Treviño) on 2016-09-01

DecorationsMenuLayout: use input monitor for menu scrubbing (LP: #1614597)

Approved by: Andrea Azzarone

4185. By Marco Trevisan (Treviño) on 2016-09-01

PanelView: use InputMonitor to track menu events

Approved by: Andrea Azzarone

4186. By Marco Trevisan (Treviño) on 2016-09-01

LockScreenPanel: use InputMonitor events instead of mouse polling for menu scrubbing

Approved by: Andrea Azzarone

4187. By Marco Trevisan (Treviño) on 2016-09-01

MenuManager: add support for mouse trackers with triangle algorithm support

It allows to register pointer trackers with menu entries selection by using the triangle
technique which prevents menus items from being opened on quick menu scrubbing

Then use use menu::Manager pointer tracker for entries activation in PanelView, LockScreenPanel and DecorationsMenuLayout (LP: #1618405)

Approved by: Andrea Azzarone

4188. By Marco Trevisan (Treviño) on 2016-09-01

PanelView: scale gradient refinement properly

Approved by: Andrea Azzarone

4189. By Marco Trevisan (Treviño) on 2016-09-01

PanelService: don't allow to deactivate menus if they've been opened too shortly

This could be caused by some random events while doing fast scrubbing.

Approved by: Andrea Azzarone

4190. By Marco Trevisan (Treviño) on 2016-09-01

WindowButton: properly partially unmaximize a window when middle/left clicking in the restore button (LP: #1616136)

Approved by: Andrea Azzarone

4191. By Marco Trevisan (Treviño) on 2016-09-01

CMake: move data and setting files in proper folder, define shared libdir variables

Approved by: Andrea Azzarone

4192. By CI Train Bot Account on 2016-09-01

Releasing 7.5.0+16.10.20160901.2-0ubuntu1

4193. By Marco Trevisan (Treviño) on 2016-09-06

Unity: add systemd units for the shell and related services, mark unity7 a requirement for ubuntu-session

At it's core this MR is about making unity7 work with the systemd user sessions.
It required a larger change than expected, so some descriptions :-)

It moves the prestart scripts from Upstart into a shared shell script so that both
systemd and Upstart can use the same code.

Added a signal wrapper for Systemd, today we are sending both signals as both
will be running for the time being. In the future the Upstart signals should be
droppable.

For lock screen we created a target for when the lock screen is enabled.
We put the panel job in there, but other jobs can add themselves by
putting a symbolic link into the "unity-screen-locked.target.wants"
directory to their jobs if they want.

4194. By CI Train Bot Account on 2016-09-06

Releasing 7.5.0+16.10.20160906.1-0ubuntu1

4195. By Martin Pitt on 2016-10-27

Add indicator-printers Wants to unity-panel-service.service

Approved by: Marco Trevisan (Treviño)

4196. By Marco Trevisan (Treviño) on 2016-10-27

TestXdndStartStopNotifierImp: enable some unstable tests by adding XTest support

Approved by: Andrea Azzarone

4197. By Martin Pitt on 2016-10-27

Disable fatal deprecation warnings to build with zesty's GTK 3.22 without breaking backportability.

4198. By CI Train Bot Account on 2016-10-27

Releasing 7.5.0+17.04.20161027-0ubuntu1

4199. By CI Train Bot Account on 2016-11-07

No-change rebuild against latest nux

4200. By CI Train Bot Account on 2016-11-07

Releasing 7.5.0+17.04.20161107-0ubuntu1

4201. By Marco Trevisan (Treviño) on 2016-11-07

LockScreenController: ignore icon_paths_changed signal in menumanager for Lockscreen (LP: #1635625)

Approved by: Andrea Azzarone

4202. By Andrea Azzarone on 2016-11-07

Properly handle the file manager copy dialog in FileManagerLauncherIcon and in StorageLauncherIcon. (LP: #1575452, #1609845)

Approved by: Marco Trevisan (Treviño)

4203. By Andrea Azzarone on 2016-11-07

Correctly position the force quit dialog when scaling is different than 1.0 (LP: #1637991)

Approved by: Marco Trevisan (Treviño)

4204. By Andrea Azzarone on 2016-11-07

GnomeSession: Retrieve the session id using dbus if $XDG_SESSION_ID is not set

Approved by: Marco Trevisan (Treviño), Martin Pitt

4205. By CI Train Bot Account on 2016-11-07

Releasing 7.5.0+17.04.20161107.2-0ubuntu1

4206. By Marco Trevisan (Treviño) on 2016-11-11

LockScreenController: use InputMonitor to get all the events and hide the Blank Window

When the blank window is shown now we use the XI2 events to figure out if we can hide it
in this way it will be possible to show the screensaver when something is grabbing the
screen and we don't need to grab the screen anymore to get the events. (LP: #1321075)

Approved by: Andrea Azzarone

4207. By Marco Trevisan (Treviño) on 2016-11-11

LockScreenController: use input monitor to get the events to switch monitor

In this way we can safely switch the monitor also on button click (after closing a menu)
or when moving over the panel (that wasn't properly handled before). (LP: #1316862)

Approved by: Andrea Azzarone

4208. By Marco Trevisan (Treviño) on 2016-11-11

LauncherOptions: use track_obj to manage option changes (LP: #1622995)

Approved by: Andrea Azzarone

4209. By CI Train Bot Account on 2016-11-11

Releasing 7.5.0+17.04.20161111.1-0ubuntu1

4210. By Marco Trevisan (Treviño) on 2016-11-30

CMakeLists.txt: add support to compile with GTest 1.8 (LP: #1644062)

4211. By Marco Trevisan (Treviño) on 2016-11-30

UnityScreen: toggle gestures recognition on lock (LP: #1645507)

Approved by: Andrea Azzarone

4212. By Kai-Heng Feng on 2016-11-30

UnitySettings: If scale-factor is not set, find and set right scale for HiDPI displays.

Approved by: Andrea Azzarone

4213. By CI Train Bot Account on 2016-11-30

Releasing 7.5.0+17.04.20161130-0ubuntu1

4214. By Andrea Azzarone on 2016-12-20

Merge with trunk.

4215. By Andrea Azzarone on 2017-01-04

GetAutomaticLogin -> AutomaticLogin

4216. By Andrea Azzarone on 2017-01-04

Minor changes.

4217. By Andrea Azzarone on 2017-01-04

Create session manager in ctor.

Andrea Azzarone (azzar1) wrote :

Done.

lp:~azzar1/unity/lock-autologin updated on 2017-01-04
4218. By Andrea Azzarone on 2017-01-04

Remove line.

Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'UnityCore/GnomeSessionManager.cpp'
--- UnityCore/GnomeSessionManager.cpp 2016-11-02 16:38:47 +0000
+++ UnityCore/GnomeSessionManager.cpp 2017-01-04 17:49:42 +0000
@@ -575,13 +575,53 @@
575 auto group = getgrnam(group_name.c_str());575 auto group = getgrnam(group_name.c_str());
576576
577 if (group && group->gr_mem)577 if (group && group->gr_mem)
578 {
578 for (int i = 0; group->gr_mem[i]; ++i)579 for (int i = 0; group->gr_mem[i]; ++i)
580 {
579 if (g_strcmp0(group->gr_mem[i], user_name.c_str()) == 0)581 if (g_strcmp0(group->gr_mem[i], user_name.c_str()) == 0)
580 return true;582 return true;
583 }
584 }
581585
582 return false;586 return false;
583}587}
584588
589bool GnomeManager::Impl::AutomaticLogin()
590{
591 glib::Error error;
592 glib::Object<GDBusConnection> bus(g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &error));
593
594 if (error)
595 {
596 LOG_ERROR(logger) << "Impossible to get the system bus to know if auto-login is enabled: " << error;
597 return false;
598 }
599
600 glib::Variant user_path(g_dbus_connection_call_sync(bus, "org.freedesktop.Accounts",
601 "/org/freedesktop/Accounts", "org.freedesktop.Accounts",
602 "FindUserByName", g_variant_new("(s)",g_get_user_name()), nullptr,
603 G_DBUS_CALL_FLAGS_NONE, 500, nullptr, &error));
604
605 if (error)
606 {
607 LOG_ERROR(logger) << "Impossible to get the user path: " << error;
608 return false;
609 }
610
611 glib::Variant autologin(g_dbus_connection_call_sync(bus, "org.freedesktop.Accounts",
612 user_path.GetObjectPath().c_str(), "org.freedesktop.DBus.Properties",
613 "Get", g_variant_new("(ss)", "org.freedesktop.Accounts.User", "AutomaticLogin"), nullptr,
614 G_DBUS_CALL_FLAGS_NONE, 500, nullptr, &error));
615
616 if (error)
617 {
618 LOG_ERROR(logger) << "Impossible to get the AutomaticLogin property: " << error;
619 return false;
620 }
621
622 return autologin.GetBool();
623}
624
585// Public implementation625// Public implementation
586626
587GnomeManager::GnomeManager()627GnomeManager::GnomeManager()
@@ -620,6 +660,11 @@
620 impl_->UserIconFile(callback);660 impl_->UserIconFile(callback);
621}661}
622662
663bool GnomeManager::AutomaticLogin() const
664{
665 return impl_->AutomaticLogin();
666}
667
623void GnomeManager::ScreenSaverActivate()668void GnomeManager::ScreenSaverActivate()
624{669{
625 screensaver_requested.emit(true);670 screensaver_requested.emit(true);
626671
=== modified file 'UnityCore/GnomeSessionManager.h'
--- UnityCore/GnomeSessionManager.h 2015-12-03 05:57:00 +0000
+++ UnityCore/GnomeSessionManager.h 2017-01-04 17:49:42 +0000
@@ -37,6 +37,7 @@
37 std::string UserName() const;37 std::string UserName() const;
38 std::string HostName() const;38 std::string HostName() const;
39 void UserIconFile(std::function<void(std::string const&)> const&) const;39 void UserIconFile(std::function<void(std::string const&)> const&) const;
40 bool AutomaticLogin() const;
4041
41 void ScreenSaverActivate();42 void ScreenSaverActivate();
42 void ScreenSaverDeactivate();43 void ScreenSaverDeactivate();
4344
=== modified file 'UnityCore/GnomeSessionManagerImpl.h'
--- UnityCore/GnomeSessionManagerImpl.h 2016-11-02 16:38:47 +0000
+++ UnityCore/GnomeSessionManagerImpl.h 2017-01-04 17:49:42 +0000
@@ -69,6 +69,7 @@
69 void UpdateHaveOtherOpenSessions();69 void UpdateHaveOtherOpenSessions();
7070
71 bool IsUserInGroup(std::string const& user_name, std::string const& group_name);71 bool IsUserInGroup(std::string const& user_name, std::string const& group_name);
72 bool AutomaticLogin();
7273
73 GnomeManager* manager_;74 GnomeManager* manager_;
74 bool test_mode_;75 bool test_mode_;
7576
=== modified file 'UnityCore/SessionManager.h'
--- UnityCore/SessionManager.h 2016-03-31 09:51:33 +0000
+++ UnityCore/SessionManager.h 2017-01-04 17:49:42 +0000
@@ -46,6 +46,7 @@
46 virtual std::string UserName() const = 0;46 virtual std::string UserName() const = 0;
47 virtual std::string HostName() const = 0;47 virtual std::string HostName() const = 0;
48 virtual void UserIconFile(std::function<void(std::string const&)> const&) const = 0;48 virtual void UserIconFile(std::function<void(std::string const&)> const&) const = 0;
49 virtual bool AutomaticLogin() const = 0;
4950
50 virtual void ScreenSaverActivate() = 0;51 virtual void ScreenSaverActivate() = 0;
51 virtual void ScreenSaverDeactivate() = 0;52 virtual void ScreenSaverDeactivate() = 0;
5253
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2016-11-28 23:40:15 +0000
+++ plugins/unityshell/src/unityshell.cpp 2017-01-04 17:49:42 +0000
@@ -197,6 +197,7 @@
197 , menus_(std::make_shared<menu::Manager>(std::make_shared<indicator::DBusIndicators>(), std::make_shared<key::GnomeGrabber>()))197 , menus_(std::make_shared<menu::Manager>(std::make_shared<indicator::DBusIndicators>(), std::make_shared<key::GnomeGrabber>()))
198 , deco_manager_(std::make_shared<decoration::Manager>(menus_))198 , deco_manager_(std::make_shared<decoration::Manager>(menus_))
199 , debugger_(this)199 , debugger_(this)
200 , session_(std::make_shared<session::GnomeManager>())
200 , needsRelayout(false)201 , needsRelayout(false)
201 , super_keypressed_(false)202 , super_keypressed_(false)
202 , newFocusedWindow(nullptr)203 , newFocusedWindow(nullptr)
@@ -515,7 +516,10 @@
515 unity_a11y_finalize();516 unity_a11y_finalize();
516 QuicklistManager::Destroy();517 QuicklistManager::Destroy();
517 decoration::DataPool::Reset();518 decoration::DataPool::Reset();
518 SaveLockStamp(false);519
520 if (!session_->AutomaticLogin())
521 SaveLockStamp(false);
522
519 reset_glib_logging();523 reset_glib_logging();
520524
521 screen->addSupportedAtomsSetEnabled(this, false);525 screen->addSupportedAtomsSetEnabled(this, false);
@@ -4005,17 +4009,32 @@
4005 UpdateGesturesSupport();4009 UpdateGesturesSupport();
4006}4010}
40074011
4012std::string UnityScreen::GetLockStampFile() const
4013{
4014 std::string cache_dir;
4015
4016 if (session_->AutomaticLogin())
4017 cache_dir = DesktopUtilities::GetUserCacheDirectory();
4018 else
4019 cache_dir = DesktopUtilities::GetUserRuntimeDirectory();
4020
4021 if (cache_dir.empty())
4022 return std::string();
4023
4024 return cache_dir+local::LOCKED_STAMP;
4025}
4026
4008void UnityScreen::SaveLockStamp(bool save)4027void UnityScreen::SaveLockStamp(bool save)
4009{4028{
4010 auto const& cache_dir = DesktopUtilities::GetUserRuntimeDirectory();4029 std::string file_path = GetLockStampFile();
40114030
4012 if (cache_dir.empty())4031 if (file_path.empty())
4013 return;4032 return;
40144033
4015 if (save)4034 if (save)
4016 {4035 {
4017 glib::Error error;4036 glib::Error error;
4018 g_file_set_contents((cache_dir+local::LOCKED_STAMP).c_str(), "", 0, &error);4037 g_file_set_contents(file_path.c_str(), "", 0, &error);
40194038
4020 if (error)4039 if (error)
4021 {4040 {
@@ -4024,7 +4043,7 @@
4024 }4043 }
4025 else4044 else
4026 {4045 {
4027 if (g_unlink((cache_dir+local::LOCKED_STAMP).c_str()) < 0)4046 if (g_unlink(file_path.c_str()) < 0)
4028 {4047 {
4029 LOG_ERROR(logger) << "Impossible to delete the unity locked stamp file";4048 LOG_ERROR(logger) << "Impossible to delete the unity locked stamp file";
4030 }4049 }
@@ -4100,24 +4119,23 @@
4100 ShowFirstRunHints();4119 ShowFirstRunHints();
41014120
4102 // Setup Session Controller4121 // Setup Session Controller
4103 auto session = std::make_shared<session::GnomeManager>();4122 session_->lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested));
4104 session->lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested));4123 session_->prompt_lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested));
4105 session->prompt_lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested));4124 session_->locked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenLocked));
4106 session->locked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenLocked));4125 session_->unlocked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenUnlocked));
4107 session->unlocked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenUnlocked));4126 session_dbus_manager_ = std::make_shared<session::DBusManager>(session_);
4108 session_dbus_manager_ = std::make_shared<session::DBusManager>(session);4127 session_controller_ = std::make_shared<session::Controller>(session_);
4109 session_controller_ = std::make_shared<session::Controller>(session);
4110 LOG_INFO(logger) << "InitUnityComponents-Session " << timer.ElapsedSeconds() << "s";4128 LOG_INFO(logger) << "InitUnityComponents-Session " << timer.ElapsedSeconds() << "s";
4111 Introspectable::AddChild(session_controller_.get());4129 Introspectable::AddChild(session_controller_.get());
41124130
4113 // Setup Lockscreen Controller4131 // Setup Lockscreen Controller
4114 screensaver_dbus_manager_ = std::make_shared<lockscreen::DBusManager>(session);4132 screensaver_dbus_manager_ = std::make_shared<lockscreen::DBusManager>(session_);
4115 lockscreen_controller_ = std::make_shared<lockscreen::Controller>(screensaver_dbus_manager_, session, menus_->KeyGrabber());4133 lockscreen_controller_ = std::make_shared<lockscreen::Controller>(screensaver_dbus_manager_, session_, menus_->KeyGrabber());
4116 UpdateActivateIndicatorsKey();4134 UpdateActivateIndicatorsKey();
4117 LOG_INFO(logger) << "InitUnityComponents-Lockscreen " << timer.ElapsedSeconds() << "s";4135 LOG_INFO(logger) << "InitUnityComponents-Lockscreen " << timer.ElapsedSeconds() << "s";
41184136
4119 if (g_file_test((DesktopUtilities::GetUserRuntimeDirectory()+local::LOCKED_STAMP).c_str(), G_FILE_TEST_EXISTS))4137 if (g_file_test(GetLockStampFile().c_str(), G_FILE_TEST_EXISTS))
4120 session->PromptLockScreen();4138 session_->PromptLockScreen();
41214139
4122 auto on_launcher_size_changed = [this] (nux::Area* area, int w, int h) {4140 auto on_launcher_size_changed = [this] (nux::Area* area, int w, int h) {
4123 /* The launcher geometry includes 1px used to draw the right/top margin4141 /* The launcher geometry includes 1px used to draw the right/top margin
41244142
=== modified file 'plugins/unityshell/src/unityshell.h'
--- plugins/unityshell/src/unityshell.h 2016-09-01 23:56:24 +0000
+++ plugins/unityshell/src/unityshell.h 2017-01-04 17:49:42 +0000
@@ -76,6 +76,7 @@
76#include "UnityShowdesktopHandler.h"76#include "UnityShowdesktopHandler.h"
77#include "ThumbnailGenerator.h"77#include "ThumbnailGenerator.h"
78#include "MenuManager.h"78#include "MenuManager.h"
79#include "UnityCore/SessionManager.h"
7980
80#include "compizminimizedwindowhandler.h"81#include "compizminimizedwindowhandler.h"
81#include "BGHash.h"82#include "BGHash.h"
@@ -231,6 +232,7 @@
231 void OnScreenLocked();232 void OnScreenLocked();
232 void OnScreenUnlocked();233 void OnScreenUnlocked();
233 void SaveLockStamp(bool);234 void SaveLockStamp(bool);
235 std::string GetLockStampFile() const;
234236
235 bool DoesPointIntersectUnityGeos(nux::Point const& pt);237 bool DoesPointIntersectUnityGeos(nux::Point const& pt);
236238
@@ -344,6 +346,8 @@
344 std::unique_ptr<BGHash> bghash_;346 std::unique_ptr<BGHash> bghash_;
345 spread::Widgets::Ptr spread_widgets_;347 spread::Widgets::Ptr spread_widgets_;
346348
349 session::Manager::Ptr session_;
350
347 /* Subscription for gestures that manipulate Unity launcher */351 /* Subscription for gestures that manipulate Unity launcher */
348 std::unique_ptr<nux::GesturesSubscription> gestures_sub_launcher_;352 std::unique_ptr<nux::GesturesSubscription> gestures_sub_launcher_;
349353
350354
=== modified file 'shutdown/StandaloneSession.cpp'
--- shutdown/StandaloneSession.cpp 2015-12-03 05:57:00 +0000
+++ shutdown/StandaloneSession.cpp 2017-01-04 17:49:42 +0000
@@ -40,6 +40,7 @@
40 std::string UserName() const { return "marco"; }40 std::string UserName() const { return "marco"; }
41 std::string HostName() const { return "tricky"; }41 std::string HostName() const { return "tricky"; }
42 void UserIconFile(std::function<void(std::string const&)> const&) const { std::cout << "UserIconFile" << std::endl; }42 void UserIconFile(std::function<void(std::string const&)> const&) const { std::cout << "UserIconFile" << std::endl; }
43 bool AutomaticLogin() const { return false; }
4344
44 void ScreenSaverActivate() { std::cout << "ScreenSaverActivate" << std::endl; }45 void ScreenSaverActivate() { std::cout << "ScreenSaverActivate" << std::endl; }
45 void ScreenSaverDeactivate() { std::cout << "ScreenSaverDeactivate" << std::endl; }46 void ScreenSaverDeactivate() { std::cout << "ScreenSaverDeactivate" << std::endl; }
4647
=== modified file 'tests/test_mock_session_manager.h'
--- tests/test_mock_session_manager.h 2016-03-31 09:51:33 +0000
+++ tests/test_mock_session_manager.h 2017-01-04 17:49:42 +0000
@@ -34,6 +34,7 @@
34 MOCK_CONST_METHOD0(UserName, std::string());34 MOCK_CONST_METHOD0(UserName, std::string());
35 MOCK_CONST_METHOD0(HostName, std::string());35 MOCK_CONST_METHOD0(HostName, std::string());
36 MOCK_CONST_METHOD1(UserIconFile, void(ReplyCallback const&));36 MOCK_CONST_METHOD1(UserIconFile, void(ReplyCallback const&));
37 MOCK_CONST_METHOD0(AutomaticLogin, bool());
3738
38 MOCK_METHOD0(ScreenSaverActivate, void());39 MOCK_METHOD0(ScreenSaverActivate, void());
39 MOCK_METHOD0(ScreenSaverDeactivate, void());40 MOCK_METHOD0(ScreenSaverDeactivate, void());