Merge lp:~azzar1/unity/lock-autologin into lp:unity
- lock-autologin
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
PS Jenkins bot | continuous-integration | Pending | |
Review via email:
|
Commit message
Keep the screen locked if rebooting with autologin.
Description of the change
- 4152. By Eleni Maria Stea
-
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
-
Releasing 7.5.0+16.
10.20160715- 0ubuntu1

Marco Trevisan (Treviño) (3v1n0) wrote : | # |
- 4154. By Andrea Azzarone
-
[LockSceen] Remove numlock warning. (LP: #1526322)
Approved by: Marco Trevisan (Treviño)
- 4155. By Andrea Azzarone
-
Make sure initiate and terminate callbacks are not empty before calling them. (LP: #1605012)
Approved by: Marco Trevisan (Treviño)
- 4156. By Andrea Azzarone
-
Properly destroy close_button_ to properly disconnect lambda. (LP: #1605010)
Approved by: Marco Trevisan (Treviño)
- 4157. By Andrea Azzarone
-
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
-
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
-
When locked discard damages from windows below lockscreen. (LP: #1605180)
Approved by: Marco Trevisan (Treviño)
- 4160. By Marco Trevisan (Treviño)
-
LockScreenAccel
eratorControlle r: ensure callbacks are valid before calling them (LP: #1605012) Approved by: Andrea Azzarone
- 4161. By Eleni Maria Stea
-
DecoratedWindow: Added shadows for shaped windows
Approved by: Marco Trevisan (Treviño), PS Jenkins bot
- 4162. By Marco Trevisan (Treviño)
-
DecoratedWindow: Cleanup shadows for shaped windows, reduce recomputation
Approved by: Andrea Azzarone
- 4163. By CI Train Bot Account
-
Releasing 7.5.0+16.
10.20160727- 0ubuntu1 - 4164. By Marco Trevisan (Treviño)
-
DecoratedWindow: avoid deferencing an invalid shadow texture ptr, and split functions (LP: #1608464)
Approved by: Andrea Azzarone
- 4165. By Marco Trevisan (Treviño)
-
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
-
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)
-
DecorationsForc
eQuitDialog: make CSS selectors work with gtk 3.20 - 4168. By CI Train Bot Account
-
Releasing 7.5.0+16.
10.20160806- 0ubuntu1

Marco Trevisan (Treviño) (3v1n0) : | # |
- 4169. By Andrea Azzarone
-
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
-
Close session dialog on first ESC. (LP: #1521116)
Approved by: Marco Trevisan (Treviño)
- 4171. By Marco Trevisan (Treviño)
-
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)
-
UserAuthenticat
orPam: 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)
-
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)
-
DecorationStyle: set css name for Gtk 3.20
Approved by: Andrea Azzarone
- 4175. By Marco Trevisan (Treviño)
-
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
-
Filter out scrolling envents for FilterExpanderL
abel. (LP: #1604632) Approved by: Marco Trevisan (Treviño)
- 4177. By CI Train Bot Account
-
Releasing 7.5.0+16.
10.20160817. 1-0ubuntu1 - 4178. By Andrea Azzarone
-
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
-
Releasing 7.5.0+16.
10.20160819- 0ubuntu1

Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Hey, could you please clean this up?
- 4180. By Andrea Azzarone
-
Disable menu discovery animation if MenusDiscoveryD
uration is 0. (LP: #942962) - 4181. By Andrea Azzarone
-
Redraw fake decorations on window resize. (LP: #940470)
Approved by: Marco Trevisan (Treviño)
- 4182. By Marco Trevisan (Treviño)
-
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)
-
EdgeBarrierCont
roller: 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)
-
DecorationsMenu
Layout: use input monitor for menu scrubbing (LP: #1614597) Approved by: Andrea Azzarone
- 4185. By Marco Trevisan (Treviño)
-
PanelView: use InputMonitor to track menu events
Approved by: Andrea Azzarone
- 4186. By Marco Trevisan (Treviño)
-
LockScreenPanel: use InputMonitor events instead of mouse polling for menu scrubbing
Approved by: Andrea Azzarone
- 4187. By Marco Trevisan (Treviño)
-
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 scrubbingThen use use menu::Manager pointer tracker for entries activation in PanelView, LockScreenPanel and DecorationsMenu
Layout (LP: #1618405) Approved by: Andrea Azzarone
- 4188. By Marco Trevisan (Treviño)
-
PanelView: scale gradient refinement properly
Approved by: Andrea Azzarone
- 4189. By Marco Trevisan (Treviño)
-
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)
-
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)
-
CMake: move data and setting files in proper folder, define shared libdir variables
Approved by: Andrea Azzarone
- 4192. By CI Train Bot Account
-
Releasing 7.5.0+16.
10.20160901. 2-0ubuntu1 - 4193. By Marco Trevisan (Treviño)
-
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
-
Releasing 7.5.0+16.
10.20160906. 1-0ubuntu1 - 4195. By Martin Pitt
-
Add indicator-printers Wants to unity-panel-
service. service Approved by: Marco Trevisan (Treviño)
- 4196. By Marco Trevisan (Treviño)
-
TestXdndStartSt
opNotifierImp: enable some unstable tests by adding XTest support Approved by: Andrea Azzarone
- 4197. By Martin Pitt
-
Disable fatal deprecation warnings to build with zesty's GTK 3.22 without breaking backportability.
- 4198. By CI Train Bot Account
-
Releasing 7.5.0+17.
04.20161027- 0ubuntu1 - 4199. By CI Train Bot Account
-
No-change rebuild against latest nux
- 4200. By CI Train Bot Account
-
Releasing 7.5.0+17.
04.20161107- 0ubuntu1 - 4201. By Marco Trevisan (Treviño)
-
LockScreenContr
oller: ignore icon_paths_changed signal in menumanager for Lockscreen (LP: #1635625) Approved by: Andrea Azzarone
- 4202. By Andrea Azzarone
-
Properly handle the file manager copy dialog in FileManagerLaun
cherIcon and in StorageLauncher Icon. (LP: #1575452, #1609845) Approved by: Marco Trevisan (Treviño)
- 4203. By Andrea Azzarone
-
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
-
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
-
Releasing 7.5.0+17.
04.20161107. 2-0ubuntu1 - 4206. By Marco Trevisan (Treviño)
-
LockScreenContr
oller: 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)
-
LockScreenContr
oller: 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)
-
LauncherOptions: use track_obj to manage option changes (LP: #1622995)
Approved by: Andrea Azzarone
- 4209. By CI Train Bot Account
-
Releasing 7.5.0+17.
04.20161111. 1-0ubuntu1 - 4210. By Marco Trevisan (Treviño)
-
CMakeLists.txt: add support to compile with GTest 1.8 (LP: #1644062)
- 4211. By Marco Trevisan (Treviño)
-
UnityScreen: toggle gestures recognition on lock (LP: #1645507)
Approved by: Andrea Azzarone
- 4212. By Kai-Heng Feng
-
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
-
Releasing 7.5.0+17.
04.20161130- 0ubuntu1 - 4214. By Andrea Azzarone
-
Merge with trunk.
- 4215. By Andrea Azzarone
-
GetAutomaticLogin -> AutomaticLogin
- 4216. By Andrea Azzarone
-
Minor changes.
- 4217. By Andrea Azzarone
-
Create session manager in ctor.

Andrea Azzarone (azzar1) wrote : | # |
Done.
- 4218. By Andrea Azzarone
-
Remove line.

Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Thanks!
Preview Diff
1 | === modified file 'UnityCore/GnomeSessionManager.cpp' |
2 | --- UnityCore/GnomeSessionManager.cpp 2016-11-02 16:38:47 +0000 |
3 | +++ UnityCore/GnomeSessionManager.cpp 2017-01-04 17:49:42 +0000 |
4 | @@ -575,13 +575,53 @@ |
5 | auto group = getgrnam(group_name.c_str()); |
6 | |
7 | if (group && group->gr_mem) |
8 | + { |
9 | for (int i = 0; group->gr_mem[i]; ++i) |
10 | + { |
11 | if (g_strcmp0(group->gr_mem[i], user_name.c_str()) == 0) |
12 | return true; |
13 | + } |
14 | + } |
15 | |
16 | return false; |
17 | } |
18 | |
19 | +bool GnomeManager::Impl::AutomaticLogin() |
20 | +{ |
21 | + glib::Error error; |
22 | + glib::Object<GDBusConnection> bus(g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &error)); |
23 | + |
24 | + if (error) |
25 | + { |
26 | + LOG_ERROR(logger) << "Impossible to get the system bus to know if auto-login is enabled: " << error; |
27 | + return false; |
28 | + } |
29 | + |
30 | + glib::Variant user_path(g_dbus_connection_call_sync(bus, "org.freedesktop.Accounts", |
31 | + "/org/freedesktop/Accounts", "org.freedesktop.Accounts", |
32 | + "FindUserByName", g_variant_new("(s)",g_get_user_name()), nullptr, |
33 | + G_DBUS_CALL_FLAGS_NONE, 500, nullptr, &error)); |
34 | + |
35 | + if (error) |
36 | + { |
37 | + LOG_ERROR(logger) << "Impossible to get the user path: " << error; |
38 | + return false; |
39 | + } |
40 | + |
41 | + glib::Variant autologin(g_dbus_connection_call_sync(bus, "org.freedesktop.Accounts", |
42 | + user_path.GetObjectPath().c_str(), "org.freedesktop.DBus.Properties", |
43 | + "Get", g_variant_new("(ss)", "org.freedesktop.Accounts.User", "AutomaticLogin"), nullptr, |
44 | + G_DBUS_CALL_FLAGS_NONE, 500, nullptr, &error)); |
45 | + |
46 | + if (error) |
47 | + { |
48 | + LOG_ERROR(logger) << "Impossible to get the AutomaticLogin property: " << error; |
49 | + return false; |
50 | + } |
51 | + |
52 | + return autologin.GetBool(); |
53 | +} |
54 | + |
55 | // Public implementation |
56 | |
57 | GnomeManager::GnomeManager() |
58 | @@ -620,6 +660,11 @@ |
59 | impl_->UserIconFile(callback); |
60 | } |
61 | |
62 | +bool GnomeManager::AutomaticLogin() const |
63 | +{ |
64 | + return impl_->AutomaticLogin(); |
65 | +} |
66 | + |
67 | void GnomeManager::ScreenSaverActivate() |
68 | { |
69 | screensaver_requested.emit(true); |
70 | |
71 | === modified file 'UnityCore/GnomeSessionManager.h' |
72 | --- UnityCore/GnomeSessionManager.h 2015-12-03 05:57:00 +0000 |
73 | +++ UnityCore/GnomeSessionManager.h 2017-01-04 17:49:42 +0000 |
74 | @@ -37,6 +37,7 @@ |
75 | std::string UserName() const; |
76 | std::string HostName() const; |
77 | void UserIconFile(std::function<void(std::string const&)> const&) const; |
78 | + bool AutomaticLogin() const; |
79 | |
80 | void ScreenSaverActivate(); |
81 | void ScreenSaverDeactivate(); |
82 | |
83 | === modified file 'UnityCore/GnomeSessionManagerImpl.h' |
84 | --- UnityCore/GnomeSessionManagerImpl.h 2016-11-02 16:38:47 +0000 |
85 | +++ UnityCore/GnomeSessionManagerImpl.h 2017-01-04 17:49:42 +0000 |
86 | @@ -69,6 +69,7 @@ |
87 | void UpdateHaveOtherOpenSessions(); |
88 | |
89 | bool IsUserInGroup(std::string const& user_name, std::string const& group_name); |
90 | + bool AutomaticLogin(); |
91 | |
92 | GnomeManager* manager_; |
93 | bool test_mode_; |
94 | |
95 | === modified file 'UnityCore/SessionManager.h' |
96 | --- UnityCore/SessionManager.h 2016-03-31 09:51:33 +0000 |
97 | +++ UnityCore/SessionManager.h 2017-01-04 17:49:42 +0000 |
98 | @@ -46,6 +46,7 @@ |
99 | virtual std::string UserName() const = 0; |
100 | virtual std::string HostName() const = 0; |
101 | virtual void UserIconFile(std::function<void(std::string const&)> const&) const = 0; |
102 | + virtual bool AutomaticLogin() const = 0; |
103 | |
104 | virtual void ScreenSaverActivate() = 0; |
105 | virtual void ScreenSaverDeactivate() = 0; |
106 | |
107 | === modified file 'plugins/unityshell/src/unityshell.cpp' |
108 | --- plugins/unityshell/src/unityshell.cpp 2016-11-28 23:40:15 +0000 |
109 | +++ plugins/unityshell/src/unityshell.cpp 2017-01-04 17:49:42 +0000 |
110 | @@ -197,6 +197,7 @@ |
111 | , menus_(std::make_shared<menu::Manager>(std::make_shared<indicator::DBusIndicators>(), std::make_shared<key::GnomeGrabber>())) |
112 | , deco_manager_(std::make_shared<decoration::Manager>(menus_)) |
113 | , debugger_(this) |
114 | + , session_(std::make_shared<session::GnomeManager>()) |
115 | , needsRelayout(false) |
116 | , super_keypressed_(false) |
117 | , newFocusedWindow(nullptr) |
118 | @@ -515,7 +516,10 @@ |
119 | unity_a11y_finalize(); |
120 | QuicklistManager::Destroy(); |
121 | decoration::DataPool::Reset(); |
122 | - SaveLockStamp(false); |
123 | + |
124 | + if (!session_->AutomaticLogin()) |
125 | + SaveLockStamp(false); |
126 | + |
127 | reset_glib_logging(); |
128 | |
129 | screen->addSupportedAtomsSetEnabled(this, false); |
130 | @@ -4005,17 +4009,32 @@ |
131 | UpdateGesturesSupport(); |
132 | } |
133 | |
134 | +std::string UnityScreen::GetLockStampFile() const |
135 | +{ |
136 | + std::string cache_dir; |
137 | + |
138 | + if (session_->AutomaticLogin()) |
139 | + cache_dir = DesktopUtilities::GetUserCacheDirectory(); |
140 | + else |
141 | + cache_dir = DesktopUtilities::GetUserRuntimeDirectory(); |
142 | + |
143 | + if (cache_dir.empty()) |
144 | + return std::string(); |
145 | + |
146 | + return cache_dir+local::LOCKED_STAMP; |
147 | +} |
148 | + |
149 | void UnityScreen::SaveLockStamp(bool save) |
150 | { |
151 | - auto const& cache_dir = DesktopUtilities::GetUserRuntimeDirectory(); |
152 | + std::string file_path = GetLockStampFile(); |
153 | |
154 | - if (cache_dir.empty()) |
155 | + if (file_path.empty()) |
156 | return; |
157 | |
158 | if (save) |
159 | { |
160 | glib::Error error; |
161 | - g_file_set_contents((cache_dir+local::LOCKED_STAMP).c_str(), "", 0, &error); |
162 | + g_file_set_contents(file_path.c_str(), "", 0, &error); |
163 | |
164 | if (error) |
165 | { |
166 | @@ -4024,7 +4043,7 @@ |
167 | } |
168 | else |
169 | { |
170 | - if (g_unlink((cache_dir+local::LOCKED_STAMP).c_str()) < 0) |
171 | + if (g_unlink(file_path.c_str()) < 0) |
172 | { |
173 | LOG_ERROR(logger) << "Impossible to delete the unity locked stamp file"; |
174 | } |
175 | @@ -4100,24 +4119,23 @@ |
176 | ShowFirstRunHints(); |
177 | |
178 | // Setup Session Controller |
179 | - auto session = std::make_shared<session::GnomeManager>(); |
180 | - session->lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested)); |
181 | - session->prompt_lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested)); |
182 | - session->locked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenLocked)); |
183 | - session->unlocked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenUnlocked)); |
184 | - session_dbus_manager_ = std::make_shared<session::DBusManager>(session); |
185 | - session_controller_ = std::make_shared<session::Controller>(session); |
186 | + session_->lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested)); |
187 | + session_->prompt_lock_requested.connect(sigc::mem_fun(this, &UnityScreen::OnLockScreenRequested)); |
188 | + session_->locked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenLocked)); |
189 | + session_->unlocked.connect(sigc::mem_fun(this, &UnityScreen::OnScreenUnlocked)); |
190 | + session_dbus_manager_ = std::make_shared<session::DBusManager>(session_); |
191 | + session_controller_ = std::make_shared<session::Controller>(session_); |
192 | LOG_INFO(logger) << "InitUnityComponents-Session " << timer.ElapsedSeconds() << "s"; |
193 | Introspectable::AddChild(session_controller_.get()); |
194 | |
195 | // Setup Lockscreen Controller |
196 | - screensaver_dbus_manager_ = std::make_shared<lockscreen::DBusManager>(session); |
197 | - lockscreen_controller_ = std::make_shared<lockscreen::Controller>(screensaver_dbus_manager_, session, menus_->KeyGrabber()); |
198 | + screensaver_dbus_manager_ = std::make_shared<lockscreen::DBusManager>(session_); |
199 | + lockscreen_controller_ = std::make_shared<lockscreen::Controller>(screensaver_dbus_manager_, session_, menus_->KeyGrabber()); |
200 | UpdateActivateIndicatorsKey(); |
201 | LOG_INFO(logger) << "InitUnityComponents-Lockscreen " << timer.ElapsedSeconds() << "s"; |
202 | |
203 | - if (g_file_test((DesktopUtilities::GetUserRuntimeDirectory()+local::LOCKED_STAMP).c_str(), G_FILE_TEST_EXISTS)) |
204 | - session->PromptLockScreen(); |
205 | + if (g_file_test(GetLockStampFile().c_str(), G_FILE_TEST_EXISTS)) |
206 | + session_->PromptLockScreen(); |
207 | |
208 | auto on_launcher_size_changed = [this] (nux::Area* area, int w, int h) { |
209 | /* The launcher geometry includes 1px used to draw the right/top margin |
210 | |
211 | === modified file 'plugins/unityshell/src/unityshell.h' |
212 | --- plugins/unityshell/src/unityshell.h 2016-09-01 23:56:24 +0000 |
213 | +++ plugins/unityshell/src/unityshell.h 2017-01-04 17:49:42 +0000 |
214 | @@ -76,6 +76,7 @@ |
215 | #include "UnityShowdesktopHandler.h" |
216 | #include "ThumbnailGenerator.h" |
217 | #include "MenuManager.h" |
218 | +#include "UnityCore/SessionManager.h" |
219 | |
220 | #include "compizminimizedwindowhandler.h" |
221 | #include "BGHash.h" |
222 | @@ -231,6 +232,7 @@ |
223 | void OnScreenLocked(); |
224 | void OnScreenUnlocked(); |
225 | void SaveLockStamp(bool); |
226 | + std::string GetLockStampFile() const; |
227 | |
228 | bool DoesPointIntersectUnityGeos(nux::Point const& pt); |
229 | |
230 | @@ -344,6 +346,8 @@ |
231 | std::unique_ptr<BGHash> bghash_; |
232 | spread::Widgets::Ptr spread_widgets_; |
233 | |
234 | + session::Manager::Ptr session_; |
235 | + |
236 | /* Subscription for gestures that manipulate Unity launcher */ |
237 | std::unique_ptr<nux::GesturesSubscription> gestures_sub_launcher_; |
238 | |
239 | |
240 | === modified file 'shutdown/StandaloneSession.cpp' |
241 | --- shutdown/StandaloneSession.cpp 2015-12-03 05:57:00 +0000 |
242 | +++ shutdown/StandaloneSession.cpp 2017-01-04 17:49:42 +0000 |
243 | @@ -40,6 +40,7 @@ |
244 | std::string UserName() const { return "marco"; } |
245 | std::string HostName() const { return "tricky"; } |
246 | void UserIconFile(std::function<void(std::string const&)> const&) const { std::cout << "UserIconFile" << std::endl; } |
247 | + bool AutomaticLogin() const { return false; } |
248 | |
249 | void ScreenSaverActivate() { std::cout << "ScreenSaverActivate" << std::endl; } |
250 | void ScreenSaverDeactivate() { std::cout << "ScreenSaverDeactivate" << std::endl; } |
251 | |
252 | === modified file 'tests/test_mock_session_manager.h' |
253 | --- tests/test_mock_session_manager.h 2016-03-31 09:51:33 +0000 |
254 | +++ tests/test_mock_session_manager.h 2017-01-04 17:49:42 +0000 |
255 | @@ -34,6 +34,7 @@ |
256 | MOCK_CONST_METHOD0(UserName, std::string()); |
257 | MOCK_CONST_METHOD0(HostName, std::string()); |
258 | MOCK_CONST_METHOD1(UserIconFile, void(ReplyCallback const&)); |
259 | + MOCK_CONST_METHOD0(AutomaticLogin, bool()); |
260 | |
261 | MOCK_METHOD0(ScreenSaverActivate, void()); |
262 | MOCK_METHOD0(ScreenSaverDeactivate, void()); |
Nice work, some stuff to cleanup...