diff -pruN 3.6.1-13/debian/changelog 3.6.1-13ubuntu2/debian/changelog
--- 3.6.1-13/debian/changelog	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/changelog	2022-07-28 11:22:34.000000000 +0000
@@ -1,3 +1,15 @@
+gnome-screensaver (3.6.1-13ubuntu2) kinetic; urgency=medium
+
+  * Rebuild against latest gnome-desktop
+
+ -- Jeremy Bicha <jbicha@ubuntu.com>  Thu, 28 Jul 2022 07:22:34 -0400
+
+gnome-screensaver (3.6.1-13ubuntu1) hirsute; urgency=medium
+
+  * Resynchronize on Debian
+
+ -- Sebastien Bacher <seb128@ubuntu.com>  Mon, 01 Mar 2021 10:49:13 +0100
+
 gnome-screensaver (3.6.1-13) unstable; urgency=medium
 
   * Build-Depend on debhelper-compat 12
@@ -13,6 +25,83 @@ gnome-screensaver (3.6.1-12) experimenta
 
  -- Iain Lane <laney@debian.org>  Fri, 28 Feb 2020 17:29:09 +0000
 
+gnome-screensaver (3.6.1-11ubuntu4) focal; urgency=medium
+
+  * Cherry-pick change from 3.6.1-12: 
+    - control, manager-adapt-to-gnome-desktop-API-changes.patch: Adapt to
+      gnome-desktop 3-19 `gnome_bg_create_surface()` changed signature.
+
+ -- Iain Lane <iain.lane@canonical.com>  Fri, 28 Feb 2020 17:42:44 +0000
+
+gnome-screensaver (3.6.1-11ubuntu3) focal; urgency=medium
+
+  * No-change rebuild against libgnome-desktop-3-19
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Fri, 28 Feb 2020 04:33:24 +0000
+
+gnome-screensaver (3.6.1-11ubuntu2) focal; urgency=medium
+
+  * Drop 05_dbus_service.patch. It causes problems for the GNOME Flashback
+    session. If something still needs gnome-screensaver, it should use the
+    session autostart mechanism instead.
+
+ -- Dmitry Shachnev <mitya57@ubuntu.com>  Thu, 13 Feb 2020 16:58:21 +0300
+
+gnome-screensaver (3.6.1-11ubuntu1) focal; urgency=medium
+
+  * Merge with Debian unstable, remaining changes:
+    - Add 03_fix_ltsp-fading.patch: don't fade on LTSP
+    - Add 05_dbus_service.patch:
+      + restore the dbus service that upstream dropped
+    - Add 10_legacy_scrsvr_inhibit.patch:
+      + Reintroduce legacy API for inhibiting the screensaver
+    - Add 13_nvidia_gamma_fade_fallback.patch:
+      + Fall back to XF86VM gamma fade if XRANDR gamma fade is not supported
+    - Add 15_dont_crash_on_no_fade.patch:
+      + Don't crash on systems that don't support XF86VM or XRANDR gamma fade,
+        by testing if fade is supported on a particular screen before calling
+        the fade_setup and fade_finish virtual functions
+    - Add 16_dont_crash_in_kvm.patch:
+      + Don't crash when the XF86VM extension doesn't allow the gamma to be set
+    - Add 17_remove_top_panel.patch: Don't create the top panel.
+    - Add 18_unity_dialog_layout.patch: Revert lock dialog to
+      previous appearance to get username back.
+    - Add 24_use_user_settings.patch: use the user settings, and
+      not the default system ones, so we get the user's background when the
+      screen is locked.
+    - Add 25_fix_lock_command.patch: make --lock expect a reply
+      so the screen gets properly locked when gnome-screensaver needs to be
+      respawned by dbus. This was preventing ctrl-alt-l from locking the
+      screen on the first attempt when the gnome-screensaver process was
+      dead.
+    - Add 27_lightdm_switch_user.patch: When used under lightdm,
+      use dbus to switch to greeter instead of calling gdmflexiserver.
+    - Add 28_blocking_return.patch:
+      + Correctly reply so the client doesn't block waiting
+    - Add 29_handle_expired_creds.patch:
+      + Allow handling of expired credentials.
+    - Add 30_ubuntu-lock-on-suspend_gsetting.patch: Handle
+      ubuntu-lock-on-suspend gsettings key. This is introduced in Ubuntu's
+      gsettings-desktop-schemas package.
+    - Modify 31_lock_screen_on_suspend.patch:
+      + Support ubunntu-lock-on-suspend key introduced by the previous patch.
+    - Add 32_input_sources_switcher.patch:
+      + Use input sources instead of XKB layouts.
+    - Add 33_budgie_support.patch:
+      + enable support for gnome-control-center
+      + style the lock-screen using the "Unity" patch-work
+    - Add move_not_nuke.patch: When trying to acquire a contentious
+      keyboard grab, don't nuke input focus, but instead move it to new grab
+      window before taking grab
+    - Add allow-replacement: Make the D-Bus interface able to be
+      replaced, so that Unity (or others in future) can take it over if they
+      want to provide their own screensaver implementations. No need to listen
+      to NameOwnerChanged, only NameLost — so we don't have to wake
+      gnome-screensaver up every time this signal goes across the bus.
+  * Refresh patches.
+
+ -- Dmitry Shachnev <mitya57@ubuntu.com>  Fri, 06 Dec 2019 13:17:42 +0300
+
 gnome-screensaver (3.6.1-11) unstable; urgency=medium
 
   [ Jeremy Bicha ]
@@ -40,6 +129,88 @@ gnome-screensaver (3.6.1-10) unstable; u
 
  -- Jeremy Bicha <jbicha@debian.org>  Tue, 25 Dec 2018 08:55:35 -0500
 
+gnome-screensaver (3.6.1-8ubuntu3.2) eoan; urgency=medium
+
+  * debian/source_gnome-screensaver.py:
+    - backport a fix from Debian for a merge error (lp: #1804709)
+    - use python3 (lp: #1804710)
+  * debian/patches/03_fix_ltsp-fading.patch:
+    - fix an invalid return call leading to a build error
+
+ -- Sebastien Bacher <seb128@debian.org>  Mon, 19 Aug 2019 17:31:01 +0200
+
+gnome-screensaver (3.6.1-8ubuntu3.1) eoan; urgency=medium
+
+  * Rebuild for new gnome-desktop soname version
+
+ -- Sebastien Bacher <seb128@ubuntu.com>  Mon, 19 Aug 2019 16:53:56 +0200
+
+gnome-screensaver (3.6.1-8ubuntu3) bionic; urgency=medium
+
+  * Update 33_budgie_support.patch
+    - Add lock-dialog stylecontext to allow theming (LP: #1740150)
+
+ -- David Mohammed <fossfreedom@ubuntu.com>  Tue, 06 Mar 2018 23:55:34 -0600
+
+gnome-screensaver (3.6.1-8ubuntu2) bionic; urgency=medium
+
+  * No-change rebuild against latest gnome-desktop3
+
+ -- Jeremy Bicha <jbicha@ubuntu.com>  Thu, 15 Feb 2018 21:03:55 -0500
+
+gnome-screensaver (3.6.1-8ubuntu1) bionic; urgency=medium
+
+  * Sync with Debian. Remaining changes:
+    - Add 03_fix_ltsp-fading.patch: don't fade on LTSP
+    - Add 05_dbus_service.patch:
+      + restore the dbus service that upstream dropped
+    - Add 13_nvidia_gamma_fade_fallback.patch:
+      + Fall back to XF86VM gamma fade if XRANDR gamma fade is not supported
+    - Add 14_no_fade_on_user_switch.patch:
+      + Disable fade on locking to work around #546578 and prevent the screen
+        remaining blank after user switching.
+    - Add 15_dont_crash_on_no_fade.patch:
+      + Don't crash on systems that don't support XF86VM or XRANDR gamma fade,
+        by testing if fade is supported on a particular screen before calling
+        the fade_setup and fade_finish virtual functions
+    - Add 16_dont_crash_in_kvm.patch:
+      + Don't crash when the XF86VM extension doesn't allow the gamma to be set
+    - Add 17_remove_top_panel.patch: Don't create the top panel.
+    - Add 18_revert_dialog_layout.patch: Revert lock dialog to
+      previous appearance to get username back.
+    - Add 24_use_user_settings.patch: use the user settings, and
+      not the default system ones, so we get the user's background when the
+      screen is locked.
+    - Add 25_fix_lock_command.patch: make --lock expect a reply
+      so the screen gets properly locked when gnome-screensaver needs to be
+      respawned by dbus. This was preventing ctrl-alt-l from locking the
+      screen on the first attempt when the gnome-screensaver process was
+      dead.
+    - Add 27_lightdm_switch_user.patch: When used under lightdm,
+      use dbus to switch to greeter instead of calling gdmflexiserver.
+    - Add 28_blocking_return.patch:
+      + Correctly reply so the client doesn't block waiting
+    - Add 28_handle_expired_creds.patch:
+      + Allow handling of expired credentials.
+    - Add 30_ubuntu-lock-on-suspend_gsetting.patch: Handle
+      ubuntu-lock-on-suspend gsettings key. This is introduced in Ubuntu's
+      gsettings-desktop-schemas package.
+    - Add 32_input_sources_switcher.patch:
+      + Use input sources instead of XKB layouts.
+    - Add 33_budgie_support.patch:
+      + enable support for gnome-control-center
+      + style the lock-screen using the "Unity" patch-work
+    - Add move_not_nuke.patch: When trying to acquire a contentious
+      keyboard grab, don't nuke input focus, but instead move it to new grab
+      window before taking grab
+    - Add allow-replacement: Make the D-Bus interface able to be
+      replaced, so that Unity (or others in future) can take it over if they
+      want to provide their own screensaver implementations. No need to listen
+      to NameOwnerChanged, only NameLost — so we don't have to wake
+      gnome-screensaver up every time this signal goes across the bus.
+
+ -- Jeremy Bicha <jbicha@ubuntu.com>  Sun, 24 Dec 2017 20:55:16 -0500
+
 gnome-screensaver (3.6.1-8) unstable; urgency=medium
 
   [ Laurent Bigonville ]
diff -pruN 3.6.1-13/debian/control 3.6.1-13ubuntu2/debian/control
--- 3.6.1-13/debian/control	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/control	2021-03-01 09:49:13.000000000 +0000
@@ -5,8 +5,9 @@
 Source: gnome-screensaver
 Section: gnome
 Priority: optional
-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
-Uploaders: Dmitry Shachnev <mitya57@debian.org>, Emilio Pozuelo Monfort <pochu@debian.org>, Iain Lane <laney@debian.org>, Jeremy Bicha <jbicha@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
+Uploaders: Dmitry Shachnev <mitya57@debian.org>, Emilio Pozuelo Monfort <pochu@debian.org>, Jeremy Bicha <jbicha@debian.org>, Michael Biebl <biebl@debian.org>, Sjoerd Simons <sjoerd@debian.org>
 Build-Depends: debhelper-compat (= 12),
                dh-sequence-gnome,
                gnome-common,
diff -pruN 3.6.1-13/debian/control.in 3.6.1-13ubuntu2/debian/control.in
--- 3.6.1-13/debian/control.in	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/control.in	2021-03-01 09:49:13.000000000 +0000
@@ -1,7 +1,8 @@
 Source: gnome-screensaver
 Section: gnome
 Priority: optional
-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>
 Uploaders: @GNOME_TEAM@
 Build-Depends: debhelper-compat (= 12),
                dh-sequence-gnome,
diff -pruN 3.6.1-13/debian/patches/0001-gs-lock-plug-Disconnect-signal-handler-from-right-ob.patch 3.6.1-13ubuntu2/debian/patches/0001-gs-lock-plug-Disconnect-signal-handler-from-right-ob.patch
--- 3.6.1-13/debian/patches/0001-gs-lock-plug-Disconnect-signal-handler-from-right-ob.patch	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/0001-gs-lock-plug-Disconnect-signal-handler-from-right-ob.patch	2019-12-06 10:17:42.000000000 +0000
@@ -10,10 +10,10 @@ https://bugzilla.gnome.org/show_bug.cgi?
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
-index 4552646..9cadedb 100644
+index 3846cd4..383508a 100644
 --- a/src/gs-lock-plug.c
 +++ b/src/gs-lock-plug.c
-@@ -483,7 +483,7 @@ gs_lock_plug_run (GSLockPlug *plug)
+@@ -522,7 +522,7 @@ gs_lock_plug_run (GSLockPlug *plug)
                  g_signal_handler_disconnect (plug, unmap_handler);
                  g_signal_handler_disconnect (plug, delete_handler);
                  g_signal_handler_disconnect (plug, destroy_handler);
diff -pruN 3.6.1-13/debian/patches/00git_logind_check.patch 3.6.1-13ubuntu2/debian/patches/00git_logind_check.patch
--- 3.6.1-13/debian/patches/00git_logind_check.patch	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/00git_logind_check.patch	2019-12-06 10:17:42.000000000 +0000
@@ -1,3 +1,4 @@
+From fd353244020cf53ce58f4abf69a5ec7893ca1fd1 Mon Sep 17 00:00:00 2001
 From: Martin Pitt <martinpitt@gnome.org>
 Date: Thu, 21 Mar 2013 10:24:20 +0000
 Subject: Check for logind, not for systemd
@@ -13,12 +14,6 @@ Drop the now unnecessary linking against
 
 https://bugzilla.gnome.org/show_bug.cgi?id=696264
 ---
- configure.ac           | 2 +-
- src/gs-listener-dbus.c | 5 +++--
- 2 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 0e8f339..3451989 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -601,7 +601,7 @@ AC_ARG_WITH(systemd,
@@ -30,8 +25,6 @@ index 0e8f339..3451989 100644
                    [have_systemd=yes], [have_systemd=no])
  
  if test "x$with_systemd" = "xauto" ; then
-diff --git a/src/gs-listener-dbus.c b/src/gs-listener-dbus.c
-index 56afdc0..b8f3376 100644
 --- a/src/gs-listener-dbus.c
 +++ b/src/gs-listener-dbus.c
 @@ -25,6 +25,7 @@
diff -pruN 3.6.1-13/debian/patches/03_fix_ltsp-fading.patch 3.6.1-13ubuntu2/debian/patches/03_fix_ltsp-fading.patch
--- 3.6.1-13/debian/patches/03_fix_ltsp-fading.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/03_fix_ltsp-fading.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,18 @@
+Description: gss apparently crashes on fade actions on LDM_DIRECTX exported displays. Since fading is a bad idea anyway on LTSP clients it's disabled completely now if LTSP_CLIENT is set.
+Author: Oliver Grawert
+
+Index: gnome-screensaver-3.4.2/src/gs-fade.c
+===================================================================
+--- gnome-screensaver-3.4.2.orig/src/gs-fade.c	2012-03-31 11:06:20.000000000 +1300
++++ gnome-screensaver-3.4.2/src/gs-fade.c	2012-06-28 10:49:32.055329115 +1200
+@@ -409,6 +409,10 @@
+         screen_priv = &fade->priv->screen_priv[screen_idx];
+ 
+ #ifdef HAVE_XF86VMODE_GAMMA
++   if (g_getenv("LTSP_CLIENT")) {
++       goto fade_none;  /* We're on an LTSP Client, bad idea to fade at all */
++   }
++
+         res = XF86VidModeQueryExtension (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &event, &error);
+         if (! res)
+                 goto fade_none;
diff -pruN 3.6.1-13/debian/patches/10_legacy_scrsvr_inhibit.patch 3.6.1-13ubuntu2/debian/patches/10_legacy_scrsvr_inhibit.patch
--- 3.6.1-13/debian/patches/10_legacy_scrsvr_inhibit.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/10_legacy_scrsvr_inhibit.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,28 @@
+Description: Reintroduce legacy API for inhibiting the screensaver
+Author: Chris Coulson <chrisccoulson@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/428884
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=579430
+Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=579430
+
+Index: gnome-screensaver-3.4.2/src/gs-monitor.c
+===================================================================
+--- gnome-screensaver-3.4.2.orig/src/gs-monitor.c	2012-02-10 20:11:45.000000000 +1300
++++ gnome-screensaver-3.4.2/src/gs-monitor.c	2012-06-28 10:49:40.239328832 +1200
+@@ -28,6 +28,8 @@
+ 
+ #include <glib.h>
+ #include <glib-object.h>
++#include <X11/Xlib.h>
++#include <gdk/gdkx.h>
+ 
+ #include "gnome-screensaver.h"
+ 
+@@ -190,7 +192,7 @@
+ static void
+ gs_monitor_simulate_user_activity (GSMonitor *monitor)
+ {
+-        /* FIXME: reset the xsync timer? */
++        XResetScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+ 
+         /* request that the manager unlock -
+            will pop up a dialog if necessary */
diff -pruN 3.6.1-13/debian/patches/13_nvidia_gamma_fade_fallback.patch 3.6.1-13ubuntu2/debian/patches/13_nvidia_gamma_fade_fallback.patch
--- 3.6.1-13/debian/patches/13_nvidia_gamma_fade_fallback.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/13_nvidia_gamma_fade_fallback.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,41 @@
+Description: Fall back to XF86VM gamma fade if XRANDR gamma fade is not supported
+Author: Chris Coulson <chrisccoulson@ubuntu.com>
+Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/522806
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=610294
+Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=610294
+
+Index: gnome-screensaver-3.4.2/src/gs-fade.c
+===================================================================
+--- gnome-screensaver-3.4.2.orig/src/gs-fade.c	2012-06-28 10:49:32.055329115 +1200
++++ gnome-screensaver-3.4.2/src/gs-fade.c	2012-06-28 10:49:42.915328739 +1200
+@@ -571,6 +571,10 @@
+         GdkDisplay *display = gdk_display_get_default ();
+         GdkScreen *screen = gdk_display_get_screen (display, screen_idx);
+         struct GSFadeScreenPrivate *screen_priv;
++        GnomeRRCrtc **crtcs;
++        GnomeRRCrtc *crtc;
++        gboolean res;
++        int gamma_size;
+ 
+         screen_priv = &fade->priv->screen_priv[screen_idx];
+ 
+@@ -581,6 +585,19 @@
+                 return;
+         }
+ 
++        crtcs = gnome_rr_screen_list_crtcs (screen_priv->rrscreen);
++
++        while (*crtcs)
++        {
++                crtc = *crtcs;
++                res = gnome_rr_crtc_get_gamma (crtc, &gamma_size, NULL, NULL, NULL);
++                if (res == FALSE || gamma_size == 0) {
++                        screen_priv->fade_type = FADE_TYPE_NONE;
++                        return;                
++                }
++                crtcs++;
++        }
++
+         screen_priv->fade_type = FADE_TYPE_XRANDR;
+         screen_priv->fade_setup = xrandr_fade_setup;
+         screen_priv->fade_finish = screen_fade_finish;
diff -pruN 3.6.1-13/debian/patches/14_no_fade_on_user_switch.patch 3.6.1-13ubuntu2/debian/patches/14_no_fade_on_user_switch.patch
--- 3.6.1-13/debian/patches/14_no_fade_on_user_switch.patch	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/14_no_fade_on_user_switch.patch	2019-12-06 10:17:42.000000000 +0000
@@ -1,16 +1,8 @@
-From: Chris Coulson <chris.coulson@canonical.com>
-Date: Fri, 28 Feb 2020 17:14:57 +0000
-Subject: Work around LP: #546578 by disabling the fade effect on screen
- locking
-
+Description: Work around LP: #546578 by disabling the fade effect on screen locking
 Bug-Ubuntu: https://launchpad.net/bugs/546578
 Forwarded: not-needed
----
- src/gs-manager.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+Author: Chris Coulson <chris.coulson@canonical.com>
 
-diff --git a/src/gs-manager.c b/src/gs-manager.c
-index ed3c1b9..32c2305 100644
 --- a/src/gs-manager.c
 +++ b/src/gs-manager.c
 @@ -1268,7 +1268,7 @@ gs_manager_activate (GSManager *manager)
diff -pruN 3.6.1-13/debian/patches/15_dont_crash_on_no_fade.patch 3.6.1-13ubuntu2/debian/patches/15_dont_crash_on_no_fade.patch
--- 3.6.1-13/debian/patches/15_dont_crash_on_no_fade.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/15_dont_crash_on_no_fade.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,36 @@
+Description: Don't crash on systems that don't support XF86VM or XRANDR gamma fade
+ Test if fade is supported on each screen before calling the fade_setup
+ virtual function.
+Bug-Ubuntu: https://launchpad.net/bugs/558721
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=618925
+Forwarded: https://bugzilla.gnome.org/attachment.cgi?id=161269
+Author: Chris Coulson <chris.coulson@canonical.com>
+
+Index: gnome-screensaver-3.4.2/src/gs-fade.c
+===================================================================
+--- gnome-screensaver-3.4.2.orig/src/gs-fade.c	2012-06-28 10:49:42.915328739 +1200
++++ gnome-screensaver-3.4.2/src/gs-fade.c	2012-06-28 10:49:45.587328645 +1200
+@@ -844,6 +844,8 @@
+ gs_fade_reset (GSFade *fade)
+ {
+         int i;
++        struct GSFadeScreenPrivate *screen_priv;
++
+         g_return_if_fail (GS_IS_FADE (fade));
+ 
+         gs_debug ("Resetting fade");
+@@ -856,8 +858,12 @@
+ 
+         gs_fade_set_alpha (fade, fade->priv->current_alpha);
+ 
+-        for (i = 0; i < fade->priv->num_screens; i++)
+-                fade->priv->screen_priv[i].fade_finish (fade, i);
++        for (i = 0; i < fade->priv->num_screens; i++) {
++                screen_priv = &fade->priv->screen_priv[i];
++                if (screen_priv->fade_type != FADE_TYPE_NONE) {
++                        screen_priv->fade_finish (fade, i);
++                }
++        }
+ }
+ 
+ static void
diff -pruN 3.6.1-13/debian/patches/16_dont_crash_in_kvm.patch 3.6.1-13ubuntu2/debian/patches/16_dont_crash_in_kvm.patch
--- 3.6.1-13/debian/patches/16_dont_crash_in_kvm.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/16_dont_crash_in_kvm.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,53 @@
+Description: Don't crash when the XF86VM extension doesn't allow the gamma to be set
+ On some systems where the XF86VM extension is present, the gamma value
+ can be read successfully with XF86VidModeGetGamma but attempting to
+ change the gamma value with XF86VidModeSetGamma will result in a
+ BadValue error (eg, on KVM).
+
+ Trap this error and abort the fade rather than crashing.
+Bug-Ubuntu: https://launchpad.net/bugs/581864
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=618932
+Forwarded: https://bugzilla.gnome.org/attachment.cgi?id=161276
+Author: Chris Coulson <chris.coulson@canonical.com>
+
+Index: gnome-screensaver/src/gs-fade.c
+===================================================================
+--- gnome-screensaver.orig/src/gs-fade.c	2012-03-07 15:11:48.829845953 +0100
++++ gnome-screensaver/src/gs-fade.c	2012-03-07 15:11:49.621845955 +0100
+@@ -208,7 +208,13 @@
+                         g2.blue = XF86_MIN_GAMMA;
+                 }
+ 
++                gdk_error_trap_push ();	   
+                 status = XF86VidModeSetGamma (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), screen, &g2);
++                gdk_flush ();
++                if (gdk_error_trap_pop ()) {
++                        gs_debug ("Failed to set gamma. Bailing out and aborting fade");
++                        return FALSE;        
++                }
+         } else {
+ 
+ # ifdef HAVE_XF86VMODE_GAMMA_RAMP
+@@ -225,7 +231,13 @@
+                         b[i] = gamma_info->b[i] * ratio;
+                 }
+ 
++                gdk_error_trap_push ();
+                 status = XF86VidModeSetGammaRamp (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), screen, gamma_info->size, r, g, b);
++                gdk_flush ();
++                if (gdk_error_trap_pop ()) {
++                        gs_debug ("Failed to set gamma. Bailing out and aborting fade");
++                        return FALSE;        
++                }
+ 
+                 g_free (r);
+                 g_free (g);
+@@ -236,8 +248,6 @@
+ # endif /* !HAVE_XF86VMODE_GAMMA_RAMP */
+         }
+ 
+-        gdk_flush ();
+-
+         return status;
+ }
+ 
diff -pruN 3.6.1-13/debian/patches/17_remove_top_panel.patch 3.6.1-13ubuntu2/debian/patches/17_remove_top_panel.patch
--- 3.6.1-13/debian/patches/17_remove_top_panel.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/17_remove_top_panel.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,44 @@
+Description: Don't create the top panel.
+Author: Marc Deslauriers <marc.deslauriers@canonical.com>
+Forwarded: no, Ubuntu-specific
+
+Index: gnome-screensaver-3.6.1/src/gs-window-x11.c
+===================================================================
+--- gnome-screensaver-3.6.1.orig/src/gs-window-x11.c	2014-01-07 18:33:03.680132713 +0100
++++ gnome-screensaver-3.6.1/src/gs-window-x11.c	2014-01-07 18:39:24.492120025 +0100
+@@ -367,7 +367,8 @@
+         monitor = gdk_screen_get_monitor_at_window (screen,
+                                                     gtk_widget_get_window (widget));
+         primary_monitor = gdk_screen_get_primary_monitor (screen);
+-        gtk_widget_set_visible (window->priv->panel, monitor == primary_monitor);
++        if (window->priv->panel)
++                gtk_widget_set_visible (window->priv->panel, monitor == primary_monitor);
+ }
+ 
+ static void
+@@ -2327,11 +2328,20 @@
+         gtk_widget_show (window->priv->vbox);
+         gtk_container_add (GTK_CONTAINER (window), window->priv->vbox);
+ 
+-        window->priv->panel = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+-        gtk_widget_show (window->priv->panel);
+-        gtk_box_pack_start (GTK_BOX (window->priv->vbox), window->priv->panel, FALSE, FALSE, 0);
+-        create_panel (window);
+-
++        /* Only display top bar if we're not running under Unity */
++        if (!g_getenv ("XDG_CURRENT_DESKTOP") ||
++            strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") != 0) {
++                window->priv->panel = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
++                gtk_widget_show (window->priv->panel);
++                gtk_box_pack_start (GTK_BOX (window->priv->vbox), window->priv->panel, FALSE, FALSE, 0);
++                create_panel (window);
++        } else {
++                window->priv->clock = gtk_label_new (NULL);
++                gtk_box_pack_start (GTK_BOX (window->priv->vbox), window->priv->clock, FALSE, FALSE, 0);
++                gtk_misc_set_alignment (GTK_MISC (window->priv->clock), 1.0, 0.5);
++                gtk_misc_set_padding (GTK_MISC (window->priv->clock), 10, 0);
++                gtk_widget_show(window->priv->clock);
++        }
+         window->priv->drawing_area = gtk_drawing_area_new ();
+         gtk_widget_show (window->priv->drawing_area);
+         gtk_widget_set_app_paintable (window->priv->drawing_area, TRUE);
diff -pruN 3.6.1-13/debian/patches/18_unity_dialog_layout.patch 3.6.1-13ubuntu2/debian/patches/18_unity_dialog_layout.patch
--- 3.6.1-13/debian/patches/18_unity_dialog_layout.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/18_unity_dialog_layout.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,149 @@
+Description: add username to lock dialog and adjust fonts and spacing
+ when used with Unity
+Author: Marc Deslauriers <marc.deslauriers@canonical.com>
+Forwarded: no, Ubuntu-specific
+
+--- a/src/gs-lock-plug.c
++++ b/src/gs-lock-plug.c
+@@ -71,6 +71,7 @@ struct GSLockPlugPrivate
+ 
+         GtkWidget   *notebook;
+         GtkWidget   *auth_face_image;
++        GtkWidget   *auth_realname_label;
+         GtkWidget   *auth_prompt_label;
+         GtkWidget   *auth_prompt_entry;
+         GtkWidget   *auth_prompt_box;
+@@ -1238,9 +1239,18 @@ gs_lock_plug_enable_prompt (GSLockPlug *
+         gtk_widget_set_sensitive (plug->priv->auth_unlock_button, TRUE);
+         gtk_widget_show (plug->priv->auth_unlock_button);
+         gtk_widget_grab_default (plug->priv->auth_unlock_button);
+-        markup = g_strdup_printf ("<b><big>%s</big></b>", message);
++
++        /* Change appearance if we're running under Unity */
++        if (g_getenv ("XDG_CURRENT_DESKTOP") &&
++            strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) {
++                markup = g_strdup_printf ("<span font_desc=\"Ubuntu 10\">%s</span>", message);
++        } else {
++                markup = g_strdup_printf ("<b><big>%s</big></b>", message);
++        }
++
+         gtk_label_set_markup (GTK_LABEL (plug->priv->auth_prompt_label), markup);
+         g_free (markup);
++
+         gtk_widget_show (plug->priv->auth_prompt_label);
+         gtk_entry_set_visibility (GTK_ENTRY (plug->priv->auth_prompt_entry), visible);
+         gtk_widget_set_sensitive (plug->priv->auth_prompt_entry, TRUE);
+@@ -1371,6 +1381,39 @@ create_page_one_buttons (GSLockPlug *plu
+         gs_profile_end ("page one buttons");
+ }
+ 
++static char *
++get_user_display_name (void)
++{
++        const char *name;
++        char       *utf8_name;
++
++        name = g_get_real_name ();
++
++        if (name == NULL || strcmp (name, "Unknown") == 0) {
++                name = g_get_user_name ();
++        }
++
++        utf8_name = NULL;
++
++        if (name != NULL) {
++                utf8_name = g_locale_to_utf8 (name, -1, NULL, NULL, NULL);
++        }
++
++        return utf8_name;
++}
++
++static void
++update_realname_label (GSLockPlug *plug)
++{
++        char *name;
++        char *markup;
++        name = get_user_display_name ();
++        markup = g_strdup_printf ("<span font_desc=\"Ubuntu 16\">%s</span>", name);
++        gtk_label_set_markup (GTK_LABEL (plug->priv->auth_realname_label), markup);
++        g_free (markup);
++        g_free (name);
++}
++
+ static void
+ create_page_one (GSLockPlug *plug)
+ {
+@@ -1402,25 +1445,59 @@ create_page_one (GSLockPlug *plug)
+         gtk_box_pack_start (GTK_BOX (hbox), plug->priv->auth_prompt_kbd_layout_indicator, FALSE, FALSE, 0);
+ #endif
+ 
+-        plug->priv->auth_prompt_label = gtk_label_new_with_mnemonic (_("_Password:"));
+-        gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_prompt_label), 0, 0.5);
+-        gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_label, FALSE, FALSE, 0);
++        /* Change appearance if we're running under Unity */
++        if (g_getenv ("XDG_CURRENT_DESKTOP") &&
++            strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) {
++                gtk_box_set_spacing (vbox2, 0);
++                gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_face_image), 0, 0.5);
++                plug->priv->auth_realname_label = gtk_label_new (NULL);
++                update_realname_label (plug);
++                gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_realname_label), 0, 1);
++                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_realname_label, FALSE, FALSE, 0);
++
++                plug->priv->auth_prompt_label = gtk_label_new_with_mnemonic (_("_Password:"));
++                gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_prompt_label), 0, 0);
++                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_label, FALSE, FALSE, 0);
++
++                plug->priv->auth_prompt_entry = gtk_entry_new ();
++                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_entry, TRUE, TRUE, 6);
++
++                gtk_label_set_mnemonic_widget (GTK_LABEL (plug->priv->auth_prompt_label),
++                                               plug->priv->auth_prompt_entry);
++
++                plug->priv->auth_capslock_label = gtk_label_new ("");
++                gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_capslock_label), 0, 0.5);
++                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_capslock_label, FALSE, FALSE, 0);
++
++                /* Status text */
++
++                plug->priv->auth_message_label = gtk_label_new (NULL);
++                gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_message_label), 0, 0.5);
++                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_message_label,
++                                    FALSE, FALSE, 0);
++
++        } else {
++
++                plug->priv->auth_prompt_label = gtk_label_new_with_mnemonic (_("_Password:"));
++                gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_prompt_label), 0, 0.5);
++                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_label, FALSE, FALSE, 0);
+ 
+-        plug->priv->auth_prompt_entry = gtk_entry_new ();
+-        gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_entry, TRUE, TRUE, 0);
++                plug->priv->auth_prompt_entry = gtk_entry_new ();
++                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_entry, TRUE, TRUE, 0);
+ 
+-        gtk_label_set_mnemonic_widget (GTK_LABEL (plug->priv->auth_prompt_label),
+-                                       plug->priv->auth_prompt_entry);
++                gtk_label_set_mnemonic_widget (GTK_LABEL (plug->priv->auth_prompt_label),
++                                           plug->priv->auth_prompt_entry);
+ 
+-        plug->priv->auth_capslock_label = gtk_label_new ("");
+-        gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_capslock_label), 0.5, 0.5);
+-        gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_capslock_label, FALSE, FALSE, 0);
++                plug->priv->auth_capslock_label = gtk_label_new ("");
++                gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_capslock_label), 0.5, 0.5);
++                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_capslock_label, FALSE, FALSE, 0);
+ 
+-        /* Status text */
++                /* Status text */
+ 
+-        plug->priv->auth_message_label = gtk_label_new (NULL);
+-        gtk_box_pack_start (GTK_BOX (vbox), plug->priv->auth_message_label,
+-                            FALSE, FALSE, 0);
++                plug->priv->auth_message_label = gtk_label_new (NULL);
++                gtk_box_pack_start (GTK_BOX (vbox), plug->priv->auth_message_label,
++                                    FALSE, FALSE, 0);
++        }
+         /* Buttons */
+         plug->priv->auth_action_area = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+ 
diff -pruN 3.6.1-13/debian/patches/24_use_user_settings.patch 3.6.1-13ubuntu2/debian/patches/24_use_user_settings.patch
--- 3.6.1-13/debian/patches/24_use_user_settings.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/24_use_user_settings.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,48 @@
+Description: use the user settings, and not the default system ones, so we
+ get the user's background when the screen is locked.
+Author: Marc Deslauriers <marc.deslauriers@canonical.com>
+Forwarded: no, is a Ubuntu-specific preference
+
+Index: gnome-screensaver-3.2.0/src/gs-manager.c
+===================================================================
+--- gnome-screensaver-3.2.0.orig/src/gs-manager.c	2012-02-09 21:23:41.000000000 -0500
++++ gnome-screensaver-3.2.0/src/gs-manager.c	2012-02-09 21:25:51.884447527 -0500
+@@ -555,13 +555,8 @@
+                                      gint       n_keys,
+                                      GSManager   *manager)
+ {
+-#if 0
+-        /* FIXME: since we bind user settings instead of system ones,
+-         *        watching for changes is no longer valid.
+-         */
+         gnome_bg_load_from_preferences (manager->priv->bg,
+                                         manager->priv->settings);
+-#endif
+ 
+         return FALSE;
+ }
+@@ -570,24 +565,9 @@
+ get_system_settings (void)
+ {
+         GSettings *settings;
+-        gchar **keys;
+-        gchar **k;
+ 
+-        /* FIXME: we need to bind system settings instead of user but
+-         *        that's currently impossible, not implemented yet.
+-         *        Hence, reset to system default values.
+-         */
+-        /* TODO: Ideally we would like to bind some other key, screensaver-specific. */
+         settings = g_settings_new ("org.gnome.desktop.background");
+ 
+-        g_settings_delay (settings);
+-
+-        keys = g_settings_list_keys (settings);
+-        for (k = keys; *k; k++) {
+-                g_settings_reset (settings, *k);
+-        }
+-        g_strfreev (keys);
+-
+         return settings;
+ }
+ 
diff -pruN 3.6.1-13/debian/patches/25_fix_lock_command.patch 3.6.1-13ubuntu2/debian/patches/25_fix_lock_command.patch
--- 3.6.1-13/debian/patches/25_fix_lock_command.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/25_fix_lock_command.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,26 @@
+Description: make --lock expect a reply so the screen gets properly locked
+ when gnome-screensaver needs to be respawned by dbus. This was preventing
+ ctrl-alt-l from locking the screen on the first attempt when the
+ gnome-screensaver process was dead.
+Author: Marc Deslauriers <marc.deslauriers@canonical.com>
+Forwarded: no, upstream doesn't configure gnome-screensaver as a dbus service
+
+Index: gnome-screensaver-3.2.0/src/gnome-screensaver-command.c
+===================================================================
+--- gnome-screensaver-3.2.0.orig/src/gnome-screensaver-command.c	2012-02-09 21:27:09.936449525 -0500
++++ gnome-screensaver-3.2.0/src/gnome-screensaver-command.c	2012-02-09 21:32:41.140458005 -0500
+@@ -260,8 +260,12 @@
+         }
+ 
+         if (do_lock) {
+-                reply = screensaver_send_message_void (connection, "Lock", FALSE);
+-                g_assert (reply == NULL);
++                reply = screensaver_send_message_void (connection, "Lock", TRUE);
++                if (reply == NULL) {
++                        g_message ("Did not receive a reply from the screensaver.");
++                        goto done;
++                }
++                g_object_unref (reply);
+         }
+ 
+         if (do_activate) {
diff -pruN 3.6.1-13/debian/patches/27_lightdm_switch_user.patch 3.6.1-13ubuntu2/debian/patches/27_lightdm_switch_user.patch
--- 3.6.1-13/debian/patches/27_lightdm_switch_user.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/27_lightdm_switch_user.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,98 @@
+Description: Under lightdm, use dbus to switch to greeter instead of
+ calling gdmflexiserver
+Author: Marc Deslauriers <marc.deslauriers@canonical.com>
+Forwarded: No, upstream uses GDM
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/950583
+
+--- a/src/gs-lock-plug.c
++++ b/src/gs-lock-plug.c
+@@ -148,28 +148,60 @@ gs_lock_plug_style_set (GtkWidget *widge
+ static void
+ do_user_switch (GSLockPlug *plug)
+ {
+-        GAppInfo *app;
+-        GAppLaunchContext *context;
+-        GError  *error;
+-        char    *command;
+-
+-        command = g_strdup_printf ("%s %s",
+-                                   GDM_FLEXISERVER_COMMAND,
+-                                   GDM_FLEXISERVER_ARGS);
++        GError  *error = NULL;
+ 
+-        error = NULL;
+-        context = (GAppLaunchContext*)gdk_app_launch_context_new ();
+-        app = g_app_info_create_from_commandline (command, "gdmflexiserver", 0, &error);
+-        if (app)
+-                g_app_info_launch (app, NULL, context, &error);
+-
+-        g_free (command);
+-        g_object_unref (context);
+-        g_object_unref (app);
++        /* If running under LightDM switch to the greeter using dbus */
++        if (g_getenv("XDG_SEAT_PATH")) {
++                GDBusConnection *bus;
++                GVariant *result = NULL;
++
++                bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
++                if (error)
++                        g_warning ("Failed to get system bus: %s", error->message);
++                g_clear_error (&error);
++
++                if (bus)
++                    result = g_dbus_connection_call_sync (bus,
++                                                          "org.freedesktop.DisplayManager",
++                                                          g_getenv ("XDG_SEAT_PATH"),
++                                                          "org.freedesktop.DisplayManager.Seat",
++                                                          "SwitchToGreeter",
++                                                          g_variant_new ("()"),
++                                                          G_VARIANT_TYPE ("()"),
++                                                          G_DBUS_CALL_FLAGS_NONE,
++                                                          -1,
++                                                          NULL,
++                                                          &error);
++                if (error)
++                        g_warning ("Failed to switch to greeter: %s", error->message);
++                g_clear_error (&error);
+ 
+-        if (error != NULL) {
+-                gs_debug ("Unable to start GDM greeter: %s", error->message);
+-                g_error_free (error);
++                if (result)
++                        g_variant_unref (result);
++        } else {
++
++                GAppInfo *app;
++                GAppLaunchContext *context;
++                char    *command;
++
++                command = g_strdup_printf ("%s %s",
++                                           GDM_FLEXISERVER_COMMAND,
++                                           GDM_FLEXISERVER_ARGS);
++
++                error = NULL;
++                context = (GAppLaunchContext*)gdk_app_launch_context_new ();
++                app = g_app_info_create_from_commandline (command, "gdmflexiserver", 0, &error);
++                if (app)
++                        g_app_info_launch (app, NULL, context, &error);
++
++                g_free (command);
++                g_object_unref (context);
++                g_object_unref (app);
++
++                if (error != NULL) {
++                        gs_debug ("Unable to start GDM greeter: %s", error->message);
++                        g_error_free (error);
++                }
+         }
+ }
+ 
+@@ -1023,7 +1055,7 @@ gs_lock_plug_set_switch_enabled (GSLockP
+         if (switch_enabled) {
+                 gboolean found;
+                 found = is_program_in_path (GDM_FLEXISERVER_COMMAND);
+-                if (found) {
++                if (found || g_getenv("XDG_SEAT_PATH")) {
+                         gtk_widget_show (plug->priv->auth_switch_button);
+                 } else {
+                         gs_debug ("Waring: GDM flexiserver command not found: %s", GDM_FLEXISERVER_COMMAND);
diff -pruN 3.6.1-13/debian/patches/28_blocking_return.patch 3.6.1-13ubuntu2/debian/patches/28_blocking_return.patch
--- 3.6.1-13/debian/patches/28_blocking_return.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/28_blocking_return.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,15 @@
+# Description: Correctly reply so the client doesn't block waiting
+# Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=686400
+# Ubuntu: https://bugs.launchpad.net/gnome-screensaver/+bug/1067515
+diff -Nur gnome-screensaver-3.6.0/src/gs-listener-dbus.c gnome-screensaver-3.6.0.new/src/gs-listener-dbus.c
+--- gnome-screensaver-3.6.0/src/gs-listener-dbus.c	2012-10-18 16:05:54.393188619 +0200
++++ gnome-screensaver-3.6.0.new/src/gs-listener-dbus.c	2012-10-18 16:05:52.729188556 +0200
+@@ -726,7 +726,7 @@
+         }
+         if (dbus_message_is_method_call (message, GS_SERVICE, "SimulateUserActivity")) {
+                 g_signal_emit (listener, signals [SIMULATE_USER_ACTIVITY], 0);
+-                return DBUS_HANDLER_RESULT_HANDLED;
++                return send_success_reply (connection, message);
+         }
+         if (dbus_message_is_method_call (message, "org.freedesktop.DBus.Introspectable", "Introspect")) {
+                 return do_introspect (connection, message, local_interface);
diff -pruN 3.6.1-13/debian/patches/29_handle_expired_creds.patch 3.6.1-13ubuntu2/debian/patches/29_handle_expired_creds.patch
--- 3.6.1-13/debian/patches/29_handle_expired_creds.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/29_handle_expired_creds.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,22 @@
+Description: Gnome Screensaver should handle expired password tokens
+Author: Brian C. Huffman <huffman@graze.net>
+Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=648875 
+Ubuntu: https://bugs.launchpad.net/bugs/952771
+
+--- a/src/gs-auth-pam.c	2010-09-28 12:46:07.000000000 -0400
++++ b/src/gs-auth-pam.c	2011-04-28 10:18:31.986171767 -0400
+@@ -533,6 +533,14 @@ gs_auth_thread_func (int auth_operation_
+         case PAM_SUCCESS:
+                 break;
+         case PAM_NEW_AUTHTOK_REQD:
++                status2 = pam_chauthtok (pam_handle, PAM_CHANGE_EXPIRED_AUTHTOK);
++
++                if (status2 != PAM_SUCCESS) {
++                    g_message ("pam_acct_mgmt (...) ==> %d (%s)\n",
++                           status2,
++                           PAM_STRERROR (pam_handle, status2));
++		    status = status2;
++                }
+                 break;
+         case PAM_AUTHINFO_UNAVAIL:
+                 break;
diff -pruN 3.6.1-13/debian/patches/30_ubuntu-lock-on-suspend_gsetting.patch 3.6.1-13ubuntu2/debian/patches/30_ubuntu-lock-on-suspend_gsetting.patch
--- 3.6.1-13/debian/patches/30_ubuntu-lock-on-suspend_gsetting.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/30_ubuntu-lock-on-suspend_gsetting.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,62 @@
+From f1d92c7881650a2cbd2a6eff651d5b1659ee755b Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martinpitt@gnome.org>
+Date: Wed, 1 May 2013 10:53:17 -0700
+Subject: [PATCH] Handle ubuntu-lock-on-suspend gsettings key
+
+This is introduced in Ubuntu's gsettings-desktop-schemas package.
+---
+ src/gs-prefs.c | 11 +++++++++++
+ src/gs-prefs.h |  1 +
+ 2 files changed, 12 insertions(+)
+
+diff --git a/src/gs-prefs.c b/src/gs-prefs.c
+index 699874f..a98acb2 100644
+--- a/src/gs-prefs.c
++++ b/src/gs-prefs.c
+@@ -51,6 +51,7 @@ static void gs_prefs_finalize   (GObject      *object);
+ #define KEY_KEYBOARD_ENABLED "embedded-keyboard-enabled"
+ #define KEY_KEYBOARD_COMMAND "embedded-keyboard-command"
+ #define KEY_STATUS_MESSAGE_ENABLED   "status-message-enabled"
++#define KEY_UBUNTU_LOCK_ON_SUSPEND   "ubuntu-lock-on-suspend"
+ 
+ #define GS_PREFS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GS_TYPE_PREFS, GSPrefsPrivate))
+ 
+@@ -258,6 +259,9 @@ gs_prefs_load_from_settings (GSPrefs *prefs)
+         uvalue = _gs_settings_get_uint (prefs->priv->settings, KEY_LOCK_DELAY);
+         _gs_prefs_set_lock_timeout (prefs, uvalue);
+ 
++        bvalue = g_settings_get_boolean (prefs->priv->settings, KEY_UBUNTU_LOCK_ON_SUSPEND);
++        prefs->ubuntu_lock_on_suspend = bvalue;
++
+         /* Embedded keyboard options */
+ 
+         bvalue = g_settings_get_boolean (prefs->priv->settings, KEY_KEYBOARD_ENABLED);
+@@ -330,6 +334,13 @@ key_changed_cb (GSettings   *settings,
+                 disabled = g_settings_get_boolean (settings, key);
+                 _gs_prefs_set_lock_disabled (prefs, disabled);
+ 
++        } else if (strcmp (key, KEY_UBUNTU_LOCK_ON_SUSPEND) == 0) {
++
++                gboolean enabled;
++
++                enabled = g_settings_get_boolean (settings, key);
++                prefs->ubuntu_lock_on_suspend = enabled;
++                gs_debug ("ubuntu-lock-on-suspend=%d",enabled);
+         } else if (strcmp (key, KEY_USER_SWITCH_DISABLE) == 0) {
+ 
+                 gboolean disabled;
+diff --git a/src/gs-prefs.h b/src/gs-prefs.h
+index ee722ac..7ca51c0 100644
+--- a/src/gs-prefs.h
++++ b/src/gs-prefs.h
+@@ -54,6 +54,7 @@ typedef struct
+ 
+         char            *logout_command;        /* command to use to logout */
+         char            *keyboard_command;      /* command to use to embed a keyboard */
++        guint            ubuntu_lock_on_suspend : 1;   /* whether to lock on suspend */
+ } GSPrefs;
+ 
+ typedef struct
+-- 
+1.8.1.2
+
diff -pruN 3.6.1-13/debian/patches/31_lock_screen_on_suspend.patch 3.6.1-13ubuntu2/debian/patches/31_lock_screen_on_suspend.patch
--- 3.6.1-13/debian/patches/31_lock_screen_on_suspend.patch	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/31_lock_screen_on_suspend.patch	2019-12-06 10:17:42.000000000 +0000
@@ -1,3 +1,4 @@
+From f8f9beb6a3bf81240d36bfec43e5db9b102ea91e Mon Sep 17 00:00:00 2001
 From: Martin Pitt <martinpitt@gnome.org>
 Date: Wed, 1 May 2013 10:55:49 -0700
 Subject: [PATCH] Lock screen on suspend
@@ -7,11 +8,9 @@ to do so). This mirrors what gnome-shell
 ---
  src/gs-listener-dbus.c | 28 ++++++++++++++++++++++++++++
  src/gs-listener-dbus.h |  1 +
- src/gs-monitor.c       | 16 ++++++++++++++++
- 3 files changed, 45 insertions(+)
+ src/gs-monitor.c       | 20 ++++++++++++++++++++
+ 3 files changed, 49 insertions(+)
 
-diff --git a/src/gs-listener-dbus.c b/src/gs-listener-dbus.c
-index b8f3376..7c20513 100644
 --- a/src/gs-listener-dbus.c
 +++ b/src/gs-listener-dbus.c
 @@ -83,6 +83,7 @@ struct GSListenerPrivate
@@ -22,11 +21,10 @@ index b8f3376..7c20513 100644
          QUIT,
          SIMULATE_USER_ACTIVITY,
          ACTIVE_CHANGED,
-@@ -871,6 +872,17 @@ listener_dbus_handle_system_message (DBusConnection *connection,
-                                 g_signal_emit (listener, signals [LOCK], 0);
+@@ -872,6 +873,17 @@ listener_dbus_handle_system_message (DBu
                          }
  
-+                        return DBUS_HANDLER_RESULT_HANDLED;
+                         return DBUS_HANDLER_RESULT_HANDLED;
 +                } else if (dbus_message_is_signal (message, SYSTEMD_LOGIND_INTERFACE, "PrepareForSleep")) {
 +                        gboolean active;
 +                        if (dbus_message_get_args (message, NULL,
@@ -37,10 +35,11 @@ index b8f3376..7c20513 100644
 +                        } else {
 +                                gs_debug ("cannot parse PrepareForSleep");
 +                        }
-                         return DBUS_HANDLER_RESULT_HANDLED;
++                        return DBUS_HANDLER_RESULT_HANDLED;
                  } else if (dbus_message_is_signal (message, DBUS_INTERFACE_PROPERTIES, "PropertiesChanged")) {
  
-@@ -1186,6 +1198,16 @@ gs_listener_class_init (GSListenerClass *klass)
+                         if (_listener_message_path_is_our_session (listener, message)) {
+@@ -1186,6 +1198,16 @@ gs_listener_class_init (GSListenerClass
                                g_cclosure_marshal_VOID__VOID,
                                G_TYPE_NONE,
                                0);
@@ -57,7 +56,7 @@ index b8f3376..7c20513 100644
          signals [QUIT] =
                  g_signal_new ("quit",
                                G_TYPE_FROM_CLASS (object_class),
-@@ -1371,6 +1393,12 @@ gs_listener_acquire (GSListener *listener,
+@@ -1371,6 +1393,12 @@ gs_listener_acquire (GSListener *listene
                                              ",interface='"DBUS_INTERFACE_PROPERTIES"'"
                                              ",member='PropertiesChanged'",
                                              NULL);
@@ -70,8 +69,6 @@ index b8f3376..7c20513 100644
  
                          return (res != -1);
                  }
-diff --git a/src/gs-listener-dbus.h b/src/gs-listener-dbus.h
-index 1cb92bc..57ae928 100644
 --- a/src/gs-listener-dbus.h
 +++ b/src/gs-listener-dbus.h
 @@ -45,6 +45,7 @@ typedef struct
@@ -82,31 +79,33 @@ index 1cb92bc..57ae928 100644
          void            (* quit)                     (GSListener *listener);
          void            (* simulate_user_activity)   (GSListener *listener);
          gboolean        (* active_changed)           (GSListener *listener,
-diff --git a/src/gs-monitor.c b/src/gs-monitor.c
-index 6e43a2b..7bc872c 100644
 --- a/src/gs-monitor.c
 +++ b/src/gs-monitor.c
-@@ -209,6 +209,19 @@ listener_lock_cb (GSListener *listener,
- 
+@@ -212,6 +212,23 @@ listener_lock_cb (GSListener *listener,
  }
  
-+static void
+ static void
 +listener_config_lock_cb (GSListener *listener,
 +                         GSMonitor  *monitor)
 +{
 +        if (! monitor->priv->prefs->lock_disabled) {
-+		gs_debug ("Locking the screen suspend");
-+		gs_monitor_lock_screen (monitor);
++                if (monitor->priv->prefs->ubuntu_lock_on_suspend) {
++                        gs_debug ("Locking the screen suspend");
++                        gs_monitor_lock_screen (monitor);
++                } else {
++                        gs_debug ("Locking the screen on suspend disabled by the administrator");
++                }
 +        } else {
 +                gs_debug ("Locking disabled by the administrator");
 +        }
 +
 +}
 +
- static void
++static void
  listener_quit_cb (GSListener *listener,
                    GSMonitor  *monitor)
-@@ -328,6 +341,7 @@ static void
+ {
+@@ -330,6 +347,7 @@ static void
  disconnect_listener_signals (GSMonitor *monitor)
  {
          g_signal_handlers_disconnect_by_func (monitor->priv->listener, listener_lock_cb, monitor);
@@ -114,7 +113,7 @@ index 6e43a2b..7bc872c 100644
          g_signal_handlers_disconnect_by_func (monitor->priv->listener, listener_quit_cb, monitor);
          g_signal_handlers_disconnect_by_func (monitor->priv->listener, listener_active_changed_cb, monitor);
          g_signal_handlers_disconnect_by_func (monitor->priv->listener, listener_simulate_user_activity_cb, monitor);
-@@ -339,6 +353,8 @@ connect_listener_signals (GSMonitor *monitor)
+@@ -341,6 +359,8 @@ connect_listener_signals (GSMonitor *mon
  {
          g_signal_connect (monitor->priv->listener, "lock",
                            G_CALLBACK (listener_lock_cb), monitor);
diff -pruN 3.6.1-13/debian/patches/32_input_sources_switcher.patch 3.6.1-13ubuntu2/debian/patches/32_input_sources_switcher.patch
--- 3.6.1-13/debian/patches/32_input_sources_switcher.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/32_input_sources_switcher.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,345 @@
+--- a/src/gs-lock-plug.c
++++ b/src/gs-lock-plug.c
+@@ -36,14 +36,17 @@
+ #include <gdk/gdkx.h>
+ #include <gtk/gtk.h>
+ 
+-#ifdef WITH_KBD_LAYOUT_INDICATOR
+-#include <libgnomekbd/gkbd-indicator.h>
+-#endif
++#define GNOME_DESKTOP_USE_UNSTABLE_API
++#include <libgnome-desktop/gnome-xkb-info.h>
+ 
+ #include "gs-lock-plug.h"
+ 
+ #include "gs-debug.h"
+ 
++#define INPUT_SOURCES_SCHEMA "org.gnome.desktop.input-sources"
++#define SOURCES_KEY          "sources"
++#define CURRENT_KEY          "current"
++
+ #define GDM_FLEXISERVER_COMMAND "gdmflexiserver"
+ #define GDM_FLEXISERVER_ARGS    "--startnew Standard"
+ 
+@@ -83,7 +86,10 @@
+         GtkWidget   *auth_switch_button;
+         GtkWidget   *auth_logout_button;
+ 
+-        GtkWidget   *auth_prompt_kbd_layout_indicator;
++        GSettings   *input_sources_settings;
++        GtkWidget   *input_sources_label;
++        GPtrArray   *input_sources;
++        guint        input_source;
+ 
+         int          kbd_lock_mode;
+         gboolean     switch_enabled;
+@@ -1446,6 +1452,135 @@
+         g_free (name);
+ }
+ 
++struct InputSource
++{
++        gchar    *name;
++        gboolean  unique;
++        guint     subscript;
++        guint     index;
++};
++
++typedef struct InputSource InputSource;
++
++static void
++input_source_free (gpointer data)
++{
++        InputSource *input_source = data;
++        g_free (input_source->name);
++        g_free (data);
++}
++
++static void
++input_sources_current_changed_cb (GSettings *settings,
++                                  gchar     *key,
++                                  gpointer   user_data)
++{
++        GSLockPlug *plug = GS_LOCK_PLUG (user_data);
++        guint current = g_settings_get_uint (settings, CURRENT_KEY);
++        guint i;
++
++        for (i = 0; i < plug->priv->input_sources->len; i++) {
++                InputSource *input_source = g_ptr_array_index (plug->priv->input_sources, i);
++
++                if (input_source->index == current) {
++                        if (!input_source->unique) {
++                                gchar *markup = g_markup_printf_escaped ("%s<sub><small>%u</small></sub>", input_source->name, input_source->subscript);
++                                gtk_label_set_markup (GTK_LABEL (plug->priv->input_sources_label), markup);
++                                g_free (markup);
++                        } else {
++                                gtk_label_set_text (GTK_LABEL (plug->priv->input_sources_label), input_source->name);
++                        }
++
++                        break;
++                }
++        }
++}
++
++static void
++gs_lock_plug_init_input_sources (GSLockPlug *plug)
++{
++        GnomeXkbInfo *xkb_info;
++        GVariant *sources;
++        GVariantIter iter;
++        const gchar *type;
++        const gchar *name;
++        guint current;
++        guint i;
++
++        if (plug->priv->input_sources != NULL)
++                return;
++
++        plug->priv->input_sources_settings = g_settings_new (INPUT_SOURCES_SCHEMA);
++        sources = g_settings_get_value (plug->priv->input_sources_settings, SOURCES_KEY);
++        current = g_settings_get_uint (plug->priv->input_sources_settings, CURRENT_KEY);
++
++        plug->priv->input_sources = g_ptr_array_new_full (g_variant_n_children (sources), input_source_free);
++        plug->priv->input_source = 0;
++
++        xkb_info = gnome_xkb_info_new ();
++
++        g_variant_iter_init (&iter, sources);
++        for (i = 0; g_variant_iter_next (&iter, "(&s&s)", &type, &name); i++) {
++                if (g_strcmp0 (type, "xkb") == 0) {
++                        InputSource *input_source;
++                        const gchar *short_name;
++                        gint j;
++
++                        gnome_xkb_info_get_layout_info (xkb_info, name, NULL, &short_name, NULL, NULL);
++
++                        input_source = g_new0 (InputSource, 1);
++                        input_source->name = g_strdup (short_name);
++                        input_source->unique = TRUE;
++                        input_source->subscript = 1;
++                        input_source->index = i;
++
++                        if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)
++                                input_source->name[0] = g_ascii_toupper (input_source->name[0]);
++
++                        for (j = plug->priv->input_sources->len - 1; j >= 0; j--) {
++                                InputSource *input_source_j = g_ptr_array_index (plug->priv->input_sources, j);
++
++                                if (g_strcmp0 (input_source_j->name, input_source->name) == 0) {
++                                        input_source_j->unique = FALSE;
++                                        input_source->unique = FALSE;
++                                        input_source->subscript = input_source_j->subscript + 1;
++                                        break;
++                                }
++                        }
++
++                        if (input_source->index == current)
++                                plug->priv->input_source = plug->priv->input_sources->len;
++
++                        g_ptr_array_add (plug->priv->input_sources, input_source);
++                }
++        }
++
++        g_object_unref (xkb_info);
++        g_variant_unref (sources);
++
++        g_signal_connect (plug->priv->input_sources_settings,
++                          "changed::" CURRENT_KEY,
++                          G_CALLBACK (input_sources_current_changed_cb),
++                          plug);
++}
++
++static gboolean
++layout_indicator_clicked_cb (GtkWidget *widget,
++                             GdkEvent  *event,
++                             gpointer   user_data)
++{
++        GSLockPlug *plug;
++        InputSource *input_source;
++
++        plug = GS_LOCK_PLUG (user_data);
++        plug->priv->input_source++;
++        plug->priv->input_source %= plug->priv->input_sources->len;
++        input_source = g_ptr_array_index (plug->priv->input_sources, plug->priv->input_source);
++        g_settings_set_uint (plug->priv->input_sources_settings, CURRENT_KEY, input_source->index);
++
++        return TRUE;
++}
++
+ static void
+ create_page_one (GSLockPlug *plug)
+ {
+@@ -1453,6 +1588,7 @@
+         GtkWidget            *vbox;
+         GtkWidget            *vbox2;
+         GtkWidget            *hbox;
++        GtkWidget            *hbox2;
+ 
+         gs_profile_start ("page one");
+ 
+@@ -1473,10 +1609,6 @@
+         gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
+         gtk_container_set_border_width (GTK_CONTAINER (vbox2), 10);
+ 
+-#ifdef WITH_KBD_LAYOUT_INDICATOR
+-        gtk_box_pack_start (GTK_BOX (hbox), plug->priv->auth_prompt_kbd_layout_indicator, FALSE, FALSE, 0);
+-#endif
+-
+         /* Change appearance if we're running under Unity */
+         if (g_getenv ("XDG_CURRENT_DESKTOP") &&
+             strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) {
+@@ -1491,11 +1623,38 @@
+                 gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_prompt_label), 0, 0);
+                 gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_label, FALSE, FALSE, 0);
+ 
++                hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+                 plug->priv->auth_prompt_entry = gtk_entry_new ();
+-                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_entry, TRUE, TRUE, 6);
+ 
+                 gtk_label_set_mnemonic_widget (GTK_LABEL (plug->priv->auth_prompt_label),
+                                                plug->priv->auth_prompt_entry);
++                gtk_box_pack_start (GTK_BOX (hbox2), plug->priv->auth_prompt_entry, TRUE, TRUE, 6);
++
++                /* Layout indicator */
++#ifdef WITH_KBD_LAYOUT_INDICATOR
++                gs_lock_plug_init_input_sources (plug);
++
++                if (plug->priv->input_sources->len > 1) {
++                        GtkWidget *layout_indicator;
++
++                        layout_indicator = gtk_event_box_new ();
++                        plug->priv->input_sources_label = gtk_label_new (NULL);
++                        input_sources_current_changed_cb (plug->priv->input_sources_settings, CURRENT_KEY, plug);
++                        g_signal_connect (layout_indicator, "button-release-event", G_CALLBACK (layout_indicator_clicked_cb), plug);
++                        gtk_widget_set_size_request (layout_indicator, 50, 40);
++
++                        gtk_container_add (GTK_CONTAINER (layout_indicator), plug->priv->input_sources_label);
++                        gtk_box_pack_start (GTK_BOX (hbox2),
++                                            layout_indicator,
++                                            FALSE,
++                                            FALSE,
++                                            6);
++
++                        gtk_widget_show_all (hbox2);
++                }
++#endif
++
++                gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, TRUE, 6);
+ 
+                 plug->priv->auth_capslock_label = gtk_label_new ("");
+                 gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_capslock_label), 0, 0.5);
+@@ -1514,11 +1673,38 @@
+                 gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_prompt_label), 0, 0.5);
+                 gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_label, FALSE, FALSE, 0);
+ 
++                hbox2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+                 plug->priv->auth_prompt_entry = gtk_entry_new ();
+-                gtk_box_pack_start (GTK_BOX (vbox2), plug->priv->auth_prompt_entry, TRUE, TRUE, 0);
+ 
+                 gtk_label_set_mnemonic_widget (GTK_LABEL (plug->priv->auth_prompt_label),
+                                            plug->priv->auth_prompt_entry);
++                gtk_box_pack_start (GTK_BOX (hbox2), plug->priv->auth_prompt_entry, TRUE, TRUE, 6);
++
++                /* Layout indicator */
++#ifdef WITH_KBD_LAYOUT_INDICATOR
++                gs_lock_plug_init_input_sources (plug);
++
++                if (plug->priv->input_sources->len > 1) {
++                        GtkWidget *layout_indicator;
++
++                        layout_indicator = gtk_event_box_new ();
++                        plug->priv->input_sources_label = gtk_label_new (NULL);
++                        input_sources_current_changed_cb (plug->priv->input_sources_settings, CURRENT_KEY, plug);
++                        g_signal_connect (layout_indicator, "button-release-event", G_CALLBACK (layout_indicator_clicked_cb), plug);
++                        gtk_widget_set_size_request (layout_indicator, 50, 40);
++
++                        gtk_container_add (GTK_CONTAINER (layout_indicator), plug->priv->input_sources_label);
++                        gtk_box_pack_start (GTK_BOX (hbox2),
++                                            layout_indicator,
++                                            FALSE,
++                                            FALSE,
++                                            6);
++
++                        gtk_widget_show_all (hbox2);
++                }
++#endif
++
++                gtk_box_pack_start (GTK_BOX (vbox2), hbox2, TRUE, TRUE, 0);
+ 
+                 plug->priv->auth_capslock_label = gtk_label_new ("");
+                 gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_capslock_label), 0.5, 0.5);
+@@ -1595,8 +1781,6 @@
+         plug->priv->vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+         gtk_container_add (GTK_CONTAINER (plug->priv->frame), plug->priv->vbox);
+ 
+-        plug->priv->auth_prompt_kbd_layout_indicator = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+-
+         /* Notebook */
+         plug->priv->notebook = gtk_notebook_new ();
+         gtk_notebook_set_show_tabs (GTK_NOTEBOOK (plug->priv->notebook), FALSE);
+@@ -1609,33 +1793,6 @@
+ 
+         gtk_widget_show_all (plug->priv->frame);
+ 
+-        /* Layout indicator */
+-#ifdef WITH_KBD_LAYOUT_INDICATOR
+-        if (plug->priv->auth_prompt_kbd_layout_indicator != NULL) {
+-                XklEngine *engine;
+-
+-                engine = xkl_engine_get_instance (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+-                if (xkl_engine_get_num_groups (engine) > 1) {
+-                        GtkWidget *layout_indicator;
+-
+-                        layout_indicator = gkbd_indicator_new ();
+-                        gkbd_indicator_set_parent_tooltips (GKBD_INDICATOR (layout_indicator), TRUE);
+-                        gtk_box_pack_start (GTK_BOX (plug->priv->auth_prompt_kbd_layout_indicator),
+-                                            layout_indicator,
+-                                            FALSE,
+-                                            FALSE,
+-                                            6);
+-
+-                        gtk_widget_show_all (layout_indicator);
+-                        gtk_widget_show (plug->priv->auth_prompt_kbd_layout_indicator);
+-                } else {
+-                        gtk_widget_hide (plug->priv->auth_prompt_kbd_layout_indicator);
+-                }
+-
+-                g_object_unref (engine);
+-        }
+-#endif
+-
+         if (plug->priv->auth_switch_button != NULL) {
+                 if (plug->priv->switch_enabled) {
+                         gtk_widget_show_all (plug->priv->auth_switch_button);
+@@ -1705,6 +1862,19 @@
+ 
+         g_return_if_fail (plug->priv != NULL);
+ 
++        if (plug->priv->input_sources != NULL)
++                g_ptr_array_unref (plug->priv->input_sources);
++
++        if (plug->priv->input_sources_label != NULL) {
++                g_signal_handlers_disconnect_by_data (plug->priv->input_sources_label, plug);
++                g_object_unref (plug->priv->input_sources_label);
++        }
++
++        if (plug->priv->input_sources_settings != NULL) {
++                g_signal_handlers_disconnect_by_data (plug->priv->input_sources_settings, plug);
++                g_object_unref (plug->priv->input_sources_settings);
++        }
++
+         g_free (plug->priv->logout_command);
+ 
+         remove_response_idle (plug);
+--- a/configure.ac
++++ b/configure.ac
+@@ -66,7 +66,8 @@
+ 
+ PKG_CHECK_MODULES(GNOME_SCREENSAVER_DIALOG,
+         gthread-2.0
+-        gtk+-3.0 >= $GTK_REQUIRED_VERSION)
++        gtk+-3.0 >= $GTK_REQUIRED_VERSION
++        gnome-desktop-3.0 >= $GNOME_DESKTOP_REQUIRED_VERSION)
+ AC_SUBST(GNOME_SCREENSAVER_DIALOG_CFLAGS)
+ AC_SUBST(GNOME_SCREENSAVER_DIALOG_LIBS)
+ 
diff -pruN 3.6.1-13/debian/patches/33_budgie_support.patch 3.6.1-13ubuntu2/debian/patches/33_budgie_support.patch
--- 3.6.1-13/debian/patches/33_budgie_support.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/33_budgie_support.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,251 @@
+Description: Add support for the Budgie Desktop
+ Budgie Desktop uses gnome-screensaver.  This patch makes the following
+ changes:
+ 1. adds support for the gnome-control-center background lock screen
+    dialog.
+ 2. The lock screen is styled for Budgie using the "Unity" style
+    patches.
+ 3. Adds a GTK+3 stylecontext to allow themes to style the lock-screen.
+Author: David Mohammed <fossfreedom@ubuntu.com>
+Date: Tue, 26 Dec 2017 16:39:23 +0000
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-desktop3/+bug/1703690
+Forwarded: not-needed
+
+Index: gnome-screensaver-3.6.1/src/gs-manager.c
+===================================================================
+--- gnome-screensaver-3.6.1.orig/src/gs-manager.c
++++ gnome-screensaver-3.6.1/src/gs-manager.c
+@@ -36,6 +36,7 @@
+ #include "gs-grab.h"
+ #include "gs-fade.h"
+ #include "gs-debug.h"
++#include "gs-common.h"
+ 
+ static void gs_manager_class_init (GSManagerClass *klass);
+ static void gs_manager_init       (GSManager      *manager);
+@@ -567,6 +568,13 @@ get_system_settings (void)
+         GSettings *settings;
+ 
+         settings = g_settings_new ("org.gnome.desktop.background");
++        if (in_desktop("Budgie")) {
++                settings = g_settings_new ("org.gnome.desktop.screensaver");
++                g_settings_delay (settings);
++        }
++        else {
++                settings = g_settings_new ("org.gnome.desktop.background");
++        }
+ 
+         return settings;
+ }
+Index: gnome-screensaver-3.6.1/src/gs-window-x11.c
+===================================================================
+--- gnome-screensaver-3.6.1.orig/src/gs-window-x11.c
++++ gnome-screensaver-3.6.1/src/gs-window-x11.c
+@@ -41,6 +41,7 @@
+ #include "gs-marshal.h"
+ #include "subprocs.h"
+ #include "gs-debug.h"
++#include "gs-common.h"
+ 
+ #ifdef HAVE_SHAPE_EXT
+ #include <X11/extensions/shape.h>
+@@ -2328,9 +2329,8 @@ gs_window_init (GSWindow *window)
+         gtk_widget_show (window->priv->vbox);
+         gtk_container_add (GTK_CONTAINER (window), window->priv->vbox);
+ 
+-        /* Only display top bar if we're not running under Unity */
+-        if (!g_getenv ("XDG_CURRENT_DESKTOP") ||
+-            strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") != 0) {
++        /* Only display top bar if we're not running under Unity or Budgie */
++        if (!in_desktop ("Unity") && !in_desktop ("Budgie")) {
+                 window->priv->panel = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+                 gtk_widget_show (window->priv->panel);
+                 gtk_box_pack_start (GTK_BOX (window->priv->vbox), window->priv->panel, FALSE, FALSE, 0);
+Index: gnome-screensaver-3.6.1/src/gs-lock-plug.c
+===================================================================
+--- gnome-screensaver-3.6.1.orig/src/gs-lock-plug.c
++++ gnome-screensaver-3.6.1/src/gs-lock-plug.c
+@@ -40,6 +40,7 @@
+ #include <libgnome-desktop/gnome-xkb-info.h>
+ 
+ #include "gs-lock-plug.h"
++#include "gs-common.h"
+ 
+ #include "gs-debug.h"
+ 
+@@ -1278,9 +1279,8 @@ gs_lock_plug_enable_prompt (GSLockPlug *
+         gtk_widget_show (plug->priv->auth_unlock_button);
+         gtk_widget_grab_default (plug->priv->auth_unlock_button);
+ 
+-        /* Change appearance if we're running under Unity */
+-        if (g_getenv ("XDG_CURRENT_DESKTOP") &&
+-            strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) {
++        /* Change appearance if we're running under Unity or Budgie */
++        if (in_desktop ("Unity") || in_desktop ("Budgie")) {
+                 markup = g_strdup_printf ("<span font_desc=\"Ubuntu 10\">%s</span>", message);
+         } else {
+                 markup = g_strdup_printf ("<b><big>%s</big></b>", message);
+@@ -1534,8 +1534,8 @@ gs_lock_plug_init_input_sources (GSLockP
+                         input_source->subscript = 1;
+                         input_source->index = i;
+ 
+-                        if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0)
+-                                input_source->name[0] = g_ascii_toupper (input_source->name[0]);
++                        if (in_desktop ("Unity") || in_desktop ("Budgie"))
++                               input_source->name[0] = g_ascii_toupper (input_source->name[0]);
+ 
+                         for (j = plug->priv->input_sources->len - 1; j >= 0; j--) {
+                                 InputSource *input_source_j = g_ptr_array_index (plug->priv->input_sources, j);
+@@ -1609,9 +1609,8 @@ create_page_one (GSLockPlug *plug)
+         gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
+         gtk_container_set_border_width (GTK_CONTAINER (vbox2), 10);
+ 
+-        /* Change appearance if we're running under Unity */
+-        if (g_getenv ("XDG_CURRENT_DESKTOP") &&
+-            strcmp (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) {
++        /* Change appearance if we're running under Unity or Budgie*/
++        if (in_desktop ("Unity") || in_desktop ("Budgie")) {
+                 gtk_box_set_spacing (vbox2, 0);
+                 gtk_misc_set_alignment (GTK_MISC (plug->priv->auth_face_image), 0, 0.5);
+                 plug->priv->auth_realname_label = gtk_label_new (NULL);
+@@ -1768,12 +1767,18 @@ delete_handler (GSLockPlug  *plug,
+ static void
+ gs_lock_plug_init (GSLockPlug *plug)
+ {
++        GtkStyleContext *context = NULL;
+         gs_profile_start (NULL);
+ 
+         plug->priv = GS_LOCK_PLUG_GET_PRIVATE (plug);
+ 
+         clear_clipboards (plug);
+ 
++        if (in_desktop("Budgie")) {
++                context = gtk_widget_get_style_context (GTK_WIDGET (plug));
++                gtk_style_context_add_class (context, "lock-dialog");
++        }
++
+         plug->priv->frame = gtk_frame_new (NULL);
+         gtk_frame_set_shadow_type (GTK_FRAME (plug->priv->frame), GTK_SHADOW_OUT);
+         gtk_container_add (GTK_CONTAINER (plug), plug->priv->frame);
+Index: gnome-screensaver-3.6.1/src/gs-common.c
+===================================================================
+--- /dev/null
++++ gnome-screensaver-3.6.1/src/gs-common.c
+@@ -0,0 +1,49 @@
++/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*-
++ *
++ * Copyright (C) 2017 David Mohammed <fossfreedom@ubuntu.com>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++ * 02110-1301, USA.
++ *
++ * Authors: David Mohammed <fossfreedom@ubuntu.com>
++ *
++ */
++
++#include <glib/gi18n.h>
++#include <gtk/gtk.h>
++
++#include "gs-common.h"
++#include "gs-debug.h"
++
++gboolean
++in_desktop (const gchar *name)
++{
++        const gchar *desktop_name_list;
++        gchar **names;
++        gboolean in_list = FALSE;
++
++        desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP");
++        if (!desktop_name_list)
++                return FALSE;
++
++        names = g_strsplit (desktop_name_list, ":", -1);
++        if (!names)
++                return FALSE;
++
++        in_list = g_strv_contains ((const gchar * const *) names, name);
++        g_strfreev (names);
++
++        return in_list;
++}
+Index: gnome-screensaver-3.6.1/src/gs-common.h
+===================================================================
+--- /dev/null
++++ gnome-screensaver-3.6.1/src/gs-common.h
+@@ -0,0 +1,32 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
++ *
++ * Copyright (C) 2017 David Mohammed <fossfreedom@ubuntu.com>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++ *
++ * Authors: David Mohammed <fossfreedom@ubuntu.com>
++ *
++ */
++
++#ifndef __GS_COMMON_H
++#define __GS_COMMON_H
++
++G_BEGIN_DECLS
++
++gboolean in_desktop (const gchar *name);
++
++G_END_DECLS
++
++#endif
+Index: gnome-screensaver-3.6.1/src/Makefile.am
+===================================================================
+--- gnome-screensaver-3.6.1.orig/src/Makefile.am
++++ gnome-screensaver-3.6.1/src/Makefile.am
+@@ -111,6 +111,8 @@ test_watcher_LDADD =			\
+ 
+ test_window_SOURCES =			\
+ 	test-window.c			\
++	gs-common.h			\
++	gs-common.c			\
+ 	gs-window.h			\
+ 	gs-window-x11.c			\
+ 	gs-grab-x11.c			\
+@@ -130,6 +132,8 @@ test_window_LDADD =			\
+ 
+ gnome_screensaver_dialog_SOURCES = 	\
+ 	gnome-screensaver-dialog.c	\
++	gs-common.h			\
++	gs-common.c			\
+ 	gs-lock-plug.c			\
+ 	gs-lock-plug.h			\
+ 	gs-debug.c			\
+@@ -166,6 +170,8 @@ gnome_screensaver_SOURCES =	\
+ 	bus.h			\
+ 	gnome-screensaver.c	\
+ 	gnome-screensaver.h	\
++	gs-common.h		\
++	gs-common.c		\
+ 	gs-monitor.c		\
+ 	gs-monitor.h		\
+ 	gs-watcher-x11.c	\
diff -pruN 3.6.1-13/debian/patches/allow-replacement 3.6.1-13ubuntu2/debian/patches/allow-replacement
--- 3.6.1-13/debian/patches/allow-replacement	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/allow-replacement	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,69 @@
+Description: Allow the dbus service to be replaced, so that other implementations of the interface (e.g. Unity) can take the service over.
+ We quit if someone else claims the name, as D-Bus activation will restart us if that owner then goes away.
+Author: Iain Lane <iain.lane@canonical.com>
+Forwared: not-needed
+
+Index: b/src/gs-listener-dbus.c
+===================================================================
+--- a/src/gs-listener-dbus.c
++++ b/src/gs-listener-dbus.c
+@@ -28,6 +28,7 @@
+ #include <unistd.h>
+ 
+ #include <glib/gi18n.h>
++#include <gtk/gtk.h>
+ 
+ #include <dbus/dbus.h>
+ #include <dbus/dbus-glib.h>
+@@ -1092,7 +1093,24 @@
+                 g_timeout_add (10000, (GSourceFunc)reinit_dbus, listener);
+         } else if (dbus_message_is_signal (message,
+                                            DBUS_INTERFACE_DBUS,
+-                                           "NameOwnerChanged")) {
++                                           "NameLost")) {
++                const char *name;
++                DBusError error;
++                dbus_error_init (&error);
++
++                if (!dbus_message_get_args (message, &error,
++                                            DBUS_TYPE_STRING, &name,
++                                            DBUS_TYPE_INVALID)) {
++                    g_warning("Got NameLost, but couldn't read name");
++                    dbus_error_free (&error);
++                } else {
++                    if (strcmp (name, GS_INTERFACE) == 0) { // We've been replaced
++                        g_message ("Lost the name, shutting down.");
++                        dbus_connection_unref (connection);
++                        listener->priv->connection = NULL;
++                        gtk_main_quit ();
++                    }
++                }
+         } else {
+                 return listener_dbus_handle_session_message (connection, message, user_data, FALSE);
+         }
+@@ -1317,7 +1335,6 @@
+                              _("not connected to the message bus"));
+                 return FALSE;
+         }
+-
+         if (screensaver_is_running (listener->priv->connection)) {
+                 g_set_error (error,
+                              GS_LISTENER_ERROR,
+@@ -1339,7 +1356,7 @@
+ 
+         res = dbus_bus_request_name (listener->priv->connection,
+                                      GS_SERVICE,
+-                                     DBUS_NAME_FLAG_DO_NOT_QUEUE,
++                                     DBUS_NAME_FLAG_DO_NOT_QUEUE | DBUS_NAME_FLAG_ALLOW_REPLACEMENT,
+                                      &buserror);
+         if (dbus_error_is_set (&buserror)) {
+                 g_set_error (error,
+@@ -1365,7 +1382,7 @@
+                             "type='signal'"
+                             ",interface='"DBUS_INTERFACE_DBUS"'"
+                             ",sender='"DBUS_SERVICE_DBUS"'"
+-                            ",member='NameOwnerChanged'",
++                            ",member='NameLost'",
+                             NULL);
+ 
+         if (listener->priv->system_connection != NULL) {
diff -pruN 3.6.1-13/debian/patches/cross.patch 3.6.1-13ubuntu2/debian/patches/cross.patch
--- 3.6.1-13/debian/patches/cross.patch	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/cross.patch	2019-12-06 10:17:42.000000000 +0000
@@ -7,10 +7,10 @@ Subject: Use triplet-prefixed pkg-config
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
-index 93e31e0..6742dff 100644
+index c573924..fceab8e 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -102,7 +102,7 @@ AC_SUBST(GNOME_SCREENSAVER_SAVER_LIBS)
+@@ -103,7 +103,7 @@ AC_SUBST(GNOME_SCREENSAVER_SAVER_LIBS)
  
  # Find out the version of DBUS we're using
  
diff -pruN 3.6.1-13/debian/patches/libsystemd.patch 3.6.1-13ubuntu2/debian/patches/libsystemd.patch
--- 3.6.1-13/debian/patches/libsystemd.patch	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/libsystemd.patch	2019-12-06 10:17:42.000000000 +0000
@@ -1,18 +1,11 @@
-From: Dmitry Shachnev <mitya57@debian.org>
-Date: Fri, 28 Feb 2020 17:14:57 +0000
-Subject: build against libsystemd library
-
+Description: build against libsystemd library
+Author: Dmitry Shachnev <mitya57@debian.org>
 Forwarded: no
 Last-Update: 2015-07-06
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/configure.ac b/configure.ac
-index 3451989..93e31e0 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -601,7 +601,7 @@ AC_ARG_WITH(systemd,
+@@ -607,7 +607,7 @@ AC_ARG_WITH(systemd,
              [with_systemd=$withval], [with_systemd=auto])
  
  PKG_CHECK_MODULES(SYSTEMD,
diff -pruN 3.6.1-13/debian/patches/move-not-nuke.patch 3.6.1-13ubuntu2/debian/patches/move-not-nuke.patch
--- 3.6.1-13/debian/patches/move-not-nuke.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/move-not-nuke.patch	2019-12-06 10:17:42.000000000 +0000
@@ -0,0 +1,36 @@
+Description: When unlocking, if we can't get the grab, try to set focus on the desired window & try again.
+Author: Ray Strode <rstrode@redhat.com>
+Bug-Upstream: https://bugzilla.redhat.com/show_bug.cgi?id=905935
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/1175717
+
+Index: b/src/gs-grab-x11.c
+===================================================================
+--- a/src/gs-grab-x11.c
++++ b/src/gs-grab-x11.c
+@@ -377,7 +377,7 @@
+ }
+ 
+ static void
+-gs_grab_nuke_focus (void)
++gs_grab_move_focus (GdkWindow *window)
+ {
+         Window focus = 0;
+         int    rev = 0;
+@@ -388,7 +388,7 @@
+ 
+         XGetInputFocus (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &focus, &rev);
+ 
+-        XSetInputFocus (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), None, RevertToNone, CurrentTime);
++        XSetInputFocus (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), GDK_WINDOW_XID (window), RevertToNone, CurrentTime);
+ 
+         gdk_error_trap_pop_ignored ();
+ }
+@@ -469,7 +469,7 @@
+         if (kstatus != GDK_GRAB_SUCCESS) {
+                 if (!focus_fuckus) {
+                         focus_fuckus = TRUE;
+-                        gs_grab_nuke_focus ();
++                        gs_grab_move_focus (window);
+                         goto AGAIN;
+                 }
+         }
diff -pruN 3.6.1-13/debian/patches/series 3.6.1-13ubuntu2/debian/patches/series
--- 3.6.1-13/debian/patches/series	2020-04-16 00:26:51.000000000 +0000
+++ 3.6.1-13ubuntu2/debian/patches/series	2020-02-28 17:41:27.000000000 +0000
@@ -1,8 +1,25 @@
 00git_logind_check.patch
 01_no_autostart.patch
+03_fix_ltsp-fading.patch
+10_legacy_scrsvr_inhibit.patch
+13_nvidia_gamma_fade_fallback.patch
 14_no_fade_on_user_switch.patch
+15_dont_crash_on_no_fade.patch
+16_dont_crash_in_kvm.patch
+17_remove_top_panel.patch
+18_unity_dialog_layout.patch
+24_use_user_settings.patch
+25_fix_lock_command.patch
+27_lightdm_switch_user.patch
+28_blocking_return.patch
+29_handle_expired_creds.patch
+30_ubuntu-lock-on-suspend_gsetting.patch
 31_lock_screen_on_suspend.patch
+32_input_sources_switcher.patch
+move-not-nuke.patch
+allow-replacement
 libsystemd.patch
 0001-gs-lock-plug-Disconnect-signal-handler-from-right-ob.patch
 cross.patch
+33_budgie_support.patch
 manager-adapt-to-gnome-desktop-API-changes.patch
