Fix centring patch, backport MR #2906 for #2176700

This commit is contained in:
Adam Williamson 2023-03-09 12:33:33 -08:00
parent 5db6bd9bf2
commit 63c751606b
3 changed files with 87 additions and 8 deletions

View File

@ -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?= <fmuellner@gnome.org> From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
Date: Fri, 2 Dec 2022 22:49:41 +0100 Date: Fri, 2 Dec 2022 22:49:41 +0100
Subject: [PATCH] place: Always center initial-setup/fedora-welcome 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(+) 1 file changed, 4 insertions(+)
diff --git a/src/core/place.c b/src/core/place.c 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 --- a/src/core/place.c
+++ b/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; type = window->type;
+ if (g_str_equal (meta_window_get_wm_class (window), "org.gnome.InitalSetup") || + if (g_strcmp0 (meta_window_get_wm_class (window), "org.gnome.InitalSetup") == 0 ||
+ g_str_equal (meta_window_get_wm_class (window), "fedora-welcome")) + g_strcmp0 (meta_window_get_wm_class (window), "fedora-welcome") == 0)
+ return TRUE; + return TRUE;
+ +
return (type == META_WINDOW_DIALOG || return (type == META_WINDOW_DIALOG ||
type == META_WINDOW_MODAL_DIALOG || type == META_WINDOW_MODAL_DIALOG ||
type == META_WINDOW_SPLASHSCREEN || type == META_WINDOW_SPLASHSCREEN ||
-- --
2.38.1 2.39.2

71
2906.patch Normal file
View File

@ -0,0 +1,71 @@
From ca082856adbb425be1c5ae97b6dea225f225bb60 Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
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

View File

@ -13,7 +13,7 @@
Name: mutter Name: mutter
Version: 44~rc Version: 44~rc
Release: 2%{?dist} Release: 3%{?dist}
Summary: Window and compositing manager based on Clutter Summary: Window and compositing manager based on Clutter
License: GPLv2+ 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 Patch2: mutter-42.alpha-disable-tegra.patch
# https://pagure.io/fedora-workstation/issue/79 # 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(gobject-introspection-1.0) >= 1.41.0
BuildRequires: pkgconfig(sm) BuildRequires: pkgconfig(sm)
@ -175,6 +179,10 @@ the functionality of the installed %{name} package.
%{_datadir}/mutter-%{mutter_api_version}/tests %{_datadir}/mutter-%{mutter_api_version}/tests
%changelog %changelog
* Thu Mar 09 2023 Adam Williamson <awilliam@redhat.com> - 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 <fmuellner@redhat.com> - 44~rc-1 * Mon Mar 06 2023 Florian Müllner <fmuellner@redhat.com> - 44~rc-1
- Update to 44.rc - Update to 44.rc