From 63c751606be2944b31b2deb64186012fb89bf4e3 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 9 Mar 2023 12:33:33 -0800 Subject: [PATCH] Fix centring patch, backport MR #2906 for #2176700 --- ...-center-initial-setup-fedora-welcome.patch | 12 ++-- 2906.patch | 71 +++++++++++++++++++ mutter.spec | 12 +++- 3 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 2906.patch diff --git a/0001-place-Always-center-initial-setup-fedora-welcome.patch b/0001-place-Always-center-initial-setup-fedora-welcome.patch index 479b6b9..cb2f1fa 100644 --- a/0001-place-Always-center-initial-setup-fedora-welcome.patch +++ b/0001-place-Always-center-initial-setup-fedora-welcome.patch @@ -1,4 +1,4 @@ -From cc057095ba4d4a9500163ec646a8bf134e9dd04a Mon Sep 17 00:00:00 2001 +From 00e208334c42ce0e0de1dc392ca4663dbc818c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 2 Dec 2022 22:49:41 +0100 Subject: [PATCH] place: Always center initial-setup/fedora-welcome @@ -8,20 +8,20 @@ Subject: [PATCH] place: Always center initial-setup/fedora-welcome 1 file changed, 4 insertions(+) diff --git a/src/core/place.c b/src/core/place.c -index 1075fe20d..35794ea6e 100644 +index f9877dfc7..58d3285bc 100644 --- a/src/core/place.c +++ b/src/core/place.c -@@ -320,6 +320,10 @@ window_place_centered (MetaWindow *window) +@@ -321,6 +321,10 @@ window_place_centered (MetaWindow *window) type = window->type; -+ if (g_str_equal (meta_window_get_wm_class (window), "org.gnome.InitalSetup") || -+ g_str_equal (meta_window_get_wm_class (window), "fedora-welcome")) ++ if (g_strcmp0 (meta_window_get_wm_class (window), "org.gnome.InitalSetup") == 0 || ++ g_strcmp0 (meta_window_get_wm_class (window), "fedora-welcome") == 0) + return TRUE; + return (type == META_WINDOW_DIALOG || type == META_WINDOW_MODAL_DIALOG || type == META_WINDOW_SPLASHSCREEN || -- -2.38.1 +2.39.2 diff --git a/2906.patch b/2906.patch new file mode 100644 index 0000000..d99300a --- /dev/null +++ b/2906.patch @@ -0,0 +1,71 @@ +From ca082856adbb425be1c5ae97b6dea225f225bb60 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Thu, 9 Mar 2023 17:34:22 +0100 +Subject: [PATCH] core: Retrieve DESKTOP_STARTUP_ID early on startup + +With the move away from GTK3, and the indirect dependency on GTK4 +grown in the GNOME Shell side, we've indirectly gotten a small sneaky +behavioral change: The GTK4 library will, right on dlopen, get +DESKTOP_AUTOSTART_ID for itself and delete it from the environment. + +This happens before our own X11 session management code is +initialized, which confuses the hell out of it, into thinking +initialization is actually shutdown, gnome-session does not follow +along with this request, which leaves GNOME Shell into a confused +startup state where it never calls SmcSaveYourselfDone() and grinds +startup to a halt until gnome-session decides to move things forward. + +In order to fix this, get the DESKTOP_AUTOSTART_ID before we lend +control to GNOME Shell bits and GTK4 is possibly initialized, and +feed it directly to our X11 session manager bits. +--- + src/core/meta-context-main.c | 11 +++++++++++ + src/x11/session.c | 10 ---------- + 2 files changed, 11 insertions(+), 10 deletions(-) + +diff --git a/src/core/meta-context-main.c b/src/core/meta-context-main.c +index 8fee10cd57..cc930116e4 100644 +--- a/src/core/meta-context-main.c ++++ b/src/core/meta-context-main.c +@@ -289,6 +289,17 @@ meta_context_main_configure (MetaContext *context, + meta_wayland_override_display_name (context_main->options.wayland_display); + #endif + ++ if (!context_main->options.sm.client_id) ++ { ++ const char *desktop_autostart_id; ++ ++ desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); ++ if (desktop_autostart_id) ++ context_main->options.sm.client_id = g_strdup (desktop_autostart_id); ++ } ++ ++ g_unsetenv ("DESKTOP_AUTOSTART_ID"); ++ + return TRUE; + } + +diff --git a/src/x11/session.c b/src/x11/session.c +index 37dd633cb4..83ec3a94e5 100644 +--- a/src/x11/session.c ++++ b/src/x11/session.c +@@ -280,16 +280,6 @@ meta_session_init (MetaContext *context, + SmcCallbacks callbacks; + char *saved_client_id; + +- if (!previous_client_id) +- { +- const char *desktop_autostart_id; +- +- desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); +- if (desktop_autostart_id) +- previous_client_id = desktop_autostart_id; +- } +- g_unsetenv ("DESKTOP_AUTOSTART_ID"); +- + meta_topic (META_DEBUG_SM, "Initializing session with save file '%s'", + previous_save_file ? previous_save_file : "(none)"); + +-- +GitLab + diff --git a/mutter.spec b/mutter.spec index 16f1f28..7bfcdac 100644 --- a/mutter.spec +++ b/mutter.spec @@ -13,7 +13,7 @@ Name: mutter Version: 44~rc -Release: 2%{?dist} +Release: 3%{?dist} Summary: Window and compositing manager based on Clutter License: GPLv2+ @@ -30,7 +30,11 @@ Patch1: 0001-Revert-build-Do-not-provide-built-sources-as-libmutt.patch Patch2: mutter-42.alpha-disable-tegra.patch # https://pagure.io/fedora-workstation/issue/79 -Patch3: 0001-place-Always-center-initial-setup-fedora-welcome.patch +Patch3: 0001-place-Always-center-initial-setup-fedora-welcome.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=2176700 +# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2906 +Patch4: 2906.patch BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0 BuildRequires: pkgconfig(sm) @@ -175,6 +179,10 @@ the functionality of the installed %{name} package. %{_datadir}/mutter-%{mutter_api_version}/tests %changelog +* Thu Mar 09 2023 Adam Williamson - 44~rc-3 +- From Florian: adjust centering patch to not crash on null values +- Backport MR #2906 to fix g-i-s startup problems (#2176700) + * Mon Mar 06 2023 Florian Müllner - 44~rc-1 - Update to 44.rc