diff -Nru unity-settings-daemon-15.04.1+18.04.20180216/debian/changelog unity-settings-daemon-15.04.1+18.04.20180413/debian/changelog --- unity-settings-daemon-15.04.1+18.04.20180216/debian/changelog 2018-04-13 21:42:26.000000000 +0000 +++ unity-settings-daemon-15.04.1+18.04.20180413/debian/changelog 2018-04-13 21:42:27.000000000 +0000 @@ -1,3 +1,20 @@ +unity-settings-daemon (15.04.1+18.04.20180413-0ubuntu1) bionic; urgency=medium + + [ Marco Trevisan (Treviño) ] + * gsd-rr-config: rename monitor config files to unity-monitors.xml* + (LP: #1763806) + * debian: + - build-depends on dh-migrations and run dh_migrations on post-install + - add debian/unity-settings-daemon.migrations to install migration files + * scripts/01-usd-migration-monitors-xml.sh: + - Move monitors.xml to unity-monitors.xml if migration is needed + (LP: #1763806) + + [ Robert Ancell ] + * Support new AccountsService method of setting background file. + + -- Marco Trevisan (Treviño) Fri, 13 Apr 2018 21:33:54 +0000 + unity-settings-daemon (15.04.1+18.04.20180216-0ubuntu1) bionic; urgency=medium * No-change rebuild against latest gnome-desktop3 diff -Nru unity-settings-daemon-15.04.1+18.04.20180216/debian/control unity-settings-daemon-15.04.1+18.04.20180413/debian/control --- unity-settings-daemon-15.04.1+18.04.20180216/debian/control 2018-04-13 21:42:26.000000000 +0000 +++ unity-settings-daemon-15.04.1+18.04.20180413/debian/control 2018-04-13 21:42:27.000000000 +0000 @@ -7,6 +7,7 @@ gnome-pkg-tools, gtk-doc-tools, dh-autoreconf, + dh-migrations, autotools-dev, intltool (>= 0.37.1), libdbus-glib-1-dev (>= 0.74), diff -Nru unity-settings-daemon-15.04.1+18.04.20180216/debian/rules unity-settings-daemon-15.04.1+18.04.20180413/debian/rules --- unity-settings-daemon-15.04.1+18.04.20180216/debian/rules 2018-04-13 21:42:26.000000000 +0000 +++ unity-settings-daemon-15.04.1+18.04.20180413/debian/rules 2018-04-13 21:42:27.000000000 +0000 @@ -29,8 +29,10 @@ find debian -name '*.a' -delete find debian -name '*.la' -delete +binary-post-install/unity-settings-daemon:: + dh_migrations + common-binary-post-install-arch:: list-missing clean:: rm -f gnome-settings-daemon/gnome-update-wallpaper-cache - diff -Nru unity-settings-daemon-15.04.1+18.04.20180216/debian/unity-settings-daemon.migrations unity-settings-daemon-15.04.1+18.04.20180413/debian/unity-settings-daemon.migrations --- unity-settings-daemon-15.04.1+18.04.20180216/debian/unity-settings-daemon.migrations 1970-01-01 00:00:00.000000000 +0000 +++ unity-settings-daemon-15.04.1+18.04.20180413/debian/unity-settings-daemon.migrations 2018-04-13 21:42:27.000000000 +0000 @@ -0,0 +1 @@ +scripts/*-usd-migration-* diff -Nru unity-settings-daemon-15.04.1+18.04.20180216/gnome-settings-daemon/gsd-rr-config.c unity-settings-daemon-15.04.1+18.04.20180413/gnome-settings-daemon/gsd-rr-config.c --- unity-settings-daemon-15.04.1+18.04.20180216/gnome-settings-daemon/gsd-rr-config.c 2018-02-16 01:57:18.000000000 +0000 +++ unity-settings-daemon-15.04.1+18.04.20180413/gnome-settings-daemon/gsd-rr-config.c 2018-04-13 21:33:21.000000000 +0000 @@ -43,8 +43,8 @@ #include "edid.h" #include "gsd-rr-private.h" -#define CONFIG_INTENDED_BASENAME "monitors.xml" -#define CONFIG_BACKUP_BASENAME "monitors.xml.backup" +#define CONFIG_INTENDED_BASENAME "unity-monitors.xml" +#define CONFIG_BACKUP_BASENAME "unity-monitors.xml.backup" /* Look for DPI_FALLBACK in: * http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/xsettings/gsd-xsettings-manager.c diff -Nru unity-settings-daemon-15.04.1+18.04.20180216/plugins/background/gsd-background-manager.c unity-settings-daemon-15.04.1+18.04.20180413/plugins/background/gsd-background-manager.c --- unity-settings-daemon-15.04.1+18.04.20180216/plugins/background/gsd-background-manager.c 2018-02-16 01:57:18.000000000 +0000 +++ unity-settings-daemon-15.04.1+18.04.20180413/plugins/background/gsd-background-manager.c 2018-04-13 21:33:07.000000000 +0000 @@ -399,80 +399,80 @@ static void set_accountsservice_background (const gchar *background) { - GDBusProxy *proxy = NULL; - GDBusProxy *user = NULL; - GVariant *variant = NULL; + GDBusConnection *bus; + GVariant *variant; GError *error = NULL; gchar *object_path = NULL; - proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - NULL, + bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); + if (bus == NULL) { + g_warning ("Failed to get system bus: %s", error->message); + g_error_free (error); + return; + } + + variant = g_dbus_connection_call_sync (bus, "org.freedesktop.Accounts", "/org/freedesktop/Accounts", "org.freedesktop.Accounts", + "FindUserByName", + g_variant_new ("(s)", g_get_user_name ()), + G_VARIANT_TYPE ("(o)"), + G_DBUS_CALL_FLAGS_NONE, + -1, NULL, &error); - - if (proxy == NULL) { - g_warning ("Failed to contact accounts service: %s", error->message); - g_error_free (error); - return; - } - - variant = g_dbus_proxy_call_sync (proxy, - "FindUserByName", - g_variant_new ("(s)", g_get_user_name ()), - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, - &error); - if (variant == NULL) { g_warning ("Could not contact accounts service to look up '%s': %s", g_get_user_name (), error->message); g_error_free (error); - goto bail; + g_object_unref (bus); + return; } - g_variant_get (variant, "(o)", &object_path); - user = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_NONE, - NULL, - "org.freedesktop.Accounts", - object_path, - "org.freedesktop.Accounts.User", - NULL, - &error); - g_free (object_path); - - if (user == NULL) { - g_warning ("Could not create proxy for user '%s': %s", - g_variant_get_string (variant, NULL), error->message); - g_error_free (error); - goto bail; - } g_variant_unref (variant); - variant = g_dbus_proxy_call_sync (user, - "SetBackgroundFile", - g_variant_new ("(s)", background ? background : ""), - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, - &error); - - if (variant == NULL) { + variant = g_dbus_connection_call_sync (bus, + "org.freedesktop.Accounts", + object_path, + "org.freedesktop.DBus.Properties", + "Set", + g_variant_new ("(ssv)", + "org.freedesktop.DisplayManager.AccountsService", + "BackgroundFile", + g_variant_new_string (background ? background : "")), + G_VARIANT_TYPE ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); + if (variant != NULL) + g_variant_unref (variant); + else { g_warning ("Failed to set the background '%s': %s", background, error->message); - g_error_free (error); - goto bail; + g_clear_error (&error); } -bail: - if (proxy != NULL) - g_object_unref (proxy); + /* Also attempt the old method (patch not upstreamed into AccountsService */ + variant = g_dbus_connection_call_sync (bus, + "org.freedesktop.Accounts", + object_path, + "org.freedesktop.Accounts.User", + "SetBackgroundFile", + g_variant_new ("(s)", background ? background : ""), + G_VARIANT_TYPE ("()"), + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + &error); if (variant != NULL) g_variant_unref (variant); + else { + g_warning ("Failed to set the background '%s': %s", background, error->message); + g_clear_error (&error); + } + + g_object_unref (bus); } static void diff -Nru unity-settings-daemon-15.04.1+18.04.20180216/plugins/xrandr/gsd-xrandr-manager.c unity-settings-daemon-15.04.1+18.04.20180413/plugins/xrandr/gsd-xrandr-manager.c --- unity-settings-daemon-15.04.1+18.04.20180216/plugins/xrandr/gsd-xrandr-manager.c 2018-02-16 01:57:18.000000000 +0000 +++ unity-settings-daemon-15.04.1+18.04.20180413/plugins/xrandr/gsd-xrandr-manager.c 2018-04-13 21:33:21.000000000 +0000 @@ -560,8 +560,8 @@ /* ENOENT means the original file didn't exist. That is *not* an error; * the backup was not created because there wasn't even an original - * monitors.xml (such as on a first-time login). Note that *here* there - * is a "didn't work" monitors.xml, so we must delete that one. + * unity-monitors.xml (such as on a first-time login). Note that *here* + * there is a "didn't work" unity-monitors.xml, so we must delete that one. */ if (saved_errno == ENOENT) unlink (intended_filename); diff -Nru unity-settings-daemon-15.04.1+18.04.20180216/scripts/01-usd-migration-monitors-xml.sh unity-settings-daemon-15.04.1+18.04.20180413/scripts/01-usd-migration-monitors-xml.sh --- unity-settings-daemon-15.04.1+18.04.20180216/scripts/01-usd-migration-monitors-xml.sh 1970-01-01 00:00:00.000000000 +0000 +++ unity-settings-daemon-15.04.1+18.04.20180413/scripts/01-usd-migration-monitors-xml.sh 2018-04-13 21:33:21.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/bash + +MONITORS_FILES="monitors.xml monitors.xml.backup monitors-v1-backup.xml" +config_path="$HOME/.config" + +if [ -n "$XDG_CONFIG_HOME" ]; then + config_path="$XDG_CONFIG_HOME"; +fi + +for monitor_file in $MONITORS_FILES; do + old_monitors="$config_path/$monitor_file" + new_monitors="$config_path/unity-$monitor_file" + + if [ -f "$old_monitors" ]; then + if grep ']*>' "$old_monitors" | grep -Fq 'version="1"'; then + cp -v "$old_monitors" "$new_monitors" + fi + fi +done + +if [ -f "$config_path/unity-monitors-v1-backup.xml" ] && + [ ! -f "$config_path/unity-monitors.xml" ]; then + cp -v "$config_path/unity-monitors-v1-backup.xml" \ + "$config_path/unity-monitors.xml" +fi