From ed906d372c828f59e2ae005538e98359116ab560 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Fri, 1 Sep 2023 10:18:09 -0500 Subject: [PATCH] Stop crashing on idle Currently whenever GNOME becomes idle, it crashes. This adds some NULL pointer guards to avoid crashing. https://bugzilla.redhat.com/show_bug.cgi?id=2231680 --- mutter.spec | 3 +++ stop-crashing.patch | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 stop-crashing.patch diff --git a/mutter.spec b/mutter.spec index 3d03ce3..8e50d4f 100644 --- a/mutter.spec +++ b/mutter.spec @@ -30,6 +30,9 @@ Patch1: mutter-42.alpha-disable-tegra.patch # https://pagure.io/fedora-workstation/issue/79 Patch2: 0001-place-Always-center-initial-setup-fedora-welcome.patch +# https://gitlab.gnome.org/GNOME/mutter/-/issues/2985 +Patch3: stop-crashing.patch + BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0 BuildRequires: pkgconfig(sm) BuildRequires: pkgconfig(libwacom) diff --git a/stop-crashing.patch b/stop-crashing.patch new file mode 100644 index 0000000..fd71765 --- /dev/null +++ b/stop-crashing.patch @@ -0,0 +1,34 @@ +diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c +index 0e7d0a9eb..d50deb421 100644 +--- a/src/backends/native/meta-output-kms.c ++++ b/src/backends/native/meta-output-kms.c +@@ -134,6 +134,9 @@ meta_output_kms_get_privacy_screen_state (MetaOutput *output) + connector_state = + meta_kms_connector_get_current_state (output_kms->kms_connector); + ++ if (!connector_state) ++ return FALSE; ++ + return connector_state->privacy_screen_state; + } + +@@ -153,6 +156,9 @@ meta_output_kms_is_color_space_supported (MetaOutput *output, + connector_state = + meta_kms_connector_get_current_state (output_kms->kms_connector); + ++ if (!connector_state) ++ return FALSE; ++ + if (!(connector_state->colorspace.supported & (1 << color_space))) + return FALSE; + +@@ -168,6 +174,9 @@ meta_output_kms_is_hdr_metadata_supported (MetaOutput *output) + connector_state = + meta_kms_connector_get_current_state (output_kms->kms_connector); + ++ if (!connector_state) ++ return FALSE; ++ + return connector_state->hdr.supported; + } +