From 5a60da6d16d1401ebe4a31c95f5c9cb7dfd34603 Mon Sep 17 00:00:00 2001 From: Achill Gilgenast Date: Tue, 17 Mar 2026 12:16:41 +0100 Subject: [PATCH] {temp,systemd}/gnome-shell-mobile: backport some GNOME 50 patches to GNOME 48 Closes: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/issues/4409 Part-of: --- ...otify-gnome-session-when-we-re-ready.patch | 64 +++++++++ ...otify-gnome-session-when-we-re-ready.patch | 53 +++++++ ...03-data-Drop-org.gnome.Shell.desktop.patch | 85 +++++++++++ .../0004-data-Overhaul-systemd-units.patch | 133 ++++++++++++++++++ .../systemd/gnome-shell-mobile/APKBUILD | 10 +- ...otify-gnome-session-when-we-re-ready.patch | 64 +++++++++ ...otify-gnome-session-when-we-re-ready.patch | 53 +++++++ ...03-data-Drop-org.gnome.Shell.desktop.patch | 85 +++++++++++ .../0004-data-Overhaul-systemd-units.patch | 133 ++++++++++++++++++ temp/gnome-shell-mobile/APKBUILD | 10 +- 10 files changed, 688 insertions(+), 2 deletions(-) create mode 100644 extra-repos/systemd/gnome-shell-mobile/0001-main-Notify-gnome-session-when-we-re-ready.patch create mode 100644 extra-repos/systemd/gnome-shell-mobile/0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch create mode 100644 extra-repos/systemd/gnome-shell-mobile/0003-data-Drop-org.gnome.Shell.desktop.patch create mode 100644 extra-repos/systemd/gnome-shell-mobile/0004-data-Overhaul-systemd-units.patch create mode 100644 temp/gnome-shell-mobile/0001-main-Notify-gnome-session-when-we-re-ready.patch create mode 100644 temp/gnome-shell-mobile/0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch create mode 100644 temp/gnome-shell-mobile/0003-data-Drop-org.gnome.Shell.desktop.patch create mode 100644 temp/gnome-shell-mobile/0004-data-Overhaul-systemd-units.patch diff --git a/extra-repos/systemd/gnome-shell-mobile/0001-main-Notify-gnome-session-when-we-re-ready.patch b/extra-repos/systemd/gnome-shell-mobile/0001-main-Notify-gnome-session-when-we-re-ready.patch new file mode 100644 index 000000000..5831c5b2a --- /dev/null +++ b/extra-repos/systemd/gnome-shell-mobile/0001-main-Notify-gnome-session-when-we-re-ready.patch @@ -0,0 +1,64 @@ +From a6600160ca8c972350e5794c341ddcfa5c1a4640 Mon Sep 17 00:00:00 2001 +From: Adrian Vovk +Date: Tue, 27 May 2025 17:03:34 -0400 +Subject: [PATCH 1/4] main: Notify gnome-session when we're ready + +Basically, we recently[1] removed XSMP from gnome-session because it's +been disabled for a while. Mutter also[2] removed its XSMP integration +shortly after. + +However, it turns out that gnome-session's builtin service manager was +relying on Mutter's XSMP integration to know when gnome-shell is done +starting up. No more XSMP = no more notification = gnome-session decides +that gnome-shell is dead even though it's not = fail whale + +This is a temporary measure. GDM will soon switch[3] to an architecture +that will allow us to completely drop gnome-session's builtin service +manager, and this workaround will go away + +[1]: https://gitlab.gnome.org/GNOME/gnome-session/-/merge_requests/139 +[2]: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4438 +[3]: https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/289 + +Part-of: +Signed-off-by: Achill Gilgenast +--- + js/ui/main.js | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/js/ui/main.js b/js/ui/main.js +index 252cfef8c191..6674bb20ca51 100644 +--- a/js/ui/main.js ++++ b/js/ui/main.js +@@ -334,6 +334,7 @@ async function _initializeUI() { + GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { + Shell.util_sd_notify(); + global.context.notify_ready(); ++ _notifyGnomeSessionReady(); + return GLib.SOURCE_REMOVE; + }); + +@@ -398,6 +399,20 @@ async function _initializeUI() { + }); + } + ++async function _notifyGnomeSessionReady() { ++ try { ++ let params = GLib.Variant.new('(ss)', ['org.gnome.Shell.desktop', '']); ++ await Gio.DBus.session.call( ++ 'org.gnome.SessionManager', ++ '/org/gnome/SessionManager', ++ 'org.gnome.SessionManager', ++ 'RegisterClient', params, null, ++ Gio.DBusCallFlags.NONE, -1, null); ++ } catch (e) { ++ log(`Error notifying gnome-session that we're ready: ${e.message}`); ++ } ++} ++ + function _handleShowWelcomeScreen() { + const lastShownVersion = global.settings.get_string(WELCOME_DIALOG_LAST_SHOWN_VERSION); + if (Util.GNOMEversionCompare(WELCOME_DIALOG_LAST_TOUR_CHANGE, lastShownVersion) > 0) { +-- +2.53.0 + diff --git a/extra-repos/systemd/gnome-shell-mobile/0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch b/extra-repos/systemd/gnome-shell-mobile/0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch new file mode 100644 index 000000000..6b1f19071 --- /dev/null +++ b/extra-repos/systemd/gnome-shell-mobile/0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch @@ -0,0 +1,53 @@ +From 64ef5f3811adb12d3dd82293687855f6b24e95ee Mon Sep 17 00:00:00 2001 +From: Adrian Vovk +Date: Tue, 8 Jul 2025 20:56:18 -0400 +Subject: [PATCH 2/4] Revert "main: Notify gnome-session when we're ready" + +This reverts commit 1747a59aa5d44f4d7b74e1f1fee1d48174a1ce5a. + +gnome-session is no longer a service manager, and thus doesn't need to +be notified of our readiness like this. We now do this exclusively +through systemd + +Part-of: +Signed-off-by: Achill Gilgenast +--- + js/ui/main.js | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/js/ui/main.js b/js/ui/main.js +index 6674bb20ca51..252cfef8c191 100644 +--- a/js/ui/main.js ++++ b/js/ui/main.js +@@ -334,7 +334,6 @@ async function _initializeUI() { + GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { + Shell.util_sd_notify(); + global.context.notify_ready(); +- _notifyGnomeSessionReady(); + return GLib.SOURCE_REMOVE; + }); + +@@ -399,20 +398,6 @@ async function _initializeUI() { + }); + } + +-async function _notifyGnomeSessionReady() { +- try { +- let params = GLib.Variant.new('(ss)', ['org.gnome.Shell.desktop', '']); +- await Gio.DBus.session.call( +- 'org.gnome.SessionManager', +- '/org/gnome/SessionManager', +- 'org.gnome.SessionManager', +- 'RegisterClient', params, null, +- Gio.DBusCallFlags.NONE, -1, null); +- } catch (e) { +- log(`Error notifying gnome-session that we're ready: ${e.message}`); +- } +-} +- + function _handleShowWelcomeScreen() { + const lastShownVersion = global.settings.get_string(WELCOME_DIALOG_LAST_SHOWN_VERSION); + if (Util.GNOMEversionCompare(WELCOME_DIALOG_LAST_TOUR_CHANGE, lastShownVersion) > 0) { +-- +2.53.0 + diff --git a/extra-repos/systemd/gnome-shell-mobile/0003-data-Drop-org.gnome.Shell.desktop.patch b/extra-repos/systemd/gnome-shell-mobile/0003-data-Drop-org.gnome.Shell.desktop.patch new file mode 100644 index 000000000..eb0721cd0 --- /dev/null +++ b/extra-repos/systemd/gnome-shell-mobile/0003-data-Drop-org.gnome.Shell.desktop.patch @@ -0,0 +1,85 @@ +From 4f2d34e1532e7c56b399b5038233c15c0f280776 Mon Sep 17 00:00:00 2001 +From: Adrian Vovk +Date: Tue, 8 Jul 2025 21:02:29 -0400 +Subject: [PATCH 3/4] data: Drop org.gnome.Shell.desktop + +gnome-session no longer launches gnome-shell via a .desktop file, +because gnome-session no longer has a builtin service manager. + +gnome-shell is now always launched via systemd + +Part-of: +Signed-off-by: Achill Gilgenast +--- + data/meson.build | 13 +------------ + ....in.in => org.gnome.Shell.Extensions.desktop.in} | 0 + ...n.in => org.gnome.Shell.PortalHelper.desktop.in} | 0 + data/org.gnome.Shell.desktop.in.in | 13 ------------- + 4 files changed, 1 insertion(+), 25 deletions(-) + rename data/{org.gnome.Shell.Extensions.desktop.in.in => org.gnome.Shell.Extensions.desktop.in} (100%) + rename data/{org.gnome.Shell.PortalHelper.desktop.in.in => org.gnome.Shell.PortalHelper.desktop.in} (100%) + delete mode 100644 data/org.gnome.Shell.desktop.in.in + +diff --git a/data/meson.build b/data/meson.build +index 114dd2010ef5..d48308743cbf 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -1,7 +1,6 @@ + data_builddir = meson.current_build_dir() + + desktop_files = [ +- 'org.gnome.Shell.desktop', + 'org.gnome.Shell.Extensions.desktop', + ] + service_files = [] +@@ -11,19 +10,9 @@ if have_portal_helper + service_files += 'org.gnome.Shell.PortalHelper.service' + endif + +-desktopconf = configuration_data() +-# We substitute in bindir so it works as an autostart +-# file when built in a non-system prefix +-desktopconf.set('bindir', bindir) +-desktopconf.set('systemd_hidden', have_systemd ? 'true' : 'false') +- + foreach desktop_file : desktop_files + i18n.merge_file( +- input: configure_file( +- input: desktop_file + '.in.in', +- output: desktop_file + '.in', +- configuration: desktopconf +- ), ++ input: desktop_file + '.in', + output: desktop_file, + po_dir: po_dir, + install: true, +diff --git a/data/org.gnome.Shell.Extensions.desktop.in.in b/data/org.gnome.Shell.Extensions.desktop.in +similarity index 100% +rename from data/org.gnome.Shell.Extensions.desktop.in.in +rename to data/org.gnome.Shell.Extensions.desktop.in +diff --git a/data/org.gnome.Shell.PortalHelper.desktop.in.in b/data/org.gnome.Shell.PortalHelper.desktop.in +similarity index 100% +rename from data/org.gnome.Shell.PortalHelper.desktop.in.in +rename to data/org.gnome.Shell.PortalHelper.desktop.in +diff --git a/data/org.gnome.Shell.desktop.in.in b/data/org.gnome.Shell.desktop.in.in +deleted file mode 100644 +index 59d1cd2fe924..000000000000 +--- a/data/org.gnome.Shell.desktop.in.in ++++ /dev/null +@@ -1,13 +0,0 @@ +-[Desktop Entry] +-Type=Application +-Name=GNOME Shell +-Comment=Window management and application launching +-Exec=@bindir@/gnome-shell +-Categories=GNOME;GTK;Core; +-OnlyShowIn=GNOME; +-NoDisplay=true +-X-GNOME-Autostart-Phase=DisplayServer +-X-GNOME-Provides=panel;windowmanager; +-X-GNOME-Autostart-Notify=true +-X-GNOME-AutoRestart=false +-X-GNOME-HiddenUnderSystemd=@systemd_hidden@ +-- +2.53.0 + diff --git a/extra-repos/systemd/gnome-shell-mobile/0004-data-Overhaul-systemd-units.patch b/extra-repos/systemd/gnome-shell-mobile/0004-data-Overhaul-systemd-units.patch new file mode 100644 index 000000000..8c47612f7 --- /dev/null +++ b/extra-repos/systemd/gnome-shell-mobile/0004-data-Overhaul-systemd-units.patch @@ -0,0 +1,133 @@ +From a1444e7bb90fbe881c3cb0dbd37a3ee9b0e03af1 Mon Sep 17 00:00:00 2001 +From: Adrian Vovk +Date: Thu, 13 Nov 2025 14:01:20 -0500 +Subject: [PATCH 4/4] data: Overhaul systemd units + +This simplifies the structure of the systemd units, since we no longer +support running with X11. But it also allows us to pass in the +gnome-shell session mode via systemd. + +This removes the need for GDM to have any special code to handle the +GNOME_SHELL_SESSION_MODE environment variable, and allows GNOME sessions +to specify directly what session mode they need without the involvement +of GDM. This makes it trivial to define custom gnome-session sessions +that use custom gnome-shell session modes. + +Sessions that consist entirely of a gnome-shell mode (like the +gnome-classic session) will need to do a little more legwork to define +themselves as proper gnome-session sessions. + +Signed-off-by: Achill Gilgenast +--- + data/meson.build | 33 +++---------------- + data/org.gnome.Shell.target.in | 9 ----- + ...service.in => org.gnome.Shell@.service.in} | 9 +++-- + 3 files changed, 9 insertions(+), 42 deletions(-) + delete mode 100644 data/org.gnome.Shell.target.in + rename data/{org.gnome.Shell@wayland.service.in => org.gnome.Shell@.service.in} (72%) + +diff --git a/data/meson.build b/data/meson.build +index d48308743cbf..d02fa12b00af 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -113,40 +113,17 @@ install_data('00_org.gnome.shell.gschema.override', install_dir: schemadir) + if have_systemd + unitconf = configuration_data() + unitconf.set('bindir', bindir) +- supported_sessions = ['wayland'] +- if have_x11 +- configure_file( +- input: 'org.gnome.Shell@x11.service.in', +- output: 'org.gnome.Shell@x11.service', +- configuration: unitconf, +- install_dir: systemduserunitdir +- ) +- supported_sessions += ['x11'] +- endif +- + configure_file( +- input: 'org.gnome.Shell@wayland.service.in', +- output: 'org.gnome.Shell@wayland.service', ++ input: 'org.gnome.Shell@.service.in', ++ output: 'org.gnome.Shell@.service', + configuration: unitconf, + install_dir: systemduserunitdir + ) + +- +- units = files('org.gnome.Shell-disable-extensions.service') +- targetconf = configuration_data() +- sessions_wants = [] +- foreach session: supported_sessions +- sessions_wants += 'org.gnome.Shell@' + session + '.service' +- endforeach +- targetconf.set('SUPPORTED_SESSIONS', ' '.join(sessions_wants)) +- target = configure_file( +- input: 'org.gnome.Shell.target.in', +- output: 'org.gnome.Shell.target', +- configuration: targetconf ++ install_data ( ++ 'org.gnome.Shell-disable-extensions.service', ++ install_dir: systemduserunitdir, + ) +- units += target +- +- install_data(units, install_dir: systemduserunitdir) + endif + + # for unit tests - gnome.compile_schemas() only looks in srcdir +diff --git a/data/org.gnome.Shell.target.in b/data/org.gnome.Shell.target.in +deleted file mode 100644 +index bb65fa0e6b63..000000000000 +--- a/data/org.gnome.Shell.target.in ++++ /dev/null +@@ -1,9 +0,0 @@ +-[Unit] +-Description=GNOME Shell +-DefaultDependencies=no +- +-Requisite=gnome-session-initialized.target +-PartOf=gnome-session-initialized.target +-Before=gnome-session-initialized.target +- +-Wants=@SUPPORTED_SESSIONS@ +\ No newline at end of file +diff --git a/data/org.gnome.Shell@wayland.service.in b/data/org.gnome.Shell@.service.in +similarity index 72% +rename from data/org.gnome.Shell@wayland.service.in +rename to data/org.gnome.Shell@.service.in +index 813da0b7081d..d9dd732d2188 100644 +--- a/data/org.gnome.Shell@wayland.service.in ++++ b/data/org.gnome.Shell@.service.in +@@ -1,6 +1,5 @@ + [Unit] +-Description=GNOME Shell on Wayland +-# On wayland, force a session shutdown ++Description=GNOME Shell + OnFailure=org.gnome.Shell-disable-extensions.service gnome-session-shutdown.target + OnFailureJobMode=replace-irreversibly + CollectMode=inactive-or-failed +@@ -13,17 +12,17 @@ Requisite=gnome-session-initialized.target + PartOf=gnome-session-initialized.target + Before=gnome-session-initialized.target + +-ConditionEnvironment=XDG_SESSION_TYPE=%I ++AssertEnvironment=XDG_SESSION_TYPE=wayland + + [Service] + Slice=session.slice + Type=notify +-ExecStart=@bindir@/gnome-shell ++ExecStart=@bindir@/gnome-shell --mode=%i + # Exit code 1 means we are probably *not* dealing with an extension failure + SuccessExitStatus=1 + + # unset some environment variables that were set by the shell and won't work now that the shell is gone +-ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY' ++ExecStopPost=-systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY + + # On wayland we cannot restart + Restart=no +-- +2.53.0 + diff --git a/extra-repos/systemd/gnome-shell-mobile/APKBUILD b/extra-repos/systemd/gnome-shell-mobile/APKBUILD index 99fb7af09..7fb5d3c42 100644 --- a/extra-repos/systemd/gnome-shell-mobile/APKBUILD +++ b/extra-repos/systemd/gnome-shell-mobile/APKBUILD @@ -5,7 +5,7 @@ maintainer="Newbyte " pkgname=gnome-shell-mobile _pkgver=48.0 pkgver=9999$_pkgver -pkgrel=1 +pkgrel=2 pkgdesc="GNOME shell mobile" url="https://wiki.gnome.org/Projects/GnomeShell" # armhf: mutter-mobile, gjs @@ -83,6 +83,10 @@ source="gnome-shell-mobile-$_commit.tar.gz::https://gitlab.gnome.org/verdre/gnom gsh.patch pcver.patch gjs-1.85.90-girepository.patch + 0001-main-Notify-gnome-session-when-we-re-ready.patch + 0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch + 0003-data-Drop-org.gnome.Shell.desktop.patch + 0004-data-Overhaul-systemd-units.patch " builddir="$srcdir/gnome-shell-mobile-$_commit" options="!check" # Tests have circular dependency 'gnome-shell <-> gdm' @@ -150,4 +154,8 @@ f1575dd86772e4bad9357f0322b2ba396478ec45a691c072c4ff98c299d8814aaaf0386fb90f883b 40cafbd0da2f2a40ff9e9db1026179d52a3b296a81fa43a98e433c0919800f0ec5231fcad32d523b8f01b8f7c0205dce1332e48493b0101ad02dae9469ac3de0 gsh.patch 0503440b547b78859c3bb87a66308899bcf33cc0b543e04e9c865904ff7fb86b10b66594c37a1726828ee1a497b0e034150be8cf1a9fbd06c59809619f6a31c8 pcver.patch 7d1bd0a60ee389c8fbc830ac573235ac1053fe44e8c249d32fb34427d9a1c0129444d781d311a6474d5e0b97897a14a52013a3aec0c85c120b8b525b835378bb gjs-1.85.90-girepository.patch +dec336bf74305fa016ffc1f9272e2b671c41dba458ebbf62b782a3dd091f02ae85315f139ab7ac40fa533e6fae67bf8648bd6557cb1ca917ce760ec1e0fb653f 0001-main-Notify-gnome-session-when-we-re-ready.patch +f10643bf010135cdc2d6bc122d47d4905e6ef3cea5e7a82e44d9a5d66ec147cd85872eaf869d05c1477ad5211a499d2351b4a20ee0085af1ff933769230bc242 0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch +0f859f4c879a432cddf0127f518b95ed4f21720be6490ee96b17414cae461e5dd643d8d918376c2656a08c5537c79b069d3acf6838b5b3ea0b4f880d620ad3e7 0003-data-Drop-org.gnome.Shell.desktop.patch +413bd3cd1ba63dae79afc84a2cc1cdce7b8ea8f5457fdae7a1472ea41d0c6c93a8b66c115bd112699b72ea8b7f1050d8cda23f1259f14c7b0fd7b423a1afde35 0004-data-Overhaul-systemd-units.patch " diff --git a/temp/gnome-shell-mobile/0001-main-Notify-gnome-session-when-we-re-ready.patch b/temp/gnome-shell-mobile/0001-main-Notify-gnome-session-when-we-re-ready.patch new file mode 100644 index 000000000..5831c5b2a --- /dev/null +++ b/temp/gnome-shell-mobile/0001-main-Notify-gnome-session-when-we-re-ready.patch @@ -0,0 +1,64 @@ +From a6600160ca8c972350e5794c341ddcfa5c1a4640 Mon Sep 17 00:00:00 2001 +From: Adrian Vovk +Date: Tue, 27 May 2025 17:03:34 -0400 +Subject: [PATCH 1/4] main: Notify gnome-session when we're ready + +Basically, we recently[1] removed XSMP from gnome-session because it's +been disabled for a while. Mutter also[2] removed its XSMP integration +shortly after. + +However, it turns out that gnome-session's builtin service manager was +relying on Mutter's XSMP integration to know when gnome-shell is done +starting up. No more XSMP = no more notification = gnome-session decides +that gnome-shell is dead even though it's not = fail whale + +This is a temporary measure. GDM will soon switch[3] to an architecture +that will allow us to completely drop gnome-session's builtin service +manager, and this workaround will go away + +[1]: https://gitlab.gnome.org/GNOME/gnome-session/-/merge_requests/139 +[2]: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4438 +[3]: https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/289 + +Part-of: +Signed-off-by: Achill Gilgenast +--- + js/ui/main.js | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/js/ui/main.js b/js/ui/main.js +index 252cfef8c191..6674bb20ca51 100644 +--- a/js/ui/main.js ++++ b/js/ui/main.js +@@ -334,6 +334,7 @@ async function _initializeUI() { + GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { + Shell.util_sd_notify(); + global.context.notify_ready(); ++ _notifyGnomeSessionReady(); + return GLib.SOURCE_REMOVE; + }); + +@@ -398,6 +399,20 @@ async function _initializeUI() { + }); + } + ++async function _notifyGnomeSessionReady() { ++ try { ++ let params = GLib.Variant.new('(ss)', ['org.gnome.Shell.desktop', '']); ++ await Gio.DBus.session.call( ++ 'org.gnome.SessionManager', ++ '/org/gnome/SessionManager', ++ 'org.gnome.SessionManager', ++ 'RegisterClient', params, null, ++ Gio.DBusCallFlags.NONE, -1, null); ++ } catch (e) { ++ log(`Error notifying gnome-session that we're ready: ${e.message}`); ++ } ++} ++ + function _handleShowWelcomeScreen() { + const lastShownVersion = global.settings.get_string(WELCOME_DIALOG_LAST_SHOWN_VERSION); + if (Util.GNOMEversionCompare(WELCOME_DIALOG_LAST_TOUR_CHANGE, lastShownVersion) > 0) { +-- +2.53.0 + diff --git a/temp/gnome-shell-mobile/0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch b/temp/gnome-shell-mobile/0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch new file mode 100644 index 000000000..6b1f19071 --- /dev/null +++ b/temp/gnome-shell-mobile/0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch @@ -0,0 +1,53 @@ +From 64ef5f3811adb12d3dd82293687855f6b24e95ee Mon Sep 17 00:00:00 2001 +From: Adrian Vovk +Date: Tue, 8 Jul 2025 20:56:18 -0400 +Subject: [PATCH 2/4] Revert "main: Notify gnome-session when we're ready" + +This reverts commit 1747a59aa5d44f4d7b74e1f1fee1d48174a1ce5a. + +gnome-session is no longer a service manager, and thus doesn't need to +be notified of our readiness like this. We now do this exclusively +through systemd + +Part-of: +Signed-off-by: Achill Gilgenast +--- + js/ui/main.js | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/js/ui/main.js b/js/ui/main.js +index 6674bb20ca51..252cfef8c191 100644 +--- a/js/ui/main.js ++++ b/js/ui/main.js +@@ -334,7 +334,6 @@ async function _initializeUI() { + GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { + Shell.util_sd_notify(); + global.context.notify_ready(); +- _notifyGnomeSessionReady(); + return GLib.SOURCE_REMOVE; + }); + +@@ -399,20 +398,6 @@ async function _initializeUI() { + }); + } + +-async function _notifyGnomeSessionReady() { +- try { +- let params = GLib.Variant.new('(ss)', ['org.gnome.Shell.desktop', '']); +- await Gio.DBus.session.call( +- 'org.gnome.SessionManager', +- '/org/gnome/SessionManager', +- 'org.gnome.SessionManager', +- 'RegisterClient', params, null, +- Gio.DBusCallFlags.NONE, -1, null); +- } catch (e) { +- log(`Error notifying gnome-session that we're ready: ${e.message}`); +- } +-} +- + function _handleShowWelcomeScreen() { + const lastShownVersion = global.settings.get_string(WELCOME_DIALOG_LAST_SHOWN_VERSION); + if (Util.GNOMEversionCompare(WELCOME_DIALOG_LAST_TOUR_CHANGE, lastShownVersion) > 0) { +-- +2.53.0 + diff --git a/temp/gnome-shell-mobile/0003-data-Drop-org.gnome.Shell.desktop.patch b/temp/gnome-shell-mobile/0003-data-Drop-org.gnome.Shell.desktop.patch new file mode 100644 index 000000000..eb0721cd0 --- /dev/null +++ b/temp/gnome-shell-mobile/0003-data-Drop-org.gnome.Shell.desktop.patch @@ -0,0 +1,85 @@ +From 4f2d34e1532e7c56b399b5038233c15c0f280776 Mon Sep 17 00:00:00 2001 +From: Adrian Vovk +Date: Tue, 8 Jul 2025 21:02:29 -0400 +Subject: [PATCH 3/4] data: Drop org.gnome.Shell.desktop + +gnome-session no longer launches gnome-shell via a .desktop file, +because gnome-session no longer has a builtin service manager. + +gnome-shell is now always launched via systemd + +Part-of: +Signed-off-by: Achill Gilgenast +--- + data/meson.build | 13 +------------ + ....in.in => org.gnome.Shell.Extensions.desktop.in} | 0 + ...n.in => org.gnome.Shell.PortalHelper.desktop.in} | 0 + data/org.gnome.Shell.desktop.in.in | 13 ------------- + 4 files changed, 1 insertion(+), 25 deletions(-) + rename data/{org.gnome.Shell.Extensions.desktop.in.in => org.gnome.Shell.Extensions.desktop.in} (100%) + rename data/{org.gnome.Shell.PortalHelper.desktop.in.in => org.gnome.Shell.PortalHelper.desktop.in} (100%) + delete mode 100644 data/org.gnome.Shell.desktop.in.in + +diff --git a/data/meson.build b/data/meson.build +index 114dd2010ef5..d48308743cbf 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -1,7 +1,6 @@ + data_builddir = meson.current_build_dir() + + desktop_files = [ +- 'org.gnome.Shell.desktop', + 'org.gnome.Shell.Extensions.desktop', + ] + service_files = [] +@@ -11,19 +10,9 @@ if have_portal_helper + service_files += 'org.gnome.Shell.PortalHelper.service' + endif + +-desktopconf = configuration_data() +-# We substitute in bindir so it works as an autostart +-# file when built in a non-system prefix +-desktopconf.set('bindir', bindir) +-desktopconf.set('systemd_hidden', have_systemd ? 'true' : 'false') +- + foreach desktop_file : desktop_files + i18n.merge_file( +- input: configure_file( +- input: desktop_file + '.in.in', +- output: desktop_file + '.in', +- configuration: desktopconf +- ), ++ input: desktop_file + '.in', + output: desktop_file, + po_dir: po_dir, + install: true, +diff --git a/data/org.gnome.Shell.Extensions.desktop.in.in b/data/org.gnome.Shell.Extensions.desktop.in +similarity index 100% +rename from data/org.gnome.Shell.Extensions.desktop.in.in +rename to data/org.gnome.Shell.Extensions.desktop.in +diff --git a/data/org.gnome.Shell.PortalHelper.desktop.in.in b/data/org.gnome.Shell.PortalHelper.desktop.in +similarity index 100% +rename from data/org.gnome.Shell.PortalHelper.desktop.in.in +rename to data/org.gnome.Shell.PortalHelper.desktop.in +diff --git a/data/org.gnome.Shell.desktop.in.in b/data/org.gnome.Shell.desktop.in.in +deleted file mode 100644 +index 59d1cd2fe924..000000000000 +--- a/data/org.gnome.Shell.desktop.in.in ++++ /dev/null +@@ -1,13 +0,0 @@ +-[Desktop Entry] +-Type=Application +-Name=GNOME Shell +-Comment=Window management and application launching +-Exec=@bindir@/gnome-shell +-Categories=GNOME;GTK;Core; +-OnlyShowIn=GNOME; +-NoDisplay=true +-X-GNOME-Autostart-Phase=DisplayServer +-X-GNOME-Provides=panel;windowmanager; +-X-GNOME-Autostart-Notify=true +-X-GNOME-AutoRestart=false +-X-GNOME-HiddenUnderSystemd=@systemd_hidden@ +-- +2.53.0 + diff --git a/temp/gnome-shell-mobile/0004-data-Overhaul-systemd-units.patch b/temp/gnome-shell-mobile/0004-data-Overhaul-systemd-units.patch new file mode 100644 index 000000000..8c47612f7 --- /dev/null +++ b/temp/gnome-shell-mobile/0004-data-Overhaul-systemd-units.patch @@ -0,0 +1,133 @@ +From a1444e7bb90fbe881c3cb0dbd37a3ee9b0e03af1 Mon Sep 17 00:00:00 2001 +From: Adrian Vovk +Date: Thu, 13 Nov 2025 14:01:20 -0500 +Subject: [PATCH 4/4] data: Overhaul systemd units + +This simplifies the structure of the systemd units, since we no longer +support running with X11. But it also allows us to pass in the +gnome-shell session mode via systemd. + +This removes the need for GDM to have any special code to handle the +GNOME_SHELL_SESSION_MODE environment variable, and allows GNOME sessions +to specify directly what session mode they need without the involvement +of GDM. This makes it trivial to define custom gnome-session sessions +that use custom gnome-shell session modes. + +Sessions that consist entirely of a gnome-shell mode (like the +gnome-classic session) will need to do a little more legwork to define +themselves as proper gnome-session sessions. + +Signed-off-by: Achill Gilgenast +--- + data/meson.build | 33 +++---------------- + data/org.gnome.Shell.target.in | 9 ----- + ...service.in => org.gnome.Shell@.service.in} | 9 +++-- + 3 files changed, 9 insertions(+), 42 deletions(-) + delete mode 100644 data/org.gnome.Shell.target.in + rename data/{org.gnome.Shell@wayland.service.in => org.gnome.Shell@.service.in} (72%) + +diff --git a/data/meson.build b/data/meson.build +index d48308743cbf..d02fa12b00af 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -113,40 +113,17 @@ install_data('00_org.gnome.shell.gschema.override', install_dir: schemadir) + if have_systemd + unitconf = configuration_data() + unitconf.set('bindir', bindir) +- supported_sessions = ['wayland'] +- if have_x11 +- configure_file( +- input: 'org.gnome.Shell@x11.service.in', +- output: 'org.gnome.Shell@x11.service', +- configuration: unitconf, +- install_dir: systemduserunitdir +- ) +- supported_sessions += ['x11'] +- endif +- + configure_file( +- input: 'org.gnome.Shell@wayland.service.in', +- output: 'org.gnome.Shell@wayland.service', ++ input: 'org.gnome.Shell@.service.in', ++ output: 'org.gnome.Shell@.service', + configuration: unitconf, + install_dir: systemduserunitdir + ) + +- +- units = files('org.gnome.Shell-disable-extensions.service') +- targetconf = configuration_data() +- sessions_wants = [] +- foreach session: supported_sessions +- sessions_wants += 'org.gnome.Shell@' + session + '.service' +- endforeach +- targetconf.set('SUPPORTED_SESSIONS', ' '.join(sessions_wants)) +- target = configure_file( +- input: 'org.gnome.Shell.target.in', +- output: 'org.gnome.Shell.target', +- configuration: targetconf ++ install_data ( ++ 'org.gnome.Shell-disable-extensions.service', ++ install_dir: systemduserunitdir, + ) +- units += target +- +- install_data(units, install_dir: systemduserunitdir) + endif + + # for unit tests - gnome.compile_schemas() only looks in srcdir +diff --git a/data/org.gnome.Shell.target.in b/data/org.gnome.Shell.target.in +deleted file mode 100644 +index bb65fa0e6b63..000000000000 +--- a/data/org.gnome.Shell.target.in ++++ /dev/null +@@ -1,9 +0,0 @@ +-[Unit] +-Description=GNOME Shell +-DefaultDependencies=no +- +-Requisite=gnome-session-initialized.target +-PartOf=gnome-session-initialized.target +-Before=gnome-session-initialized.target +- +-Wants=@SUPPORTED_SESSIONS@ +\ No newline at end of file +diff --git a/data/org.gnome.Shell@wayland.service.in b/data/org.gnome.Shell@.service.in +similarity index 72% +rename from data/org.gnome.Shell@wayland.service.in +rename to data/org.gnome.Shell@.service.in +index 813da0b7081d..d9dd732d2188 100644 +--- a/data/org.gnome.Shell@wayland.service.in ++++ b/data/org.gnome.Shell@.service.in +@@ -1,6 +1,5 @@ + [Unit] +-Description=GNOME Shell on Wayland +-# On wayland, force a session shutdown ++Description=GNOME Shell + OnFailure=org.gnome.Shell-disable-extensions.service gnome-session-shutdown.target + OnFailureJobMode=replace-irreversibly + CollectMode=inactive-or-failed +@@ -13,17 +12,17 @@ Requisite=gnome-session-initialized.target + PartOf=gnome-session-initialized.target + Before=gnome-session-initialized.target + +-ConditionEnvironment=XDG_SESSION_TYPE=%I ++AssertEnvironment=XDG_SESSION_TYPE=wayland + + [Service] + Slice=session.slice + Type=notify +-ExecStart=@bindir@/gnome-shell ++ExecStart=@bindir@/gnome-shell --mode=%i + # Exit code 1 means we are probably *not* dealing with an extension failure + SuccessExitStatus=1 + + # unset some environment variables that were set by the shell and won't work now that the shell is gone +-ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY' ++ExecStopPost=-systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY + + # On wayland we cannot restart + Restart=no +-- +2.53.0 + diff --git a/temp/gnome-shell-mobile/APKBUILD b/temp/gnome-shell-mobile/APKBUILD index 7e41f921b..72fb7cae1 100644 --- a/temp/gnome-shell-mobile/APKBUILD +++ b/temp/gnome-shell-mobile/APKBUILD @@ -4,7 +4,7 @@ maintainer="Newbyte " pkgname=gnome-shell-mobile pkgver=48.0 -pkgrel=5 +pkgrel=6 pkgdesc="GNOME shell" url="https://wiki.gnome.org/Projects/GnomeShell" # armhf: gjs -> mozjs @@ -80,6 +80,10 @@ source="gnome-shell-mobile-$_commit.tar.gz::https://gitlab.gnome.org/verdre/gnom gsh.patch pcver.patch gjs-1.85.90-girepository.patch + 0001-main-Notify-gnome-session-when-we-re-ready.patch + 0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch + 0003-data-Drop-org.gnome.Shell.desktop.patch + 0004-data-Overhaul-systemd-units.patch " builddir="$srcdir/gnome-shell-mobile-$_commit" options="!check" # Tests have circular dependency 'gnome-shell <-> gdm' @@ -142,4 +146,8 @@ f1575dd86772e4bad9357f0322b2ba396478ec45a691c072c4ff98c299d8814aaaf0386fb90f883b ae4ac679bacd35948b44068e5a70407f473bd96986ee126abb1bdf066db5cbc2087a3ffae0b390286689cacbe8325870fd43663ba39f4f7543216e02bf083934 gsh.patch 0503440b547b78859c3bb87a66308899bcf33cc0b543e04e9c865904ff7fb86b10b66594c37a1726828ee1a497b0e034150be8cf1a9fbd06c59809619f6a31c8 pcver.patch 7d1bd0a60ee389c8fbc830ac573235ac1053fe44e8c249d32fb34427d9a1c0129444d781d311a6474d5e0b97897a14a52013a3aec0c85c120b8b525b835378bb gjs-1.85.90-girepository.patch +dec336bf74305fa016ffc1f9272e2b671c41dba458ebbf62b782a3dd091f02ae85315f139ab7ac40fa533e6fae67bf8648bd6557cb1ca917ce760ec1e0fb653f 0001-main-Notify-gnome-session-when-we-re-ready.patch +f10643bf010135cdc2d6bc122d47d4905e6ef3cea5e7a82e44d9a5d66ec147cd85872eaf869d05c1477ad5211a499d2351b4a20ee0085af1ff933769230bc242 0002-Revert-main-Notify-gnome-session-when-we-re-ready.patch +0f859f4c879a432cddf0127f518b95ed4f21720be6490ee96b17414cae461e5dd643d8d918376c2656a08c5537c79b069d3acf6838b5b3ea0b4f880d620ad3e7 0003-data-Drop-org.gnome.Shell.desktop.patch +413bd3cd1ba63dae79afc84a2cc1cdce7b8ea8f5457fdae7a1472ea41d0c6c93a8b66c115bd112699b72ea8b7f1050d8cda23f1259f14c7b0fd7b423a1afde35 0004-data-Overhaul-systemd-units.patch "