Merge lp:~unity-team/unity/x-sru5 into lp:unity/7.4

Proposed by Marco Trevisan (Treviño) on 2017-07-06
Status: Merged
Approved by: Andrea Azzarone on 2017-07-27
Approved revision: no longer in the source branch.
Merged at revision: 4115
Proposed branch: lp:~unity-team/unity/x-sru5
Merge into: lp:unity/7.4
Diff against target: 12627 lines (+4713/-1916)
190 files modified
AUTHORS (+2/-0)
CMakeLists.txt (+9/-98)
ChangeLog (+663/-0)
UnityCore/CMakeLists.txt (+2/-1)
UnityCore/DBusIndicators.cpp (+1/-1)
UnityCore/GLibDBusProxy.cpp (+12/-8)
UnityCore/GLibDBusProxy.h (+2/-2)
UnityCore/GLibSignal-inl.h (+10/-2)
UnityCore/GLibSignal.cpp (+75/-29)
UnityCore/GLibSignal.h (+16/-11)
UnityCore/GnomeSessionManager.cpp (+127/-39)
UnityCore/GnomeSessionManager.h (+1/-0)
UnityCore/GnomeSessionManagerImpl.h (+4/-0)
UnityCore/SessionManager.h (+1/-0)
UnityCore/Variant.cpp (+30/-0)
UnityCore/Variant.h (+1/-0)
config.h.cmake (+3/-2)
dash/ResultRendererTile.cpp (+1/-1)
data/CMakeLists.txt (+37/-1)
data/com.canonical.Unity.gschema.xml (+5/-0)
data/unity7.conf.in (+2/-19)
debian/changelog (+78/-0)
debian/control (+2/-1)
debian/rules (+3/-0)
debian/unity.install (+3/-0)
debian/unity.migrations (+1/-0)
decorations/DecoratedWindow.cpp (+2/-9)
decorations/DecorationsForceQuitDialog.cpp (+4/-2)
decorations/DecorationsMenuLayout.cpp (+35/-37)
decorations/DecorationsMenuLayout.h (+3/-2)
decorations/DecorationsPriv.h (+0/-1)
decorations/DecorationsWindowButton.cpp (+2/-1)
launcher/EdgeBarrierController.cpp (+32/-117)
launcher/EdgeBarrierControllerPrivate.h (+1/-6)
launcher/FileManagerLauncherIcon.cpp (+30/-0)
launcher/FileManagerLauncherIcon.h (+8/-0)
launcher/Launcher.cpp (+36/-32)
launcher/Launcher.h (+1/-0)
launcher/LauncherOptions.cpp (+22/-22)
launcher/StorageLauncherIcon.cpp (+7/-12)
launcher/Tooltip.cpp (+6/-6)
launcher/Tooltip.h (+1/-2)
lockscreen/BackgroundSettings.cpp (+18/-13)
lockscreen/KylinLockScreenShield.cpp (+1/-19)
lockscreen/KylinLockScreenShield.h (+0/-3)
lockscreen/KylinUserPromptView.cpp (+15/-15)
lockscreen/KylinUserPromptView.h (+2/-3)
lockscreen/LockScreenAbstractPromptView.h (+5/-3)
lockscreen/LockScreenBaseShield.cpp (+14/-7)
lockscreen/LockScreenBaseShield.h (+4/-6)
lockscreen/LockScreenController.cpp (+91/-38)
lockscreen/LockScreenController.h (+12/-2)
lockscreen/LockScreenPanel.cpp (+26/-57)
lockscreen/LockScreenPanel.h (+5/-9)
lockscreen/LockScreenPromptFactory.cpp (+4/-3)
lockscreen/LockScreenPromptFactory.h (+3/-1)
lockscreen/LockScreenShield.cpp (+8/-17)
lockscreen/LockScreenShield.h (+4/-3)
lockscreen/LockScreenShieldFactory.cpp (+2/-2)
lockscreen/LockScreenShieldFactory.h (+3/-3)
lockscreen/SuspendInhibitorManager.cpp (+2/-0)
lockscreen/SuspendInhibitorManager.h (+1/-0)
lockscreen/UserAuthenticator.h (+2/-0)
lockscreen/UserAuthenticatorPam.cpp (+41/-33)
lockscreen/UserAuthenticatorPam.h (+9/-8)
lockscreen/UserPromptView.cpp (+51/-15)
lockscreen/UserPromptView.h (+7/-4)
panel/PanelController.cpp (+1/-2)
panel/PanelIndicatorEntryView.cpp (+10/-0)
panel/PanelMenuView.cpp (+1/-7)
panel/PanelMenuView.h (+0/-2)
panel/PanelView.cpp (+14/-121)
panel/PanelView.h (+4/-12)
plugins/unityshell/src/unityshell.cpp (+117/-95)
plugins/unityshell/src/unityshell.h (+9/-2)
plugins/unityshell/unityshell.xml.in (+0/-6)
services/CMakeLists.txt (+1/-1)
services/panel-main.c (+36/-0)
services/panel-service.c (+86/-10)
services/panel-service.h (+2/-0)
services/unity-panel-service-lockscreen.conf.in (+3/-1)
services/unity-panel-service-lockscreen.service.in (+7/-0)
services/unity-panel-service.conf.in (+3/-1)
shutdown/StandaloneSession.cpp (+1/-0)
tests/CMakeLists.txt (+473/-292)
tests/MockCategories.h (+24/-14)
tests/MockResults.h (+32/-7)
tests/autopilot/unity/tests/test_dash.py (+4/-4)
tests/data/external.gschema.xml (+7/-1)
tests/test-gestures/CMakeLists.txt (+5/-3)
tests/test-gestures/test_gesture_broker.cpp (+3/-3)
tests/test_action_handle.cpp (+12/-12)
tests/test_animation_utils.cpp (+4/-4)
tests/test_application_launcher_icon.cpp (+4/-4)
tests/test_bamf_application.cpp (+28/-3)
tests/test_categories.cpp (+3/-3)
tests/test_connection_manager.cpp (+10/-10)
tests/test_dashview.cpp (+1/-1)
tests/test_dashview_impl.cpp (+3/-3)
tests/test_dbus_indicators.cpp (+4/-4)
tests/test_decorations_input_mixer.cpp (+7/-7)
tests/test_decorations_widgets.cpp (+5/-5)
tests/test_delta_tracker.cpp (+6/-6)
tests/test_desktop_launcher_icon.cpp (+1/-1)
tests/test_device_launcher_section.cpp (+1/-1)
tests/test_edge_barrier_controller.cpp (+2/-0)
tests/test_favorite_store_gsettings.cpp (+5/-5)
tests/test_favorite_store_private.cpp (+4/-4)
tests/test_file_manager_launcher_icon.cpp (+202/-0)
tests/test_filter_widgets.cpp (+1/-1)
tests/test_glib_dbus_object.cpp (+2/-2)
tests/test_glib_dbus_server.cpp (+17/-17)
tests/test_glib_object.cpp (+10/-10)
tests/test_glib_signals.cpp (+201/-63)
tests/test_glib_source.cpp (+45/-45)
tests/test_glib_variant.cpp (+9/-9)
tests/test_gnome_session_manager.cpp (+10/-3)
tests/test_grabhandle.cpp (+2/-2)
tests/test_gsettings_scopes.cpp (+32/-32)
tests/test_hud_button.cpp (+2/-2)
tests/test_hud_private.cpp (+6/-6)
tests/test_hud_view.cpp (+1/-1)
tests/test_icon_loader.cpp (+32/-32)
tests/test_indicator.cpp (+6/-6)
tests/test_indicator_appmenu.cpp (+3/-3)
tests/test_indicator_entry.cpp (+3/-3)
tests/test_indicators.cpp (+11/-11)
tests/test_introspection_data.cpp (+40/-40)
tests/test_keyboard_util.cpp (+8/-0)
tests/test_launcher_controller.cpp (+14/-11)
tests/test_launcher_model.cpp (+6/-6)
tests/test_layout_system.cpp (+9/-9)
tests/test_lockscreen_controller.cpp (+9/-7)
tests/test_mock_session_manager.h (+1/-0)
tests/test_panel_controller.cpp (+5/-3)
tests/test_panel_indicator_entry_dropdown_view.cpp (+10/-10)
tests/test_panel_view.cpp (+2/-0)
tests/test_pointer_barrier.cpp (+2/-2)
tests/test_previews.cpp (+2/-2)
tests/test_previews_application.cpp (+2/-2)
tests/test_previews_generic.cpp (+1/-1)
tests/test_previews_movie.cpp (+1/-1)
tests/test_previews_music.cpp (+1/-1)
tests/test_previews_music_payment.cpp (+1/-1)
tests/test_previews_payment.cpp (+1/-0)
tests/test_previews_social.cpp (+1/-1)
tests/test_quicklist_view.cpp (+1/-1)
tests/test_results.cpp (+10/-10)
tests/test_scope.cpp (+6/-6)
tests/test_scope_view.cpp (+12/-12)
tests/test_session_view.cpp (+4/-4)
tests/test_shortcut_model.cpp (+4/-4)
tests/test_shortcut_view.cpp (+3/-3)
tests/test_showdesktop_handler.cpp (+13/-5)
tests/test_switcher_controller_slow.cpp (+5/-5)
tests/test_tabiterator.cpp (+0/-6)
tests/test_texture_cache.cpp (+2/-2)
tests/test_thumbnail_generator.cpp (+5/-5)
tests/test_trash_launcher_icon.cpp (+6/-6)
tests/test_ubus.cpp (+6/-6)
tests/test_unity_window_style.cpp (+3/-3)
tests/test_volume_launcher_icon.cpp (+4/-4)
tools/CMakeLists.txt (+13/-3)
tools/compiz-profile-selector.in (+49/-0)
tools/compiz_config_profile_setter.c (+228/-0)
tools/migration-scripts/06_unity_set_lowgfx_mode_settings_v1 (+95/-0)
tools/unity.cmake (+23/-7)
tools/upstart-prestart-check (+17/-0)
unity-shared/BGHash.cpp (+22/-59)
unity-shared/BGHash.h (+3/-4)
unity-shared/BackgroundEffectHelper.cpp (+3/-4)
unity-shared/CMakeLists.txt (+1/-0)
unity-shared/DashStyle.cpp (+2/-2)
unity-shared/GnomeFileManager.cpp (+4/-2)
unity-shared/InputMonitor.cpp (+423/-0)
unity-shared/InputMonitor.h (+67/-0)
unity-shared/MenuManager.cpp (+157/-1)
unity-shared/MenuManager.h (+4/-0)
unity-shared/SigcSlotHash.h (+70/-0)
unity-shared/StandaloneWindowManager.cpp (+3/-0)
unity-shared/StandaloneWindowManager.h (+1/-0)
unity-shared/ThumbnailGenerator.cpp (+1/-1)
unity-shared/UScreen.cpp (+9/-0)
unity-shared/UScreen.h (+2/-0)
unity-shared/UnitySettings.cpp (+147/-14)
unity-shared/UnitySettings.h (+1/-1)
unity-shared/UpstartWrapper.cpp (+11/-6)
unity-shared/WindowManager.h (+1/-0)
unity-shared/XWindowManager.cpp (+6/-0)
unity-shared/XWindowManager.h (+1/-0)
To merge this branch: bzr merge lp:~unity-team/unity/x-sru5
Reviewer Review Type Date Requested Status
Andrea Azzarone 2017-07-06 Approve on 2017-07-27
Review via email: mp+326916@code.launchpad.net

Commit message

Releasing unity SRU 5 as unity-7.4.5

Description of the change

Backported upstream commits with no changes (a part from revision 4143 which is an half-backport of the upstream 4193, minus the systemd bits)

To post a comment you must log in.
Andrea Azzarone (azzar1) wrote :

LGTM now thanks!

review: Approve
Andrea Azzarone (azzar1) :
review: Needs Fixing
lp:~unity-team/unity/x-sru5 updated on 2017-07-21
4150. By Marco Trevisan (Treviño) on 2017-07-17

GLibSignal: allow to block, unblock signals

Added support also to SignalManager, changed a bit the interface

4151. By Marco Trevisan (Treviño) on 2017-07-17

UnitySettings: use glib::Signal blocking for ignoring setting changes

4152. By Marco Trevisan (Treviño) on 2017-07-17

UnitySettings: listen to compiz profile status in order to set low_gfx value

Instead of changing this value back and forth multiple times, just wait
this to be really changed in compiz, and update our internal variable
accordingly.
Also take care of the gsettings unity's lowgfx value only if the user has
set it.

This fixes an infinite loop when starting compiz in a lowgfx environment.

4153. By Marco Trevisan (Treviño) on 2017-07-17

Launcher: disable or reduce most icon effects on lowgfx

4154. By Marco Trevisan (Treviño) on 2017-07-17

tests: add org.compiz 'current-profile' to external gsettings

4155. By Marco Trevisan (Treviño) on 2017-07-18

compiz-profile-selector: use ligther syntax for updating env variables

And fixes badly set variables in systemd too

4156. By Marco Trevisan (Treviño) on 2017-07-18

unity.cmake: avoid setting not existing profiles when gfx tests fail

4157. By Marco Trevisan (Treviño) on 2017-07-21

compiz-profile-selector: use initctl properly (it won't pull env var from current config)

4158. By Marco Trevisan (Treviño) on 2017-07-21

PanelController: ensure we disconnect from signals on destruction

It's just about using the magic of deriving from sigc::trackable.
Since UScreen might be late in signaling screen changes it could fail

Andrea Azzarone (azzar1) wrote :

Works fine now!

review: Approve
Amr Ibrahim (amribrahim1987) wrote :

Ping!
SRU into Xenial.

lp:~unity-team/unity/x-sru5 updated on 2017-12-01
4160. By Marco Trevisan (Treviño) on 2017-09-25

Tests: split unit tests in single binaries, enable unstable tests

Use CMake foo, for getting the best for running tests in single mode
and generating smart targets for them

4161. By Andrea Azzarone on 2017-09-25

Refactor the way UserAuthenticator is created and passed around. Handle failures to create new threads and fallback to a "Switch to greeter..." button in case of failure.

4162. By Andrea Azzarone on 2017-09-25

Wait until the color buffer is cleared before suspending.

4163. By Andrea Azzarone on 2017-10-10

Avoid to show multiple "Authentication Failure" messages.

4164. By Marco Trevisan (Treviño) on 2017-11-16

tools: add migration script to set the default values for unity-lowgfx profile

Compiz migration scripts are tricky and non always functional, this is safer
and known to work.

4165. By Marco Trevisan (Treviño) on 2017-12-01

dash: reverting neko-mode, not SRU material

4166. By Marco Trevisan (Treviño) on 2017-12-01

Releasing Unity 7.4.5

4167. By Marco Trevisan (Treviño) on 2017-12-01

debian/rules: disable tests for powerpc

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2016-05-14 23:01:37 +0000
3+++ AUTHORS 2017-12-01 18:43:57 +0000
4@@ -4,6 +4,7 @@
5 alanbell@ubuntu.com
6 Alan Pope <alan.pope@canonical.com>
7 Albert Astals <albert.astals@canonical.com>
8+ Alberto Milone <alberto.milone@canonical.com>
9 Alejandro Piñeiro <apinheiro@igalia.com>
10 Alexander Fougner <fougner89@gmail.com>
11 Alexandre Abreu <alexandre.abreu@canonical.com>
12@@ -80,6 +81,7 @@
13 jokerdino@bvm128.zdom.org
14 Jonas Schwabe
15 Jussi Pakkanen <jussi.pakkanen@canonical.com>
16+ Kai-Heng Feng <kai.heng.feng@canonical.com>
17 Ken VanDine <ken.vandine@canonical.com>
18 Kevin DuBois <kevin.dubois@canonical.com>
19 Koichi Akabe <vbkaisetsu@gmail.com>
20
21=== modified file 'CMakeLists.txt'
22--- CMakeLists.txt 2016-08-01 08:37:57 +0000
23+++ CMakeLists.txt 2017-12-01 18:43:57 +0000
24@@ -11,7 +11,7 @@
25 set (PROJECT_NAME "unity")
26 set (UNITY_MAJOR 7)
27 set (UNITY_MINOR 4)
28-set (UNITY_MICRO 0)
29+set (UNITY_MICRO 5)
30 set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")
31 set (UNITY_API_VERSION "6.0")
32 set (UNITY_COMPONENTS_VERSION "6")
33@@ -158,14 +158,15 @@
34 #
35 set (VERSION "${UNITY_VERSION}")
36 set (PREFIXPATH "${CMAKE_INSTALL_PREFIX}")
37-set (UNITYLIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME}")
38-set (UNITYDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}")
39-set (PKGDATADIR "${UNITYDATADIR}/icons")
40+set (UNITY_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME}")
41+set (UNITY_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}")
42+set (UNITY_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}")
43+set (PKGDATADIR "${UNITY_DATADIR}/icons")
44 set (SOURCEDATADIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
45 set (BUILDDIR "${CMAKE_BINARY_DIR}")
46 set (TESTDATADIR "${CMAKE_CURRENT_SOURCE_DIR}/tests/data")
47 set (LOCALE_DIR "${CMAKE_INSTALL_FULL_LOCALEDIR}")
48-# specify the domain directly rather than refering to a variable
49+# specify the domain directly rather than refering to a variable
50 # like ${PROJECT_NAME} to no confuse dh_translations
51 set (GETTEXT_PACKAGE "unity")
52
53@@ -182,7 +183,6 @@
54 #
55 # i18n
56 #
57-
58 find_package (Gettext REQUIRED)
59
60 set (COMPIZ_I18N_DIR ${CMAKE_SOURCE_DIR}/po)
61@@ -203,7 +203,7 @@
62
63 #
64 # Enable or disable boot logging
65-#
66+#
67 option (BOOT_LOGGER "Enable startup performance logging" OFF)
68 if (BOOT_LOGGER)
69 SET (BOOT_LOGGER_FLAG "-DENABLE_LOGGER")
70@@ -248,7 +248,7 @@
71 libnotify
72 libstartup-notification-1.0
73 nux-4.0>=4.0.5
74- sigc++-2.0
75+ sigc++-2.0>=2.4.0
76 unity-misc>=0.4.0
77 xpathselect=1.4
78 zeitgeist-2.0
79@@ -259,7 +259,7 @@
80 if(ENABLE_X_SUPPORT)
81 set(UNITY_PLUGIN_DEPS
82 ${UNITY_PLUGIN_DEPS}
83- compiz>=0.9.9
84+ compiz>=0.9.11
85 libgeis
86 x11
87 xfixes
88@@ -304,56 +304,7 @@
89 add_subdirectory(gnome)
90
91 if (ENABLE_UNIT_TESTS)
92- # Check for google test and build it locally
93- set (
94- GMOCK_ROOT_DIR
95- "/usr/src/gmock"
96- CACHE
97- PATH
98- "Path to Google mock srcs"
99- )
100-
101- set (
102- GMOCK_INCLUDE_DIR
103- "/usr/include/gmock/include"
104- CACHE
105- PATH
106- "Path to Google mock include"
107- )
108-
109- set(
110- GTEST_ROOT_DIR
111- "${GMOCK_ROOT_DIR}/gtest" # Default value, adjustable by user with e.g., ccmake
112- CACHE
113- PATH
114- "Path to Google test srcs"
115- )
116-
117- set(
118- GTEST_INCLUDE_DIR
119- "${GMOCK_ROOT_DIR}/gtest/include"
120- CACHE
121- PATH
122- "Path to Google tests include"
123- )
124-
125- if (GTEST_INCLUDE_DIR AND GMOCK_INCLUDE_DIR)
126- include_directories (
127- ${GMOCK_INCLUDE_DIR}
128- ${GTEST_INCLUDE_DIR}
129- )
130- add_subdirectory(
131- ${GMOCK_ROOT_DIR}
132- "${CMAKE_CURRENT_BINARY_DIR}/gmock"
133- )
134- elseif (GTEST_INCLUDE_DIR AND NOT GMOCK_INCLUDE_DIR)
135- include_directories (
136- ${GTEST_INCLUDE_DIR}
137- )
138- endif(GTEST_INCLUDE_DIR AND GMOCK_INCLUDE_DIR)
139-
140 add_subdirectory(tests)
141-
142 else (ENABLE_UNIT_TESTS)
143 set (MISSING_TESTS_MSG "-- Tests disabled, compile with -DENABLE_UNIT_TESTS=ON")
144 add_custom_target (check COMMAND echo ${MISSING_TESTS_MSG})
145@@ -361,46 +312,11 @@
146 add_custom_target (gcheck COMMAND echo ${MISSING_TESTS_MSG})
147 endif (ENABLE_UNIT_TESTS)
148
149-#
150-# GSettings Schema
151-#
152-SET (UNITY_SCHEMAS "com.canonical.Unity.gschema.xml")
153-SET (UNITY_TEST_SCHEMAS "external.gschema.xml")
154-
155-# Have an option to not install the schema into where GLib is
156-option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" OFF)
157-if (GSETTINGS_LOCALINSTALL)
158- SET (GSETTINGS_DIR "${CMAKE_INSTALL_DATADIR}/glib-2.0/schemas/")
159-else (GSETTINGS_LOCALINSTALL)
160- execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
161- SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/")
162-endif (GSETTINGS_LOCALINSTALL)
163-
164-# Run the validator and error if it fails
165-execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
166-execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${UNITY_SCHEMAS} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
167-
168-if (_schemas_invalid)
169- message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
170-endif (_schemas_invalid)
171-
172-# Actually install and recomple schemas
173-message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}")
174-install (FILES ${UNITY_SCHEMAS} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
175-install (CODE "message (STATUS \"Compiling GSettings schemas\")")
176-install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
177-
178 # Resources
179 install (FILES resources/dash-widgets.json DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/themes)
180 file (GLOB _datafiles "${CMAKE_CURRENT_SOURCE_DIR}/resources/*")
181 install (FILES ${_datafiles} DESTINATION ${PKGDATADIR})
182
183-
184-# For testing
185-configure_file (${CMAKE_SOURCE_DIR}/${UNITY_SCHEMAS} ${CMAKE_BINARY_DIR}/settings/${UNITY_SCHEMAS})
186-configure_file (${CMAKE_SOURCE_DIR}/tests/data/${UNITY_TEST_SCHEMAS} ${CMAKE_BINARY_DIR}/settings/${UNITY_TEST_SCHEMAS})
187-execute_process (COMMAND ${_glib_comple_schemas} ${CMAKE_BINARY_DIR}/settings)
188-
189 #
190 # docs
191 #
192@@ -426,8 +342,3 @@
193
194 endif (DOXYGEN_FOUND STREQUAL "YES")
195
196-#
197-# Upstart
198-#
199-configure_file(unity7.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf)
200-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions)
201
202=== modified file 'ChangeLog'
203--- ChangeLog 2016-05-14 23:01:37 +0000
204+++ ChangeLog 2017-12-01 18:43:57 +0000
205@@ -1,3 +1,666 @@
206+2017-11-16 Marco Trevisan (Treviño) <mail@3v1n0.net>
207+
208+ tools: add migration script to set the default values for unity-lowgfx profile
209+
210+ Compiz migration scripts are tricky and non always functional, this is safer
211+ and known to work.
212+
213+2017-10-10 Andrea Azzarone <azzaronea@gmail.com>
214+
215+ Avoid to show multiple "Authentication Failure" messages.
216+
217+2017-09-25 Andrea Azzarone <azzaronea@gmail.com>
218+
219+ Wait until the color buffer is cleared before suspending.
220+
221+2017-09-25 Andrea Azzarone <azzaronea@gmail.com>
222+
223+ Refactor the way UserAuthenticator is created and passed around. Handle failures to create new threads and fallback to a "Switch to greeter..." button in case of failure.
224+
225+2017-09-25 Marco Trevisan (Treviño) <mail@3v1n0.net>
226+
227+ Tests: split unit tests in single binaries, enable unstable tests
228+
229+ Use CMake foo, for getting the best for running tests in single mode
230+ and generating smart targets for them
231+
232+2016-11-30 Marco Trevisan (Treviño) <mail@3v1n0.net>
233+
234+ CMakeLists.txt: add support to compile with GTest 1.8
235+
236+2017-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net>
237+
238+ PanelController: ensure we disconnect from signals on destruction
239+
240+ It's just about using the magic of deriving from sigc::trackable.
241+ Since UScreen might be late in signaling screen changes it could fail
242+
243+2017-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net>
244+
245+ compiz-profile-selector: use initctl properly (it won't pull env var from current config)
246+
247+2017-07-18 Marco Trevisan (Treviño) <mail@3v1n0.net>
248+
249+ unity.cmake: avoid setting not existing profiles when gfx tests fail
250+
251+2017-07-18 Marco Trevisan (Treviño) <mail@3v1n0.net>
252+
253+ compiz-profile-selector: use ligther syntax for updating env variables
254+
255+ And fixes badly set variables in systemd too
256+
257+2017-07-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
258+
259+ tests: add org.compiz 'current-profile' to external gsettings
260+
261+2017-07-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
262+
263+ Launcher: disable or reduce most icon effects on lowgfx
264+
265+2017-07-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
266+
267+ UnitySettings: listen to compiz profile status in order to set low_gfx value
268+
269+ Instead of changing this value back and forth multiple times, just wait
270+ this to be really changed in compiz, and update our internal variable
271+ accordingly.
272+ Also take care of the gsettings unity's lowgfx value only if the user has
273+ set it.
274+
275+ This fixes an infinite loop when starting compiz in a lowgfx environment.
276+
277+2017-07-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
278+
279+ UnitySettings: use glib::Signal blocking for ignoring setting changes
280+
281+2017-07-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
282+
283+ GLibSignal: allow to block, unblock signals
284+
285+ Added support also to SignalManager, changed a bit the interface
286+
287+2017-07-07 Andrea Azzarone <azzaronea@gmail.com>
288+
289+ Lockscreen: always draw the background-color in the lockscreen
290+
291+ This is to avoid showing a transparent background if the background file is missing.
292+
293+2017-07-07 Marco Trevisan (Treviño) <mail@3v1n0.net>
294+
295+ compiz-profile-selector: don't try to update systemd in upstart session
296+
297+2017-07-03 Marco Trevisan (Treviño) <mail@3v1n0.net>
298+
299+ BGHash, UnityScreen: get desktop averageColor from compiz
300+
301+ compiz now supports getting this value, let's use it instead of
302+ doing this again here.
303+
304+2017-06-09 Andrea Azzarone <azzaronea@gmail.com>
305+
306+ Use g_mkdir_with_parents instead of mkdir.
307+
308+2017-04-25 Marco Trevisan (Treviño) <mail@3v1n0.net>
309+
310+ compiz-profile-setter: tool to update the current profile and use in systemd and Unity settings
311+
312+ Added a compiz-profile-setter tool that allows to change compiz profile, so we use
313+ this to set the right profile when starting unity and when the gsettings key has changed.
314+
315+ So we can just toggle lowgfx profile on the fly by just doing
316+ gsettings set com.canonical.Unity lowgfx true|false
317+
318+2017-04-25 Eleni Maria Stea <elenimaria.stea@canonical.com>
319+
320+ removes lowgfx option from ccsm, reads the "lowgfx" gsetting (lp:~hikiko/unity-control-center/unity-control-center.lowgfx)
321+
322+2017-07-05 Marco Trevisan (Treviño) <mail@3v1n0.net>
323+
324+ Unity: Move scripts to tools, using cmake to generate proper paths
325+
326+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
327+
328+ CMake: move data and setting files in proper folder, define shared libdir variables
329+
330+2017-04-25 Nick Dedekind <nick.dedekind@canonical.com>
331+
332+ Fixed tooltip scaling issues.
333+
334+2017-04-25 Marco Trevisan (Treviño) <mail@3v1n0.net>
335+
336+ Panel: ensure the menu-manager tracker is updated to match monitor
337+
338+ Also always use an unique name for panel depending on monitor
339+
340+2017-03-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
341+
342+ InputMonitor: don't try to deference an invalid Nux display
343+
344+2017-03-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
345+
346+ UnityWindow: safely check validity of UnityWindow from scaled one
347+
348+2017-02-22 Marco Trevisan (Treviño) <mail@3v1n0.net>
349+
350+ BackgroundSettings: use gnome-bg to generate textures with proper scaling
351+
352+ When using non-user background, we ensure that the texture size matches
353+ the screen size, and also we now generate the background using an high
354+ quality pixmap, instead of stretching a non-scaled one.
355+
356+2017-01-25 Marco Trevisan (Treviño) <mail@3v1n0.net>
357+
358+ GnomeSessionManager: add gcancellable to instance and use it for calls with temporary proxies
359+
360+ This fixes various crashes when the session manager is destroyed while a temporary proxy
361+ call is still in progress, and the callback is called afterwards.
362+
363+2017-01-09 Andrea Azzarone <azzaronea@gmail.com>
364+
365+ Keep the screen locked if rebooting with autologin.
366+
367+2017-01-09 Andrea Azzarone <azzaronea@gmail.com>
368+
369+ Round gtk scaling factor to closest integer.
370+
371+2017-01-09 Eleni Maria Stea <elenimaria.stea@canonical.com>
372+
373+ shouldn't create blur rectangles when there's no blur, skips the blur rects processing in low gfx.
374+
375+2016-11-30 Kai-Heng Feng <kai.heng.feng@canonical.com>
376+
377+ UnitySettings: If scale-factor is not set, find and set right scale for HiDPI displays.
378+
379+2016-11-30 Marco Trevisan (Treviño) <mail@3v1n0.net>
380+
381+ UnityScreen: toggle gestures recognition on lock
382+
383+2016-11-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
384+
385+ LauncherOptions: use track_obj to manage option changes
386+
387+2016-11-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
388+
389+ LockScreenController: use input monitor to get the events to switch monitor
390+
391+ In this way we can safely switch the monitor also on button click (after closing a menu)
392+ or when moving over the panel (that wasn't properly handled before).
393+
394+2016-11-11 Marco Trevisan (Treviño) <mail@3v1n0.net>
395+
396+ LockScreenController: use InputMonitor to get all the events and hide the Blank Window
397+
398+ When the blank window is shown now we use the XI2 events to figure out if we can hide it
399+ in this way it will be possible to show the screensaver when something is grabbing the
400+ screen and we don't need to grab the screen anymore to get the events.
401+
402+2016-11-07 Andrea Azzarone <azzaronea@gmail.com>
403+
404+ GnomeSession: Retrieve the session id using dbus if c2 is not set
405+
406+2016-11-07 Andrea Azzarone <azzaronea@gmail.com>
407+
408+ Correctly position the force quit dialog when scaling is different than 1.0
409+
410+2016-11-07 Andrea Azzarone <azzaronea@gmail.com>
411+
412+ Properly handle the file manager copy dialog in FileManagerLauncherIcon and in StorageLauncherIcon.
413+
414+2016-11-07 Marco Trevisan (Treviño) <mail@3v1n0.net>
415+
416+ LockScreenController: ignore icon_paths_changed signal in menumanager for Lockscreen
417+
418+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
419+
420+ PanelService: don't allow to deactivate menus if they've been opened too shortly
421+
422+ This could be caused by some random events while doing fast scrubbing.
423+
424+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
425+
426+ PanelView: scale gradient refinement properly
427+
428+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
429+
430+ MenuManager: add support for mouse trackers with triangle algorithm support
431+
432+ It allows to register pointer trackers with menu entries selection by using the triangle
433+ technique which prevents menus items from being opened on quick menu scrubbing
434+
435+ Then use use menu::Manager pointer tracker for entries activation in PanelView, LockScreenPanel and DecorationsMenuLayout
436+
437+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
438+
439+ LockScreenPanel: use InputMonitor events instead of mouse polling for menu scrubbing
440+
441+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
442+
443+ PanelView: use InputMonitor to track menu events
444+
445+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
446+
447+ DecorationsMenuLayout: use input monitor for menu scrubbing
448+
449+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
450+
451+ EdgeBarrierController: use InputMonitor to get the barrier events instead of relying on its implementation
452+
453+ Also disable the input barrier if we don't really need it
454+
455+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
456+
457+ InputMonitor: add an unity class that monitors XInput2 events and converts them to XEvent
458+
459+ Clients of this class can register event handlers, and when an interested event will hit
460+ our event filter function (that is set only if we have handlers), then we notify them
461+ with a standard XEvent struct, converted from the XIDeviceEvent cookie.
462+
463+ The nice thing of this monitor is that it always reports events, despite the X grabs.
464+
465+2016-09-06 Bileto Bot <ci-train-bot@canonical.com>
466+
467+ Releasing 7.4.0+16.04.20160906-0ubuntu1
468+
469+2016-09-06 Bileto Bot <ci-train-bot@canonical.com>
470+
471+ * SwitcherView: always disable animations when in lowgfx mode (LP:
472+ #1602784)
473+ * When locked discard damages from windows below lockscreen. (LP:
474+ #1605180)
475+ * DecoratedWindow: display unmaximize button if the window is
476+ vertically or horizontally maximized (LP: #1608480)
477+ * Make sure the switcher detail view is properly scaled. Also scale
478+ the xy_offset to make sure the switcher and launcher do not overlap.
479+ (LP: #1605256)
480+ * Close session dialog on first ESC. (LP: #1521116)
481+ * Filter out scrolling envents for FilterExpanderLabel. (LP: #1604632)
482+ * Disable menu discovery animation if MenusDiscoveryDuration is 0.
483+ (LP: #942962)
484+ * Redraw fake decorations on window resize. (LP: #940470)
485+ * Use compiz::Window::serverNext instead of compiz::Window::next in
486+ IsWindowObscured as the latter can be outdated just after
487+ scale/spread terminates. (LP: #1614116)
488+ * DecoratedWindow: avoid deferencing an invalid shadow texture ptr,
489+ and split functions (LP: #1608464)
490+ * DecoratedWindow: display unmaximize button if the window is
491+ vertically or horizontally maximized (LP: #1608480)
492+ * DecorationsForceQuitDialog: make CSS selectors work with gtk 3.20
493+ * UserAuthenticatorPam: ensure pam_handle_ is null initialized and
494+ don't proceed if not set (LP: #1611668)
495+ * DecorationStyle: set css name for Gtk 3.20
496+ * OverlayRenderer: properly decorate launcher/panel when the launcher
497+ is at the bottom (LP: #1611694)
498+ * OverlayRenderer: don't use rotated textures, just rotate them at
499+ rendering time
500+ * SpreadWidgets: add container for spread filter and new spread
501+ decorations (LP: #1283314)
502+ * WindowButton: properly partially unmaximize a window when
503+ middle/left clicking in the restore button (LP: #1616136)
504+
505+2016-09-07 Marco Trevisan (Treviño) <mail@3v1n0.net>
506+
507+ debian/changelog: no bug #1616031 is not sadly fixed here
508+
509+2016-08-19 Andrea Azzarone <azzaronea@gmail.com>
510+
511+ Use compiz::Window::serverNext instead of compiz::Window::next in IsWindowObscured as the latter can be outdated just after scale/spread terminates.
512+
513+2016-09-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
514+
515+ WindowButton: properly partially unmaximize a window when middle/left clicking in the restore button
516+
517+2016-09-01 Andrea Azzarone <azzaronea@gmail.com>
518+
519+ Redraw fake decorations on window resize.
520+
521+2016-09-01 Andrea Azzarone <azzaronea@gmail.com>
522+
523+ Disable menu discovery animation if MenusDiscoveryDuration is 0.
524+
525+2016-08-23 Marco Trevisan (Treviño) <mail@3v1n0.net>
526+
527+ debian/changelog: add bug #1616031 as fixed too
528+
529+2016-08-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
530+
531+ SpreadWidgets: add container for spread filter and new spread decorations
532+
533+ Now when windows are spread, launcher and panel aren't "naked" anymore
534+
535+2016-08-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
536+
537+ OverlayRenderer: don't use rotated textures, just rotate them at rendering time
538+
539+ So removing duplicated data, since we can do this at code level
540+
541+2016-08-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
542+
543+ OverlayRenderer: properly decorate launcher/panel when the launcher is at the bottom
544+
545+2016-08-17 Andrea Azzarone <azzaronea@gmail.com>
546+
547+ Filter out scrolling envents for FilterExpanderLabel.
548+
549+2016-08-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
550+
551+ DecorationStyle: set css name for Gtk 3.20
552+
553+2016-08-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
554+
555+ UserAuthenticatorPam: ensure pam_handle_ is null initialized and don't proceed if not set
556+
557+2016-08-17 Andrea Azzarone <azzaronea@gmail.com>
558+
559+ Close session dialog on first ESC.
560+
561+2016-08-17 Andrea Azzarone <azzaronea@gmail.com>
562+
563+ Make sure the switcher detail view is properly scaled. Also scale the xy_offset to make sure the switcher and launcher do not overlap.
564+
565+2016-08-06 Marco Trevisan (Treviño) <mail@3v1n0.net>
566+
567+ DecorationsForceQuitDialog: make CSS selectors work with gtk 3.20
568+
569+2016-08-06 Marco Trevisan (Treviño) <mail@3v1n0.net>
570+
571+ DecoratedWindow: display unmaximize button if the window is vertically or horizontally maximized
572+
573+2016-08-06 Marco Trevisan (Treviño) <mail@3v1n0.net>
574+
575+ DecoratedWindow: avoid deferencing an invalid shadow texture ptr, and split functions
576+
577+2016-07-27 Andrea Azzarone <azzaronea@gmail.com>
578+
579+ When locked discard damages from windows below lockscreen.
580+
581+2016-07-14 Marco Trevisan (Treviño) <mail@3v1n0.net>
582+
583+ SwitcherView: always disable animations when in lowgfx mode
584+
585+2016-08-01 Bileto Bot <ci-train-bot@canonical.com>
586+
587+ Releasing 7.4.0+16.04.20160801.2-0ubuntu1
588+
589+2016-08-01 Bileto Bot <ci-train-bot@canonical.com>
590+
591+ * FileManagerLauncherIcon: Don't trust the Quirk::VISIBLE in the ctor.
592+ (LP: #1599133)
593+ * [TrashLauncherIcon] Create GFileMonitor in an idle to avoid blocking
594+ calls. (LP: #1602720)
595+ * [LockSceen] Remove numlock warning. (LP: #1526322)
596+ * Make sure initiate and terminate callbacks are not empty before
597+ calling them. (LP: #1605012)
598+ * Properly destroy close_button_ to properly disconnect lambda. (LP:
599+ #1605010)
600+ * Use the standard notification-device-eject in the "device eject"
601+ notification. This allows us to scale it properly on high-dpi
602+ setups. (LP: #1605231)
603+ * Add tools to enforce unityshell plugin for the current profile and
604+ add "move" and "resize" plugins as requirements. (LP: #1506023, LP:
605+ #1605007, LP: #1604657)
606+ * Unity script: use result from unity_support_test to check the right
607+ COMPIZ_CONFIG_PROFILE to use (LP: #1602377)
608+ * LockScreenAcceleratorController: ensure callbacks are valid before
609+ calling them (LP: #1605012)
610+ * DecoratedWindow: Added shadows for shaped windows (LP: 1608418)
611+ * DecoratedWindow: Cleanup shadows for shaped windows, reduce
612+ recomputation (LP: #1608418)
613+ * UnityWindowView: don't try to deference close_button_ if its' null
614+
615+2016-08-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
616+
617+ DecoratedWindow: split shadow quads computation based on shaped window state
618+
619+ And reset textures on change
620+
621+2016-08-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
622+
623+ CompizUtils: add add flag to decoration utils for shaped windows
624+
625+2016-08-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
626+
627+ DecoratedWindow: avoid deferencing an invalid shadow texture ptr, and split functions
628+
629+2016-08-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
630+
631+ UnityWindowView: don't try to deference close_button_ if its' null
632+
633+ It could happen when manually triggering a signal
634+
635+2016-08-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
636+
637+ DecoratedWindow: Cleanup shadows for shaped windows, reduce recomputation
638+
639+2016-07-27 Eleni Maria Stea <elenimaria.stea@canonical.com>
640+
641+ DecoratedWindow: Added shadows for shaped windows
642+
643+2016-07-27 Marco Trevisan (Treviño) <mail@3v1n0.net>
644+
645+ LockScreenAcceleratorController: ensure callbacks are valid before calling them
646+
647+2016-08-01 Marco Trevisan (Treviño) <mail@3v1n0.net>
648+
649+ Add tools to enforce unityshell plugin for the current profile and add "move" and "resize" plugins as requirements.
650+
651+2016-07-27 Andrea Azzarone <azzaronea@gmail.com>
652+
653+ Use the standard notification-device-eject in the "device eject" notification. This allows us to scale it properly on high-dpi setups.
654+
655+2016-07-27 Andrea Azzarone <azzaronea@gmail.com>
656+
657+ Properly destroy close_button_ to properly disconnect lambda.
658+
659+2016-07-27 Andrea Azzarone <azzaronea@gmail.com>
660+
661+ Make sure initiate and terminate callbacks are not empty before calling them.
662+
663+2016-07-27 Andrea Azzarone <azzaronea@gmail.com>
664+
665+ [LockSceen] Remove numlock warning.
666+
667+2016-07-14 Marco Trevisan (Treviño) <mail@3v1n0.net>
668+
669+ Unity script: use result from unity_support_test to check the right COMPIZ_CONFIG_PROFILE to use
670+
671+2016-07-14 Andrea Azzarone <azzaronea@gmail.com>
672+
673+ [TrashLauncherIcon] Create GFileMonitor in an idle to avoid blocking calls.
674+
675+2016-07-14 Andrea Azzarone <azzaronea@gmail.com>
676+
677+ FileManagerLauncherIcon: Don't trust the Quirk::VISIBLE in the ctor.
678+
679+ Make sure a window is valid/mapped before considering it a manager storage window.
680+
681+2016-07-15 Bileto Bot <ci-train-bot@canonical.com>
682+
683+ Releasing 7.4.0+16.04.20160715-0ubuntu1
684+
685+2016-07-15 Bileto Bot <ci-train-bot@canonical.com>
686+
687+ * PanelView: Don't draw it if the geo doesn't intersect the monitor
688+ geo (as in ezoom)
689+ * speeds up the showdesktop plugin in lowgfx mode
690+ * Add whitelist for auto-repated keys. (LP: #1586491)
691+ * Fix scale window activation if in show desktop mode. (LP: #1582056)
692+ * Order matters in the rendering. Draw launcher shadow after the
693+ background in all cases. (LP: #1586374)
694+ * Fallback to volume name if no other identifier is available. (LP:
695+ #1103593)
696+ * Do not trigger screensaver on session inactive. (LP: #1587507)
697+ * Use SwitcherController::SetDetail instead of detail=... (LP:
698+ #1587618)
699+ * UnitySettings: Add an option to enable/disable pam account checking.
700+ (LP: #1460649)
701+ * Lockscreen: Make sure warning and errors are properly shown to the
702+ user (LP: #1593696)
703+ * Add missing header to fix compilation error with -Duse_pch=OFF.
704+ * Filter out fullscreen window in show desktop mode. (LP: #1597706)
705+ * Make sure file manager icon is not removed when unpinned. (LP:
706+ #1578792)
707+ * Properly calculate the intersection geometry in PanelView::Draw.
708+ This is needed to properly call SyncGeometries and to avoid problems
709+ such as lp:1595698. (LP: #1595698)
710+ * UnitySettings: Add dconf keys for disabling multitouch gestures (LP:
711+ #1589520)
712+ * LockScreenAcceleratorController: use key::Grabber to handle allowed
713+ bindings (LP: #1438754)
714+ * LockScreenAcceleratorController: check if a setting key is available
715+ instead of crashing
716+ * ApplicationLauncherIcon: ensure quirks are properly set on icon
717+ initialization
718+ * Views: Toggle animators durations based on low-gfx setting (LP:
719+ #1598770)
720+ * unity7.conf: use different compiz profile based on
721+ unity_support_test result (LP: #1598770)
722+
723+2016-07-05 Marco Trevisan (Treviño) <mail@3v1n0.net>
724+
725+ unity7.conf: use different compiz profile based on unity_support_test result
726+
727+2016-07-05 Marco Trevisan (Treviño) <mail@3v1n0.net>
728+
729+ Views: Toggle animators durations based on low-gfx setting
730+
731+ Disable animations based on low_gfx setting (now ported to nux::Property)
732+
733+2016-07-05 Eleni Maria Stea <elenimaria.stea@canonical.com>
734+
735+ speeds up the showdesktop plugin in lowgfx mode
736+
737+2016-07-05 Marco Trevisan (Treviño) <mail@3v1n0.net>
738+
739+ ApplicationLauncherIcon: ensure quirks are properly set on icon initialization
740+
741+2016-07-05 Marco Trevisan (Treviño) <mail@3v1n0.net>
742+
743+ LockScreenAcceleratorController: check if a setting key is available instead of crashing
744+
745+2016-07-05 Andrea Azzarone <azzaronea@gmail.com>
746+
747+ Properly calculate the intersection geometry in PanelView::Draw. This is needed to properly call SyncGeometries and to avoid problems such as lp:1595698.
748+
749+2016-07-05 Andrea Azzarone <azzaronea@gmail.com>
750+
751+ Make sure file manager icon is not removed when unpinned.
752+
753+2016-06-30 Andrea Azzarone <azzaronea@gmail.com>
754+
755+ Filter out fullscreen window in show desktop mode.
756+
757+2016-06-30 Andrea Azzarone <azzaronea@gmail.com>
758+
759+ Add missing header to fix compilation error with -Duse_pch=OFF.
760+
761+2016-06-29 Marco Trevisan (Treviño) <mail@3v1n0.net>
762+
763+ debian/changelog: fix author
764+
765+2016-06-28 Andrea Azzarone <azzaronea@gmail.com>
766+
767+ Lockscreen: Make sure warning and errors are properly shown to the user
768+
769+2016-06-28 Andrea Azzarone <azzaronea@gmail.com>
770+
771+ UnitySettings: Add an option to enable/disable pam account checking.
772+
773+2016-06-21 Marco Trevisan (Treviño) <mail@3v1n0.net>
774+
775+ LockScreenAcceleratorController: use key::Grabber to handle allowed bindings This makes U-S-D to handle key events, without having to add some extra custom code inside the lockscreen. It's all just about whitelisting the wanted values.
776+
777+2016-06-06 Alberto Milone <alberto.milone@canonical.com>
778+
779+ UnitySettings: Add dconf keys for disabling multitouch gestures
780+
781+2016-06-06 Andrea Azzarone <azzaronea@gmail.com>
782+
783+ Use SwitcherController::SetDetail instead of detail=...
784+
785+2016-06-06 Andrea Azzarone <azzaronea@gmail.com>
786+
787+ Do not trigger screensaver on session inactive.
788+
789+2016-06-02 Andrea Azzarone <azzaronea@gmail.com>
790+
791+ Fallback to volume name if no other identifier is available.
792+
793+2016-06-02 Andrea Azzarone <azzaronea@gmail.com>
794+
795+ Order matters in the rendering. Draw launcher shadow after the background in all cases.
796+
797+2016-06-02 Andrea Azzarone <azzaronea@gmail.com>
798+
799+ Fix scale window activation if in show desktop mode.
800+
801+2016-06-02 Andrea Azzarone <azzaronea@gmail.com>
802+
803+ Add whitelist for auto-repated keys.
804+
805+2016-05-25 Eleni Maria Stea <elenimaria.stea@canonical.com>
806+
807+ PanelView: Don't draw it if the geo doesn't intersect the monitor geo (as in ezoom) added check to see if the panel geometry intersects the geometry of the monitor the panel belongs to. If there's no intersection there's no need to draw it (return). If there is intersection we should only draw the intersection area (clip the non visible parts).
808+
809+2016-05-26 CI Train Bot <ci-train-bot@canonical.com>
810+
811+ Releasing 7.4.0+16.04.20160526.1-0ubuntu1
812+
813+2016-05-26 handsome_feng <445865575@qq.com>
814+
815+ Releasing unity SRU1 for Xenial Fixes: #1525685, #1553165, #1562348, #1562847, #1570843, #1572241, #1573897, #1574689, #1575527, #1580211, #1580212
816+
817+2016-05-26 Marco Trevisan (Treviño) <mail@3v1n0.net>
818+
819+ debian/changelog: set proper version manually
820+
821+2016-05-17 handsome_feng <445865575@qq.com>
822+
823+ Change the x_offset of expo when launcher position changed.
824+
825+2016-05-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
826+
827+ DashStyle: ensure LazyLoadTexture disconnects from signals on destruction
828+
829+2016-05-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
830+
831+ SwitcherController: don't try to get a window from empty selections
832+
833+2016-05-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
834+
835+ UnityScreen, UnityWindow: cleanup a little the code, and ensure overridden CompositeWindow functions get actually called There would be still a lot to do in this scenario, but still a start...F
836+
837+2016-05-17 Marco Trevisan (Treviño) <mail@3v1n0.net>
838+
839+ SwitcherView: close the mouse-selected application on middle-click
840+
841+2016-05-17 Andrea Azzarone <azzaronea@gmail.com>
842+
843+ Do not reset the shortcut for icons that have their own shortcut.
844+
845+2016-05-17 Andrea Azzarone <azzaronea@gmail.com>
846+
847+ Fallback to background class in case no background is specified for title bars and top panel.
848+
849+2016-05-17 Andrea Azzarone <azzaronea@gmail.com>
850+
851+ Properly calculate array indexes to avoid crashes.
852+
853+2016-05-17 Andrea Azzarone <azzaronea@gmail.com>
854+
855+ GnomeKeyGrabber: do not activate an action if it's a repeated one.
856+
857+2016-05-17 Andrea Azzarone <azzaronea@gmail.com>
858+
859+ Update ExpoLauncherIcon in case the quicklist is used to switch vp.
860+
861+2016-05-17 Andrea Azzarone <azzaronea@gmail.com>
862+
863+ Properly remove SoftwareCenterLauncherIcon in case of failure.
864+
865+2016-05-15 Marco Trevisan (Treviño) <mail@3v1n0.net>
866+
867+ Releasing Unity 7.4.0
868+
869 2016-04-15 CI Train Bot <ci-train-bot@canonical.com>
870
871 Releasing 7.4.0+16.04.20160415-0ubuntu1
872
873=== modified file 'UnityCore/CMakeLists.txt'
874--- UnityCore/CMakeLists.txt 2016-02-09 01:26:22 +0000
875+++ UnityCore/CMakeLists.txt 2017-12-01 18:43:57 +0000
876@@ -145,7 +145,8 @@
877 set_target_properties(${CORE_LIB_NAME} PROPERTIES
878 VERSION ${CORE_LIB_LT_CURRENT}.${CORE_LIB_LT_REV}.${CORE_LIB_LT_AGE}
879 SOVERSION ${CORE_LIB_LT_CURRENT}
880- INSTALL_RPATH "${PRIVATE_CORE_DEPS_LIBRARY_DIRS}")
881+ INSTALL_RPATH "${PRIVATE_CORE_DEPS_LIBRARY_DIRS}"
882+ BUILD_WITH_INSTALL_RPATH TRUE)
883 add_pch(pch/unitycore_pch.hh ${CORE_LIB_NAME})
884
885 install (TARGETS ${CORE_LIB_NAME}
886
887=== modified file 'UnityCore/DBusIndicators.cpp'
888--- UnityCore/DBusIndicators.cpp 2016-02-09 01:26:22 +0000
889+++ UnityCore/DBusIndicators.cpp 2017-12-01 18:43:57 +0000
890@@ -123,7 +123,7 @@
891
892 // This is obviously hackish, but this part of the code is mostly hackish...
893 // Let's attempt to run it from where we expect it to be
894- std::string cmd = UNITYLIBDIR"/" + std::string("unity-panel-service");
895+ std::string cmd = UNITY_LIBDIR"/" + std::string("unity-panel-service");
896 LOG_WARN(logger) << "Couldn't load panel from installed services, "
897 << "so trying to load panel from known location: " << cmd;
898
899
900=== modified file 'UnityCore/GLibDBusProxy.cpp'
901--- UnityCore/GLibDBusProxy.cpp 2015-11-24 16:40:03 +0000
902+++ UnityCore/GLibDBusProxy.cpp 2017-12-01 18:43:57 +0000
903@@ -609,7 +609,7 @@
904 return nullptr;
905 }
906
907-void DBusProxy::GetProperty(std::string const& name, ReplyCallback const& callback)
908+void DBusProxy::GetProperty(std::string const& name, ReplyCallback const& callback, GCancellable *cancellable)
909 {
910 if (!callback)
911 return;
912@@ -620,7 +620,8 @@
913 pimpl->name_.c_str(), pimpl->object_path_.c_str(),
914 "org.freedesktop.DBus.Properties",
915 "Get", g_variant_new ("(ss)", pimpl->interface_name_.c_str(), name.c_str()),
916- G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, -1, pimpl->cancellable_,
917+ G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE, -1,
918+ cancellable ? cancellable : pimpl->cancellable_,
919 [] (GObject *source, GAsyncResult *res, gpointer user_data) {
920 glib::Error err;
921 std::unique_ptr<ReplyCallback> callback(static_cast<ReplyCallback*>(user_data));
922@@ -641,15 +642,16 @@
923 else
924 {
925 // This will get the property as soon as we have a connection
926+ glib::Object<GCancellable> canc(cancellable, AddRef());
927 auto conn = std::make_shared<sigc::connection>();
928- *conn = connected.connect([this, conn, name, callback] {
929- GetProperty(name, callback);
930+ *conn = connected.connect([this, conn, name, callback, canc] {
931+ GetProperty(name, callback, canc);
932 conn->disconnect();
933 });
934 }
935 }
936
937-void DBusProxy::SetProperty(std::string const& name, GVariant* value)
938+void DBusProxy::SetProperty(std::string const& name, GVariant* value, GCancellable *cancellable)
939 {
940 if (IsConnected())
941 {
942@@ -657,7 +659,8 @@
943 pimpl->name_.c_str(), pimpl->object_path_.c_str(),
944 "org.freedesktop.DBus.Properties",
945 "Set", g_variant_new ("(ssv)", pimpl->interface_name_.c_str(), name.c_str(), value),
946- nullptr, G_DBUS_CALL_FLAGS_NONE, -1, pimpl->cancellable_,
947+ nullptr, G_DBUS_CALL_FLAGS_NONE, -1,
948+ cancellable ? cancellable : pimpl->cancellable_,
949 [] (GObject *source, GAsyncResult *res, gpointer user_data) {
950 glib::Error err;
951 Variant result(g_dbus_connection_call_finish(G_DBUS_CONNECTION(source), res, &err), StealRef());
952@@ -670,9 +673,10 @@
953 else
954 {
955 // This will set the property as soon as we have a connection
956+ glib::Object<GCancellable> canc(cancellable, AddRef());
957 auto conn = std::make_shared<sigc::connection>();
958- *conn = connected.connect([this, conn, name, value] {
959- SetProperty(name, value);
960+ *conn = connected.connect([this, conn, name, value, canc] {
961+ SetProperty(name, value, canc);
962 conn->disconnect();
963 });
964 }
965
966=== modified file 'UnityCore/GLibDBusProxy.h'
967--- UnityCore/GLibDBusProxy.h 2014-10-10 11:35:40 +0000
968+++ UnityCore/GLibDBusProxy.h 2017-12-01 18:43:57 +0000
969@@ -74,8 +74,8 @@
970 bool IsConnected() const;
971
972 Variant GetProperty(std::string const& property_name) const;
973- void GetProperty(std::string const& property_name, ReplyCallback const&);
974- void SetProperty(std::string const& property_name, GVariant* value);
975+ void GetProperty(std::string const& property_name, ReplyCallback const&, GCancellable *cancellable = nullptr);
976+ void SetProperty(std::string const& property_name, GVariant* value, GCancellable *cancellable = nullptr);
977
978 void Connect(std::string const& signal_name, ReplyCallback const& callback);
979 void DisconnectSignal(std::string const& signal_name = "");
980
981=== modified file 'UnityCore/GLibSignal-inl.h'
982--- UnityCore/GLibSignal-inl.h 2014-10-15 05:16:46 +0000
983+++ UnityCore/GLibSignal-inl.h 2017-12-01 18:43:57 +0000
984@@ -34,11 +34,11 @@
985 }
986
987 template <typename R, typename G, typename... Ts>
988-void Signal<R, G, Ts...>::Connect(G object, std::string const& signal_name,
989+bool Signal<R, G, Ts...>::Connect(G object, std::string const& signal_name,
990 SignalCallback const& callback)
991 {
992 if (!callback || !G_IS_OBJECT(object) || signal_name.empty())
993- return;
994+ return false;
995
996 Disconnect();
997
998@@ -47,6 +47,8 @@
999 callback_ = callback;
1000 connection_id_ = g_signal_connect(object_, signal_name.c_str(), G_CALLBACK(Callback), this);
1001 g_object_add_weak_pointer(object_, reinterpret_cast<gpointer*>(&object_));
1002+
1003+ return true;
1004 }
1005
1006 template <typename R, typename G, typename... Ts>
1007@@ -59,6 +61,12 @@
1008 return R();
1009 }
1010
1011+template <typename R, typename G, typename... Ts>
1012+SignalBase::Ptr SignalManager::Add(G object, std::string const& signal_name, typename Signal<R, G, Ts...>::SignalCallback const& callback)
1013+{
1014+ return Add(std::make_shared<Signal<R, G, Ts...>>(object, signal_name, callback));
1015+}
1016+
1017 }
1018 }
1019
1020
1021=== modified file 'UnityCore/GLibSignal.cpp'
1022--- UnityCore/GLibSignal.cpp 2012-08-15 16:58:14 +0000
1023+++ UnityCore/GLibSignal.cpp 2017-12-01 18:43:57 +0000
1024@@ -35,16 +35,46 @@
1025 Disconnect();
1026 }
1027
1028-void SignalBase::Disconnect()
1029+bool SignalBase::Disconnect()
1030 {
1031+ bool disconnected = false;
1032+
1033 if (connection_id_ && G_IS_OBJECT(object_))
1034 {
1035 g_signal_handler_disconnect(object_, connection_id_);
1036 g_object_remove_weak_pointer(object_, reinterpret_cast<gpointer*>(&object_));
1037+ disconnected = true;
1038 }
1039
1040 object_ = nullptr;
1041 connection_id_ = 0;
1042+ return disconnected;
1043+}
1044+
1045+bool SignalBase::Block() const
1046+{
1047+ bool blocked = false;
1048+
1049+ if (connection_id_ && G_IS_OBJECT(object_))
1050+ {
1051+ g_signal_handler_block(object_, connection_id_);
1052+ blocked = true;
1053+ }
1054+
1055+ return blocked;
1056+}
1057+
1058+bool SignalBase::Unblock() const
1059+{
1060+ bool unblocked = false;
1061+
1062+ if (connection_id_ && G_IS_OBJECT(object_))
1063+ {
1064+ g_signal_handler_unblock(object_, connection_id_);
1065+ unblocked = true;
1066+ }
1067+
1068+ return unblocked;
1069 }
1070
1071 GObject* SignalBase::object() const
1072@@ -75,57 +105,73 @@
1073 // was too messy to try and write a copy constructor/operator that would steal
1074 // from "other" and make the new one the owner. Not only did it create
1075 // opportunity for random bugs, it also made the API bad.
1076-void SignalManager::Add(SignalBase* signal)
1077+SignalBase::Ptr SignalManager::Add(SignalBase* signal)
1078 {
1079- Add(SignalBase::Ptr(signal));
1080+ return Add(SignalBase::Ptr(signal));
1081 }
1082
1083-void SignalManager::Add(SignalBase::Ptr const& signal)
1084+SignalBase::Ptr SignalManager::Add(SignalBase::Ptr const& signal)
1085 {
1086 connections_.push_back(signal);
1087 g_object_weak_ref(signal->object(), (GWeakNotify)&OnObjectDestroyed, this);
1088-}
1089-
1090-void SignalManager::OnObjectDestroyed(SignalManager* self, GObject* old_obj)
1091-{
1092- for (auto it = self->connections_.begin(); it != self->connections_.end();)
1093- {
1094- auto const& signal = *it;
1095-
1096- // When an object has been destroyed, the signal member is nullified,
1097- // so at this point we can be sure that removing signal with a null object,
1098- // means removing invalid signals.
1099- if (!signal->object())
1100- {
1101- it = self->connections_.erase(it);
1102- }
1103- else
1104- {
1105- ++it;
1106- }
1107- }
1108+ return signal;
1109 }
1110
1111 // This uses void* to keep in line with the g_signal* functions
1112 // (it allows you to pass in a GObject without casting up).
1113-void SignalManager::Disconnect(void* object, std::string const& signal_name)
1114+bool SignalManager::ForeachMatchedSignal(void* object, std::string const& signal_name, std::function<void(SignalBase::Ptr const&)> action, bool erase_after)
1115 {
1116- bool all_signals = signal_name.empty();
1117+ bool action_performed = false;
1118+ bool all_objects = (object == reinterpret_cast<void*>(std::numeric_limits<uintptr_t>::max()));
1119+ bool all_signals = all_objects || signal_name.empty();
1120
1121 for (auto it = connections_.begin(); it != connections_.end();)
1122 {
1123 auto const& signal = *it;
1124
1125- if (signal->object() == object && (all_signals || signal->name() == signal_name))
1126+ if ((all_objects || signal->object() == object) && (all_signals || signal->name() == signal_name))
1127 {
1128- g_object_weak_unref(signal->object(), (GWeakNotify)&OnObjectDestroyed, this);
1129- it = connections_.erase(it);
1130+ if (action)
1131+ {
1132+ action_performed = true;
1133+ action(signal);
1134+ }
1135+
1136+ it = erase_after ? connections_.erase(it) : ++it;
1137 }
1138 else
1139 {
1140 ++it;
1141 }
1142 }
1143+
1144+ return action_performed;
1145+}
1146+
1147+void SignalManager::OnObjectDestroyed(SignalManager* self, GObject* old_obj)
1148+{
1149+ self->ForeachMatchedSignal(nullptr, "", nullptr, /*erase_after*/ true);
1150+}
1151+
1152+bool SignalManager::Block(void* object, std::string const& signal_name)
1153+{
1154+ return ForeachMatchedSignal(object, signal_name, [this] (SignalBase::Ptr const& signal) {
1155+ signal->Block();
1156+ });
1157+}
1158+
1159+bool SignalManager::Unblock(void* object, std::string const& signal_name)
1160+{
1161+ return ForeachMatchedSignal(object, signal_name, [this] (SignalBase::Ptr const& signal) {
1162+ signal->Unblock();
1163+ });
1164+}
1165+
1166+bool SignalManager::Disconnect(void* object, std::string const& signal_name)
1167+{
1168+ return ForeachMatchedSignal(object, signal_name, [this] (SignalBase::Ptr const& signal) {
1169+ g_object_weak_unref(signal->object(), (GWeakNotify)&OnObjectDestroyed, this);
1170+ }, true);
1171 }
1172
1173 }
1174
1175=== modified file 'UnityCore/GLibSignal.h'
1176--- UnityCore/GLibSignal.h 2012-08-15 16:58:14 +0000
1177+++ UnityCore/GLibSignal.h 2017-12-01 18:43:57 +0000
1178@@ -21,6 +21,7 @@
1179 #ifndef UNITY_GLIB_SIGNAL_H
1180 #define UNITY_GLIB_SIGNAL_H
1181
1182+#include <limits>
1183 #include <string>
1184 #include <vector>
1185 #include <memory>
1186@@ -39,7 +40,10 @@
1187
1188 virtual ~SignalBase();
1189
1190- void Disconnect();
1191+ bool Disconnect();
1192+
1193+ bool Block() const;
1194+ bool Unblock() const;
1195
1196 GObject* object() const;
1197 std::string const& name() const;
1198@@ -71,9 +75,9 @@
1199 #endif
1200
1201 inline Signal() {};
1202- inline Signal(G object, std::string const& signal_name, SignalCallback const& callback);
1203+ inline Signal(G object, std::string const& signal_name, SignalCallback const&);
1204
1205- inline void Connect(G Object, std::string const& signal_name, SignalCallback const& callback);
1206+ inline bool Connect(G Object, std::string const& signal_name, SignalCallback const&);
1207
1208 private:
1209 static R Callback(G Object, Ts... vs, Signal* self);
1210@@ -86,17 +90,18 @@
1211 public:
1212 SignalManager();
1213 ~SignalManager();
1214- void Add(SignalBase* signal);
1215- void Add(SignalBase::Ptr const& signal);
1216+ SignalBase::Ptr Add(SignalBase* signal);
1217+ SignalBase::Ptr Add(SignalBase::Ptr const& signal);
1218 template <typename R, typename G, typename... Ts>
1219- void Add(G object, std::string const& signal_name, typename Signal<R, G, Ts...>::SignalCallback const& callback)
1220- {
1221- Add(std::make_shared<Signal<R, G, Ts...>>(object, signal_name, callback));
1222- }
1223-
1224- void Disconnect(void* object, std::string const& signal_name = "");
1225+ SignalBase::Ptr Add(G object, std::string const& signal_name, typename Signal<R, G, Ts...>::SignalCallback const&);
1226+
1227+ bool Block(void* object = (void*) std::numeric_limits<uintptr_t>::max(), std::string const& signal_name = "");
1228+ bool Unblock(void* object = (void*) std::numeric_limits<uintptr_t>::max(), std::string const& signal_name = "");
1229+
1230+ bool Disconnect(void* object, std::string const& signal_name = "");
1231
1232 private:
1233+ bool ForeachMatchedSignal(void* object, std::string const& signal_name, std::function<void(SignalBase::Ptr const&)> action, bool erase_after = false);
1234 static void OnObjectDestroyed(SignalManager* self, GObject* old_obj);
1235
1236 protected:
1237
1238=== modified file 'UnityCore/GnomeSessionManager.cpp'
1239--- UnityCore/GnomeSessionManager.cpp 2016-06-06 14:28:04 +0000
1240+++ UnityCore/GnomeSessionManager.cpp 2017-12-01 18:43:57 +0000
1241@@ -77,6 +77,8 @@
1242
1243 const std::string GNOME_LOCKDOWN_OPTIONS = "org.gnome.desktop.lockdown";
1244 const std::string DISABLE_LOCKSCREEN_KEY = "disable-lock-screen";
1245+
1246+GDBusProxyFlags DEFAULT_CALL_FLAGS = static_cast<GDBusProxyFlags>(G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES|G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS|G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START_AT_CONSTRUCTION);
1247 }
1248
1249 GnomeManager::Impl::Impl(GnomeManager* manager, bool test_mode)
1250@@ -99,38 +101,45 @@
1251 });
1252
1253 {
1254- const char* session_id = test_mode_ ? "id0" : g_getenv("XDG_SESSION_ID");
1255-
1256- login_proxy_ = std::make_shared<glib::DBusProxy>(test_mode_ ? testing::DBUS_NAME : "org.freedesktop.login1",
1257- "/org/freedesktop/login1/session/" + glib::gchar_to_string(session_id),
1258- "org.freedesktop.login1.Session",
1259- test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
1260- G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES);
1261-
1262- login_proxy_->Connect("Lock", [this](GVariant*){
1263- manager_->PromptLockScreen();
1264- });
1265-
1266- login_proxy_->Connect("Unlock", [this](GVariant*){
1267- manager_->unlock_requested.emit();
1268- });
1269-
1270- login_proxy_->ConnectProperty("Active", [this] (GVariant* variant) {
1271- bool active = glib::Variant(variant).GetBool();
1272- manager_->is_session_active.changed.emit(active);
1273- if (active)
1274- manager_->screensaver_requested.emit(false);
1275- });
1276-
1277- manager_->is_session_active.SetGetterFunction([this] {
1278- return login_proxy_->GetProperty("Active").GetBool();
1279- });
1280+ std::string session_id = test_mode_ ? "id0" : glib::gchar_to_string(g_getenv("XDG_SESSION_ID"));
1281+
1282+ if (!session_id.empty())
1283+ {
1284+ CallLogindMethod("GetSession", g_variant_new("(s)", session_id.c_str()), [this, session_id] (GVariant* variant, glib::Error const& err) {
1285+ std::string session_path;
1286+
1287+ if (!err && variant)
1288+ session_path = glib::Variant(variant).GetObjectPath();
1289+
1290+ if (session_path.empty())
1291+ session_path = "/org/freedesktop/login1/session/" + session_id;
1292+
1293+ SetupLogin1Proxy(session_path);
1294+ });
1295+ }
1296+ else
1297+ {
1298+ auto proxy = std::make_shared<glib::DBusProxy>("org.freedesktop.login1",
1299+ "/org/freedesktop/login1/user/self",
1300+ "org.freedesktop.login1.User",
1301+ G_BUS_TYPE_SYSTEM);
1302+
1303+ proxy->GetProperty("Display", [this, proxy] (GVariant *variant) {
1304+ if (!variant || g_variant_n_children(variant) < 2)
1305+ return;
1306+
1307+ glib::Variant tmp(g_variant_get_child_value(variant, 1), glib::StealRef());
1308+ SetupLogin1Proxy(tmp.GetObjectPath());
1309+ }, cancellable_);
1310+ }
1311 }
1312
1313 {
1314 presence_proxy_ = std::make_shared<glib::DBusProxy>(test_mode_ ? testing::DBUS_NAME : "org.gnome.SessionManager",
1315 "/org/gnome/SessionManager/Presence",
1316- "org.gnome.SessionManager.Presence");
1317+ "org.gnome.SessionManager.Presence",
1318+ G_BUS_TYPE_SESSION,
1319+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES);
1320
1321 presence_proxy_->Connect("StatusChanged", [this](GVariant* variant) {
1322 enum class PresenceStatus : unsigned
1323@@ -166,7 +175,8 @@
1324 dm_seat_proxy_ = std::make_shared<glib::DBusProxy>("org.freedesktop.Accounts",
1325 ("/org/freedesktop/Accounts/User" + std::to_string(getuid())).c_str(),
1326 "org.freedesktop.Accounts.User",
1327- G_BUS_TYPE_SYSTEM);
1328+ G_BUS_TYPE_SYSTEM,
1329+ G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS);
1330 }
1331
1332 CallLogindMethod("CanHibernate", nullptr, [this] (GVariant* variant, glib::Error const& err) {
1333@@ -216,6 +226,34 @@
1334 ClosedDialog();
1335 }
1336
1337+void GnomeManager::Impl::SetupLogin1Proxy(std::string const& session_path)
1338+{
1339+ login_proxy_ = std::make_shared<glib::DBusProxy>(test_mode_ ? testing::DBUS_NAME : "org.freedesktop.login1",
1340+ session_path,
1341+ "org.freedesktop.login1.Session",
1342+ test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
1343+ G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES);
1344+
1345+ login_proxy_->Connect("Lock", [this](GVariant*){
1346+ manager_->PromptLockScreen();
1347+ });
1348+
1349+ login_proxy_->Connect("Unlock", [this](GVariant*){
1350+ manager_->unlock_requested.emit();
1351+ });
1352+
1353+ login_proxy_->ConnectProperty("Active", [this] (GVariant* variant) {
1354+ bool active = glib::Variant(variant).GetBool();
1355+ manager_->is_session_active.changed.emit(active);
1356+ if (active)
1357+ manager_->screensaver_requested.emit(false);
1358+ });
1359+
1360+ manager_->is_session_active.SetGetterFunction([this] {
1361+ return login_proxy_->GetProperty("Active").GetBool();
1362+ });
1363+}
1364+
1365 bool GnomeManager::Impl::InteractiveMode()
1366 {
1367 bool schema_found = false;
1368@@ -374,7 +412,8 @@
1369 glib::DBusProxy::CallFinishedCallback const& cb)
1370 {
1371 auto proxy = std::make_shared<glib::DBusProxy>(test_mode_ ? testing::DBUS_NAME : "org.gnome.SessionManager",
1372- "/org/gnome/SessionManager", "org.gnome.SessionManager");
1373+ "/org/gnome/SessionManager", "org.gnome.SessionManager",
1374+ G_BUS_TYPE_SESSION, DEFAULT_CALL_FLAGS);
1375
1376 // By passing the proxy to the lambda we ensure that it will be smartly handled
1377 proxy->CallBegin(method, parameters, [proxy, cb] (GVariant* ret, glib::Error const& e) {
1378@@ -385,14 +424,15 @@
1379
1380 if (cb)
1381 cb(ret, e);
1382- });
1383+ }, cancellable_);
1384 }
1385
1386 void GnomeManager::Impl::CallUPowerMethod(std::string const& method, glib::DBusProxy::ReplyCallback const& cb)
1387 {
1388 auto proxy = std::make_shared<glib::DBusProxy>(test_mode_ ? testing::DBUS_NAME : "org.freedesktop.UPower",
1389 "/org/freedesktop/UPower", "org.freedesktop.UPower",
1390- test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM);
1391+ test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
1392+ DEFAULT_CALL_FLAGS);
1393
1394 proxy->CallBegin(method, nullptr, [proxy, cb] (GVariant *ret, glib::Error const& e) {
1395 if (e)
1396@@ -403,7 +443,7 @@
1397 {
1398 cb(ret);
1399 }
1400- });
1401+ }, cancellable_);
1402 }
1403
1404 void GnomeManager::Impl::CallLogindMethod(std::string const& method, GVariant* parameters, glib::DBusProxy::CallFinishedCallback const& cb)
1405@@ -411,7 +451,8 @@
1406 auto proxy = std::make_shared<glib::DBusProxy>(test_mode_ ? testing::DBUS_NAME : "org.freedesktop.login1",
1407 "/org/freedesktop/login1",
1408 "org.freedesktop.login1.Manager",
1409- test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM);
1410+ test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
1411+ DEFAULT_CALL_FLAGS);
1412
1413 // By passing the proxy to the lambda we ensure that it will be smartly handled
1414 proxy->CallBegin(method, parameters, [proxy, cb, method] (GVariant* ret, glib::Error const& e) {
1415@@ -424,7 +465,7 @@
1416 {
1417 cb(ret, e);
1418 }
1419- });
1420+ }, cancellable_);
1421 }
1422
1423 void GnomeManager::Impl::CallConsoleKitMethod(std::string const& method, GVariant* parameters)
1424@@ -432,7 +473,8 @@
1425 auto proxy = std::make_shared<glib::DBusProxy>(test_mode_ ? testing::DBUS_NAME : "org.freedesktop.ConsoleKit",
1426 "/org/freedesktop/ConsoleKit/Manager",
1427 "org.freedesktop.ConsoleKit.Manager",
1428- test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM);
1429+ test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
1430+ DEFAULT_CALL_FLAGS);
1431
1432 // By passing the proxy to the lambda we ensure that it will be smartly handled
1433 proxy->CallBegin(method, parameters, [this, proxy] (GVariant*, glib::Error const& e) {
1434@@ -440,7 +482,7 @@
1435 {
1436 LOG_ERROR(logger) << "Fallback call failed: " << e.Message();
1437 }
1438- });
1439+ }, cancellable_);
1440 }
1441
1442 void GnomeManager::Impl::CallDisplayManagerSeatMethod(std::string const& method, GVariant* parameters)
1443@@ -450,13 +492,14 @@
1444 auto proxy = std::make_shared<glib::DBusProxy>(test_mode_ ? testing::DBUS_NAME : "org.freedesktop.DisplayManager",
1445 glib::gchar_to_string(xdg_seat_path),
1446 "org.freedesktop.DisplayManager.Seat",
1447- test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM);
1448+ test_mode_ ? G_BUS_TYPE_SESSION : G_BUS_TYPE_SYSTEM,
1449+ DEFAULT_CALL_FLAGS);
1450 proxy->CallBegin(method, parameters, [this, proxy] (GVariant*, glib::Error const& e) {
1451 if (e)
1452 {
1453 LOG_ERROR(logger) << "DisplayManager Seat call failed: " << e.Message();
1454 }
1455- });
1456+ }, cancellable_);
1457 }
1458
1459 void GnomeManager::Impl::LockScreen(bool prompt)
1460@@ -509,7 +552,7 @@
1461 glib::Variant inhibitors(g_dbus_connection_call_sync(bus, test_mode_ ? testing::DBUS_NAME.c_str() : "org.gnome.SessionManager",
1462 "/org/gnome/SessionManager", "org.gnome.SessionManager",
1463 "IsInhibited", g_variant_new("(u)", Inhibited::LOGOUT), nullptr,
1464- G_DBUS_CALL_FLAGS_NONE, 500, nullptr, &error));
1465+ G_DBUS_CALL_FLAGS_NONE, 500, cancellable_, &error));
1466
1467 if (error)
1468 {
1469@@ -532,13 +575,53 @@
1470 auto group = getgrnam(group_name.c_str());
1471
1472 if (group && group->gr_mem)
1473+ {
1474 for (int i = 0; group->gr_mem[i]; ++i)
1475+ {
1476 if (g_strcmp0(group->gr_mem[i], user_name.c_str()) == 0)
1477 return true;
1478+ }
1479+ }
1480
1481 return false;
1482 }
1483
1484+bool GnomeManager::Impl::AutomaticLogin()
1485+{
1486+ glib::Error error;
1487+ glib::Object<GDBusConnection> bus(g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &error));
1488+
1489+ if (error)
1490+ {
1491+ LOG_ERROR(logger) << "Impossible to get the system bus to know if auto-login is enabled: " << error;
1492+ return false;
1493+ }
1494+
1495+ glib::Variant user_path(g_dbus_connection_call_sync(bus, "org.freedesktop.Accounts",
1496+ "/org/freedesktop/Accounts", "org.freedesktop.Accounts",
1497+ "FindUserByName", g_variant_new("(s)",g_get_user_name()), nullptr,
1498+ G_DBUS_CALL_FLAGS_NONE, 500, cancellable_, &error));
1499+
1500+ if (error)
1501+ {
1502+ LOG_ERROR(logger) << "Impossible to get the user path: " << error;
1503+ return false;
1504+ }
1505+
1506+ glib::Variant autologin(g_dbus_connection_call_sync(bus, "org.freedesktop.Accounts",
1507+ user_path.GetObjectPath().c_str(), "org.freedesktop.DBus.Properties",
1508+ "Get", g_variant_new("(ss)", "org.freedesktop.Accounts.User", "AutomaticLogin"), nullptr,
1509+ G_DBUS_CALL_FLAGS_NONE, 500, cancellable_, &error));
1510+
1511+ if (error)
1512+ {
1513+ LOG_ERROR(logger) << "Impossible to get the AutomaticLogin property: " << error;
1514+ return false;
1515+ }
1516+
1517+ return autologin.GetBool();
1518+}
1519+
1520 // Public implementation
1521
1522 GnomeManager::GnomeManager()
1523@@ -577,6 +660,11 @@
1524 impl_->UserIconFile(callback);
1525 }
1526
1527+bool GnomeManager::AutomaticLogin() const
1528+{
1529+ return impl_->AutomaticLogin();
1530+}
1531+
1532 void GnomeManager::ScreenSaverActivate()
1533 {
1534 screensaver_requested.emit(true);
1535
1536=== modified file 'UnityCore/GnomeSessionManager.h'
1537--- UnityCore/GnomeSessionManager.h 2015-12-03 05:57:00 +0000
1538+++ UnityCore/GnomeSessionManager.h 2017-12-01 18:43:57 +0000
1539@@ -37,6 +37,7 @@
1540 std::string UserName() const;
1541 std::string HostName() const;
1542 void UserIconFile(std::function<void(std::string const&)> const&) const;
1543+ bool AutomaticLogin() const;
1544
1545 void ScreenSaverActivate();
1546 void ScreenSaverDeactivate();
1547
1548=== modified file 'UnityCore/GnomeSessionManagerImpl.h'
1549--- UnityCore/GnomeSessionManagerImpl.h 2015-12-03 05:57:00 +0000
1550+++ UnityCore/GnomeSessionManagerImpl.h 2017-12-01 18:43:57 +0000
1551@@ -46,6 +46,8 @@
1552 Impl(GnomeManager* parent, bool test_mode = false);
1553 ~Impl();
1554
1555+ void SetupLogin1Proxy(std::string const& session_path);
1556+
1557 void ConfirmLogout();
1558 void ConfirmReboot();
1559 void ConfirmShutdown();
1560@@ -67,6 +69,7 @@
1561 void UpdateHaveOtherOpenSessions();
1562
1563 bool IsUserInGroup(std::string const& user_name, std::string const& group_name);
1564+ bool AutomaticLogin();
1565
1566 GnomeManager* manager_;
1567 bool test_mode_;
1568@@ -82,6 +85,7 @@
1569 glib::DBusProxy::Ptr dm_proxy_;
1570 glib::DBusProxy::Ptr dm_seat_proxy_;
1571
1572+ glib::Cancellable cancellable_;
1573 int open_sessions_;
1574 };
1575
1576
1577=== modified file 'UnityCore/SessionManager.h'
1578--- UnityCore/SessionManager.h 2016-03-31 09:51:33 +0000
1579+++ UnityCore/SessionManager.h 2017-12-01 18:43:57 +0000
1580@@ -46,6 +46,7 @@
1581 virtual std::string UserName() const = 0;
1582 virtual std::string HostName() const = 0;
1583 virtual void UserIconFile(std::function<void(std::string const&)> const&) const = 0;
1584+ virtual bool AutomaticLogin() const = 0;
1585
1586 virtual void ScreenSaverActivate() = 0;
1587 virtual void ScreenSaverDeactivate() = 0;
1588
1589=== modified file 'UnityCore/Variant.cpp'
1590--- UnityCore/Variant.cpp 2013-11-19 20:28:13 +0000
1591+++ UnityCore/Variant.cpp 2017-12-01 18:43:57 +0000
1592@@ -174,6 +174,36 @@
1593 return result ? result : "";
1594 }
1595
1596+std::string Variant::GetObjectPath() const
1597+{
1598+ const gchar *result = nullptr;
1599+
1600+ if (!variant_)
1601+ return "";
1602+
1603+ if (g_variant_is_of_type(variant_, G_VARIANT_TYPE_OBJECT_PATH))
1604+ {
1605+ // g_variant_get_string doesn't duplicate the string
1606+ result = g_variant_get_string(variant_, nullptr);
1607+ }
1608+ else if (g_variant_is_of_type(variant_, G_VARIANT_TYPE("(o)")))
1609+ {
1610+ // As we're using the '&' prefix we don't need to free the string!
1611+ g_variant_get(variant_, "(&o)", &result);
1612+ }
1613+ else
1614+ {
1615+ auto const& variant = get_variant(variant_);
1616+ if (variant)
1617+ return variant.GetObjectPath();
1618+
1619+ LOG_ERROR(logger) << "You're trying to extract a 'o' from a variant which is of type '"
1620+ << g_variant_type_peek_string(g_variant_get_type(variant_)) << "'";
1621+ }
1622+
1623+ return result ? result : "";
1624+}
1625+
1626 template <typename TYPE, typename GTYPE>
1627 TYPE get_numeric_value(GVariant *variant_, const char *type_str, const char *fallback_type_str)
1628 {
1629
1630=== modified file 'UnityCore/Variant.h'
1631--- UnityCore/Variant.h 2013-11-19 20:28:13 +0000
1632+++ UnityCore/Variant.h 2017-12-01 18:43:57 +0000
1633@@ -68,6 +68,7 @@
1634 ~Variant();
1635
1636 std::string GetString() const;
1637+ std::string GetObjectPath() const;
1638 unsigned char GetByte() const;
1639 int16_t GetInt16() const;
1640 uint16_t GetUInt16() const;
1641
1642=== modified file 'config.h.cmake'
1643--- config.h.cmake 2016-02-09 01:26:22 +0000
1644+++ config.h.cmake 2017-12-01 18:43:57 +0000
1645@@ -2,8 +2,9 @@
1646 #define CONFIG_H
1647
1648 #cmakedefine PREFIXPATH "@PREFIXPATH@"
1649-#cmakedefine UNITYDATADIR "@UNITYDATADIR@"
1650-#cmakedefine UNITYLIBDIR "@UNITYLIBDIR@"
1651+#cmakedefine UNITY_DATADIR "@UNITY_DATADIR@"
1652+#cmakedefine UNITY_LIBDIR "@UNITY_LIBDIR@"
1653+#cmakedefine UNITY_INSTALL_LIBDIR "@UNITY_INSTALL_LIBDIR@"
1654 #cmakedefine PKGDATADIR "@PKGDATADIR@"
1655 #cmakedefine LOCALE_DIR "@LOCALE_DIR@"
1656 #cmakedefine VERSION "@VERSION@"
1657
1658=== modified file 'dash/ResultRendererTile.cpp'
1659--- dash/ResultRendererTile.cpp 2016-02-09 18:16:51 +0000
1660+++ dash/ResultRendererTile.cpp 2017-12-01 18:43:57 +0000
1661@@ -273,7 +273,7 @@
1662 std::string const& icon_hint = row.icon_hint;
1663 std::string const& icon_name = !icon_hint.empty() ? icon_hint : DEFAULT_GICON;
1664
1665- glib::Object<GIcon> icon(g_icon_new_for_string(icon_name.c_str(), NULL));
1666+ glib::Object<GIcon> icon(g_icon_new_for_string(icon_name.c_str(), nullptr));
1667 TextureContainer* container = row.renderer<TextureContainer*>();
1668
1669 if (container)
1670
1671=== modified file 'data/CMakeLists.txt'
1672--- data/CMakeLists.txt 2014-05-27 07:53:19 +0000
1673+++ data/CMakeLists.txt 2017-12-01 18:43:57 +0000
1674@@ -1,1 +1,37 @@
1675-add_subdirectory(pam)
1676\ No newline at end of file
1677+add_subdirectory(pam)
1678+
1679+# GSettings Schema
1680+SET (UNITY_SCHEMAS "com.canonical.Unity.gschema.xml")
1681+SET (UNITY_TEST_SCHEMAS "external.gschema.xml")
1682+
1683+# Have an option to not install the schema into where GLib is
1684+option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" OFF)
1685+if (GSETTINGS_LOCALINSTALL)
1686+ SET (GSETTINGS_DIR "${CMAKE_INSTALL_DATADIR}/glib-2.0/schemas/")
1687+else (GSETTINGS_LOCALINSTALL)
1688+ execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
1689+ SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/")
1690+endif (GSETTINGS_LOCALINSTALL)
1691+
1692+# Run the validator and error if it fails
1693+execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
1694+execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${UNITY_SCHEMAS} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
1695+
1696+if (_schemas_invalid)
1697+ message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
1698+endif (_schemas_invalid)
1699+
1700+# Actually install and recomple schemas
1701+message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}")
1702+install (FILES ${UNITY_SCHEMAS} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
1703+install (CODE "message (STATUS \"Compiling GSettings schemas\")")
1704+install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
1705+
1706+# Settings for testing
1707+configure_file (${CMAKE_SOURCE_DIR}/data/${UNITY_SCHEMAS} ${CMAKE_BINARY_DIR}/settings/${UNITY_SCHEMAS})
1708+configure_file (${CMAKE_SOURCE_DIR}/tests/data/${UNITY_TEST_SCHEMAS} ${CMAKE_BINARY_DIR}/settings/${UNITY_TEST_SCHEMAS})
1709+execute_process (COMMAND ${_glib_comple_schemas} ${CMAKE_BINARY_DIR}/settings)
1710+
1711+# Upstart
1712+configure_file(unity7.conf.in ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf)
1713+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unity7.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/upstart/sessions)
1714
1715=== renamed file 'com.canonical.Unity.gschema.xml' => 'data/com.canonical.Unity.gschema.xml'
1716--- com.canonical.Unity.gschema.xml 2016-06-28 16:23:15 +0000
1717+++ data/com.canonical.Unity.gschema.xml 2017-12-01 18:43:57 +0000
1718@@ -100,6 +100,11 @@
1719 when authenticating. Only do this if you have account
1720 configured properly on your system.</description>
1721 </key>
1722+ <key type="b" name="lowgfx">
1723+ <default>false</default>
1724+ <summary>Enable/Disable Low Graphics Mode</summary>
1725+ <description>Whether Unity runs in Low Graphics Mode.</description>
1726+ </key>
1727 </schema>
1728 <schema path="/com/canonical/unity/interface/" id="com.canonical.Unity.Interface" gettext-domain="unity">
1729 <key type="d" name="text-scale-factor">
1730
1731=== renamed file 'unity7.conf.in' => 'data/unity7.conf.in'
1732--- unity7.conf.in 2016-08-01 08:37:57 +0000
1733+++ data/unity7.conf.in 2017-12-01 18:43:57 +0000
1734@@ -5,25 +5,8 @@
1735 stop on desktop-end
1736
1737 pre-start script
1738- # If gnome-session is going to start compiz,
1739- # we don't want to be the ones doing it.
1740-
1741- if grep -q compiz /usr/share/gnome-session/sessions/ubuntu.session ; then
1742- echo "GNOME Session is starting Compiz"
1743- stop ; exit 0
1744- fi
1745-
1746- compiz_profile="ubuntu"
1747-
1748- if ! /usr/lib/nux/unity_support_test -p; then
1749- compiz_profile="ubuntu-lowgfx"
1750- fi
1751-
1752- echo "Using compiz profile '$compiz_profile'"
1753- initctl set-env -g COMPIZ_CONFIG_PROFILE="$compiz_profile"
1754- export COMPIZ_CONFIG_PROFILE="$compiz_profile"
1755-
1756- ${CMAKE_INSTALL_FULL_LIBDIR}/unity/unity-active-plugins-safety-check
1757+ @UNITY_LIBDIR@/upstart-prestart-check
1758+ @UNITY_LIBDIR@/compiz-profile-selector
1759 end script
1760
1761 respawn
1762
1763=== modified file 'debian/changelog'
1764--- debian/changelog 2016-09-06 23:17:39 +0000
1765+++ debian/changelog 2017-12-01 18:43:57 +0000
1766@@ -1,3 +1,81 @@
1767+unity (7.4.5+16.04) UNRELEASED; urgency=medium
1768+
1769+ [ Marco Trevisan (Treviño) ]
1770+ * InputMonitor: add an unity class that monitors XInput2 events and
1771+ converts them to XEvent
1772+ * EdgeBarrierController: use InputMonitor to get the barrier events
1773+ instead of relying on its implementation
1774+ * DecorationsMenuLayout: use input monitor for menu scrubbing (LP:
1775+ #1614597)
1776+ * PanelView: use InputMonitor to track menu events
1777+ * LockScreenPanel: use InputMonitor events instead of mouse polling
1778+ for menu scrubbing
1779+ * MenuManager: add support for mouse trackers with triangle algorithm
1780+ support (LP: #1618405)
1781+ * PanelView: scale gradient refinement properly
1782+ * PanelService: don't allow to deactivate menus if they've been opened
1783+ too shortly
1784+ * LockScreenController: ignore icon_paths_changed signal in
1785+ menumanager for Lockscreen
1786+ * LockScreenController: use InputMonitor to get all the events and
1787+ hide the Blank Window (LP: #1321075)
1788+ * LockScreenController: use input monitor to get the events to switch
1789+ monitor (LP: #1316862)
1790+ * LauncherOptions: use track_obj to manage option changes (LP:
1791+ #1622995)
1792+ * UnityScreen: toggle gestures recognition on lock (LP: #1645507)
1793+ * GnomeSessionManager: add gcancellable to instance and use it for
1794+ calls with temporary proxies
1795+ * BackgroundSettings: use gnome-bg to generate textures with proper
1796+ scaling (LP: #1666359)
1797+ * UnityWindow: safely check validity of UnityWindow from scaled one
1798+ (LP: #1659847)
1799+ * Panel: ensure the menu-manager tracker is updated to match monitor
1800+ (LP: #1671432)
1801+ * compiz-profile-setter: tool to update the current profile and use in
1802+ systemd and Unity settings (LP: #1668950)
1803+ * BGHash, UnityScreen: get desktop averageColor from compiz
1804+ * Launcher: disable or reduce most icon effects on lowgfx (LP:
1805+ #1700859)
1806+ * PanelController: ensure we disconnect from signals on destruction
1807+ (LP: #1504870)
1808+ * tools: add migration script to set the default values for unity-
1809+ lowgfx profile
1810+
1811+ [ Andrea Azzarone ]
1812+ * Properly handle the file manager copy dialog in
1813+ FileManagerLauncherIcon and in StorageLauncherIcon. (LP: #1575452,
1814+ LP: #1609845)
1815+ * Correctly position the force quit dialog when scaling is different
1816+ than 1.0 (LP: #1637991)
1817+ * GnomeSession: Retrieve the session id using dbus if $XDG_SESSION_ID
1818+ is not set
1819+ * Round gtk scaling factor to closest integer. (LP: #1649736)
1820+ * Keep the screen locked if rebooting with autologin. (LP: #1600389)
1821+ * Use g_mkdir_with_parents instead of mkdir.
1822+ * Lockscreen: always draw the background-color in the lockscreen (LP:
1823+ #1702701)
1824+ * Refactor the way UserAuthenticator is created and passed around.
1825+ Handle failures to create new threads and fallback to a "Switch to
1826+ greeter..." button in case of failure. (LP: #1311316)
1827+ * Wait until the color buffer is cleared before suspending. (LP:
1828+ #1532508)
1829+
1830+ [ Kai-Heng Feng ]
1831+ * UnitySettings: If scale-factor is not set, find and set right scale
1832+ for HiDPI displays.
1833+
1834+ [ Eleni Maria Stea ]
1835+ * shouldn't create blur rectangles when there's no blur, skips the
1836+ blur rects processing in low gfx.
1837+ * removes lowgfx option from ccsm, reads the "lowgfx" gsetting (LP:
1838+ #1668950)
1839+
1840+ [ Nick Dedekind ]
1841+ * Fixed tooltip scaling issues. (LP: #1673950)
1842+
1843+ -- Marco Trevisan (Treviño) <marco@ubuntu.com> Tue, 04 Jul 2017 18:12:47 +0200
1844+
1845 unity (7.4.0+16.04.20160906-0ubuntu1) xenial; urgency=medium
1846
1847 [ Marco Trevisan (Treviño) ]
1848
1849=== modified file 'debian/control'
1850--- debian/control 2016-08-01 08:37:57 +0000
1851+++ debian/control 2017-12-01 18:43:57 +0000
1852@@ -3,9 +3,10 @@
1853 Priority: optional
1854 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
1855 Build-Depends: cmake,
1856- compiz-dev (>= 1:0.9.12.2),
1857+ compiz-dev (>= 1:0.9.12.3+16.04.20170704),
1858 debhelper (>= 9.0.0~),
1859 dbus-test-runner,
1860+ dbus-x11,
1861 dh-migrations,
1862 dh-translations (>= 94),
1863 dh-python,
1864
1865=== modified file 'debian/rules'
1866--- debian/rules 2016-02-09 12:21:08 +0000
1867+++ debian/rules 2017-12-01 18:43:57 +0000
1868@@ -6,6 +6,7 @@
1869 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
1870 DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
1871 gles2_architectures := armel armhf
1872+disable_tests_archs := powerpc
1873
1874 DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
1875
1876@@ -53,8 +54,10 @@
1877
1878 override_dh_auto_test:
1879 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
1880+ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(disable_tests_archs)))
1881 make -C obj-$(DEB_HOST_GNU_TYPE) check-headless
1882 endif
1883+endif
1884
1885 %:
1886 dh $@ --with translations,quilt,python2,python3,migrations --parallel
1887
1888=== modified file 'debian/unity.install'
1889--- debian/unity.install 2016-08-01 08:37:57 +0000
1890+++ debian/unity.install 2017-12-01 18:43:57 +0000
1891@@ -2,6 +2,9 @@
1892 usr/bin
1893 usr/lib/*/compiz/libunity*.so
1894 usr/lib/*/unity/unity-active-plugins-safety-check
1895+usr/lib/*/unity/compiz-config-profile-setter
1896+usr/lib/*/unity/compiz-profile-selector
1897+usr/lib/*/unity/*-prestart-check
1898 usr/share/man/*/unity.1
1899 usr/share/compiz
1900 usr/share/locale
1901
1902=== modified file 'debian/unity.migrations'
1903--- debian/unity.migrations 2016-02-22 20:34:21 +0000
1904+++ debian/unity.migrations 2017-12-01 18:43:57 +0000
1905@@ -2,3 +2,4 @@
1906 tools/migration-scripts/02_unity_setup_text_scale_factor
1907 tools/migration-scripts/03_unity_first_run_stamp_move
1908 tools/migration-scripts/04_unity_update_software_center_desktop_file
1909+tools/migration-scripts/06_unity_set_lowgfx_mode_settings_v1
1910
1911=== modified file 'decorations/DecoratedWindow.cpp'
1912--- decorations/DecoratedWindow.cpp 2016-08-06 16:24:45 +0000
1913+++ decorations/DecoratedWindow.cpp 2017-12-01 18:43:57 +0000
1914@@ -37,7 +37,6 @@
1915 {
1916 namespace
1917 {
1918-const std::string MENUS_PANEL_NAME = "WindowLIM";
1919 const int SHADOW_BLUR_MARGIN_FACTOR = 2;
1920 }
1921
1922@@ -55,7 +54,6 @@
1923 , deco_elements_(cu::DecorationElement::NONE)
1924 , last_mwm_decor_(win_->mwmDecor())
1925 , last_actions_(win_->actions())
1926- , panel_id_(MENUS_PANEL_NAME + std::to_string(win_->id()))
1927 , cv_(Settings::Instance().em())
1928 {
1929 active.changed.connect([this] (bool active) {
1930@@ -932,18 +930,13 @@
1931 sliding_layout->mouse_owner = grab_edge_->mouse_owner();
1932 }
1933
1934-inline std::string const& Window::Impl::GetMenusPanelID() const
1935-{
1936- return panel_id_;
1937-}
1938-
1939 void Window::Impl::UnsetAppMenu()
1940 {
1941 if (!menus_)
1942 return;
1943
1944 auto const& indicators = manager_->impl_->menu_manager_->Indicators();
1945- indicators->SyncGeometries(GetMenusPanelID(), indicator::EntryLocationMap());
1946+ indicators->SyncGeometries(menus_->MenubarId(), indicator::EntryLocationMap());
1947 sliding_layout_->SetInputItem(nullptr);
1948 grab_mouse_changed_->disconnect();
1949 }
1950@@ -956,7 +949,7 @@
1951 auto const& indicators = manager_->impl_->menu_manager_->Indicators();
1952 indicator::EntryLocationMap map;
1953 menus_->ChildrenGeometries(map);
1954- indicators->SyncGeometries(GetMenusPanelID(), map);
1955+ indicators->SyncGeometries(menus_->MenubarId(), map);
1956 }
1957
1958 bool Window::Impl::ActivateMenu(std::string const& entry_id)
1959
1960=== modified file 'decorations/DecorationsForceQuitDialog.cpp'
1961--- decorations/DecorationsForceQuitDialog.cpp 2016-08-06 16:24:55 +0000
1962+++ decorations/DecorationsForceQuitDialog.cpp 2017-12-01 18:43:57 +0000
1963@@ -478,9 +478,11 @@
1964
1965 void UpdateDialogPosition()
1966 {
1967+ gint scale = gtk_widget_get_scale_factor(dialog_);
1968+ scale = std::max<gint>(1, scale);
1969 auto const& win_geo = win_->inputRect();
1970- nux::Size walloc(gtk_widget_get_allocated_width(dialog_), gtk_widget_get_allocated_height(dialog_));
1971- gtk_window_move(GTK_WINDOW(dialog_), win_geo.centerX() - walloc.width/2, win_geo.centerY() - walloc.height/2);
1972+ nux::Size walloc(gtk_widget_get_allocated_width(dialog_) * scale, gtk_widget_get_allocated_height(dialog_) * scale);
1973+ gtk_window_move(GTK_WINDOW(dialog_), (win_geo.centerX() - walloc.width/2) / scale, (win_geo.centerY() - walloc.height/2) / scale);
1974 }
1975
1976 ForceQuitDialog* parent_;
1977
1978=== modified file 'decorations/DecorationsMenuLayout.cpp'
1979--- decorations/DecorationsMenuLayout.cpp 2015-02-03 10:04:17 +0000
1980+++ decorations/DecorationsMenuLayout.cpp 2017-12-01 18:43:57 +0000
1981@@ -25,6 +25,10 @@
1982 {
1983 namespace decoration
1984 {
1985+namespace
1986+{
1987+const std::string MENUS_PANEL_NAME = "WindowLIM";
1988+}
1989
1990 using namespace indicator;
1991
1992@@ -33,8 +37,8 @@
1993 , show_now(false)
1994 , menu_manager_(menu)
1995 , win_(win)
1996- , last_pointer_(-1, -1)
1997 , dropdown_(std::make_shared<MenuDropdown>(menu_manager_->Indicators(), win))
1998+ , menubar_id_(MENUS_PANEL_NAME + std::to_string(win_->id()))
1999 {
2000 visible = false;
2001 }
2002@@ -91,6 +95,11 @@
2003 Relayout();
2004 }
2005
2006+std::string const& MenuLayout::MenubarId() const
2007+{
2008+ return menubar_id_;
2009+}
2010+
2011 bool MenuLayout::ActivateMenu(std::string const& entry_id)
2012 {
2013 MenuEntry::Ptr target;
2014@@ -117,16 +126,29 @@
2015 if (!activated)
2016 activated = dropdown_->ActivateChild(target);
2017
2018- if (activated)
2019- {
2020- // Since this generally happens on keyboard activation we need to avoid that
2021- // the mouse position would interfere with this
2022- last_pointer_.set(pointerX, pointerY);
2023- }
2024-
2025 return activated;
2026 }
2027
2028+bool MenuLayout::ActivateMenu(CompPoint const& pos)
2029+{
2030+ if (!Geometry().contains(pos))
2031+ return false;
2032+
2033+ for (auto const& item : items_)
2034+ {
2035+ if (!item->visible() || !item->sensitive())
2036+ continue;
2037+
2038+ if (item->Geometry().contains(pos))
2039+ {
2040+ std::static_pointer_cast<MenuEntry>(item)->ShowMenu(1);
2041+ return true;
2042+ }
2043+ }
2044+
2045+ return false;
2046+}
2047+
2048 void MenuLayout::OnEntryMouseOwnershipChanged(bool owner)
2049 {
2050 mouse_owner = owner;
2051@@ -154,39 +176,15 @@
2052 {
2053 active = actived;
2054
2055- if (active && !pointer_tracker_ && items_.size() > 1)
2056+ if (active && items_.size() > 1)
2057 {
2058- pointer_tracker_.reset(new glib::Timeout(16));
2059- pointer_tracker_->Run([this] {
2060- Window win;
2061- int i, x, y;
2062- unsigned int ui;
2063-
2064- XQueryPointer(screen->dpy(), screen->root(), &win, &win, &x, &y, &i, &i, &ui);
2065-
2066- if (last_pointer_.x() != x || last_pointer_.y() != y)
2067- {
2068- last_pointer_.set(x, y);
2069-
2070- for (auto const& item : items_)
2071- {
2072- if (!item->visible() || !item->sensitive())
2073- continue;
2074-
2075- if (item->Geometry().contains(last_pointer_))
2076- {
2077- std::static_pointer_cast<MenuEntry>(item)->ShowMenu(1);
2078- break;
2079- }
2080- }
2081- }
2082-
2083- return true;
2084- });
2085+ menu_manager_->RegisterTracker(menubar_id_, (sigc::track_obj([this] (int x, int y, double speed) {
2086+ ActivateMenu(CompPoint(x, y));
2087+ }, *this)));
2088 }
2089 else if (!active)
2090 {
2091- pointer_tracker_.reset();
2092+ menu_manager_->UnregisterTracker(menubar_id_);
2093 }
2094 }
2095
2096
2097=== modified file 'decorations/DecorationsMenuLayout.h'
2098--- decorations/DecorationsMenuLayout.h 2014-02-13 03:01:30 +0000
2099+++ decorations/DecorationsMenuLayout.h 2017-12-01 18:43:57 +0000
2100@@ -42,7 +42,9 @@
2101
2102 void Setup();
2103 bool ActivateMenu(std::string const& entry_id);
2104+ bool ActivateMenu(CompPoint const&);
2105 void ChildrenGeometries(indicator::EntryLocationMap&) const;
2106+ std::string const& MenubarId() const;
2107
2108 protected:
2109 void DoRelayout() override;
2110@@ -55,10 +57,9 @@
2111
2112 menu::Manager::Ptr menu_manager_;
2113 CompWindow* win_;
2114- CompPoint last_pointer_;
2115- glib::Source::UniquePtr pointer_tracker_;
2116 glib::Source::UniquePtr show_now_timeout_;
2117 std::shared_ptr<MenuDropdown> dropdown_;
2118+ std::string menubar_id_;
2119 };
2120
2121 } // decoration namespace
2122
2123=== modified file 'decorations/DecorationsPriv.h'
2124--- decorations/DecorationsPriv.h 2016-08-06 16:24:45 +0000
2125+++ decorations/DecorationsPriv.h 2017-12-01 18:43:57 +0000
2126@@ -162,7 +162,6 @@
2127 connection::Wrapper dpi_changed_;
2128 connection::Wrapper grab_mouse_changed_;
2129 std::string last_title_;
2130- std::string panel_id_;
2131 std::vector<cu::SimpleTextureQuad> bg_textures_;
2132 cu::PixmapTexture::Ptr shaped_shadow_pixmap_;
2133 std::shared_ptr<ForceQuitDialog> force_quit_;
2134
2135=== modified file 'decorations/DecorationsWindowButton.cpp'
2136--- decorations/DecorationsWindowButton.cpp 2016-08-06 16:24:45 +0000
2137+++ decorations/DecorationsWindowButton.cpp 2017-12-01 18:43:57 +0000
2138@@ -45,7 +45,8 @@
2139
2140 void WindowButton::UpdateTexture()
2141 {
2142- SetTexture(DataPool::Get()->ButtonTexture(scale(), type(), GetCurrentState()));
2143+ if (auto tex = DataPool::Get()->ButtonTexture(scale(), type(), GetCurrentState()))
2144+ SetTexture(tex);
2145 }
2146
2147 WidgetState WindowButton::GetCurrentState() const
2148
2149=== modified file 'launcher/EdgeBarrierController.cpp'
2150--- launcher/EdgeBarrierController.cpp 2015-12-23 09:29:24 +0000
2151+++ launcher/EdgeBarrierController.cpp 2017-12-01 18:43:57 +0000
2152@@ -25,6 +25,7 @@
2153 #include <NuxCore/Logger.h>
2154 #include "unity-shared/UnitySettings.h"
2155 #include "unity-shared/UScreen.h"
2156+#include "unity-shared/InputMonitor.h"
2157 #include "UnityCore/GLibSource.h"
2158
2159 namespace unity
2160@@ -36,50 +37,10 @@
2161 {
2162 int const Y_BREAK_BUFFER = 20;
2163 int const X_BREAK_BUFFER = 20;
2164- int const MAJOR = 2;
2165- int const MINOR = 3;
2166-}
2167-
2168-DECLARE_LOGGER(logger, "unity.edge_barrier_controller");
2169-
2170-int GetXI2OpCode()
2171-{
2172- Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
2173-
2174- int opcode, event_base, error_base;
2175- if (!XQueryExtension(dpy, "XFIXES",
2176- &opcode,
2177- &event_base,
2178- &error_base))
2179- {
2180- LOG_ERROR(logger) << "Missing XFixes";
2181- return -1;
2182- }
2183-
2184- if (!XQueryExtension (dpy, "XInputExtension",
2185- &opcode,
2186- &event_base,
2187- &error_base))
2188- {
2189- LOG_ERROR(logger) << "Missing XInput";
2190- return -1;
2191- }
2192-
2193- int maj = MAJOR;
2194- int min = MINOR;
2195-
2196- if (XIQueryVersion(dpy, &maj, &min) == BadRequest)
2197- {
2198- LOG_ERROR(logger) << "Need XInput version 2.3";
2199- return -1;
2200- }
2201-
2202- return opcode;
2203 }
2204
2205 EdgeBarrierController::Impl::Impl(EdgeBarrierController *parent)
2206- : xi2_opcode_(-1)
2207- , edge_overcome_pressure_(0)
2208+ : edge_overcome_pressure_(0)
2209 , parent_(parent)
2210 {
2211 UScreen *uscreen = UScreen::GetDefault();
2212@@ -119,8 +80,6 @@
2213 options->option_changed.connect(sigc::mem_fun(this, &EdgeBarrierController::Impl::OnOptionsChanged));
2214 SetupBarriers(UScreen::GetDefault()->GetMonitors());
2215 });
2216-
2217- xi2_opcode_ = GetXI2OpCode();
2218 }
2219
2220 EdgeBarrierController::Impl::~Impl()
2221@@ -202,36 +161,30 @@
2222 }
2223 }
2224
2225-void SetupXI2Events()
2226-{
2227- Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
2228-
2229- unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
2230- XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
2231-
2232- XISetMask(mask.mask, XI_BarrierHit);
2233- XISetMask(mask.mask, XI_BarrierLeave);
2234- XISelectEvents (dpy, DefaultRootWindow(dpy), &mask, 1);
2235-}
2236-
2237 void EdgeBarrierController::Impl::SetupBarriers(std::vector<nux::Geometry> const& layout)
2238 {
2239 if (parent_->force_disable())
2240 return;
2241
2242+ size_t monitors_size = layout.size();
2243+ auto launcher_position = Settings::Instance().launcher_position();
2244 bool edge_resist = parent_->sticky_edges();
2245- auto launcher_position = Settings::Instance().launcher_position();
2246-
2247- for (unsigned i = 0; i < layout.size(); i++)
2248+ bool needs_barrier = edge_resist && monitors_size > 1;
2249+ bool needs_vertical_barrier = needs_barrier;
2250+
2251+ if (parent_->options()->hide_mode() != launcher::LauncherHideMode::LAUNCHER_HIDE_NEVER)
2252+ needs_vertical_barrier = true;
2253+
2254+ for (unsigned i = 0; i < layout.size(); ++i)
2255 {
2256- auto vertical_barrier = vertical_barriers_[i];
2257- auto horizontal_barrier = horizontal_barriers_[i];
2258- auto monitor = layout[i];
2259+ auto const& vertical_barrier = vertical_barriers_[i];
2260+ auto const& horizontal_barrier = horizontal_barriers_[i];
2261+ auto const& monitor = layout[i];
2262
2263 vertical_barrier->DestroyBarrier();
2264 horizontal_barrier->DestroyBarrier();
2265
2266- if (edge_resist)
2267+ if (needs_barrier)
2268 {
2269 horizontal_barrier->x1 = monitor.x;
2270 horizontal_barrier->x2 = monitor.x + monitor.width;
2271@@ -246,7 +199,7 @@
2272 horizontal_barrier->ConstructBarrier();
2273 }
2274
2275- if (!edge_resist && parent_->options()->hide_mode() == launcher::LauncherHideMode::LAUNCHER_HIDE_NEVER)
2276+ if (!needs_vertical_barrier)
2277 continue;
2278
2279 if (launcher_position == LauncherPosition::LEFT)
2280@@ -273,8 +226,10 @@
2281 vertical_barrier->ConstructBarrier();
2282 }
2283
2284- SetupXI2Events();
2285- AddEventFilter();
2286+ if (needs_barrier || needs_vertical_barrier)
2287+ input::Monitor::Get().RegisterClient(input::Events::BARRIER, sigc::mem_fun(this, &Impl::HandleEvent));
2288+ else
2289+ input::Monitor::Get().UnregisterClient(sigc::mem_fun(this, &Impl::HandleEvent));
2290
2291 float decay_responsiveness_mult = ((parent_->options()->edge_responsiveness() - 1) * .3f) + 1;
2292 decaymulator_.rate_of_decay = parent_->options()->edge_decay_rate() * decay_responsiveness_mult;
2293@@ -283,65 +238,25 @@
2294 edge_overcome_pressure_ = parent_->options()->edge_overcome_pressure() * overcome_responsiveness_mult;
2295 }
2296
2297-void EdgeBarrierController::Impl::AddEventFilter()
2298-{
2299- // Remove an old one, if it exists
2300- nux::GetGraphicsDisplay()->RemoveEventFilter(this);
2301-
2302- nux::GraphicsDisplay::EventFilterArg event_filter;
2303- event_filter.filter = &HandleEventCB;
2304- event_filter.data = this;
2305-
2306- nux::GetGraphicsDisplay()->AddEventFilter(event_filter);
2307-}
2308-
2309-bool EdgeBarrierController::Impl::HandleEvent(XEvent xevent)
2310-{
2311- Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
2312- XGenericEventCookie *cookie = &xevent.xcookie;
2313- bool ret = false;
2314-
2315- switch (cookie->evtype)
2316- {
2317- case (XI_BarrierHit):
2318- {
2319- if (XGetEventData(dpy, cookie))
2320- {
2321- XIBarrierEvent* barrier_event = (XIBarrierEvent*)cookie->data;
2322- PointerBarrierWrapper::Ptr wrapper = FindBarrierEventOwner(barrier_event);
2323-
2324- if (wrapper)
2325- ret = wrapper->HandleBarrierEvent(barrier_event);
2326- }
2327-
2328- XFreeEventData(dpy, cookie);
2329- break;
2330- }
2331- default:
2332- break;
2333- }
2334-
2335- return ret;
2336-}
2337-
2338-bool EdgeBarrierController::Impl::HandleEventCB(XEvent xevent, void* data)
2339-{
2340- auto edge_barrier_controller = static_cast<EdgeBarrierController::Impl*>(data);
2341- int const xi2_opcode = edge_barrier_controller->xi2_opcode_;
2342-
2343- if (xevent.type != GenericEvent || xevent.xcookie.extension != xi2_opcode)
2344- return false;
2345-
2346- return edge_barrier_controller->HandleEvent(xevent);
2347+void EdgeBarrierController::Impl::HandleEvent(XEvent const& xevent)
2348+{
2349+ if (xevent.xcookie.evtype != XI_BarrierHit)
2350+ return;
2351+
2352+ auto* barrier_event = reinterpret_cast<XIBarrierEvent*>(xevent.xcookie.data);
2353+ PointerBarrierWrapper::Ptr const& wrapper = FindBarrierEventOwner(barrier_event);
2354+
2355+ if (wrapper)
2356+ wrapper->HandleBarrierEvent(barrier_event);
2357 }
2358
2359 PointerBarrierWrapper::Ptr EdgeBarrierController::Impl::FindBarrierEventOwner(XIBarrierEvent* barrier_event)
2360 {
2361- for (auto barrier : vertical_barriers_)
2362+ for (auto const& barrier : vertical_barriers_)
2363 if (barrier->OwnsBarrierEvent(barrier_event->barrier))
2364 return barrier;
2365
2366- for (auto barrier : horizontal_barriers_)
2367+ for (auto const& barrier : horizontal_barriers_)
2368 if (barrier->OwnsBarrierEvent(barrier_event->barrier))
2369 return barrier;
2370
2371
2372=== modified file 'launcher/EdgeBarrierControllerPrivate.h'
2373--- launcher/EdgeBarrierControllerPrivate.h 2015-12-23 09:29:24 +0000
2374+++ launcher/EdgeBarrierControllerPrivate.h 2017-12-01 18:43:57 +0000
2375@@ -53,12 +53,8 @@
2376 bool EventIsInsideYBreakZone(BarrierEvent::Ptr const& event);
2377 bool EventIsInsideXBreakZone(BarrierEvent::Ptr const& event);
2378
2379- void AddEventFilter();
2380-
2381 PointerBarrierWrapper::Ptr FindBarrierEventOwner(XIBarrierEvent* barrier_event);
2382-
2383- static bool HandleEventCB(XEvent event, void* data);
2384- bool HandleEvent(XEvent event);
2385+ void HandleEvent(XEvent const&);
2386
2387 std::vector<PointerBarrierWrapper::Ptr> vertical_barriers_;
2388 std::vector<PointerBarrierWrapper::Ptr> horizontal_barriers_;
2389@@ -68,7 +64,6 @@
2390
2391 Decaymulator decaymulator_;
2392 glib::Source::UniquePtr release_timeout_;
2393- int xi2_opcode_;
2394 float edge_overcome_pressure_;
2395 EdgeBarrierController* parent_;
2396 };
2397
2398=== modified file 'launcher/FileManagerLauncherIcon.cpp'
2399--- launcher/FileManagerLauncherIcon.cpp 2016-07-14 10:04:31 +0000
2400+++ launcher/FileManagerLauncherIcon.cpp 2017-12-01 18:43:57 +0000
2401@@ -49,6 +49,11 @@
2402 SetQuirk(Quirk::VISIBLE, false);
2403 SkipQuirkAnimation(Quirk::VISIBLE);
2404
2405+ signals_conn_.Add(app_->window_opened.connect([this](ApplicationWindowPtr const& win) {
2406+ signals_conn_.Add(win->monitor.changed.connect([this] (int) { UpdateStorageWindows(); }));
2407+ UpdateStorageWindows();
2408+ }));
2409+
2410 signals_conn_.Add(app_->desktop_file.changed.connect([this](std::string const& desktop_file) {
2411 LOG_DEBUG(logger) << tooltip_text() << " desktop_file now " << desktop_file;
2412 UpdateDesktopFile();
2413@@ -134,5 +139,30 @@
2414 return StorageLauncherIcon::OnShouldHighlightOnDrag(dnd_data);
2415 }
2416
2417+bool FileManagerLauncherIcon::IsUserVisible() const
2418+{
2419+ return ApplicationLauncherIcon::IsUserVisible();
2420+}
2421+
2422+WindowList FileManagerLauncherIcon::WindowsOnViewport()
2423+{
2424+ WindowFilterMask filter = 0;
2425+ filter |= WindowFilter::MAPPED;
2426+ filter |= WindowFilter::ON_CURRENT_DESKTOP;
2427+ filter |= WindowFilter::ON_ALL_MONITORS;
2428+
2429+ return WindowedLauncherIcon::GetWindows(filter);
2430+}
2431+
2432+WindowList FileManagerLauncherIcon::WindowsForMonitor(int monitor)
2433+{
2434+ WindowFilterMask filter = 0;
2435+ filter |= WindowFilter::MAPPED;
2436+ filter |= WindowFilter::ON_CURRENT_DESKTOP;
2437+
2438+ return WindowedLauncherIcon::GetWindows(filter, monitor);
2439+}
2440+
2441+
2442 } // namespace launcher
2443 } // namespace unity
2444
2445=== modified file 'launcher/FileManagerLauncherIcon.h'
2446--- launcher/FileManagerLauncherIcon.h 2015-12-09 12:02:48 +0000
2447+++ launcher/FileManagerLauncherIcon.h 2017-12-01 18:43:57 +0000
2448@@ -32,8 +32,16 @@
2449 class FileManagerLauncherIcon : public ApplicationLauncherIcon, public StorageLauncherIcon
2450 {
2451 public:
2452+ typedef nux::ObjectPtr<FileManagerLauncherIcon> Ptr;
2453+
2454 FileManagerLauncherIcon(ApplicationPtr const&, DeviceLauncherSection::Ptr const&, FileManager::Ptr const& = nullptr);
2455
2456+ bool IsUserVisible() const override;
2457+
2458+protected:
2459+ WindowList WindowsOnViewport() override;
2460+ WindowList WindowsForMonitor(int monitor) override;
2461+
2462 private:
2463 WindowList GetManagedWindows() const override;
2464 WindowList GetStorageWindows() const override;
2465
2466=== modified file 'launcher/Launcher.cpp'
2467--- launcher/Launcher.cpp 2016-07-05 10:22:42 +0000
2468+++ launcher/Launcher.cpp 2017-12-01 18:43:57 +0000
2469@@ -138,13 +138,6 @@
2470 , drag_action_(nux::DNDACTION_NONE)
2471 , bg_effect_helper_(this)
2472 , launcher_position_(unity::Settings::Instance().launcher_position())
2473- , auto_hide_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_SHORT)
2474- , hover_animation_(Settings::Instance().low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION)
2475- , drag_over_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_LONG)
2476- , drag_out_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_SHORT)
2477- , drag_icon_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_SHORT)
2478- , dnd_hide_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION * 3)
2479- , dash_showing_animation_(Settings::Instance().low_gfx ? 0 : ANIM_DURATION_DASH_SHOWING)
2480 , cv_(Settings::Instance().em(monitor))
2481 {
2482 icon_renderer_->monitor = monitor();
2483@@ -199,17 +192,9 @@
2484 });
2485
2486 Settings::Instance().dpi_changed.connect(sigc::mem_fun(this, &Launcher::OnDPIChanged));
2487- Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
2488- auto_hide_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
2489- hover_animation_.SetDuration(low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION);
2490- drag_over_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_LONG);
2491- drag_out_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
2492- drag_icon_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
2493- dnd_hide_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION * 3);
2494- dash_showing_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_DASH_SHOWING);
2495- QueueDraw();
2496- }, *this));
2497+ Settings::Instance().low_gfx.changed.connect(sigc::hide(sigc::mem_fun(this, &Launcher::UpdateAnimations)));
2498
2499+ UpdateAnimations();
2500 auto_hide_animation_.updated.connect(redraw_cb);
2501 hover_animation_.updated.connect(redraw_cb);
2502 drag_over_animation_.updated.connect(redraw_cb);
2503@@ -1356,13 +1341,29 @@
2504 SetLauncherMinimizeWindow(options->minimize_window_on_click);
2505 OnMonitorChanged(monitor);
2506
2507+ UpdateAnimations();
2508+ ConfigureBarrier();
2509+ QueueDraw();
2510+}
2511+
2512+void Launcher::UpdateAnimations()
2513+{
2514+ bool low_gfx = Settings::Instance().low_gfx();
2515+
2516+ auto_hide_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
2517+ hover_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION);
2518+ drag_over_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_LONG);
2519+ drag_out_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
2520+ drag_icon_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_SHORT);
2521+ dnd_hide_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION * 3);
2522+ dash_showing_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_DASH_SHOWING);
2523+
2524 if (model_)
2525 {
2526 for (auto const& icon : *model_)
2527 SetupIconAnimations(icon);
2528 }
2529
2530- ConfigureBarrier();
2531 QueueDraw();
2532 }
2533
2534@@ -1739,23 +1740,26 @@
2535
2536 void Launcher::SetupIconAnimations(AbstractLauncherIcon::Ptr const& icon)
2537 {
2538- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::VISIBLE, ANIM_DURATION_SHORT, monitor());
2539- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::RUNNING, ANIM_DURATION_SHORT, monitor());
2540- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::ACTIVE, ANIM_DURATION_SHORT, monitor());
2541- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::STARTING, (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), monitor());
2542- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PULSE_ONCE, (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), monitor());
2543- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PRESENTED, ANIM_DURATION, monitor());
2544- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::UNFOLDED, ANIM_DURATION, monitor());
2545- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::SHIMMER, ANIM_DURATION_LONG, monitor());
2546- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::CENTER_SAVED, ANIM_DURATION, monitor());
2547- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PROGRESS, ANIM_DURATION, monitor());
2548- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::DESAT, ANIM_DURATION_SHORT_SHORT, monitor());
2549- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::GLOW, ANIM_DURATION_SHORT, monitor());
2550+ bool display = monitor();
2551+ bool low_gfx = Settings::Instance().low_gfx();
2552+
2553+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::VISIBLE, low_gfx ? 0 : ANIM_DURATION_SHORT, display);
2554+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::RUNNING, low_gfx ? 0 : ANIM_DURATION_SHORT, display);
2555+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::ACTIVE, low_gfx ? 0 : ANIM_DURATION_SHORT, display);
2556+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::STARTING, (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), display);
2557+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PULSE_ONCE, (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), display);
2558+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PRESENTED, low_gfx ? 0 : ANIM_DURATION, display);
2559+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::UNFOLDED, low_gfx ? 0 : ANIM_DURATION, display);
2560+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::SHIMMER, low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION_LONG, display);
2561+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::CENTER_SAVED, low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION, display);
2562+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PROGRESS, low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION, display);
2563+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::DESAT, low_gfx ? 0 : ANIM_DURATION_SHORT_SHORT, display);
2564+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::GLOW, low_gfx ? 0 : ANIM_DURATION_SHORT, display);
2565
2566 if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
2567- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_SHORT * WIGGLE_CYCLES), monitor());
2568+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_SHORT * WIGGLE_CYCLES), display);
2569 else
2570- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_LONG * URGENT_BLINKS * 2), monitor());
2571+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_LONG * URGENT_BLINKS * 2), display);
2572 }
2573
2574 void Launcher::SetModel(LauncherModel::Ptr model)
2575
2576=== modified file 'launcher/Launcher.h'
2577--- launcher/Launcher.h 2016-03-30 18:18:07 +0000
2578+++ launcher/Launcher.h 2017-12-01 18:43:57 +0000
2579@@ -195,6 +195,7 @@
2580 void OnOptionsChanged(Options::Ptr options);
2581 void OnOptionChanged();
2582 void UpdateOptions(Options::Ptr options);
2583+ void UpdateAnimations();
2584
2585 #ifdef NUX_GESTURES_SUPPORT
2586 void OnDragStart(const nux::GestureEvent &event);
2587
2588=== modified file 'launcher/LauncherOptions.cpp'
2589--- launcher/LauncherOptions.cpp 2014-03-17 20:58:25 +0000
2590+++ launcher/LauncherOptions.cpp 2017-12-01 18:43:57 +0000
2591@@ -49,31 +49,31 @@
2592 , scroll_inactive_icons(false)
2593 , minimize_window_on_click(false)
2594 {
2595- auto changed_lambda = [this] {
2596+ auto changed_cb = sigc::track_obj(sigc::hide([this] {
2597 changed_idle_.reset(new glib::Idle(glib::Source::Priority::HIGH));
2598 changed_idle_->Run([this] { option_changed.emit(); return false; });
2599- };
2600+ }), *this);
2601
2602- auto_hide_animation.changed.connect(sigc::hide(changed_lambda));
2603- background_alpha.changed.connect(sigc::hide(changed_lambda));
2604- background_color.changed.connect(sigc::hide(changed_lambda));
2605- backlight_mode.changed.connect(sigc::hide(changed_lambda));
2606- edge_decay_rate.changed.connect(sigc::hide(changed_lambda));
2607- edge_overcome_pressure.changed.connect(sigc::hide(changed_lambda));
2608- edge_responsiveness.changed.connect(sigc::hide(changed_lambda));
2609- edge_reveal_pressure.changed.connect(sigc::hide(changed_lambda));
2610- edge_stop_velocity.changed.connect(sigc::hide(changed_lambda));
2611- edge_passed_disabled_ms.changed.connect(sigc::hide(changed_lambda));
2612- hide_mode.changed.connect(sigc::hide(changed_lambda));
2613- icon_size.changed.connect(sigc::hide(changed_lambda));
2614- launch_animation.changed.connect(sigc::hide(changed_lambda));
2615- reveal_trigger.changed.connect(sigc::hide(changed_lambda));
2616- tile_size.changed.connect(sigc::hide(changed_lambda));
2617- super_tap_duration.changed.connect(sigc::hide(changed_lambda));
2618- urgent_animation.changed.connect(sigc::hide(changed_lambda));
2619- edge_resist.changed.connect(sigc::hide(changed_lambda));
2620- scroll_inactive_icons.changed.connect(sigc::hide(changed_lambda));
2621- minimize_window_on_click.changed.connect(sigc::hide(changed_lambda));
2622+ auto_hide_animation.changed.connect(changed_cb);
2623+ background_alpha.changed.connect(changed_cb);
2624+ background_color.changed.connect(changed_cb);
2625+ backlight_mode.changed.connect(changed_cb);
2626+ edge_decay_rate.changed.connect(changed_cb);
2627+ edge_overcome_pressure.changed.connect(changed_cb);
2628+ edge_responsiveness.changed.connect(changed_cb);
2629+ edge_reveal_pressure.changed.connect(changed_cb);
2630+ edge_stop_velocity.changed.connect(changed_cb);
2631+ edge_passed_disabled_ms.changed.connect(changed_cb);
2632+ hide_mode.changed.connect(changed_cb);
2633+ icon_size.changed.connect(changed_cb);
2634+ launch_animation.changed.connect(changed_cb);
2635+ reveal_trigger.changed.connect(changed_cb);
2636+ tile_size.changed.connect(changed_cb);
2637+ super_tap_duration.changed.connect(changed_cb);
2638+ urgent_animation.changed.connect(changed_cb);
2639+ edge_resist.changed.connect(changed_cb);
2640+ scroll_inactive_icons.changed.connect(changed_cb);
2641+ minimize_window_on_click.changed.connect(changed_cb);
2642 }
2643
2644 }
2645
2646=== modified file 'launcher/StorageLauncherIcon.cpp'
2647--- launcher/StorageLauncherIcon.cpp 2015-12-08 14:31:30 +0000
2648+++ launcher/StorageLauncherIcon.cpp 2017-12-01 18:43:57 +0000
2649@@ -36,7 +36,7 @@
2650 bool active = false;
2651 bool urgent = false;
2652 bool check_visibility = (GetIconType() == IconType::APPLICATION);
2653- bool visible = IsSticky();
2654+ bool visible = false;
2655
2656 managed_windows_ = GetStorageWindows();
2657 windows_connections_.Clear();
2658@@ -54,13 +54,8 @@
2659 if (!urgent && win->urgent())
2660 urgent = true;
2661
2662- if (check_visibility)
2663- {
2664- windows_connections_.Add(win->visible.changed.connect([this] (bool) { OnWindowStateChanged(); }));
2665-
2666- if (!visible && win->visible())
2667- visible = true;
2668- }
2669+ if (check_visibility && !visible)
2670+ visible = true;
2671 }
2672
2673 SetQuirk(Quirk::RUNNING, !managed_windows_.empty());
2674@@ -68,7 +63,7 @@
2675 SetQuirk(Quirk::URGENT, urgent);
2676
2677 if (check_visibility)
2678- SetQuirk(Quirk::VISIBLE, visible);
2679+ SetQuirk(Quirk::VISIBLE, visible || IsSticky());
2680
2681 EnsureWindowsLocation();
2682 }
2683@@ -83,7 +78,7 @@
2684 bool active = false;
2685 bool urgent = false;
2686 bool check_visibility = (GetIconType() == IconType::APPLICATION);
2687- bool visible = IsSticky();
2688+ bool visible = false;
2689
2690 for (auto const& win : managed_windows_)
2691 {
2692@@ -93,7 +88,7 @@
2693 if (!urgent && win->urgent())
2694 urgent = true;
2695
2696- if (check_visibility && !visible && win->visible())
2697+ if (check_visibility && !visible)
2698 visible = true;
2699 }
2700
2701@@ -101,7 +96,7 @@
2702 SetQuirk(Quirk::URGENT, urgent);
2703
2704 if (check_visibility)
2705- SetQuirk(Quirk::VISIBLE, visible);
2706+ SetQuirk(Quirk::VISIBLE, visible || IsSticky());
2707 }
2708
2709 bool StorageLauncherIcon::OnShouldHighlightOnDrag(DndData const& dnd_data)
2710
2711=== modified file 'launcher/Tooltip.cpp'
2712--- launcher/Tooltip.cpp 2016-01-29 03:45:34 +0000
2713+++ launcher/Tooltip.cpp 2017-12-01 18:43:57 +0000
2714@@ -124,13 +124,13 @@
2715 {
2716 int size = 0;
2717 int max = GetBaseWidth() - ROTATED_ANCHOR_WIDTH.CP(cv_) - 2 * CORNER_RADIUS.CP(cv_) - 2 * _padding.CP(cv_);
2718- if (_left_size.CP(cv_) > max)
2719+ if (_left_size > max)
2720 {
2721 size = max;
2722 }
2723- else if (_left_size.CP(cv_) > 0)
2724+ else if (_left_size > 0)
2725 {
2726- size = _left_size.CP(cv_);
2727+ size = _left_size;
2728 }
2729 x = _anchorX - (ROTATED_ANCHOR_WIDTH.CP(cv_) / 2) - size - CORNER_RADIUS.CP(cv_) - _padding.CP(cv_);
2730 }
2731@@ -222,7 +222,7 @@
2732 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
2733 _bottom_space->SetMinMaxSize(1, space_height + 1);
2734 else
2735- _bottom_space->SetMinMaxSize(1, space_height + ROTATED_ANCHOR_HEIGHT + 1);
2736+ _bottom_space->SetMinMaxSize(1, space_height + ROTATED_ANCHOR_HEIGHT.CP(cv_) + 1);
2737
2738 CairoBaseWindow::PreLayoutManagement();
2739 }
2740@@ -653,7 +653,7 @@
2741 height / dpi_scale,
2742 anchor_width,
2743 anchor_height,
2744- _left_size,
2745+ _left_size / dpi_scale,
2746 CORNER_RADIUS,
2747 blur_coef,
2748 shadow_color,
2749@@ -669,7 +669,7 @@
2750 CORNER_RADIUS, // radius,
2751 anchor_width, // anchor_width,
2752 anchor_height, // anchor_height,
2753- _left_size, // left_size,
2754+ _left_size / dpi_scale, // left_size,
2755 true, // negative,
2756 false, // outline,
2757 1.0, // line_width,
2758
2759=== modified file 'launcher/Tooltip.h'
2760--- launcher/Tooltip.h 2015-12-17 01:08:54 +0000
2761+++ launcher/Tooltip.h 2017-12-01 18:43:57 +0000
2762@@ -78,7 +78,7 @@
2763
2764 int _anchorX;
2765 int _anchorY;
2766- RawPixel _left_size; // size of the segment from point 10 to 11, used when launcher at bottom.
2767+ int _left_size; // size of the segment from point 10 to 11, used when launcher at bottom.
2768 RawPixel _padding;
2769
2770 nux::HLayout* _hlayout;
2771@@ -94,4 +94,3 @@
2772 }
2773
2774 #endif // TOOLTIP_H
2775-
2776
2777=== modified file 'lockscreen/BackgroundSettings.cpp'
2778--- lockscreen/BackgroundSettings.cpp 2014-07-29 12:05:47 +0000
2779+++ lockscreen/BackgroundSettings.cpp 2017-12-01 18:43:57 +0000
2780@@ -53,24 +53,33 @@
2781 auto& settings = Settings::Instance();
2782
2783 nux::CairoGraphics cairo_graphics(CAIRO_FORMAT_ARGB32, geo.width, geo.height);
2784- cairo_surface_set_device_scale(cairo_graphics.GetSurface(), scale, scale);
2785 cairo_t* c = cairo_graphics.GetInternalContext();
2786
2787+ glib::Object<GnomeBG> gnome_bg;
2788 double s_width = geo.width / scale;
2789 double s_height = geo.height / scale;
2790 cairo_surface_t* bg_surface = nullptr;
2791
2792 if (settings.use_user_background())
2793 {
2794- bg_surface = gnome_bg_create_surface(gnome_bg_, gdk_get_default_root_window(), s_width, s_height, FALSE);
2795+ gnome_bg = gnome_bg_;
2796 }
2797 else if (!settings.background().empty())
2798 {
2799- glib::Object<GdkPixbuf> pixbuf(gdk_pixbuf_new_from_file_at_scale(settings.background().c_str(), s_width, s_height, FALSE, NULL));
2800-
2801- if (pixbuf)
2802- bg_surface = gdk_cairo_surface_create_from_pixbuf(pixbuf, 0, NULL);
2803- }
2804+ gnome_bg = gnome_bg_new();
2805+ gnome_bg_set_filename(gnome_bg, settings.background().c_str());
2806+ gnome_bg_set_placement(gnome_bg, G_DESKTOP_BACKGROUND_STYLE_ZOOM);
2807+ }
2808+
2809+ if (gnome_bg)
2810+ {
2811+ auto *root_window = gdk_get_default_root_window();
2812+ bg_surface = gnome_bg_create_surface(gnome_bg, root_window, geo.width, geo.height, FALSE);
2813+ }
2814+
2815+ auto const& bg_color = settings.background_color();
2816+ cairo_set_source_rgb(c, bg_color.red, bg_color.green, bg_color.blue);
2817+ cairo_paint(c);
2818
2819 if (bg_surface)
2820 {
2821@@ -78,12 +87,8 @@
2822 cairo_paint(c);
2823 cairo_surface_destroy(bg_surface);
2824 }
2825- else
2826- {
2827- auto const& bg_color = settings.background_color();
2828- cairo_set_source_rgb(c, bg_color.red, bg_color.green, bg_color.blue);
2829- cairo_paint(c);
2830- }
2831+
2832+ cairo_surface_set_device_scale(cairo_graphics.GetSurface(), scale, scale);
2833
2834 if (!settings.logo().empty())
2835 {
2836
2837=== modified file 'lockscreen/KylinLockScreenShield.cpp'
2838--- lockscreen/KylinLockScreenShield.cpp 2015-12-07 03:09:28 +0000
2839+++ lockscreen/KylinLockScreenShield.cpp 2017-12-01 18:43:57 +0000
2840@@ -37,7 +37,7 @@
2841 Accelerators::Ptr const& accelerators,
2842 nux::ObjectPtr<AbstractUserPromptView> const& prompt_view,
2843 int monitor_num, bool is_primary)
2844- : BaseShield(session_manager, nullptr, accelerators, prompt_view, monitor_num, is_primary)
2845+ : BaseShield(session_manager, accelerators, prompt_view, monitor_num, is_primary)
2846 {
2847 is_primary ? ShowPrimaryView() : ShowSecondaryView();
2848 EnableInputWindow(true);
2849@@ -77,23 +77,5 @@
2850 main_layout->AddSpace(0, 10);
2851 }
2852
2853-nux::Area* KylinShield::FindKeyFocusArea(unsigned etype, unsigned long keysym, unsigned long modifiers)
2854-{
2855- if (primary)
2856- {
2857- grab_key.emit(modifiers, keysym);
2858-
2859- if (prompt_view_)
2860- {
2861- auto* focus_view = prompt_view_->focus_view();
2862-
2863- if (focus_view && focus_view->GetInputEventSensitivity())
2864- return focus_view;
2865- }
2866- }
2867-
2868- return nullptr;
2869-}
2870-
2871 }
2872 }
2873
2874=== modified file 'lockscreen/KylinLockScreenShield.h'
2875--- lockscreen/KylinLockScreenShield.h 2015-12-07 03:09:28 +0000
2876+++ lockscreen/KylinLockScreenShield.h 2017-12-01 18:43:57 +0000
2877@@ -41,9 +41,6 @@
2878 nux::ObjectPtr<AbstractUserPromptView> const&,
2879 int monitor, bool is_primary);
2880
2881-protected:
2882- nux::Area* FindKeyFocusArea(unsigned int, unsigned long, unsigned long) override;
2883-
2884 private:
2885 void ShowPrimaryView() override;
2886 };
2887
2888=== modified file 'lockscreen/KylinUserPromptView.cpp'
2889--- lockscreen/KylinUserPromptView.cpp 2016-03-31 05:57:11 +0000
2890+++ lockscreen/KylinUserPromptView.cpp 2017-12-01 18:43:57 +0000
2891@@ -79,9 +79,9 @@
2892
2893 }
2894
2895-KylinUserPromptView::KylinUserPromptView(session::Manager::Ptr const& session_manager)
2896- : AbstractUserPromptView(session_manager)
2897- , session_manager_(session_manager)
2898+KylinUserPromptView::KylinUserPromptView(session::Manager::Ptr const& session_manager,
2899+ UserAuthenticator::Ptr const& user_authenticator)
2900+ : AbstractUserPromptView(session_manager, user_authenticator)
2901 , username_(nullptr)
2902 , msg_layout_(nullptr)
2903 , prompt_layout_(nullptr)
2904@@ -90,25 +90,25 @@
2905 , avatar_(nullptr)
2906 , avatar_icon_file("")
2907 {
2908- user_authenticator_.echo_on_requested.connect([this](std::string const& message, PromiseAuthCodePtr const& promise){
2909+ user_authenticator_->echo_on_requested.connect(sigc::track_obj([this](std::string const& message, PromiseAuthCodePtr const& promise){
2910 AddPrompt(message, true, promise);
2911- });
2912+ }, *this));
2913
2914- user_authenticator_.echo_off_requested.connect([this](std::string const& message, PromiseAuthCodePtr const& promise){
2915+ user_authenticator_->echo_off_requested.connect(sigc::track_obj([this](std::string const& message, PromiseAuthCodePtr const& promise){
2916 AddPrompt(message, false, promise);
2917- });
2918+ }, *this));
2919
2920- user_authenticator_.message_requested.connect([this](std::string const& message){
2921+ user_authenticator_->message_requested.connect(sigc::track_obj([this](std::string const& message){
2922 AddMessage(message, nux::color::White);
2923- });
2924+ }, *this));
2925
2926- user_authenticator_.error_requested.connect([this](std::string const& message){
2927+ user_authenticator_->error_requested.connect(sigc::track_obj([this](std::string const& message){
2928 AddMessage(message, nux::color::Red);
2929- });
2930+ }, *this));
2931
2932- user_authenticator_.clear_prompts.connect([this](){
2933+ user_authenticator_->clear_prompts.connect(sigc::track_obj([this](){
2934 ResetLayout();
2935- });
2936+ }, *this));
2937
2938 scale.changed.connect(sigc::hide(sigc::mem_fun(this, &KylinUserPromptView::UpdateSize)));
2939
2940@@ -121,7 +121,7 @@
2941 ResetLayout();
2942
2943 TextureCache::GetDefault().themed_invalidated.connect(sigc::mem_fun(this, &KylinUserPromptView::ResetLayout));
2944- user_authenticator_.AuthenticateStart(session_manager_->UserName(),
2945+ user_authenticator_->AuthenticateStart(session_manager_->UserName(),
2946 sigc::mem_fun(this, &KylinUserPromptView::AuthenticationCb));
2947 }
2948
2949@@ -244,7 +244,7 @@
2950 {
2951 AddMessage(_("Invalid password, please try again"), nux::color::Red);
2952
2953- user_authenticator_.AuthenticateStart(session_manager_->UserName(),
2954+ user_authenticator_->AuthenticateStart(session_manager_->UserName(),
2955 sigc::mem_fun(this, &KylinUserPromptView::AuthenticationCb));
2956 }
2957 }
2958
2959=== modified file 'lockscreen/KylinUserPromptView.h'
2960--- lockscreen/KylinUserPromptView.h 2016-03-16 10:47:16 +0000
2961+++ lockscreen/KylinUserPromptView.h 2017-12-01 18:43:57 +0000
2962@@ -44,7 +44,8 @@
2963 class KylinUserPromptView : public AbstractUserPromptView
2964 {
2965 public:
2966- KylinUserPromptView(session::Manager::Ptr const& session_manager);
2967+ KylinUserPromptView(session::Manager::Ptr const& session_manager,
2968+ UserAuthenticator::Ptr const& user_authenticator);
2969
2970 nux::View* focus_view();
2971
2972@@ -62,8 +63,6 @@
2973 nux::ObjectPtr<nux::BaseTexture> LoadUserIcon(std::string const& icon_file, int icon_size);
2974
2975 private:
2976- session::Manager::Ptr session_manager_;
2977- UserAuthenticatorPam user_authenticator_;
2978 StaticCairoText* username_;
2979 nux::VLayout* msg_layout_;
2980 nux::VLayout* prompt_layout_;
2981
2982=== modified file 'lockscreen/LockScreenAbstractPromptView.h'
2983--- lockscreen/LockScreenAbstractPromptView.h 2016-03-31 09:51:33 +0000
2984+++ lockscreen/LockScreenAbstractPromptView.h 2017-12-01 18:43:57 +0000
2985@@ -29,7 +29,7 @@
2986 #include <Nux/VLayout.h>
2987 #include "UnityCore/SessionManager.h"
2988
2989-#include "UserAuthenticatorPam.h"
2990+#include "UserAuthenticator.h"
2991 #include "unity-shared/IMTextEntry.h"
2992
2993 namespace nux
2994@@ -48,10 +48,12 @@
2995 class AbstractUserPromptView : public nux::View
2996 {
2997 public:
2998- AbstractUserPromptView(session::Manager::Ptr const& session_manager)
2999+ AbstractUserPromptView(session::Manager::Ptr const& session_manager,
3000+ UserAuthenticator::Ptr const& user_authenticator)
3001 : nux::View(NUX_TRACKER_LOCATION)
3002 , scale(1.0)
3003 , session_manager_(session_manager)
3004+ , user_authenticator_(user_authenticator)
3005 {}
3006
3007 nux::Property<double> scale;
3008@@ -64,7 +66,7 @@
3009
3010 protected:
3011 session::Manager::Ptr session_manager_;
3012- UserAuthenticatorPam user_authenticator_;
3013+ UserAuthenticator::Ptr user_authenticator_;
3014 std::shared_ptr<nux::AbstractPaintLayer> bg_layer_;
3015 StaticCairoText* username_;
3016 nux::VLayout* msg_layout_;
3017
3018=== modified file 'lockscreen/LockScreenBaseShield.cpp'
3019--- lockscreen/LockScreenBaseShield.cpp 2015-12-03 14:13:10 +0000
3020+++ lockscreen/LockScreenBaseShield.cpp 2017-12-01 18:43:57 +0000
3021@@ -38,7 +38,6 @@
3022 }
3023
3024 BaseShield::BaseShield(session::Manager::Ptr const& session,
3025- indicator::Indicators::Ptr const& indicators,
3026 Accelerators::Ptr const& accelerators,
3027 nux::ObjectPtr<AbstractUserPromptView> const& prompt_view,
3028 int monitor_num, bool is_primary)
3029@@ -47,7 +46,6 @@
3030 , monitor(monitor_num)
3031 , scale(1.0)
3032 , session_manager_(session)
3033- , indicators_(indicators)
3034 , accelerators_(accelerators)
3035 , prompt_view_(prompt_view)
3036 , bg_settings_(std::make_shared<BackgroundSettings>())
3037@@ -83,11 +81,6 @@
3038 background_layer_.reset();
3039 UpdateBackgroundTexture();
3040 });
3041-
3042- mouse_move.connect([this] (int x, int y, int, int, unsigned long, unsigned long) {
3043- auto const& abs_geo = GetAbsoluteGeometry();
3044- grab_motion.emit(abs_geo.x + x, abs_geo.y + y);
3045- });
3046 }
3047
3048 bool BaseShield::HasGrab() const
3049@@ -96,6 +89,19 @@
3050 return (wc.GetPointerGrabArea() == this && wc.GetKeyboardGrabArea() == this);
3051 }
3052
3053+nux::Area* BaseShield::FindKeyFocusArea(unsigned etype, unsigned long keysym, unsigned long modifiers)
3054+{
3055+ if (primary && prompt_view_)
3056+ {
3057+ auto* focus_view = prompt_view_->focus_view();
3058+
3059+ if (focus_view && focus_view->GetInputEventSensitivity())
3060+ return focus_view;
3061+ }
3062+
3063+ return nullptr;
3064+}
3065+
3066 nux::Area* BaseShield::FindAreaUnderMouse(nux::Point const& mouse, nux::NuxEventType event_type)
3067 {
3068 nux::Area* area = BaseWindow::FindAreaUnderMouse(mouse, event_type);
3069@@ -139,6 +145,7 @@
3070 {
3071 auto background_texture = bg_settings_->GetBackgroundTexture(monitor);
3072 background_layer_.reset(new nux::TextureLayer(background_texture->GetDeviceTexture(), nux::TexCoordXForm(), nux::color::White, true));
3073+ background_layer_->SetGeometry(monitor_geo);
3074 SetBackgroundLayer(background_layer_.get());
3075 }
3076 }
3077
3078=== modified file 'lockscreen/LockScreenBaseShield.h'
3079--- lockscreen/LockScreenBaseShield.h 2016-03-31 09:51:33 +0000
3080+++ lockscreen/LockScreenBaseShield.h 2017-12-01 18:43:57 +0000
3081@@ -21,8 +21,8 @@
3082 #define UNITY_LOCKSCREEN_BASE_SHIELD_H
3083
3084 #include <NuxCore/Property.h>
3085+#include "UnityCore/ConnectionManager.h"
3086 #include "UnityCore/SessionManager.h"
3087-#include "UnityCore/Indicators.h"
3088 #include "UnityCore/GLibSource.h"
3089 #include "unity-shared/MockableBaseWindow.h"
3090
3091@@ -39,8 +39,8 @@
3092 class BaseShield : public MockableBaseWindow
3093 {
3094 public:
3095- BaseShield(session::Manager::Ptr const&, indicator::Indicators::Ptr const&,
3096- Accelerators::Ptr const&, nux::ObjectPtr<AbstractUserPromptView> const&,
3097+ BaseShield(session::Manager::Ptr const&, Accelerators::Ptr const&,
3098+ nux::ObjectPtr<AbstractUserPromptView> const&,
3099 int monitor_num, bool is_primary);
3100
3101 nux::Property<bool> primary;
3102@@ -54,14 +54,13 @@
3103
3104 sigc::signal<void> grabbed;
3105 sigc::signal<void> grab_failed;
3106- sigc::signal<void, int, int> grab_motion;
3107- sigc::signal<void, unsigned long, unsigned long> grab_key;
3108
3109 protected:
3110 virtual bool AcceptKeyNavFocus() { return false; }
3111 virtual void ShowPrimaryView() = 0;
3112 virtual void ShowSecondaryView();
3113
3114+ nux::Area* FindKeyFocusArea(unsigned int, unsigned long, unsigned long) override;
3115 nux::Area* FindAreaUnderMouse(nux::Point const& mouse, nux::NuxEventType event_type) override;
3116
3117 void GrabScreen(bool cancel_on_failure);
3118@@ -69,7 +68,6 @@
3119 void UpdateScale();
3120
3121 session::Manager::Ptr session_manager_;
3122- indicator::Indicators::Ptr indicators_;
3123 Accelerators::Ptr accelerators_;
3124 nux::ObjectPtr<AbstractUserPromptView> prompt_view_;
3125 std::shared_ptr<BackgroundSettings> bg_settings_;
3126
3127=== modified file 'lockscreen/LockScreenController.cpp'
3128--- lockscreen/LockScreenController.cpp 2016-07-05 10:22:42 +0000
3129+++ lockscreen/LockScreenController.cpp 2017-12-01 18:43:57 +0000
3130@@ -27,7 +27,9 @@
3131 #include "LockScreenPromptFactory.h"
3132 #include "LockScreenShield.h"
3133 #include "LockScreenSettings.h"
3134+#include "UserAuthenticatorPam.h"
3135 #include "unity-shared/AnimationUtils.h"
3136+#include "unity-shared/InputMonitor.h"
3137 #include "unity-shared/UnitySettings.h"
3138 #include "unity-shared/UScreen.h"
3139 #include "unity-shared/WindowManager.h"
3140@@ -66,10 +68,13 @@
3141 , upstart_wrapper_(upstart_wrapper)
3142 , shield_factory_(shield_factory)
3143 , suspend_inhibitor_manager_(std::make_shared<SuspendInhibitorManager>())
3144+ , user_authenticator_(std::make_shared<UserAuthenticatorPam>())
3145 , fade_animator_(unity::Settings::Instance().low_gfx() ? 0 : LOCK_FADE_DURATION)
3146 , blank_window_animator_(IDLE_FADE_DURATION)
3147 , test_mode_(test_mode)
3148 , prompt_activation_(false)
3149+ , is_paint_inhibited_(false)
3150+ , buffer_cleared_(true)
3151 {
3152 auto* uscreen = UScreen::GetDefault();
3153 uscreen_connection_ = uscreen->changed.connect([this] (int, std::vector<nux::Geometry> const& monitors) {
3154@@ -87,7 +92,13 @@
3155 suspend_inhibitor_manager_->connected.connect(sigc::mem_fun(this, &Controller::SyncInhibitor));
3156 suspend_inhibitor_manager_->about_to_suspend.connect([this] () {
3157 if (Settings::Instance().lock_on_suspend())
3158+ {
3159+ InhibitPaint();
3160 session_manager_->PromptLockScreen();
3161+ }
3162+ });
3163+ suspend_inhibitor_manager_->resumed.connect([this] () {
3164+ UninhibitPaint();
3165 });
3166
3167 Settings::Instance().lock_on_suspend.changed.connect(sigc::hide(sigc::mem_fun(this, &Controller::SyncInhibitor)));
3168@@ -117,6 +128,8 @@
3169
3170 if (animation::GetDirection(fade_animator_) == animation::Direction::BACKWARD)
3171 {
3172+ auto events_cb = sigc::track_obj(sigc::mem_fun(this, &Controller::OnLockScreenInputEvent), *primary_shield_);
3173+ input::Monitor::Get().UnregisterClient(events_cb);
3174 primary_shield_connections_.Clear();
3175 uscreen_connection_->block();
3176 hidden_window_connection_->block();
3177@@ -130,7 +143,7 @@
3178
3179 upstart_wrapper_->Emit("desktop-unlock");
3180 accelerator_controller_.reset();
3181- indicators_.reset();
3182+ menu_manager_.reset();
3183 }
3184 else if (!prompt_activation_)
3185 {
3186@@ -195,6 +208,20 @@
3187 break;
3188 }
3189 }
3190+}
3191+
3192+void Controller::OnLockScreenInputEvent(XEvent const& event)
3193+{
3194+ switch (event.type)
3195+ {
3196+ case MotionNotify:
3197+ case ButtonPress:
3198+ if (primary_shield_->IsIndicatorOpen())
3199+ break;
3200+ case ButtonRelease:
3201+ OnPrimaryShieldMotion(event.xmotion.x_root, event.xmotion.y_root);
3202+ break;
3203+ }
3204
3205 ResetPostLockScreenSaver();
3206 }
3207@@ -206,11 +233,8 @@
3208
3209 primary_shield_connections_.Clear();
3210
3211- auto move_cb = sigc::mem_fun(this, &Controller::OnPrimaryShieldMotion);
3212- primary_shield_connections_.Add(primary_shield_->grab_motion.connect(move_cb));
3213-
3214- auto key_cb = sigc::hide(sigc::hide(sigc::mem_fun(this, &Controller::ResetPostLockScreenSaver)));
3215- primary_shield_connections_.Add(primary_shield_->grab_key.connect(key_cb));
3216+ auto events_cb = sigc::track_obj(sigc::mem_fun(this, &Controller::OnLockScreenInputEvent), *primary_shield_);
3217+ input::Monitor::Get().RegisterClient(input::Events::INPUT, events_cb);
3218
3219 if (!session_manager_->is_locked())
3220 {
3221@@ -241,7 +265,7 @@
3222
3223 if (!prompt_view)
3224 {
3225- prompt_view = test_mode_ ? nux::ObjectPtr<AbstractUserPromptView>() : PromptFactory::CreatePrompt(session_manager_);
3226+ prompt_view = test_mode_ ? nux::ObjectPtr<AbstractUserPromptView>() : PromptFactory::CreatePrompt(session_manager_, user_authenticator_);
3227 prompt_view_ = prompt_view.GetPointer();
3228 }
3229
3230@@ -252,7 +276,7 @@
3231
3232 if (i >= shields_size)
3233 {
3234- shield = shield_factory_->CreateShield(session_manager_, indicators_, accelerator_controller_->GetAccelerators(), prompt_view, i, i == primary);
3235+ shield = shield_factory_->CreateShield(session_manager_, menu_manager_, accelerator_controller_->GetAccelerators(), prompt_view, i, i == primary);
3236 is_new = true;
3237 }
3238
3239@@ -314,10 +338,19 @@
3240 blank_window_->ShowWindow(false);
3241 animation::SetValue(blank_window_animator_, animation::Direction::BACKWARD);
3242
3243+ if (prompt_activation_)
3244+ BlankWindowGrabEnable(false);
3245+
3246 blank_window_.Release();
3247 lockscreen_delay_timeout_.reset();
3248 }
3249
3250+void Controller::OnBlankWindowInputEvent(XEvent const&)
3251+{
3252+ if (!lockscreen_timeout_)
3253+ HideBlankWindow();
3254+}
3255+
3256 void Controller::BlankWindowGrabEnable(bool grab)
3257 {
3258 if (!blank_window_)
3259@@ -325,41 +358,29 @@
3260
3261 if (grab)
3262 {
3263- for (auto const& shield : shields_)
3264+ if (!primary_shield_.IsValid())
3265 {
3266- shield->UnGrabPointer();
3267- shield->UnGrabKeyboard();
3268+ blank_window_->EnableInputWindow(true);
3269+ blank_window_->GrabPointer();
3270+ blank_window_->GrabKeyboard();
3271 }
3272
3273- blank_window_->EnableInputWindow(true);
3274- blank_window_->GrabPointer();
3275- blank_window_->GrabKeyboard();
3276+ input::Monitor::Get().RegisterClient(input::Events::INPUT, sigc::mem_fun(this, &Controller::OnBlankWindowInputEvent));
3277 nux::GetWindowCompositor().SetAlwaysOnFrontWindow(blank_window_.GetPointer());
3278-
3279- blank_window_->mouse_move.connect([this](int, int, int dx, int dy, unsigned long, unsigned long) {
3280- if ((dx || dy) && !lockscreen_timeout_) HideBlankWindow();
3281- });
3282- blank_window_->key_down.connect([this] (unsigned long et, unsigned long k, unsigned long s, const char* c, unsigned short kc) {
3283- if (prompt_view_.GetPointer() && prompt_view_->focus_view())
3284- prompt_view_->focus_view()->key_down.emit(et, k, s, c, kc);
3285- if (!lockscreen_timeout_) HideBlankWindow();
3286- });
3287- blank_window_->mouse_down.connect([this] (int, int, unsigned long, unsigned long) {
3288- if (!lockscreen_timeout_) HideBlankWindow();
3289- });
3290 }
3291 else
3292 {
3293- blank_window_->UnGrabPointer();
3294- blank_window_->UnGrabKeyboard();
3295-
3296- for (auto const& shield : shields_)
3297- {
3298- if (!shield->primary())
3299- continue;
3300-
3301- shield->GrabPointer();
3302- shield->GrabKeyboard();
3303+ input::Monitor::Get().UnregisterClient(sigc::mem_fun(this, &Controller::OnBlankWindowInputEvent));
3304+
3305+ if (primary_shield_.IsValid())
3306+ {
3307+ primary_shield_->GrabPointer();
3308+ primary_shield_->GrabKeyboard();
3309+ }
3310+ else
3311+ {
3312+ blank_window_->UnGrabPointer();
3313+ blank_window_->UnGrabKeyboard();
3314 }
3315 }
3316 }
3317@@ -382,6 +403,7 @@
3318 if (prompt)
3319 {
3320 EnsureBlankWindow();
3321+ BlankWindowGrabEnable(true);
3322 blank_window_->SetOpacity(1.0);
3323 }
3324
3325@@ -462,7 +484,8 @@
3326
3327 void Controller::LockScreen()
3328 {
3329- indicators_ = std::make_shared<indicator::LockScreenDBusIndicators>();
3330+ menu_manager_ = std::make_shared<menu::Manager>(std::make_shared<indicator::LockScreenDBusIndicators>(), key_grabber_);
3331+ menu_manager_->Indicators()->icon_paths_changed.clear(); // Ignore custom icon themes for lockscreen, see bug #1635625
3332 upstart_wrapper_->Emit("desktop-lock");
3333
3334 accelerator_controller_ = std::make_shared<AcceleratorController>(key_grabber_);
3335@@ -536,6 +559,36 @@
3336 return primary_shield_.IsValid() ? primary_shield_->IsIndicatorOpen() : false;
3337 }
3338
3339+void Controller::InhibitPaint()
3340+{
3341+ buffer_cleared_ = false;
3342+ is_paint_inhibited_ = true;
3343+}
3344+
3345+void Controller::UninhibitPaint()
3346+{
3347+ if (!is_paint_inhibited_)
3348+ return;
3349+
3350+ buffer_cleared_ = true;
3351+ is_paint_inhibited_ = false;
3352+ SyncInhibitor();
3353+}
3354+
3355+bool Controller::IsPaintInhibited() const
3356+{
3357+ return is_paint_inhibited_;
3358+}
3359+
3360+void Controller::MarkBufferHasCleared()
3361+{
3362+ if (buffer_cleared_)
3363+ return;
3364+
3365+ buffer_cleared_ = true;
3366+ SyncInhibitor();
3367+}
3368+
3369 void Controller::SyncInhibitor()
3370 {
3371 bool locked = IsLocked() && primary_shield_.IsValid() && primary_shield_->GetOpacity() == 1.0f;
3372@@ -546,7 +599,7 @@
3373
3374 if (inhibit)
3375 suspend_inhibitor_manager_->Inhibit("Unity needs to lock the screen");
3376- else
3377+ else if (buffer_cleared_)
3378 suspend_inhibitor_manager_->Uninhibit();
3379 }
3380
3381
3382=== modified file 'lockscreen/LockScreenController.h'
3383--- lockscreen/LockScreenController.h 2016-06-21 14:44:00 +0000
3384+++ lockscreen/LockScreenController.h 2017-12-01 18:43:57 +0000
3385@@ -29,8 +29,8 @@
3386 #include "LockScreenAcceleratorController.h"
3387 #include "SuspendInhibitorManager.h"
3388 #include "ScreenSaverDBusManager.h"
3389+#include "UserAuthenticator.h"
3390 #include "unity-shared/BackgroundEffectHelper.h"
3391-#include "unity-shared/KeyGrabber.h"
3392 #include "unity-shared/UpstartWrapper.h"
3393
3394 namespace unity
3395@@ -54,6 +54,8 @@
3396
3397 bool IsLocked() const;
3398 bool HasOpenMenu() const;
3399+ bool IsPaintInhibited() const;
3400+ void MarkBufferHasCleared();
3401
3402 private:
3403 friend class TestLockScreenController;
3404@@ -77,6 +79,11 @@
3405 void OnPresenceStatusChanged(bool idle);
3406 void OnScreenSaverActivationRequest(bool activate);
3407 void OnPrimaryShieldMotion(int x, int y);
3408+ void OnLockScreenInputEvent(XEvent const&);
3409+ void OnBlankWindowInputEvent(XEvent const&);
3410+
3411+ void InhibitPaint();
3412+ void UninhibitPaint();
3413
3414 std::vector<nux::ObjectPtr<BaseShield>> shields_;
3415 nux::ObjectWeakPtr<BaseShield> primary_shield_;
3416@@ -85,12 +92,13 @@
3417
3418 DBusManager::Ptr dbus_manager_;
3419 session::Manager::Ptr session_manager_;
3420+ menu::Manager::Ptr menu_manager_;
3421 key::Grabber::Ptr key_grabber_;
3422- indicator::Indicators::Ptr indicators_;
3423 AcceleratorController::Ptr accelerator_controller_;
3424 UpstartWrapper::Ptr upstart_wrapper_;
3425 ShieldFactoryInterface::Ptr shield_factory_;
3426 SuspendInhibitorManager::Ptr suspend_inhibitor_manager_;
3427+ UserAuthenticator::Ptr user_authenticator_;
3428
3429 nux::animation::AnimateValue<double> fade_animator_;
3430 nux::animation::AnimateValue<double> blank_window_animator_;
3431@@ -98,6 +106,8 @@
3432 bool test_mode_;
3433 bool prompt_activation_;
3434 BlurType old_blur_type_;
3435+ bool is_paint_inhibited_;
3436+ bool buffer_cleared_;
3437
3438 connection::Wrapper uscreen_connection_;
3439 connection::Wrapper hidden_window_connection_;
3440
3441=== modified file 'lockscreen/LockScreenPanel.cpp'
3442--- lockscreen/LockScreenPanel.cpp 2015-11-05 14:55:54 +0000
3443+++ lockscreen/LockScreenPanel.cpp 2017-12-01 18:43:57 +0000
3444@@ -24,7 +24,7 @@
3445
3446 #include "LockScreenSettings.h"
3447 #include "panel/PanelIndicatorsView.h"
3448-#include "unity-shared/CairoTexture.h"
3449+#include "unity-shared/InputMonitor.h"
3450 #include "unity-shared/StaticCairoText.h"
3451 #include "unity-shared/PanelStyle.h"
3452 #include "unity-shared/RawPixel.h"
3453@@ -38,24 +38,24 @@
3454 namespace
3455 {
3456 const RawPixel PADDING = 5_em;
3457+const nux::Color BG_COLOR(0.1, 0.1, 0.1, 0.4);
3458 }
3459
3460 using namespace indicator;
3461 using namespace panel;
3462
3463-Panel::Panel(int monitor_, Indicators::Ptr const& indicators, session::Manager::Ptr const& session_manager)
3464+Panel::Panel(int monitor_, menu::Manager::Ptr const& menu_manager, session::Manager::Ptr const& session_manager)
3465 : nux::View(NUX_TRACKER_LOCATION)
3466 , active(false)
3467 , monitor(monitor_)
3468- , indicators_(indicators)
3469+ , menu_manager_(menu_manager)
3470 , needs_geo_sync_(true)
3471 {
3472 double scale = unity::Settings::Instance().em(monitor)->DPIScale();
3473 auto* layout = new nux::HLayout();
3474 layout->SetLeftAndRightPadding(PADDING.CP(scale), 0);
3475 SetLayout(layout);
3476-
3477- BuildTexture();
3478+ UpdateSize();
3479
3480 // Add setting
3481 auto *hostname = new StaticCairoText(session_manager->HostName());
3482@@ -72,34 +72,33 @@
3483 indicators_view_->on_indicator_updated.connect(sigc::mem_fun(this, &Panel::OnIndicatorViewUpdated));
3484 layout->AddView(indicators_view_, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
3485
3486- for (auto const& indicator : indicators_->GetIndicators())
3487+ auto indicators = menu_manager_->Indicators();
3488+ menu_manager_->RegisterTracker(GetPanelName(), (sigc::track_obj([this] (int x, int y, double speed) {
3489+ indicators_view_->ActivateEntryAt(x, y);
3490+ }, *this)));
3491+
3492+ for (auto const& indicator : indicators->GetIndicators())
3493 AddIndicator(indicator);
3494
3495- indicators_->on_object_added.connect(sigc::mem_fun(this, &Panel::AddIndicator));
3496- indicators_->on_object_removed.connect(sigc::mem_fun(this, &Panel::RemoveIndicator));
3497- indicators_->on_entry_show_menu.connect(sigc::mem_fun(this, &Panel::OnEntryShowMenu));
3498- indicators_->on_entry_activated.connect(sigc::mem_fun(this, &Panel::OnEntryActivated));
3499- indicators_->on_entry_activate_request.connect(sigc::mem_fun(this, &Panel::OnEntryActivateRequest));
3500+ indicators->on_object_added.connect(sigc::mem_fun(this, &Panel::AddIndicator));
3501+ indicators->on_object_removed.connect(sigc::mem_fun(this, &Panel::RemoveIndicator));
3502+ indicators->on_entry_show_menu.connect(sigc::mem_fun(this, &Panel::OnEntryShowMenu));
3503+ indicators->on_entry_activated.connect(sigc::mem_fun(this, &Panel::OnEntryActivated));
3504+ indicators->on_entry_activate_request.connect(sigc::mem_fun(this, &Panel::OnEntryActivateRequest));
3505
3506 monitor.changed.connect([this, hostname] (int monitor) {
3507 double scale = unity::Settings::Instance().em(monitor)->DPIScale();
3508 hostname->SetScale(scale);
3509 static_cast<nux::HLayout*>(GetLayout())->SetLeftAndRightPadding(PADDING.CP(scale), 0);
3510 indicators_view_->SetMonitor(monitor);
3511- BuildTexture();
3512+ UpdateSize();
3513 QueueRelayout();
3514 });
3515 }
3516
3517-void Panel::BuildTexture()
3518+void Panel::UpdateSize()
3519 {
3520 int height = panel::Style::Instance().PanelHeight(monitor);
3521- nux::CairoGraphics context(CAIRO_FORMAT_ARGB32, 1, height);
3522- auto* cr = context.GetInternalContext();
3523- cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
3524- cairo_paint_with_alpha(cr, 0.4);
3525- bg_texture_ = texture_ptr_from_cairo_graphics(context);
3526-
3527 view_layout_->SetMinimumHeight(height);
3528 view_layout_->SetMaximumHeight(height);
3529 }
3530@@ -150,7 +149,7 @@
3531
3532 std::string Panel::GetPanelName() const
3533 {
3534- return "LockScreenPanel";
3535+ return "LockScreenPanel" + std::to_string(reinterpret_cast<uintptr_t>(this));
3536 }
3537
3538 void Panel::OnIndicatorViewUpdated()
3539@@ -165,12 +164,7 @@
3540 if (!GetInputEventSensitivity())
3541 return;
3542
3543- if (!active)
3544- {
3545- // This is ugly... But Nux fault!
3546- WindowManager::Default().UnGrabMousePointer(CurrentTime, button, x, y);
3547- active = true;
3548- }
3549+ active = true;
3550 }
3551
3552 void Panel::OnEntryActivateRequest(std::string const& entry_id)
3553@@ -184,36 +178,16 @@
3554 if (!GetInputEventSensitivity() || (!panel.empty() && panel != GetPanelName()))
3555 return;
3556
3557- bool active = !entry_id.empty();
3558+ bool valid_entry = !entry_id.empty();
3559
3560- if (active && !WindowManager::Default().IsScreenGrabbed())
3561+ if (valid_entry && !WindowManager::Default().IsScreenGrabbed())
3562 {
3563 // The menu didn't grab the keyboard, let's take it back.
3564 nux::GetWindowCompositor().GrabKeyboardAdd(static_cast<nux::BaseWindow*>(GetTopLevelViewWindow()));
3565 }
3566
3567- if (active && !track_menu_pointer_timeout_)
3568- {
3569- track_menu_pointer_timeout_.reset(new glib::Timeout(16));
3570- track_menu_pointer_timeout_->Run([this] {
3571- nux::Point const& mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
3572- if (tracked_pointer_pos_ != mouse)
3573- {
3574- if (GetAbsoluteGeometry().IsPointInside(mouse.x, mouse.y))
3575- indicators_view_->ActivateEntryAt(mouse.x, mouse.y);
3576-
3577- tracked_pointer_pos_ = mouse;
3578- }
3579-
3580- return true;
3581- });
3582- }
3583- else if (!active)
3584- {
3585- track_menu_pointer_timeout_.reset();
3586- tracked_pointer_pos_ = {-1, -1};
3587- this->active = false;
3588- }
3589+ if (!valid_entry)
3590+ active = valid_entry;
3591 }
3592
3593 void Panel::Draw(nux::GraphicsEngine& graphics_engine, bool force_draw)
3594@@ -227,12 +201,7 @@
3595 graphics_engine.PushClippingRectangle(geo);
3596 nux::GetPainter().PaintBackground(graphics_engine, geo);
3597
3598- nux::TexCoordXForm texxform;
3599- texxform.SetWrap(nux::TEXWRAP_REPEAT, nux::TEXWRAP_CLAMP);
3600- graphics_engine.QRP_1Tex(geo.x, geo.y, geo.width, geo.height,
3601- bg_texture_->GetDeviceTexture(), texxform,
3602- nux::color::White);
3603-
3604+ graphics_engine.QRP_Color(geo.x, geo.y, geo.width, geo.height, BG_COLOR);
3605 view_layout_->ProcessDraw(graphics_engine, force_draw);
3606
3607 graphics_engine.PopClippingRectangle();
3608@@ -242,7 +211,7 @@
3609 {
3610 EntryLocationMap locations;
3611 indicators_view_->GetGeometryForSync(locations);
3612- indicators_->SyncGeometries(GetPanelName(), locations);
3613+ menu_manager_->Indicators()->SyncGeometries(GetPanelName(), locations);
3614 needs_geo_sync_ = false;
3615 }
3616 }
3617
3618=== modified file 'lockscreen/LockScreenPanel.h'
3619--- lockscreen/LockScreenPanel.h 2016-03-31 09:51:33 +0000
3620+++ lockscreen/LockScreenPanel.h 2017-12-01 18:43:57 +0000
3621@@ -22,9 +22,9 @@
3622
3623 #include <Nux/Nux.h>
3624 #include <Nux/View.h>
3625-#include "UnityCore/Indicators.h"
3626 #include "UnityCore/GLibSource.h"
3627 #include "UnityCore/SessionManager.h"
3628+#include "unity-shared/MenuManager.h"
3629
3630 namespace unity
3631 {
3632@@ -39,7 +39,7 @@
3633 class Panel : public nux::View
3634 {
3635 public:
3636- Panel(int monitor, indicator::Indicators::Ptr const&, session::Manager::Ptr const&);
3637+ Panel(int monitor, menu::Manager::Ptr const&, session::Manager::Ptr const&);
3638
3639 nux::Property<bool> active;
3640 nux::Property<int> monitor;
3641@@ -55,20 +55,16 @@
3642 void AddIndicator(indicator::Indicator::Ptr const&);
3643 void RemoveIndicator(indicator::Indicator::Ptr const&);
3644 void OnIndicatorViewUpdated();
3645- void OnEntryActivated(std::string const& panel, std::string const& entry_id, nux::Rect const& geo);
3646+ void OnEntryActivated(std::string const& panel, std::string const& entry_id, nux::Rect const&);
3647 void OnEntryShowMenu(std::string const& entry_id, unsigned xid, int x, int y, unsigned button);
3648 void OnEntryActivateRequest(std::string const& entry_id);
3649
3650- void BuildTexture();
3651+ void UpdateSize();
3652 std::string GetPanelName() const;
3653
3654- indicator::Indicators::Ptr indicators_;
3655+ menu::Manager::Ptr menu_manager_;
3656 panel::PanelIndicatorsView* indicators_view_;
3657- nux::ObjectPtr<nux::BaseTexture> bg_texture_;
3658-
3659 bool needs_geo_sync_;
3660- nux::Point tracked_pointer_pos_;
3661- glib::Source::UniquePtr track_menu_pointer_timeout_;
3662 };
3663
3664 } // lockscreen namespace
3665
3666=== modified file 'lockscreen/LockScreenPromptFactory.cpp'
3667--- lockscreen/LockScreenPromptFactory.cpp 2015-12-04 08:17:46 +0000
3668+++ lockscreen/LockScreenPromptFactory.cpp 2017-12-01 18:43:57 +0000
3669@@ -26,14 +26,15 @@
3670 {
3671 namespace lockscreen
3672 {
3673-nux::ObjectPtr<AbstractUserPromptView> PromptFactory::CreatePrompt(session::Manager::Ptr const& sm)
3674+nux::ObjectPtr<AbstractUserPromptView> PromptFactory::CreatePrompt(session::Manager::Ptr const& sm,
3675+ UserAuthenticator::Ptr const& ua)
3676 {
3677 nux::ObjectPtr<AbstractUserPromptView> prompt;
3678
3679 if (unity::Settings::Instance().desktop_type() == DesktopType::UBUNTUKYLIN)
3680- prompt = new KylinUserPromptView(sm);
3681+ prompt = new KylinUserPromptView(sm, ua);
3682 else
3683- prompt = new UserPromptView(sm);
3684+ prompt = new UserPromptView(sm, ua);
3685
3686 return prompt;
3687 }
3688
3689=== modified file 'lockscreen/LockScreenPromptFactory.h'
3690--- lockscreen/LockScreenPromptFactory.h 2016-03-31 09:51:33 +0000
3691+++ lockscreen/LockScreenPromptFactory.h 2017-12-01 18:43:57 +0000
3692@@ -22,6 +22,7 @@
3693
3694 #include <NuxCore/NuxCore.h>
3695 #include "UnityCore/SessionManager.h"
3696+#include "UserAuthenticator.h"
3697
3698 namespace unity
3699 {
3700@@ -33,7 +34,8 @@
3701
3702 struct PromptFactory
3703 {
3704- static nux::ObjectPtr<AbstractUserPromptView> CreatePrompt(session::Manager::Ptr const&);
3705+ static nux::ObjectPtr<AbstractUserPromptView> CreatePrompt(session::Manager::Ptr const&,
3706+ UserAuthenticator::Ptr const&);
3707 };
3708
3709 }
3710
3711=== modified file 'lockscreen/LockScreenShield.cpp'
3712--- lockscreen/LockScreenShield.cpp 2015-12-03 14:13:10 +0000
3713+++ lockscreen/LockScreenShield.cpp 2017-12-01 18:43:57 +0000
3714@@ -32,11 +32,12 @@
3715 {
3716
3717 Shield::Shield(session::Manager::Ptr const& session_manager,
3718- indicator::Indicators::Ptr const& indicators,
3719+ menu::Manager::Ptr const& menu_manager,
3720 Accelerators::Ptr const& accelerators,
3721 nux::ObjectPtr<AbstractUserPromptView> const& prompt_view,
3722 int monitor_num, bool is_primary)
3723- : BaseShield(session_manager, indicators, accelerators, prompt_view, monitor_num, is_primary)
3724+ : BaseShield(session_manager, accelerators, prompt_view, monitor_num, is_primary)
3725+ , menu_manager_(menu_manager)
3726 , panel_view_(nullptr)
3727 {
3728 is_primary ? ShowPrimaryView() : ShowSecondaryView();
3729@@ -91,11 +92,11 @@
3730
3731 Panel* Shield::CreatePanel()
3732 {
3733- if (!indicators_ || !session_manager_)
3734+ if (!menu_manager_ || !session_manager_)
3735 return nullptr;
3736
3737- panel_view_ = new Panel(monitor, indicators_, session_manager_);
3738- panel_active_conn_ = panel_view_->active.changed.connect([this] (bool active) {
3739+ panel_view_ = new Panel(monitor, menu_manager_, session_manager_);
3740+ panel_view_->active.changed.connect(sigc::track_obj([this] (bool active) {
3741 if (primary())
3742 {
3743 if (active)
3744@@ -109,7 +110,7 @@
3745 GrabScreen(false);
3746 }
3747 }
3748- });
3749+ }, *this));
3750
3751 return panel_view_;
3752 }
3753@@ -118,8 +119,6 @@
3754 {
3755 if (primary)
3756 {
3757- grab_key.emit(modifiers, keysym);
3758-
3759 if (accelerators_)
3760 {
3761 if (etype == nux::EVENT_KEY_DOWN)
3762@@ -133,17 +132,9 @@
3763 return panel_view_;
3764 }
3765 }
3766-
3767- if (prompt_view_)
3768- {
3769- auto* focus_view = prompt_view_->focus_view();
3770-
3771- if (focus_view && focus_view->GetInputEventSensitivity())
3772- return focus_view;
3773- }
3774 }
3775
3776- return nullptr;
3777+ return BaseShield::FindKeyFocusArea(etype, keysym, modifiers);
3778 }
3779
3780 bool Shield::IsIndicatorOpen() const
3781
3782=== modified file 'lockscreen/LockScreenShield.h'
3783--- lockscreen/LockScreenShield.h 2015-12-03 14:13:10 +0000
3784+++ lockscreen/LockScreenShield.h 2017-12-01 18:43:57 +0000
3785@@ -20,8 +20,9 @@
3786 #ifndef UNITY_LOCKSCREEN_SHIELD_H
3787 #define UNITY_LOCKSCREEN_SHIELD_H
3788
3789-#include <UnityCore/ConnectionManager.h>
3790 #include "LockScreenBaseShield.h"
3791+#include "unity-shared/MenuManager.h"
3792+
3793
3794 namespace unity
3795 {
3796@@ -35,7 +36,7 @@
3797 {
3798 public:
3799 Shield(session::Manager::Ptr const&,
3800- indicator::Indicators::Ptr const&,
3801+ menu::Manager::Ptr const&,
3802 Accelerators::Ptr const&,
3803 nux::ObjectPtr<AbstractUserPromptView> const&,
3804 int monitor, bool is_primary);
3805@@ -50,7 +51,7 @@
3806 void ShowPrimaryView() override;
3807 Panel* CreatePanel();
3808
3809- connection::Wrapper panel_active_conn_;
3810+ menu::Manager::Ptr menu_manager_;
3811 Panel* panel_view_;
3812 };
3813
3814
3815=== modified file 'lockscreen/LockScreenShieldFactory.cpp'
3816--- lockscreen/LockScreenShieldFactory.cpp 2015-12-04 08:17:46 +0000
3817+++ lockscreen/LockScreenShieldFactory.cpp 2017-12-01 18:43:57 +0000
3818@@ -28,7 +28,7 @@
3819 {
3820
3821 nux::ObjectPtr<BaseShield> ShieldFactory::CreateShield(session::Manager::Ptr const& session_manager,
3822- indicator::Indicators::Ptr const& indicators,
3823+ menu::Manager::Ptr const& menu_manager,
3824 Accelerators::Ptr const& accelerators,
3825 nux::ObjectPtr<AbstractUserPromptView> const& prompt_view,
3826 int monitor, bool is_primary)
3827@@ -38,7 +38,7 @@
3828 if (Settings::Instance().desktop_type() == DesktopType::UBUNTUKYLIN)
3829 shield = new KylinShield(session_manager, accelerators, prompt_view, monitor, is_primary);
3830 else
3831- shield = new Shield(session_manager, indicators, accelerators, prompt_view, monitor, is_primary);
3832+ shield = new Shield(session_manager, menu_manager, accelerators, prompt_view, monitor, is_primary);
3833
3834 return shield;
3835 }
3836
3837=== modified file 'lockscreen/LockScreenShieldFactory.h'
3838--- lockscreen/LockScreenShieldFactory.h 2016-03-31 09:51:33 +0000
3839+++ lockscreen/LockScreenShieldFactory.h 2017-12-01 18:43:57 +0000
3840@@ -22,7 +22,7 @@
3841
3842 #include <NuxCore/NuxCore.h>
3843 #include "UnityCore/SessionManager.h"
3844-#include "UnityCore/Indicators.h"
3845+#include "unity-shared/MenuManager.h"
3846 #include "LockScreenAccelerators.h"
3847
3848 namespace unity
3849@@ -41,7 +41,7 @@
3850 virtual ~ShieldFactoryInterface() = default;
3851
3852 virtual nux::ObjectPtr<BaseShield> CreateShield(session::Manager::Ptr const&,
3853- indicator::Indicators::Ptr const&,
3854+ menu::Manager::Ptr const&,
3855 Accelerators::Ptr const&,
3856 nux::ObjectPtr<AbstractUserPromptView> const&,
3857 int monitor, bool is_primary) = 0;
3858@@ -50,7 +50,7 @@
3859 struct ShieldFactory : ShieldFactoryInterface
3860 {
3861 nux::ObjectPtr<BaseShield> CreateShield(session::Manager::Ptr const&,
3862- indicator::Indicators::Ptr const&,
3863+ menu::Manager::Ptr const&,
3864 Accelerators::Ptr const&,
3865 nux::ObjectPtr<AbstractUserPromptView> const&,
3866 int monitor, bool is_primary) override;
3867
3868=== modified file 'lockscreen/SuspendInhibitorManager.cpp'
3869--- lockscreen/SuspendInhibitorManager.cpp 2016-03-31 09:59:30 +0000
3870+++ lockscreen/SuspendInhibitorManager.cpp 2017-12-01 18:43:57 +0000
3871@@ -60,6 +60,8 @@
3872 lm_proxy_->Connect("PrepareForSleep", [this] (GVariant* variant) {
3873 if (glib::Variant(variant).GetBool())
3874 parent_->about_to_suspend.emit();
3875+ else
3876+ parent_->resumed.emit();
3877 });
3878
3879 lm_proxy_->connected.connect(sigc::mem_fun(&parent->connected, &decltype(parent->connected)::emit));
3880
3881=== modified file 'lockscreen/SuspendInhibitorManager.h'
3882--- lockscreen/SuspendInhibitorManager.h 2016-03-31 09:59:30 +0000
3883+++ lockscreen/SuspendInhibitorManager.h 2017-12-01 18:43:57 +0000
3884@@ -42,6 +42,7 @@
3885
3886 sigc::signal<void> connected;
3887 sigc::signal<void> about_to_suspend;
3888+ sigc::signal<void> resumed;
3889
3890 private:
3891 class Impl;
3892
3893=== modified file 'lockscreen/UserAuthenticator.h'
3894--- lockscreen/UserAuthenticator.h 2014-03-05 04:09:13 +0000
3895+++ lockscreen/UserAuthenticator.h 2017-12-01 18:43:57 +0000
3896@@ -36,6 +36,7 @@
3897 class UserAuthenticator
3898 {
3899 public:
3900+ typedef std::shared_ptr<UserAuthenticator> Ptr;
3901 typedef std::function<void(bool)> AuthenticateEndCallback;
3902
3903 virtual ~UserAuthenticator() = default;
3904@@ -43,6 +44,7 @@
3905 // Authenticate the user in a background thread.
3906 virtual bool AuthenticateStart(std::string const& username, AuthenticateEndCallback const&) = 0;
3907
3908+ sigc::signal<void> start_failed;
3909 sigc::signal<void, std::string, PromiseAuthCodePtr const&> echo_on_requested;
3910 sigc::signal<void, std::string, PromiseAuthCodePtr const&> echo_off_requested;
3911 sigc::signal<void, std::string> message_requested;
3912
3913=== modified file 'lockscreen/UserAuthenticatorPam.cpp'
3914--- lockscreen/UserAuthenticatorPam.cpp 2016-08-17 14:01:39 +0000
3915+++ lockscreen/UserAuthenticatorPam.cpp 2017-12-01 18:43:57 +0000
3916@@ -23,6 +23,7 @@
3917
3918 #include "UserAuthenticatorPam.h"
3919 #include "unity-shared/UnitySettings.h"
3920+#include "UnityCore/GLibWrapper.h"
3921
3922 #include <cstring>
3923 #include <security/pam_appl.h>
3924@@ -36,42 +37,49 @@
3925 bool UserAuthenticatorPam::AuthenticateStart(std::string const& username,
3926 AuthenticateEndCallback const& authenticate_cb)
3927 {
3928+ if (pam_handle_)
3929+ return false;
3930+
3931 first_prompt_ = true;
3932 username_ = username;
3933 authenticate_cb_ = authenticate_cb;
3934- pam_handle_ = nullptr;
3935-
3936- if (!InitPam() || !pam_handle_)
3937- return false;
3938-
3939- glib::Object<GTask> task(g_task_new(nullptr, cancellable_, [] (GObject*, GAsyncResult*, gpointer data) {
3940- auto self = static_cast<UserAuthenticatorPam*>(data);
3941- pam_end(self->pam_handle_, self->status_);
3942- self->authenticate_cb_(self->status_ == PAM_SUCCESS);
3943- }, this));
3944-
3945- g_task_set_task_data(task, this, nullptr);
3946-
3947- g_task_run_in_thread(task, [] (GTask* task, gpointer, gpointer data, GCancellable*) {
3948- auto self = static_cast<UserAuthenticatorPam*>(data);
3949-
3950- self->status_ = pam_authenticate(self->pam_handle_, 0);
3951-
3952- if (self->status_ == PAM_SUCCESS)
3953- {
3954- int status2 = pam_acct_mgmt(self->pam_handle_, 0);
3955-
3956- if (status2 == PAM_NEW_AUTHTOK_REQD)
3957- status2 = pam_chauthtok(self->pam_handle_, PAM_CHANGE_EXPIRED_AUTHTOK);
3958-
3959- if (unity::Settings::Instance().pam_check_account_type())
3960- self->status_ = status2;
3961-
3962- pam_setcred(self->pam_handle_, PAM_REINITIALIZE_CRED);
3963- }
3964- });
3965-
3966- return true;
3967+
3968+ glib::Error error;
3969+ g_thread_try_new(nullptr, AuthenticationThreadFunc, this, &error);
3970+
3971+ return !error;
3972+}
3973+
3974+gpointer UserAuthenticatorPam::AuthenticationThreadFunc(gpointer data)
3975+{
3976+ auto self = static_cast<UserAuthenticatorPam*>(data);
3977+
3978+ if (!self->InitPam() || !self->pam_handle_)
3979+ {
3980+ self->pam_handle_ = nullptr;
3981+ self->source_manager_.AddTimeout(0, [self] { self->start_failed.emit(); return false; });
3982+ return nullptr;
3983+ }
3984+
3985+ self->status_ = pam_authenticate(self->pam_handle_, 0);
3986+
3987+ if (self->status_ == PAM_SUCCESS)
3988+ {
3989+ int status2 = pam_acct_mgmt(self->pam_handle_, 0);
3990+
3991+ if (status2 == PAM_NEW_AUTHTOK_REQD)
3992+ status2 = pam_chauthtok(self->pam_handle_, PAM_CHANGE_EXPIRED_AUTHTOK);
3993+
3994+ if (unity::Settings::Instance().pam_check_account_type())
3995+ self->status_ = status2;
3996+
3997+ pam_setcred(self->pam_handle_, PAM_REINITIALIZE_CRED);
3998+ }
3999+
4000+ pam_end(self->pam_handle_, self->status_);
4001+ self->pam_handle_ = nullptr;
4002+ self->source_manager_.AddTimeout(0, [self] { self->authenticate_cb_(self->status_ == PAM_SUCCESS); return false; });
4003+ return nullptr;
4004 }
4005
4006 bool UserAuthenticatorPam::InitPam()
4007
4008=== modified file 'lockscreen/UserAuthenticatorPam.h'
4009--- lockscreen/UserAuthenticatorPam.h 2014-03-05 04:09:13 +0000
4010+++ lockscreen/UserAuthenticatorPam.h 2017-12-01 18:43:57 +0000
4011@@ -20,8 +20,6 @@
4012 #ifndef UNITY_USER_AUTHENTICATOR_PAM_H
4013 #define UNITY_USER_AUTHENTICATOR_PAM_H
4014
4015-#include <boost/noncopyable.hpp>
4016-#include <UnityCore/GLibWrapper.h>
4017 #include <UnityCore/GLibSource.h>
4018
4019 #include "UserAuthenticator.h"
4020@@ -36,13 +34,17 @@
4021 namespace lockscreen
4022 {
4023
4024-class UserAuthenticatorPam : public UserAuthenticator, private boost::noncopyable
4025+class UserAuthenticatorPam : public UserAuthenticator
4026 {
4027 public:
4028+ UserAuthenticatorPam() = default;
4029 bool AuthenticateStart(std::string const& username, AuthenticateEndCallback const&) override;
4030
4031 private:
4032- // TODO (andy) move to pimpl
4033+ UserAuthenticatorPam(UserAuthenticatorPam const&) = delete;
4034+ UserAuthenticatorPam& operator=(UserAuthenticatorPam const&) = delete;
4035+
4036+ static gpointer AuthenticationThreadFunc(gpointer);
4037 bool InitPam();
4038
4039 static int ConversationFunction(int num_msg,
4040@@ -53,10 +55,9 @@
4041 std::string username_;
4042 AuthenticateEndCallback authenticate_cb_;
4043
4044- int status_;
4045- bool first_prompt_;
4046- pam_handle* pam_handle_;
4047- glib::Cancellable cancellable_;
4048+ int status_ = 0;
4049+ bool first_prompt_ = true;
4050+ pam_handle* pam_handle_ = nullptr;
4051 glib::SourceManager source_manager_;
4052 };
4053
4054
4055=== modified file 'lockscreen/UserPromptView.cpp'
4056--- lockscreen/UserPromptView.cpp 2016-06-28 16:23:27 +0000
4057+++ lockscreen/UserPromptView.cpp 2017-12-01 18:43:57 +0000
4058@@ -23,6 +23,7 @@
4059 #include <glib/gi18n-lib.h>
4060
4061 #include <boost/algorithm/string/trim.hpp>
4062+#include <NuxCore/Logger.h>
4063 #include <Nux/VLayout.h>
4064
4065 #include "LockScreenSettings.h"
4066@@ -38,6 +39,9 @@
4067 {
4068 namespace
4069 {
4070+
4071+DECLARE_LOGGER(logger, "unity.lockscreen");
4072+
4073 const RawPixel PADDING = 10_em;
4074 const RawPixel LAYOUT_MARGIN = 10_em;
4075 const RawPixel MSG_LAYOUT_MARGIN = 15_em;
4076@@ -101,41 +105,46 @@
4077
4078 }
4079
4080-UserPromptView::UserPromptView(session::Manager::Ptr const& session_manager)
4081- : AbstractUserPromptView(session_manager)
4082- , session_manager_(session_manager)
4083+UserPromptView::UserPromptView(session::Manager::Ptr const& session_manager,
4084+ UserAuthenticator::Ptr const& user_authenticator)
4085+ : AbstractUserPromptView(session_manager, user_authenticator)
4086 , username_(nullptr)
4087 , msg_layout_(nullptr)
4088 , prompt_layout_(nullptr)
4089 , button_layout_(nullptr)
4090 , prompted_(false)
4091 , unacknowledged_messages_(false)
4092+ , num_retry_auth_(0)
4093 {
4094- user_authenticator_.echo_on_requested.connect([this](std::string const& message, PromiseAuthCodePtr const& promise){
4095+ user_authenticator_->start_failed.connect(sigc::track_obj([this](){
4096+ HandleAuthenticationStartFailure();
4097+ }, *this));
4098+
4099+ user_authenticator_->echo_on_requested.connect(sigc::track_obj([this](std::string const& message, PromiseAuthCodePtr const& promise){
4100 prompted_ = true;
4101 unacknowledged_messages_ = false;
4102 AddPrompt(message, /* visible */ true, promise);
4103- });
4104+ }, *this));
4105
4106- user_authenticator_.echo_off_requested.connect([this](std::string const& message, PromiseAuthCodePtr const& promise){
4107+ user_authenticator_->echo_off_requested.connect(sigc::track_obj([this](std::string const& message, PromiseAuthCodePtr const& promise){
4108 prompted_ = true;
4109 unacknowledged_messages_ = false;
4110 AddPrompt(message, /* visible */ false, promise);
4111- });
4112+ }, *this));
4113
4114- user_authenticator_.message_requested.connect([this](std::string const& message){
4115+ user_authenticator_->message_requested.connect(sigc::track_obj([this](std::string const& message){
4116 unacknowledged_messages_ = true;
4117 AddMessage(message, nux::color::White);
4118- });
4119+ }, *this));
4120
4121- user_authenticator_.error_requested.connect([this](std::string const& message){
4122+ user_authenticator_->error_requested.connect(sigc::track_obj([this](std::string const& message){
4123 unacknowledged_messages_ = true;
4124 AddMessage(message, nux::color::Red);
4125- });
4126+ }, *this));
4127
4128- user_authenticator_.clear_prompts.connect([this](){
4129+ user_authenticator_->clear_prompts.connect(sigc::track_obj([this](){
4130 ResetLayout();
4131- });
4132+ }, *this));
4133
4134 scale.changed.connect(sigc::hide(sigc::mem_fun(this, &UserPromptView::UpdateSize)));
4135
4136@@ -469,13 +478,40 @@
4137 prompted_ = false;
4138 unacknowledged_messages_ = false;
4139
4140- user_authenticator_.AuthenticateStart(session_manager_->UserName(),
4141- sigc::mem_fun(this, &UserPromptView::AuthenticationCb));
4142+ if(!user_authenticator_->AuthenticateStart(session_manager_->UserName(),
4143+ sigc::mem_fun(this, &UserPromptView::AuthenticationCb)))
4144+ {
4145+ HandleAuthenticationStartFailure();
4146+ }
4147 }
4148
4149 void UserPromptView::DoUnlock()
4150 {
4151 session_manager_->unlock_requested.emit();
4152+ num_retry_auth_ = 0;
4153+}
4154+
4155+void UserPromptView::HandleAuthenticationStartFailure()
4156+{
4157+ ++num_retry_auth_;
4158+
4159+ if (num_retry_auth_ <= 5)
4160+ {
4161+ LOG_WARNING(logger) << "Failed to start the authentication process. Retrying for " << num_retry_auth_ << " time.";
4162+ source_manager_.AddTimeout(100, [this] {
4163+ StartAuthentication();
4164+ return false;
4165+ });
4166+ }
4167+ else
4168+ {
4169+ AddMessage(_("Authentication failure"), nux::color::Red);
4170+ AddButton(_("Switch to greeter…"), [this] {
4171+ session_manager_->SwitchToGreeter();
4172+ });
4173+
4174+ GetLayout()->AddLayout(button_layout_);
4175+ }
4176 }
4177
4178 }
4179
4180=== modified file 'lockscreen/UserPromptView.h'
4181--- lockscreen/UserPromptView.h 2016-06-28 16:23:27 +0000
4182+++ lockscreen/UserPromptView.h 2017-12-01 18:43:57 +0000
4183@@ -25,10 +25,10 @@
4184
4185 #include <Nux/Nux.h>
4186 #include <Nux/View.h>
4187+#include "UnityCore/GLibSource.h"
4188 #include "UnityCore/SessionManager.h"
4189
4190 #include "LockScreenAbstractPromptView.h"
4191-#include "UserAuthenticatorPam.h"
4192 #include "unity-shared/IMTextEntry.h"
4193
4194 namespace nux
4195@@ -48,7 +48,8 @@
4196 class UserPromptView : public AbstractUserPromptView
4197 {
4198 public:
4199- UserPromptView(session::Manager::Ptr const& session_manager);
4200+ UserPromptView(session::Manager::Ptr const& session_manager,
4201+ UserAuthenticator::Ptr const& user_authenticator);
4202
4203 nux::View* focus_view();
4204
4205@@ -70,9 +71,8 @@
4206 void ShowAuthenticated(bool successful);
4207 void StartAuthentication();
4208 void DoUnlock();
4209+ void HandleAuthenticationStartFailure();
4210
4211- session::Manager::Ptr session_manager_;
4212- UserAuthenticatorPam user_authenticator_;
4213 std::shared_ptr<nux::AbstractPaintLayer> bg_layer_;
4214 StaticCairoText* username_;
4215 nux::VLayout* msg_layout_;
4216@@ -84,6 +84,9 @@
4217
4218 bool prompted_;
4219 bool unacknowledged_messages_;
4220+ int num_retry_auth_ = 0;
4221+
4222+ glib::SourceManager source_manager_;
4223 };
4224
4225 }
4226
4227=== modified file 'panel/PanelController.cpp'
4228--- panel/PanelController.cpp 2014-07-30 00:49:35 +0000
4229+++ panel/PanelController.cpp 2017-12-01 18:43:57 +0000
4230@@ -33,9 +33,8 @@
4231
4232 const char* window_title = "unity-panel";
4233
4234-class Controller::Impl
4235+struct Controller::Impl : sigc::trackable
4236 {
4237-public:
4238 Impl(Controller*, menu::Manager::Ptr const&, ui::EdgeBarrierController::Ptr const&);
4239 ~Impl();
4240
4241
4242=== modified file 'panel/PanelIndicatorEntryView.cpp'
4243--- panel/PanelIndicatorEntryView.cpp 2016-02-17 13:14:37 +0000
4244+++ panel/PanelIndicatorEntryView.cpp 2017-12-01 18:43:57 +0000
4245@@ -33,6 +33,8 @@
4246 #include "unity-shared/RawPixel.h"
4247 #include "unity-shared/WindowManager.h"
4248 #include "unity-shared/ThemeSettings.h"
4249+#include "unity-shared/UBusWrapper.h"
4250+#include "unity-shared/UBusMessages.h"
4251 #include "unity-shared/UnitySettings.h"
4252
4253 namespace unity
4254@@ -117,6 +119,9 @@
4255 }
4256 else
4257 {
4258+ if (overlay_showing_)
4259+ UBusManager::SendMessage(UBUS_OVERLAY_CLOSE_REQUEST);
4260+
4261 WindowManager& wm = WindowManager::Default();
4262
4263 if (wm.IsExpoActive())
4264@@ -140,6 +145,11 @@
4265 wm.TerminateScale();
4266 }
4267
4268+ // This is ugly... But Nux fault!
4269+ auto const& abs_geo = GetAbsoluteGeometry();
4270+ guint64 timestamp = nux::GetGraphicsDisplay()->GetCurrentEvent().x11_timestamp;
4271+ WindowManager::Default().UnGrabMousePointer(timestamp, button, abs_geo.x, abs_geo.y);
4272+
4273 Activate(button);
4274 }
4275 }
4276
4277=== modified file 'panel/PanelMenuView.cpp'
4278--- panel/PanelMenuView.cpp 2016-09-01 23:56:04 +0000
4279+++ panel/PanelMenuView.cpp 2017-12-01 18:43:57 +0000
4280@@ -102,7 +102,6 @@
4281 , ignore_menu_visibility_(false)
4282 , integrated_menus_(menu_manager_->integrated_menus())
4283 , always_show_menus_(menu_manager_->always_show_menus())
4284- , ignore_leave_events_(false)
4285 , desktop_name_(get_current_desktop())
4286 {
4287 if (ApplicationWindowPtr const& win = ApplicationManager::Default().GetActiveWindow())
4288@@ -1814,14 +1813,9 @@
4289 }
4290 }
4291
4292-void PanelMenuView::IgnoreLeaveEvents(bool ignore)
4293-{
4294- ignore_leave_events_ = ignore;
4295-}
4296-
4297 void PanelMenuView::OnPanelViewMouseLeave(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
4298 {
4299- if (always_show_menus_ || ignore_leave_events_)
4300+ if (always_show_menus_)
4301 return;
4302
4303 if (is_inside_)
4304
4305=== modified file 'panel/PanelMenuView.h'
4306--- panel/PanelMenuView.h 2015-11-05 14:54:13 +0000
4307+++ panel/PanelMenuView.h 2017-12-01 18:43:57 +0000
4308@@ -56,7 +56,6 @@
4309 bool HasKeyActivableMenus() const;
4310
4311 void NotifyAllMenusClosed();
4312- void IgnoreLeaveEvents(bool);
4313
4314 virtual void AddIndicator(indicator::Indicator::Ptr const& indicator);
4315
4316@@ -192,7 +191,6 @@
4317 bool ignore_menu_visibility_;
4318 bool integrated_menus_;
4319 bool always_show_menus_;
4320- bool ignore_leave_events_;
4321
4322 nux::Geometry monitor_geo_;
4323 const std::string desktop_name_;
4324
4325=== modified file 'panel/PanelView.cpp'
4326--- panel/PanelView.cpp 2016-08-17 14:02:12 +0000
4327+++ panel/PanelView.cpp 2017-12-01 18:43:57 +0000
4328@@ -42,7 +42,8 @@
4329 namespace
4330 {
4331 const RawPixel TRIANGLE_THRESHOLD = 5_em;
4332-const int refine_gradient_midpoint = 959;
4333+const double SCRUB_VELOCITY_THRESHOLD = 0.05;
4334+const RawPixel REFINE_GRADIENT_MIDPOINT = 959;
4335 }
4336
4337
4338@@ -51,7 +52,8 @@
4339 PanelView::PanelView(MockableBaseWindow* parent, menu::Manager::Ptr const& menus, NUX_FILE_LINE_DECL)
4340 : View(NUX_FILE_LINE_PARAM)
4341 , parent_(parent)
4342- , remote_(menus->Indicators())
4343+ , menus_(menus)
4344+ , remote_(menus_->Indicators())
4345 , is_dirty_(true)
4346 , opacity_maximized_toggle_(false)
4347 , needs_geo_sync_(false)
4348@@ -113,10 +115,9 @@
4349
4350 remote_->on_object_added.connect(sigc::mem_fun(this, &PanelView::OnObjectAdded));
4351 remote_->on_object_removed.connect(sigc::mem_fun(this, &PanelView::OnObjectRemoved));
4352- remote_->on_entry_activated.connect(sigc::mem_fun(this, &PanelView::OnEntryActivated));
4353- remote_->on_entry_show_menu.connect(sigc::mem_fun(this, &PanelView::OnEntryShowMenu));
4354 menus->key_activate_entry.connect(sigc::mem_fun(this, &PanelView::ActivateEntry));
4355 menus->open_first.connect(sigc::mem_fun(this, &PanelView::ActivateFirstSensitive));
4356+ menus->RegisterTracker(GetPanelName(), sigc::mem_fun(this, &PanelView::OnMenuPointerMoved));
4357
4358 ubus_manager_.RegisterInterest(UBUS_OVERLAY_HIDDEN, sigc::mem_fun(this, &PanelView::OnOverlayHidden));
4359 ubus_manager_.RegisterInterest(UBUS_OVERLAY_SHOWN, sigc::mem_fun(this, &PanelView::OnOverlayShown));
4360@@ -134,7 +135,7 @@
4361 PanelView::~PanelView()
4362 {
4363 indicator::EntryLocationMap locations;
4364- remote_->SyncGeometries(GetName() + std::to_string(monitor_), locations);
4365+ remote_->SyncGeometries(GetPanelName(), locations);
4366 }
4367
4368 void PanelView::LoadTextures()
4369@@ -374,7 +375,7 @@
4370 GfxContext.GetRenderStates().SetBlend(true, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
4371 nux::TexCoordXForm refine_texxform;
4372
4373- int refine_x_pos = geo.x + (stored_dash_width_ - refine_gradient_midpoint);
4374+ int refine_x_pos = geo.x + (stored_dash_width_ - REFINE_GRADIENT_MIDPOINT.CP(Settings::Instance().em(monitor_)));
4375
4376 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
4377 refine_x_pos += unity::Settings::Instance().LauncherSize(monitor_);
4378@@ -473,7 +474,7 @@
4379
4380 nux::Geometry refine_geo = geo;
4381
4382- int refine_x_pos = geo.x + (stored_dash_width_ - refine_gradient_midpoint);
4383+ int refine_x_pos = geo.x + (stored_dash_width_ - REFINE_GRADIENT_MIDPOINT.CP(Settings::Instance().em(monitor_)));
4384 if (Settings::Instance().launcher_position() == LauncherPosition::LEFT)
4385 refine_x_pos += unity::Settings::Instance().LauncherSize(monitor_);
4386
4387@@ -627,7 +628,7 @@
4388 QueueDraw();
4389 }
4390
4391-void PanelView::OnMenuPointerMoved(int x, int y)
4392+void PanelView::OnMenuPointerMoved(int x, int y, double speed)
4393 {
4394 nux::Geometry const& geo = GetAbsoluteGeometry();
4395
4396@@ -648,116 +649,6 @@
4397 }
4398 }
4399
4400-static bool PointInTriangle(nux::Point const& p, nux::Point const& t0, nux::Point const& t1, nux::Point const& t2)
4401-{
4402- int s = t0.y * t2.x - t0.x * t2.y + (t2.y - t0.y) * p.x + (t0.x - t2.x) * p.y;
4403- int t = t0.x * t1.y - t0.y * t1.x + (t0.y - t1.y) * p.x + (t1.x - t0.x) * p.y;
4404-
4405- if ((s < 0) != (t < 0))
4406- return false;
4407-
4408- int A = -t1.y * t2.x + t0.y * (t2.x - t1.x) + t0.x * (t1.y - t2.y) + t1.x * t2.y;
4409- if (A < 0)
4410- {
4411- s = -s;
4412- t = -t;
4413- A = -A;
4414- }
4415-
4416- return s > 0 && t > 0 && (s + t) < A;
4417-}
4418-
4419-static double GetMouseVelocity(nux::Point const& p0, nux::Point const& p1, util::Timer &timer)
4420-{
4421- int dx, dy;
4422- double speed;
4423- auto millis = timer.ElapsedMicroSeconds();
4424-
4425- if (millis == 0)
4426- return 1;
4427-
4428- dx = p0.x - p1.x;
4429- dy = p0.y - p1.y;
4430-
4431- speed = sqrt(dx * dx + dy * dy) / millis * 1000;
4432-
4433- return speed;
4434-}
4435-
4436-bool PanelView::TrackMenuPointer()
4437-{
4438- nux::Point const& mouse = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
4439- double speed = GetMouseVelocity(mouse, tracked_pointer_pos_, mouse_tracker_timer_);
4440-
4441- mouse_tracker_timer_.Reset();
4442- tracked_pointer_pos_ = mouse;
4443-
4444- double scale = Settings::Instance().em(monitor_)->DPIScale();
4445- if (speed > 0 && PointInTriangle(mouse,
4446- nux::Point(triangle_top_corner_.x, std::max(triangle_top_corner_.y - TRIANGLE_THRESHOLD.CP(scale), 0)),
4447- nux::Point(menu_geo_.x, menu_geo_.y),
4448- nux::Point(menu_geo_.x + menu_geo_.width, menu_geo_.y)))
4449- {
4450- return true;
4451- }
4452-
4453- if (mouse != triangle_top_corner_)
4454- {
4455- triangle_top_corner_ = mouse;
4456- OnMenuPointerMoved(mouse.x, mouse.y);
4457- }
4458-
4459- return true;
4460-}
4461-
4462-void PanelView::OnEntryActivated(std::string const& panel, std::string const& entry_id, nux::Rect const& menu_geo)
4463-{
4464- if (!panel.empty() && panel != GetPanelName())
4465- return;
4466-
4467- menu_geo_ = menu_geo;
4468-
4469- bool active = !entry_id.empty();
4470- if (active && !track_menu_pointer_timeout_)
4471- {
4472- //
4473- // Track menus being scrubbed at 60Hz (about every 16 millisec)
4474- // It might sound ugly, but it's far nicer (and more responsive) than the
4475- // code it replaces which used to capture motion events in another process
4476- // (unity-panel-service) and send them to us over dbus.
4477- // NOTE: The reason why we have to use a timer instead of tracking motion
4478- // events is because the motion events will never be delivered to this
4479- // process. All the motion events will go to unity-panel-service while
4480- // scrubbing because the active panel menu has (needs) the pointer grab.
4481- //
4482- mouse_tracker_timer_.Reset();
4483- triangle_top_corner_ = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
4484- track_menu_pointer_timeout_.reset(new glib::Timeout(16));
4485- track_menu_pointer_timeout_->Run(sigc::mem_fun(this, &PanelView::TrackMenuPointer));
4486- }
4487- else if (!active)
4488- {
4489- track_menu_pointer_timeout_.reset();
4490- menu_view_->NotifyAllMenusClosed();
4491- tracked_pointer_pos_ = {-1, -1};
4492- }
4493-
4494- if (overlay_is_open_)
4495- ubus_manager_.SendMessage(UBUS_OVERLAY_CLOSE_REQUEST);
4496-}
4497-
4498-void PanelView::OnEntryShowMenu(std::string const& entry_id, unsigned xid,
4499- int x, int y, unsigned button)
4500-{
4501- if (!track_menu_pointer_timeout_)
4502- {
4503- // This is ugly... But Nux fault!
4504- menu_view_->IgnoreLeaveEvents(true);
4505- WindowManager::Default().UnGrabMousePointer(CurrentTime, button, x, y);
4506- menu_view_->IgnoreLeaveEvents(false);
4507- }
4508-}
4509-
4510 bool PanelView::ActivateFirstSensitive()
4511 {
4512 if (!IsActive())
4513@@ -768,7 +659,6 @@
4514 {
4515 // Since this only happens on keyboard events, we need to prevent that the
4516 // pointer tracker would select another entry.
4517- tracked_pointer_pos_ = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
4518 return true;
4519 }
4520
4521@@ -785,7 +675,6 @@
4522 {
4523 // Since this only happens on keyboard events, we need to prevent that the
4524 // pointer tracker would select another entry.
4525- tracked_pointer_pos_ = nux::GetGraphicsDisplay()->GetMouseScreenCoord();
4526 return true;
4527 }
4528
4529@@ -847,7 +736,7 @@
4530
4531 std::string PanelView::GetPanelName() const
4532 {
4533- return GetName() + std::to_string(monitor_);
4534+ return GetName() + std::to_string(reinterpret_cast<uintptr_t>(this)) + '_' + std::to_string(monitor_);
4535 }
4536
4537 void PanelView::SyncGeometries()
4538@@ -863,9 +752,13 @@
4539
4540 void PanelView::SetMonitor(int monitor)
4541 {
4542+ auto mouse_tracker_cb = sigc::mem_fun(this, &PanelView::OnMenuPointerMoved);
4543+ menus_->UnregisterTracker(GetPanelName(), mouse_tracker_cb);
4544+
4545 monitor_ = monitor;
4546 menu_view_->SetMonitor(monitor);
4547 indicators_->SetMonitor(monitor);
4548+ menus_->RegisterTracker(GetPanelName(), mouse_tracker_cb);
4549 Resize();
4550
4551 if (WindowManager::Default().IsScaleActive())
4552
4553=== modified file 'panel/PanelView.h'
4554--- panel/PanelView.h 2016-03-30 18:18:07 +0000
4555+++ panel/PanelView.h 2017-12-01 18:43:57 +0000
4556@@ -35,7 +35,6 @@
4557 #include "unity-shared/Introspectable.h"
4558 #include "unity-shared/MenuManager.h"
4559 #include "unity-shared/MockableBaseWindow.h"
4560-#include "unity-shared/Timer.h"
4561 #include "PanelMenuView.h"
4562 #include "PanelTray.h"
4563 #include "PanelIndicatorsView.h"
4564@@ -88,9 +87,6 @@
4565 void OnObjectAdded(indicator::Indicator::Ptr const& proxy);
4566 void OnObjectRemoved(indicator::Indicator::Ptr const& proxy);
4567 void OnIndicatorViewUpdated();
4568- void OnMenuPointerMoved(int x, int y);
4569- void OnEntryActivated(std::string const& panel, std::string const& entry_id, nux::Rect const& geo);
4570- void OnEntryShowMenu(std::string const& entry_id, unsigned xid, int x, int y, unsigned button);
4571
4572 private:
4573 std::string GetPanelName() const;
4574@@ -100,6 +96,8 @@
4575 void OnSpreadInitiate();
4576 void OnSpreadTerminate();
4577 void OnLowGfxChanged();
4578+ void OnMenuPointerMoved(int x, int y, double speed);
4579+ void OnActiveEntryEvent(XEvent const&);
4580 void EnableOverlayMode(bool);
4581 void LoadTextures();
4582
4583@@ -109,11 +107,11 @@
4584 bool IsTransparent();
4585 void UpdateBackground();
4586 void ForceUpdateBackground();
4587- bool TrackMenuPointer();
4588 void SyncGeometries();
4589 void AddPanelView(PanelIndicatorsView* child, unsigned int stretchFactor);
4590
4591 MockableBaseWindow* parent_;
4592+ menu::Manager::Ptr menus_;
4593 indicator::Indicators::Ptr remote_;
4594
4595 // No ownership is taken for these views, that is done by the AddChild method.
4596@@ -133,10 +131,6 @@
4597 BaseTexturePtr bg_refine_single_column_tex_;
4598 std::unique_ptr<nux::AbstractPaintLayer> bg_refine_single_column_layer_;
4599
4600- std::string active_overlay_;
4601- nux::Point tracked_pointer_pos_, triangle_top_corner_;
4602- util::Timer mouse_tracker_timer_;
4603-
4604 bool is_dirty_;
4605 bool opacity_maximized_toggle_;
4606 bool needs_geo_sync_;
4607@@ -144,15 +138,13 @@
4608 float opacity_;
4609 int monitor_;
4610 int stored_dash_width_;
4611-
4612- nux::Geometry menu_geo_;
4613+ std::string active_overlay_;
4614
4615 connection::Manager on_indicator_updated_connections_;
4616 connection::Manager maximized_opacity_toggle_connections_;
4617 BackgroundEffectHelper bg_effect_helper_;
4618 nux::ObjectPtr<nux::IOpenGLBaseTexture> bg_blur_texture_;
4619 UBusManager ubus_manager_;
4620- glib::Source::UniquePtr track_menu_pointer_timeout_;
4621 };
4622
4623 } // namespace panel
4624
4625=== modified file 'plugins/unityshell/src/unityshell.cpp'
4626--- plugins/unityshell/src/unityshell.cpp 2016-09-01 23:56:16 +0000
4627+++ plugins/unityshell/src/unityshell.cpp 2017-12-01 18:43:57 +0000
4628@@ -197,6 +197,7 @@
4629 , menus_(std::make_shared<menu::Manager>(std::make_shared<indicator::DBusIndicators>(), std::make_shared<key::GnomeGrabber>()))
4630 , deco_manager_(std::make_shared<decoration::Manager>(menus_))
4631 , debugger_(this)
4632+ , session_(std::make_shared<session::GnomeManager>())
4633 , needsRelayout(false)
4634 , super_keypressed_(false)
4635 , newFocusedWindow(nullptr)
4636@@ -291,23 +292,22 @@
4637 }
4638 }
4639
4640- //In case of software rendering then enable lowgfx mode.
4641+ //In case of software rendering then enable lowgfx mode.
4642+ std::string lowgfx_env = glib::gchar_to_string(getenv("UNITY_LOW_GFX_MODE"));
4643 std::string renderer = ANSI_TO_TCHAR(NUX_REINTERPRET_CAST(const char *, glGetString(GL_RENDERER)));
4644-
4645 if (renderer.find("Software Rasterizer") != std::string::npos ||
4646 renderer.find("Mesa X11") != std::string::npos ||
4647 renderer.find("llvmpipe") != std::string::npos ||
4648 renderer.find("softpipe") != std::string::npos ||
4649- (getenv("UNITY_LOW_GFX_MODE") != NULL && atoi(getenv("UNITY_LOW_GFX_MODE")) == 1) ||
4650- optionGetLowGraphicsMode())
4651- {
4652- unity_settings_.low_gfx = true;
4653- }
4654-
4655- if (getenv("UNITY_LOW_GFX_MODE") != NULL && atoi(getenv("UNITY_LOW_GFX_MODE")) == 0)
4656+ atoi(lowgfx_env.c_str()) == 1)
4657 {
4658- unity_settings_.low_gfx = false;
4659+ if (lowgfx_env.empty() || atoi(lowgfx_env.c_str()) != 0)
4660+ unity_settings_.supports_3d = false;
4661 }
4662+
4663+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
4664+ BackgroundEffectHelper::blur_type = low_gfx ? BLUR_NONE : (unity::BlurType) optionGetDashBlurExperimental();
4665+ }, *this));
4666 #endif
4667
4668 if (!failed)
4669@@ -383,7 +383,6 @@
4670 optionSetAutohideAnimationNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
4671 optionSetDashBlurExperimentalNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
4672 optionSetShortcutOverlayNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
4673- optionSetLowGraphicsModeNotify(boost::bind(&UnityScreen::optionChanged, this, _1, _2));
4674 optionSetShowLauncherInitiate(boost::bind(&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));
4675 optionSetShowLauncherTerminate(boost::bind(&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3));
4676 optionSetKeyboardFocusInitiate(boost::bind(&UnityScreen::setKeyboardFocusKeyInitiate, this, _1, _2, _3));
4677@@ -477,9 +476,10 @@
4678
4679 Introspectable::AddChild(deco_manager_.get());
4680 auto const& deco_style = decoration::Style::Get();
4681- auto deco_style_cb = sigc::hide(sigc::mem_fun(this, &UnityScreen::OnDecorationStyleChanged));
4682+ auto deco_style_cb = sigc::hide(sigc::mem_fun(this, &UnityScreen::UpdateDecorationStyle));
4683 deco_style->theme.changed.connect(deco_style_cb);
4684 deco_style->title_font.changed.connect(deco_style_cb);
4685+ UpdateDecorationStyle();
4686
4687 minimize_speed_controller_.DurationChanged.connect(
4688 sigc::mem_fun(this, &UnityScreen::OnMinimizeDurationChanged)
4689@@ -515,7 +515,10 @@
4690 unity_a11y_finalize();
4691 QuicklistManager::Destroy();
4692 decoration::DataPool::Reset();
4693- SaveLockStamp(false);
4694+
4695+ if (!session_->AutomaticLogin())
4696+ SaveLockStamp(false);
4697+
4698 reset_glib_logging();
4699
4700 screen->addSupportedAtomsSetEnabled(this, false);
4701@@ -583,12 +586,14 @@
4702
4703 for (auto const& swin : sScreen->getWindows())
4704 {
4705- if (filtered_windows.find(swin->window->id()) != filtered_windows.end())
4706+ if (!swin->window || filtered_windows.find(swin->window->id()) != filtered_windows.end())
4707 continue;
4708
4709- auto* uwin = UnityWindow::get(swin->window);
4710- uwin->OnTerminateSpread();
4711- fake_decorated_windows_.erase(uwin);
4712+ if (UnityWindow* uwin = UnityWindow::get(swin->window))
4713+ {
4714+ uwin->OnTerminateSpread();
4715+ fake_decorated_windows_.erase(uwin);
4716+ }
4717 }
4718
4719 for (auto xid : filtered_windows)
4720@@ -602,6 +607,9 @@
4721
4722 for (auto const& swin : sScreen->getWindows())
4723 {
4724+ if (!swin->window)
4725+ continue;
4726+
4727 auto* uwin = UnityWindow::get(swin->window);
4728 fake_decorated_windows_.insert(uwin);
4729 uwin->OnInitiateSpread();
4730@@ -613,7 +621,13 @@
4731 spread_widgets_.reset();
4732
4733 for (auto const& swin : sScreen->getWindows())
4734- UnityWindow::get(swin->window)->OnTerminateSpread();
4735+ {
4736+ if (!swin->window)
4737+ continue;
4738+
4739+ if (UnityWindow* uwin = UnityWindow::get(swin->window))
4740+ uwin->OnTerminateSpread();
4741+ }
4742
4743 fake_decorated_windows_.clear();
4744 }
4745@@ -845,17 +859,28 @@
4746 wy = y + (last_bound.height - height) / 2;
4747 }
4748
4749-void UnityScreen::OnDecorationStyleChanged()
4750+void UnityScreen::UpdateDecorationStyle()
4751 {
4752 for (UnityWindow* uwin : fake_decorated_windows_)
4753 uwin->CleanupCachedTextures();
4754
4755- auto const& style = decoration::Style::Get();
4756- deco_manager_->shadow_offset = style->ShadowOffset();
4757- deco_manager_->active_shadow_color = style->ActiveShadowColor();
4758- deco_manager_->active_shadow_radius = style->ActiveShadowRadius();
4759- deco_manager_->inactive_shadow_color = style->InactiveShadowColor();
4760- deco_manager_->inactive_shadow_radius = style->InactiveShadowRadius();
4761+ if (optionGetOverrideDecorationTheme())
4762+ {
4763+ deco_manager_->active_shadow_color = NuxColorFromCompizColor(optionGetActiveShadowColor());
4764+ deco_manager_->inactive_shadow_color = NuxColorFromCompizColor(optionGetInactiveShadowColor());
4765+ deco_manager_->active_shadow_radius = optionGetActiveShadowRadius();
4766+ deco_manager_->inactive_shadow_radius = optionGetInactiveShadowRadius();
4767+ deco_manager_->shadow_offset = nux::Point(optionGetShadowXOffset(), optionGetShadowYOffset());
4768+ }
4769+ else
4770+ {
4771+ auto const& style = decoration::Style::Get();
4772+ deco_manager_->shadow_offset = style->ShadowOffset();
4773+ deco_manager_->active_shadow_color = style->ActiveShadowColor();
4774+ deco_manager_->active_shadow_radius = style->ActiveShadowRadius();
4775+ deco_manager_->inactive_shadow_color = style->InactiveShadowColor();
4776+ deco_manager_->inactive_shadow_radius = style->InactiveShadowRadius();
4777+ }
4778 }
4779
4780 void UnityScreen::DamageBlurUpdateRegion(nux::Geometry const& blur_update)
4781@@ -863,7 +888,7 @@
4782 cScreen->damageRegion(CompRegionFromNuxGeo(blur_update));
4783 }
4784
4785-void UnityScreen::paintDisplay()
4786+void UnityScreen::paintOutput()
4787 {
4788 CompOutput *output = last_output_;
4789
4790@@ -1471,6 +1496,13 @@
4791 CompOutput* output,
4792 unsigned int mask)
4793 {
4794+ if (G_UNLIKELY(lockscreen_controller_->IsPaintInhibited()))
4795+ {
4796+ CHECKGL(glClearColor(0.0f, 0.0f, 0.0f, 1.0f));
4797+ CHECKGL(glClear(GL_COLOR_BUFFER_BIT));
4798+ return true;
4799+ }
4800+
4801 bool ret;
4802
4803 /*
4804@@ -1504,7 +1536,7 @@
4805 doShellRepaint = false;
4806
4807 if (doShellRepaint)
4808- paintDisplay();
4809+ paintOutput();
4810
4811 return ret;
4812 }
4813@@ -1667,6 +1699,11 @@
4814
4815 void UnityScreen::donePaint()
4816 {
4817+ if (G_UNLIKELY(lockscreen_controller_->IsPaintInhibited()))
4818+ {
4819+ lockscreen_controller_->MarkBufferHasCleared();
4820+ }
4821+
4822 /*
4823 * It's only safe to clear the draw list if drawing actually occurred
4824 * (i.e. the shell was not obscured behind a fullscreen window).
4825@@ -2042,13 +2079,6 @@
4826 case MapRequest:
4827 ShowdesktopHandler::InhibitLeaveShowdesktopMode (event->xmaprequest.window);
4828 break;
4829- case PropertyNotify:
4830- if (bghash_ && event->xproperty.window == GDK_ROOT_WINDOW() &&
4831- event->xproperty.atom == bghash_->ColorAtomId())
4832- {
4833- bghash_->RefreshColor();
4834- }
4835- break;
4836 default:
4837 if (screen->shapeEvent() + ShapeNotify == event->type)
4838 {
4839@@ -3104,18 +3134,18 @@
4840
4841 if (uScreen->doShellRepaint && window == uScreen->onboard_)
4842 {
4843- uScreen->paintDisplay();
4844+ uScreen->paintOutput();
4845 }
4846 else if (uScreen->doShellRepaint &&
4847 window == uScreen->firstWindowAboveShell &&
4848 !uScreen->forcePaintOnTop() &&
4849 !uScreen->fullscreenRegion.contains(window->geometry()))
4850 {
4851- uScreen->paintDisplay();
4852+ uScreen->paintOutput();
4853 }
4854 else if (locked && CanBypassLockScreen())
4855 {
4856- uScreen->paintDisplay();
4857+ uScreen->paintOutput();
4858 }
4859
4860 enum class DrawPanelShadow
4861@@ -3598,43 +3628,16 @@
4862 break;
4863 }
4864 case UnityshellOptions::OverrideDecorationTheme:
4865- if (optionGetOverrideDecorationTheme())
4866- {
4867- deco_manager_->active_shadow_color = NuxColorFromCompizColor(optionGetActiveShadowColor());
4868- deco_manager_->inactive_shadow_color = NuxColorFromCompizColor(optionGetInactiveShadowColor());
4869- deco_manager_->active_shadow_radius = optionGetActiveShadowRadius();
4870- deco_manager_->inactive_shadow_radius = optionGetInactiveShadowRadius();
4871- deco_manager_->shadow_offset = nux::Point(optionGetShadowXOffset(), optionGetShadowYOffset());
4872- }
4873- else
4874- {
4875- OnDecorationStyleChanged();
4876- }
4877- break;
4878 case UnityshellOptions::ActiveShadowColor:
4879- if (optionGetOverrideDecorationTheme())
4880- deco_manager_->active_shadow_color = NuxColorFromCompizColor(optionGetActiveShadowColor());
4881- break;
4882+ case UnityshellOptions::ActiveShadowRadius:
4883 case UnityshellOptions::InactiveShadowColor:
4884- if (optionGetOverrideDecorationTheme())
4885- deco_manager_->inactive_shadow_color = NuxColorFromCompizColor(optionGetInactiveShadowColor());
4886- break;
4887- case UnityshellOptions::ActiveShadowRadius:
4888- if (optionGetOverrideDecorationTheme())
4889- deco_manager_->active_shadow_radius = optionGetActiveShadowRadius();
4890- break;
4891 case UnityshellOptions::InactiveShadowRadius:
4892- if (optionGetOverrideDecorationTheme())
4893- deco_manager_->inactive_shadow_radius = optionGetInactiveShadowRadius();
4894- break;
4895 case UnityshellOptions::ShadowXOffset:
4896- if (optionGetOverrideDecorationTheme())
4897- deco_manager_->shadow_offset = nux::Point(optionGetShadowXOffset(), optionGetShadowYOffset());
4898- break;
4899 case UnityshellOptions::ShadowYOffset:
4900- if (optionGetOverrideDecorationTheme())
4901- deco_manager_->shadow_offset = nux::Point(optionGetShadowXOffset(), optionGetShadowYOffset());
4902+ {
4903+ UpdateDecorationStyle();
4904 break;
4905+ }
4906 case UnityshellOptions::LauncherHideMode:
4907 {
4908 launcher_options->hide_mode = (launcher::LauncherHideMode) optionGetLauncherHideMode();
4909@@ -3736,14 +3739,6 @@
4910 case UnityshellOptions::ShortcutOverlay:
4911 shortcut_controller_->SetEnabled(optionGetShortcutOverlay());
4912 break;
4913- case UnityshellOptions::LowGraphicsMode:
4914- if (optionGetLowGraphicsMode())
4915- BackgroundEffectHelper::blur_type = BLUR_NONE;
4916- else
4917- BackgroundEffectHelper::blur_type = (unity::BlurType)optionGetDashBlurExperimental();
4918-
4919- unity::Settings::Instance().low_gfx = optionGetLowGraphicsMode();
4920- break;
4921 case UnityshellOptions::DecayRate:
4922 launcher_options->edge_decay_rate = optionGetDecayRate() * 100;
4923 break;
4924@@ -3843,6 +3838,12 @@
4925 ScheduleRelayout(500);
4926 }
4927
4928+void UnityScreen::averageColorChangeNotify(const unsigned short *color)
4929+{
4930+ bghash_->UpdateColor(color, nux::animation::Animation::State::Running);
4931+ screen->averageColorChangeNotify (color);
4932+}
4933+
4934 bool UnityScreen::layoutSlotsAndAssignWindows()
4935 {
4936 auto const& scaled_windows = sScreen->getWindows();
4937@@ -3855,7 +3856,7 @@
4938
4939 for (ScaleWindow *sw : scaled_windows)
4940 {
4941- if (sw->window->outputDevice() == static_cast<int>(output.id()))
4942+ if (sw->window && sw->window->outputDevice() == static_cast<int>(output.id()))
4943 {
4944 UnityWindow::get(sw->window)->deco_win_->scaled = true;
4945 layout_windows.emplace_back(std::make_shared<LayoutWindow>(sw->window->id()));
4946@@ -3983,6 +3984,8 @@
4947
4948 // We disable the edge barriers, to avoid blocking the mouse pointer during lockscreen
4949 edge_barriers_->force_disable = true;
4950+
4951+ UpdateGesturesSupport();
4952 }
4953
4954 void UnityScreen::OnScreenUnlocked()
4955@@ -3999,19 +4002,36 @@
4956 screen->addAction(&action);
4957
4958 edge_barriers_->force_disable = false;
4959+
4960+ UpdateGesturesSupport();
4961+}
4962+
4963+std::string UnityScreen::GetLockStampFile() const
4964+{
4965+ std::string cache_dir;
4966+
4967+ if (session_->AutomaticLogin())
4968+ cache_dir = DesktopUtilities::GetUserCacheDirectory();
4969+ else
4970+ cache_dir = DesktopUtilities::GetUserRuntimeDirectory();
4971+
4972+ if (cache_dir.empty())
4973+ return std::string();
4974+
4975+ return cache_dir+local::LOCKED_STAMP;
4976 }
4977
4978 void UnityScreen::SaveLockStamp(bool save)
4979 {
4980- auto const& cache_dir = DesktopUtilities::GetUserRuntimeDirectory();
4981+ std::string file_path = GetLockStampFile();
4982
4983- if (cache_dir.empty())
4984+ if (file_path.empty())
4985 return;
4986
4987 if (save)
4988 {
4989 glib::Error error;
4990- g_file_set_contents((cache_dir+local::LOCKED_STAMP).c_str(), "", 0, &error);
4991+ g_file_set_contents(file_path.c_str(), "", 0, &error);
4992
4993 if (error)
4994 {
4995@@ -4020,7 +4040,7 @@
4996 }
4997 else
4998 {
4999- if (g_unlink((cache_dir+local::LOCKED_STAMP).c_str()) < 0)
5000+ if (g_unlink(file_path.c_str()) < 0)
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: