Bug#1031496: gnome-shell: Support Wayland session for all seats in multiseat setups

Tino Mettler tino.mettler+debbugs at tikei.de
Fri Feb 17 08:38:07 GMT 2023


Package: gnome-shell
Version: 43.3-1
Severity: normal
Tags: patch upstream

Dear Maintainer,

in multiseat setups, GNOME is limited to only support Wayland sessions on seat0.

There are patches for gdm3 and gnome-shell to enable Wayland sessions for all
seats in a multiseat environment. I use these patches on top of the current
Debian sid packages for some months now without any glitches. I also tested
fast user-switching as requested by the author of these patches.

The original source of the patches is here:
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2230/commits

This bug belongs to bug #1031494 which is the gdm part of this issue.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031494

Regards,
Tino

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.7 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gnome-shell depends on:
ii  dconf-gsettings-backend [gsettings-backend]  0.40.0-4
ii  gconf-gsettings-backend [gsettings-backend]  3.2.6-8
ii  gir1.2-accountsservice-1.0                   22.08.8-5
ii  gir1.2-adw-1                                 1.2.1-2
ii  gir1.2-atk-1.0                               2.46.0-5
ii  gir1.2-atspi-2.0                             2.46.0-5
ii  gir1.2-freedesktop                           1.74.0-3
ii  gir1.2-gcr-3                                 3.41.1-1+b1
ii  gir1.2-gdesktopenums-3.0                     43.0-1
ii  gir1.2-gdkpixbuf-2.0                         2.42.10+dfsg-1+b1
ii  gir1.2-gdm-1.0                               43.0-3.1
ii  gir1.2-geoclue-2.0                           2.6.0-2
ii  gir1.2-glib-2.0                              1.74.0-3
ii  gir1.2-gnomebluetooth-3.0                    42.5-3
ii  gir1.2-gnomedesktop-3.0                      43.1-1
ii  gir1.2-graphene-1.0                          1.10.8-1
ii  gir1.2-gstreamer-1.0                         1.22.0-2
ii  gir1.2-gtk-3.0                               3.24.36-3
ii  gir1.2-gtk-4.0                               4.8.3+ds-2
ii  gir1.2-gweather-4.0                          4.2.0-1
ii  gir1.2-ibus-1.0                              1.5.27-4
ii  gir1.2-mutter-11                             43.2-6
ii  gir1.2-nm-1.0                                1.42.0-1
ii  gir1.2-nma-1.0                               1.10.6-1
ii  gir1.2-pango-1.0                             1.50.12+ds-1
ii  gir1.2-polkit-1.0                            122-3
ii  gir1.2-rsvg-2.0                              2.54.5+dfsg-1
ii  gir1.2-soup-3.0                              3.2.2-1
ii  gir1.2-upowerglib-1.0                        0.99.20-2
ii  gir1.2-webkit2-4.1                           2.38.4-2
ii  gnome-backgrounds                            43-1
ii  gnome-settings-daemon                        43.0-4
ii  gnome-shell-common                           43.3-1.1
ii  gsettings-desktop-schemas                    43.0-1
ii  gstreamer1.0-pipewire                        0.3.65-2
ii  libatk-bridge2.0-0                           2.46.0-5
ii  libatk1.0-0                                  2.46.0-5
ii  libc6                                        2.36-8
ii  libcairo2                                    1.16.0-7
ii  libecal-2.0-2                                3.46.4-1
ii  libedataserver-1.2-27                        3.46.4-1
ii  libgcr-base-3-1                              3.41.1-1+b1
ii  libgdk-pixbuf-2.0-0                          2.42.10+dfsg-1+b1
ii  libgirepository-1.0-1                        1.74.0-3
ii  libgjs0g                                     1.74.1-1
ii  libgles2                                     1.6.0-1
ii  libglib2.0-0                                 2.74.5-1
ii  libglib2.0-bin                               2.74.5-1
ii  libgnome-autoar-0-0                          0.4.3-1
ii  libgnome-desktop-3-20                        43.1-1
ii  libgraphene-1.0-0                            1.10.8-1
ii  libgtk-3-0                                   3.24.36-3
ii  libgtk-4-1                                   4.8.3+ds-2
ii  libical3                                     3.0.16-1+b1
ii  libjson-glib-1.0-0                           1.6.6-1
ii  libmutter-11-0                               43.2-6
ii  libnm0                                       1.42.0-1
ii  libpango-1.0-0                               1.50.12+ds-1
ii  libpangocairo-1.0-0                          1.50.12+ds-1
ii  libpolkit-agent-1-0                          122-3
ii  libpolkit-gobject-1-0                        122-3
ii  libpulse-mainloop-glib0                      16.1+dfsg1-2+b1
ii  libpulse0                                    16.1+dfsg1-2+b1
ii  libsecret-1-0                                0.20.5-3
ii  libsystemd0                                  252.5-2
ii  libwayland-server0                           1.21.0-1
ii  libx11-6                                     2:1.8.3-3
ii  libxfixes3                                   1:6.0.0-2
ii  python3                                      3.11.1-3

Versions of packages gnome-shell recommends:
pn  bolt                   <none>
pn  chrome-gnome-shell     <none>
ii  evolution-data-server  3.46.4-1
ii  gdm3                   43.0-3.1
pn  gkbd-capplet           <none>
ii  gnome-control-center   1:43.2-2
pn  gnome-menus            <none>
pn  gnome-remote-desktop   <none>
pn  gnome-user-docs        <none>
ii  ibus                   1.5.27-4
pn  iio-sensor-proxy       <none>
pn  power-profiles-daemon  <none>
pn  switcheroo-control     <none>
ii  unzip                  6.0-27

Versions of packages gnome-shell suggests:
pn  gir1.2-malcontent-0          <none>
pn  gir1.2-telepathyglib-0.12    <none>
pn  gir1.2-telepathylogger-0.2   <none>
ii  gnome-shell-extension-prefs  43.3-1.1

Versions of packages gnome-session depends on:
ii  gnome-session-bin                                      43.0-1
ii  gnome-session-common                                   43.0-1
ii  gnome-settings-daemon                                  43.0-4
ii  xdg-desktop-portal-gnome [xdg-desktop-portal-backend]  43.1-2
ii  xdg-desktop-portal-gtk [xdg-desktop-portal-backend]    1.14.1-1

Versions of packages gnome-session suggests:
ii  desktop-base   12.0.2
ii  gnome-keyring  42.1-1+b1

Versions of packages gnome-settings-daemon depends on:
ii  gnome-settings-daemon-common  43.0-4
ii  gsettings-desktop-schemas     43.0-1
ii  libasound2                    1.2.8-1+b1
ii  libc6                         2.36-8
ii  libcairo2                     1.16.0-7
ii  libcanberra-gtk3-0            0.30-10
ii  libcanberra0                  0.30-10
ii  libcolord2                    1.4.6-2.1
ii  libcups2                      2.4.2-1+b2
ii  libfontconfig1                2.14.1-4
ii  libgcr-base-3-1               3.41.1-1+b1
ii  libgdk-pixbuf-2.0-0           2.42.10+dfsg-1+b1
ii  libgeoclue-2-0                2.6.0-2
ii  libgeocode-glib-2-0           3.26.3-5
ii  libglib2.0-0                  2.74.5-1
ii  libgnome-desktop-3-20         43.1-1
ii  libgtk-3-0                    3.24.36-3
ii  libgudev-1.0-0                237-2
ii  libgweather-4-0               4.2.0-1
ii  libmm-glib0                   1.20.4-1
ii  libnm0                        1.42.0-1
ii  libnotify4                    0.8.1-1
ii  libnspr4                      2:4.35-1
ii  libnss3                       2:3.87-1
ii  libpam-systemd [logind]       252.5-2
ii  libpango-1.0-0                1.50.12+ds-1
ii  libpangocairo-1.0-0           1.50.12+ds-1
ii  libpolkit-gobject-1-0         122-3
ii  libpulse-mainloop-glib0       16.1+dfsg1-2+b1
ii  libpulse0                     16.1+dfsg1-2+b1
ii  libspa-0.2-bluetooth          0.3.65-2
ii  libupower-glib3               0.99.20-2
ii  libwacom9                     2.5.0-1
ii  libwayland-client0            1.21.0-1
ii  libx11-6                      2:1.8.3-3
ii  libxext6                      2:1.3.4-1+b1
ii  libxfixes3                    1:6.0.0-2
ii  libxi6                        2:1.8-1+b1
ii  pulseaudio                    16.1+dfsg1-2+b1
ii  pulseaudio-module-bluetooth   16.1+dfsg1-2+b1

Versions of packages gnome-settings-daemon recommends:
pn  iio-sensor-proxy   <none>
pn  pipewire-audio     <none>
ii  pkexec             122-3
ii  x11-xserver-utils  7.7+9+b1

Versions of packages gnome-settings-daemon suggests:
pn  usbguard  <none>

Versions of packages libgjs0g depends on:
ii  libc6                                                       2.36-8
ii  libcairo-gobject2                                           1.16.0-7
ii  libcairo2                                                   1.16.0-7
ii  libffi8                                                     3.4.4-1
ii  libgcc-s1                                                   12.2.0-14
ii  libgirepository-1.0-1 [libgirepository-1.0-1-with-libffi8]  1.74.0-3
ii  libglib2.0-0                                                2.74.5-1
ii  libmozjs-102-0                                              102.7.0-1
ii  libreadline8                                                8.2-1.3
ii  libstdc++6                                                  12.2.0-14
ii  libx11-6                                                    2:1.8.3-3

Versions of packages libmutter-11-0 depends on:
ii  adwaita-icon-theme         43-1
ii  gsettings-desktop-schemas  43.0-1
ii  libatk1.0-0                2.46.0-5
ii  libc6                      2.36-8
ii  libcairo-gobject2          1.16.0-7
ii  libcairo2                  1.16.0-7
ii  libcanberra0               0.30-10
ii  libcolord2                 1.4.6-2.1
ii  libdrm2                    2.4.114-1
ii  libegl1                    1.6.0-1
ii  libfontconfig1             2.14.1-4
ii  libfribidi0                1.0.8-2.1
ii  libgbm1                    23.0.0~rc1-1
ii  libgdk-pixbuf-2.0-0        2.42.10+dfsg-1+b1
ii  libgl1                     1.6.0-1
ii  libglib2.0-0               2.74.5-1
ii  libgnome-desktop-3-20      43.1-1
ii  libgraphene-1.0-0          1.10.8-1
ii  libgtk-3-0                 3.24.36-3
ii  libgudev-1.0-0             237-2
ii  libice6                    2:1.0.10-1
ii  libinput10                 1.22.1-1
ii  libjson-glib-1.0-0         1.6.6-1
ii  liblcms2-2                 2.14-1+b1
ii  libpango-1.0-0             1.50.12+ds-1
ii  libpangocairo-1.0-0        1.50.12+ds-1
ii  libpangoft2-1.0-0          1.50.12+ds-1
ii  libpipewire-0.3-0          0.3.65-2
ii  libsm6                     2:1.2.3-1
ii  libstartup-notification0   0.12-6+b1
ii  libsystemd0                252.5-2
ii  libudev1                   252.5-2
ii  libwacom9                  2.5.0-1
ii  libwayland-server0         1.21.0-1
ii  libx11-6                   2:1.8.3-3
ii  libx11-xcb1                2:1.8.3-3
ii  libxau6                    1:1.0.9-1
ii  libxcb-randr0              1.15-1
ii  libxcb-res0                1.15-1
ii  libxcb1                    1.15-1
ii  libxcomposite1             1:0.4.5-1
ii  libxcursor1                1:1.2.1-1
ii  libxdamage1                1:1.1.6-1
ii  libxext6                   2:1.3.4-1+b1
ii  libxfixes3                 1:6.0.0-2
ii  libxi6                     2:1.8-1+b1
ii  libxinerama1               2:1.1.4-3
ii  libxkbcommon-x11-0         1.5.0-1
ii  libxkbcommon0              1.5.0-1
ii  libxkbfile1                1:1.1.0-1
ii  libxrandr2                 2:1.5.2-2+b1
ii  libxtst6                   2:1.2.3-1.1
ii  mutter-common              43.2-6

Versions of packages gnome-shell is related to:
ii  libegl-mesa0 [libegl-vendor]  23.0.0~rc1-1
ii  libgl1-mesa-dri               23.0.0~rc1-1
ii  libglx-mesa0 [libglx-vendor]  23.0.0~rc1-1

-- no debconf information
-------------- next part --------------
>From 4d68488635c8df92c88cacca6c8f79b4f6f8ef99 Mon Sep 17 00:00:00 2001
From: msizanoen1 <msizanoen at qtmlabs.xyz>
Date: Mon, 7 Mar 2022 15:52:23 +0700
Subject: [PATCH 1/2] gdm: Do not run session start fade out effect when not on
 a VT-capable seat

On a non-VT-capable seat, logind will automatically activate the login
session on creation. On a gnome-shell Wayland session, this causes
animation effects to be stalled indefinitely, causing hang during login
as the animation completion callback is never invoked to launch the
session.

Fix this by checking for current seat's CanTTY property and do not run
session start effect if the current seat is not VT-capable.
---
 .../org.freedesktop.login1.Seat.xml           |  5 +++++
 .../org.freedesktop.login1.Session.xml        |  1 +
 .../gnome-shell-dbus-interfaces.gresource.xml |  1 +
 js/gdm/loginDialog.js                         | 17 ++++++++++++--
 js/misc/loginManager.js                       | 22 +++++++++++++++++++
 5 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 data/dbus-interfaces/org.freedesktop.login1.Seat.xml

diff --git a/data/dbus-interfaces/org.freedesktop.login1.Seat.xml b/data/dbus-interfaces/org.freedesktop.login1.Seat.xml
new file mode 100644
index 000000000..06c08263e
--- /dev/null
+++ b/data/dbus-interfaces/org.freedesktop.login1.Seat.xml
@@ -0,0 +1,5 @@
+<node>
+  <interface name="org.freedesktop.login1.Seat">
+    <property name="CanTTY" type="b" access="read"/>
+  </interface>
+</node>
diff --git a/data/dbus-interfaces/org.freedesktop.login1.Session.xml b/data/dbus-interfaces/org.freedesktop.login1.Session.xml
index 6fab81794..9a86d8c04 100644
--- a/data/dbus-interfaces/org.freedesktop.login1.Session.xml
+++ b/data/dbus-interfaces/org.freedesktop.login1.Session.xml
@@ -8,6 +8,7 @@
     <property name="Remote" type="b" access="read"/>
     <property name="Type" type="s" access="read"/>
     <property name="State" type="s" access="read"/>
+    <property name="Seat" type="(so)" access="read"/>
     <method name="SetLockedHint">
       <arg type="b" direction="in"/>
     </method>
diff --git a/data/gnome-shell-dbus-interfaces.gresource.xml b/data/gnome-shell-dbus-interfaces.gresource.xml
index 6682c462d..3bad73f40 100644
--- a/data/gnome-shell-dbus-interfaces.gresource.xml
+++ b/data/gnome-shell-dbus-interfaces.gresource.xml
@@ -15,6 +15,7 @@
     <file preprocess="xml-stripblanks">org.freedesktop.impl.portal.PermissionStore.xml</file>
     <file preprocess="xml-stripblanks">org.freedesktop.impl.portal.Request.xml</file>
     <file preprocess="xml-stripblanks">org.freedesktop.login1.Manager.xml</file>
+    <file preprocess="xml-stripblanks">org.freedesktop.login1.Seat.xml</file>
     <file preprocess="xml-stripblanks">org.freedesktop.login1.Session.xml</file>
     <file preprocess="xml-stripblanks">org.freedesktop.login1.User.xml</file>
     <file preprocess="xml-stripblanks">org.freedesktop.ModemManager1.Modem.Modem3gpp.xml</file>
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 607193677..9549acc5e 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -992,19 +992,32 @@ var LoginDialog = GObject.registerClass({
         }, this);
     }
 
-    _startSession(serviceName) {
+    _startSessionWithEffect(serviceName) {
         this._bindOpacity();
         this.ease({
             opacity: 0,
             duration: _FADE_ANIMATION_TIME,
             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
             onComplete: () => {
-                this._greeter.call_start_session_when_ready_sync(serviceName, true, null);
+                this._startSessionWithoutEffect(serviceName);
                 this._unbindOpacity();
             },
         });
     }
 
+    _startSessionWithoutEffect(serviceName) {
+        this._greeter.call_start_session_when_ready_sync(serviceName, true, null);
+    }
+
+    async _startSession(serviceName) {
+        let seat = await LoginManager.getLoginManager().getCurrentSeatProxy();
+
+        if (seat !== null && seat.CanTTY)
+            this._startSessionWithEffect(serviceName);
+        else
+            this._startSessionWithoutEffect(serviceName);
+    }
+
     _onSessionOpened(client, serviceName) {
         this._authPrompt.finish(() => this._startSession(serviceName));
     }
diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js
index 94d62e819..d6eb4c081 100644
--- a/js/misc/loginManager.js
+++ b/js/misc/loginManager.js
@@ -7,10 +7,12 @@ const Signals = imports.misc.signals;
 const { loadInterfaceXML } = imports.misc.fileUtils;
 
 const SystemdLoginManagerIface = loadInterfaceXML('org.freedesktop.login1.Manager');
+const SystemdLoginSeatIface = loadInterfaceXML('org.freedesktop.login1.Seat');
 const SystemdLoginSessionIface = loadInterfaceXML('org.freedesktop.login1.Session');
 const SystemdLoginUserIface = loadInterfaceXML('org.freedesktop.login1.User');
 
 const SystemdLoginManager = Gio.DBusProxy.makeProxyWrapper(SystemdLoginManagerIface);
+const SystemdLoginSeat = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSeatIface);
 const SystemdLoginSession = Gio.DBusProxy.makeProxyWrapper(SystemdLoginSessionIface);
 const SystemdLoginUser = Gio.DBusProxy.makeProxyWrapper(SystemdLoginUserIface);
 
@@ -101,6 +103,22 @@ var LoginManagerSystemd = class extends Signals.EventEmitter {
                                   this._prepareForSleep.bind(this));
     }
 
+    async getCurrentSeatProxy() {
+        if (this._currentSeat)
+            return this._currentSeat;
+
+        try {
+            let session = await this.getCurrentSessionProxy();
+            const [seatName_, objectPath] = session.Seat;
+            this._currentSeat = new SystemdLoginSeat(Gio.DBus.system,
+                'org.freedesktop.login1', objectPath);
+            return this._currentSeat;
+        } catch (error) {
+            logError(error, 'Could not get a proxy for the current session');
+            return null;
+        }
+    }
+
     async getCurrentSessionProxy() {
         if (this._currentSession)
             return this._currentSession;
@@ -214,6 +232,10 @@ var LoginManagerDummy = class extends Signals.EventEmitter  {
         return new Promise(() => {});
     }
 
+    getCurrentSeatProxy() {
+        return new Promise(resolve => resolve(null));
+    }
+
     canSuspend() {
         return new Promise(resolve => resolve({
             canSuspend: false,
-------------- next part --------------
>From 12b9665273f431e927cb2f01048ffbeca08a0d9f Mon Sep 17 00:00:00 2001
From: msizanoen1 <msizanoen at qtmlabs.xyz>
Date: Mon, 7 Mar 2022 17:00:35 +0700
Subject: [PATCH 2/2] LoginManager: Use logind auto heuristic when
 XDG_SESSION_ID is not set

On a multiseat system, the current session determination method will
cause the wrong session to be detected in the GDM greeter. Fix this by
letting logind figure out the session instead. logind will use the
session ID acquired from gnome-shell's cgroup information then
automatically fall back to using the user display session.
---
 js/misc/loginManager.js | 32 +++++++++-----------------------
 1 file changed, 9 insertions(+), 23 deletions(-)

diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js
index d6eb4c081..b755db870 100644
--- a/js/misc/loginManager.js
+++ b/js/misc/loginManager.js
@@ -126,29 +126,15 @@ var LoginManagerSystemd = class extends Signals.EventEmitter {
         let sessionId = GLib.getenv('XDG_SESSION_ID');
         if (!sessionId) {
             log('Unset XDG_SESSION_ID, getCurrentSessionProxy() called outside a user session. Asking logind directly.');
-            let [session, objectPath] = this._userProxy.Display;
-            if (session) {
-                log(`Will monitor session ${session}`);
-                sessionId = session;
-            } else {
-                log('Failed to find "Display" session; are we the greeter?');
-
-                for ([session, objectPath] of this._userProxy.Sessions) {
-                    let sessionProxy = new SystemdLoginSession(Gio.DBus.system,
-                                                               'org.freedesktop.login1',
-                                                               objectPath);
-                    log(`Considering ${session}, class=${sessionProxy.Class}`);
-                    if (sessionProxy.Class == 'greeter') {
-                        log(`Yes, will monitor session ${session}`);
-                        sessionId = session;
-                        break;
-                    }
-                }
-
-                if (!sessionId) {
-                    log('No, failed to get session from logind.');
-                    return null;
-                }
+            try {
+                let session = new SystemdLoginSession(Gio.DBus.system,
+                    'org.freedesktop.login1',
+                    '/org/freedesktop/login1/session/auto');
+                log(`Will monitor session ${session.Id}`);
+                sessionId = session.Id;
+            } catch (error) {
+                logError(error, 'Failed to get session from logind');
+                return null;
             }
         }
 


More information about the pkg-gnome-maintainers mailing list