on xenial help sign in
More $SNAP fixes
commitcd839cf78898c0a5f1b641911faaa7c8ae94377c authorMichael Terry <michael.terry@canonical.com> dateFri 7 Oct 2016, 13:22 (10 years ago) parentd7f92d3
7 files changed+27−8
data/unity8-dash.conf+1−1 data/unity8-filewatcher.conf+5 data/unity8-greeter-wrapper+6−6 plugins/LightDM/SessionsModel.cpp+8 plugins/Utils/constants.cpp+3 plugins/Utils/constants.h+3 qml/Shell.qml+1−1
data/unity8-dash.conf+1−1
@@ -22,4 +22,4 @@ pre-start script
2222 initctl emit scope-ui-starting
2323end script
2424
25−exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=/usr/share/applications/unity8-dash.desktop
25+exec ${BINARY:-unity8-dash} $ARGS --desktop_file_hint=unity8-dash.desktop
data/unity8-filewatcher.conf+5
@@ -1,6 +1,11 @@
11description "File system watcher for unity8"
22author "Michael Zanetti <michael.zanetti@canonical.com>"
33
4+# This method of updating the launcher will not work in our new snappy world,
5+# neither for snaps installed in the system nor if we are running inside a snap.
6+# Plus it hardcodes the phablet user... To be replaced once bug 1630997 is
7+# fixed in ubuntu-app-launch.
8+
49# Workaround for bug 1360208. ~ and * in one expression doesn't work currently
510start on (file FILE=/home/phablet/.local/share/applications/*.desktop) or (file FILE=/usr/share/applications/*.desktop)
611
data/unity8-greeter-wrapper+6−6
@@ -45,8 +45,8 @@ echo "DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS}" >"$XDG_RUNTIME_DIR/d
4545
4646# If touch session script (which sets up grid units and mir variables) is available, use it
4747TOUCH_WRAPPER=
48−if [ -x /usr/bin/ubuntu-touch-session ]; then
49− TOUCH_WRAPPER=/usr/bin/ubuntu-touch-session
48+if which ubuntu-touch-session >/dev/null; then
49+ TOUCH_WRAPPER=ubuntu-touch-session
5050fi
5151
5252# Pretend that we're in an ubuntu-touch session, so that indicator-network
@@ -63,7 +63,7 @@ set_greeter_var PA_DISABLED 1
6363# creates for them and don't want to start all the services that a normal
6464# session would. So it's inconvenient to live within an upstart session.
6565# But... we still want to use Upstart for some services. So launch here.
66−MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER /sbin/upstart --user --no-startup-event &
66+MIR_SOCKET=$SUB_SOCKET $TOUCH_WRAPPER upstart --user --no-startup-event &
6767INIT_PID=$!
6868while [ ! -e "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session" ]; do sleep 0.1; done
6969. "$XDG_RUNTIME_DIR/upstart/sessions/$INIT_PID.session"
@@ -72,11 +72,11 @@ export UPSTART_SESSION
7272# Connect upstart to system, but do first command in a loop to avoid any
7373# race condition between the session file above being written and upstart being
7474# ready to handle requests.
75−while ! /sbin/initctl notify-dbus-address "$DBUS_SESSION_BUS_ADDRESS"; do sleep 0.1; done
76−/sbin/initctl start notify-cgmanager
75+while ! initctl notify-dbus-address "$DBUS_SESSION_BUS_ADDRESS"; do sleep 0.1; done
76+initctl start notify-cgmanager
7777
7878# Start any pre-greeter tasks if needed (like wizard)
79−/sbin/initctl emit unity8-greeter-starting
79+initctl emit unity8-greeter-starting
8080
8181# Define language here for phone if available. When phone user switches their
8282# language, they expect that to affect the greeter too. But the user doesn't
plugins/LightDM/SessionsModel.cpp+8
@@ -119,6 +119,14 @@ SessionsModel::SessionsModel(QObject* parent)
119119 m_roleNames = m_model->roleNames();
120120 m_roleNames[IconRole] = "icon_url";
121121
122+ // Update search locations to use $SNAP prefix if specified
123+ auto snapRoot = QFile::decodeName(qgetenv("SNAP"));
124+ if (!snapRoot.isEmpty()) {
125+ for (int i = 0; i < m_iconSearchDirectories.size(); i++) {
126+ m_iconSearchDirectories[i] = snapRoot + m_iconSearchDirectories[i];
127+ }
128+ }
129+
122130 setModel(m_model);
123131 setSourceModel(m_model);
124132 setSortCaseSensitivity(Qt::CaseInsensitive);
plugins/Utils/constants.cpp+3
@@ -24,4 +24,7 @@ Constants::Constants(QObject *parent)
2424 } else {
2525 m_indicatorValueTimeout = 5000;
2626 }
27+
28+ QString snapRoot = QFile::decodeName(qgetenv("SNAP"));
29+ m_defaultWallpaper = snapRoot + "/usr/share/backgrounds/warty-final-ubuntu.png";
2730}
plugins/Utils/constants.h+3
@@ -30,14 +30,17 @@ class Constants: public QObject
3030{
3131 Q_OBJECT
3232 Q_PROPERTY(int indicatorValueTimeout READ indicatorValueTimeout CONSTANT)
33+ Q_PROPERTY(QString defaultWallpaper READ defaultWallpaper CONSTANT)
3334
3435public:
3536 Constants(QObject *parent = 0);
3637
3738 int indicatorValueTimeout() const { return m_indicatorValueTimeout; }
39+ QString defaultWallpaper() const { return m_defaultWallpaper; }
3840
3941private:
4042 int m_indicatorValueTimeout;
43+ QString m_defaultWallpaper;
4144};
4245
4346#endif
qml/Shell.qml+1−1
@@ -148,7 +148,7 @@ StyledItem {
148148 id: wallpaperResolver
149149 objectName: "wallpaperResolver"
150150
151− readonly property url defaultBackground: "file:///usr/share/backgrounds/warty-final-ubuntu.png"
151+ readonly property url defaultBackground: "file://" + Utils.Constants.defaultBackground
152152 readonly property bool hasCustomBackground: background != defaultBackground
153153
154154 // Use a cached version of the scaled-down wallpaper (as sometimes the