From d6c812eb3bbed90eb5a7ce11da097d9353ed16b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 12 Feb 2025 16:21:13 +0800 Subject: [PATCH] Upgrade to 47.5 This also contains two additional patches backported from the gnome-47 branch. Related: RHEL-74562 --- .gitignore | 1 + ...esh-interval-reporting-in-presentati.patch | 81 +++++++++++++++++++ ...ssion-Disconnect-on_keymap_changed-o.patch | 41 ++++++++++ mutter.spec | 6 +- sources | 2 +- 5 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch create mode 100644 0002-input-capture-session-Disconnect-on_keymap_changed-o.patch diff --git a/.gitignore b/.gitignore index dac3674..a6296f1 100644 --- a/.gitignore +++ b/.gitignore @@ -226,3 +226,4 @@ mutter-2.31.5.tar.bz2 /mutter-47.rc.tar.xz /mutter-47.0.tar.xz /mutter-47.4.tar.xz +/mutter-47.5.tar.xz diff --git a/0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch b/0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch new file mode 100644 index 0000000..9531ee1 --- /dev/null +++ b/0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch @@ -0,0 +1,81 @@ +From cadb4cdbb15a58cc38cc15cfe1ad457ffda7d7a0 Mon Sep 17 00:00:00 2001 +From: Dudemanguy +Date: Thu, 6 Feb 2025 08:21:16 -0600 +Subject: [PATCH 1/2] wayland: Fix refresh interval reporting in + presentation-time version 1 + +Version 1 of the presentation protocol requires that 0 be sent for the +refresh rate for variable refresh rate. Fix this by checking the mode +during the presentation event. + +Part-of: +--- + src/wayland/meta-wayland-outputs.c | 6 ++++++ + src/wayland/meta-wayland-outputs.h | 2 ++ + src/wayland/meta-wayland-presentation-time.c | 13 ++++++++++++- + 3 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c +index d860ac91f7..1c09f6f101 100644 +--- a/src/wayland/meta-wayland-outputs.c ++++ b/src/wayland/meta-wayland-outputs.c +@@ -92,6 +92,12 @@ meta_wayland_output_get_monitor (MetaWaylandOutput *wayland_output) + return wayland_output->monitor; + } + ++MetaMonitorMode * ++meta_wayland_output_get_monitor_mode (MetaWaylandOutput *wayland_output) ++{ ++ return wayland_output->mode; ++} ++ + static void + output_resource_destroy (struct wl_resource *res) + { +diff --git a/src/wayland/meta-wayland-outputs.h b/src/wayland/meta-wayland-outputs.h +index f28b591220..d27948d153 100644 +--- a/src/wayland/meta-wayland-outputs.h ++++ b/src/wayland/meta-wayland-outputs.h +@@ -33,6 +33,8 @@ const GList * meta_wayland_output_get_resources (MetaWaylandOutput *wayland_outp + + MetaMonitor * meta_wayland_output_get_monitor (MetaWaylandOutput *wayland_output); + ++MetaMonitorMode * meta_wayland_output_get_monitor_mode (MetaWaylandOutput *wayland_output); ++ + void meta_wayland_outputs_finalize (MetaWaylandCompositor *compositor); + + void meta_wayland_outputs_init (MetaWaylandCompositor *compositor); +diff --git a/src/wayland/meta-wayland-presentation-time.c b/src/wayland/meta-wayland-presentation-time.c +index abddb63b12..13a98a984b 100644 +--- a/src/wayland/meta-wayland-presentation-time.c ++++ b/src/wayland/meta-wayland-presentation-time.c +@@ -323,6 +323,8 @@ meta_wayland_presentation_feedback_present (MetaWaylandPresentationFeedback *fee + uint32_t seq_hi, seq_lo; + uint32_t flags; + const GList *l; ++ MetaMonitorMode *mode; ++ gboolean is_vrr; + + if (output == NULL) + { +@@ -337,7 +339,16 @@ meta_wayland_presentation_feedback_present (MetaWaylandPresentationFeedback *fee + tv_sec_lo = time_s; + tv_nsec = (uint32_t) us2ns (time_us - s2us (time_s)); + +- refresh_interval_ns = (uint32_t) (0.5 + s2ns (1) / frame_info->refresh_rate); ++ mode = meta_wayland_output_get_monitor_mode (output); ++ ++ is_vrr = meta_monitor_mode_get_refresh_rate_mode (mode) == ++ META_CRTC_REFRESH_RATE_MODE_VARIABLE; ++ ++ /* The refresh rate interval is required to be 0 for vrr. */ ++ if (is_vrr) ++ refresh_interval_ns = 0; ++ else ++ refresh_interval_ns = (uint32_t) (0.5 + s2ns (1) / frame_info->refresh_rate); + + maybe_update_presentation_sequence (surface, frame_info, output); + +-- +2.44.0.501.g19981daefd.dirty + diff --git a/0002-input-capture-session-Disconnect-on_keymap_changed-o.patch b/0002-input-capture-session-Disconnect-on_keymap_changed-o.patch new file mode 100644 index 0000000..3118573 --- /dev/null +++ b/0002-input-capture-session-Disconnect-on_keymap_changed-o.patch @@ -0,0 +1,41 @@ +From 05c722d66dda0c55d3c58ccf5c7c321445664a45 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Wed, 12 Feb 2025 07:52:14 +0000 +Subject: [PATCH 2/2] input-capture/session: Disconnect on_keymap_changed on + session finalize + +When Input Capture was enabled on Input Leap server startup and then +finalized when Input Leap server was stopped, switching keymap was +still triggering its on_keymap_changed callback, but on a freed session +thus triggering use after free a segfault. + +Fixes: 2fb3bdf77 - input-capture: Hook up capturing of events to active session +Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3360 +Part-of: + + +(cherry picked from commit 99dbcf1b8caba93acb5479d1c7ad754ff3fd0540) + +Co-authored-by: Alban Browaeys +--- + src/backends/meta-input-capture-session.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/backends/meta-input-capture-session.c b/src/backends/meta-input-capture-session.c +index 14973e3e75..4f9d854273 100644 +--- a/src/backends/meta-input-capture-session.c ++++ b/src/backends/meta-input-capture-session.c +@@ -1188,6 +1188,10 @@ static void + meta_input_capture_session_finalize (GObject *object) + { + MetaInputCaptureSession *session = META_INPUT_CAPTURE_SESSION (object); ++ MetaBackend *backend = ++ meta_dbus_session_manager_get_backend (session->session_manager); ++ ++ g_signal_handlers_disconnect_by_func (backend, on_keymap_changed, session); + + g_clear_pointer (&session->barriers, g_hash_table_unref); + +-- +2.44.0.501.g19981daefd.dirty + diff --git a/mutter.spec b/mutter.spec index 098312c..4dcf9c8 100644 --- a/mutter.spec +++ b/mutter.spec @@ -12,7 +12,7 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: mutter -Version: 47.4 +Version: 47.5 Release: %autorelease Summary: Window and compositing manager based on Clutter @@ -45,6 +45,10 @@ Patch: 0001-cursor-renderer-native-Pass-destination-format-to-sc.patch Patch: 0002-cursor-renderer-native-Store-formats-in-MetaCursorRe.patch Patch: 0003-cursor-renderer-native-Probe-formats-supported-by-cu.patch +# Backports from gnome-47 branch between 47.5 and 47.6 +Patch: 0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch +Patch: 0002-input-capture-session-Disconnect-on_keymap_changed-o.patch + BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.41.0 BuildRequires: pkgconfig(sm) BuildRequires: pkgconfig(libwacom) diff --git a/sources b/sources index 538691d..ab2072a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mutter-47.4.tar.xz) = f1d3c16830a5fd8225f62d37f583931d582ed1d09631b1d44321a162c14b4d99b2487f322a4c95954b154cdc205b0d20d5d12663f89675baff211e49067ef1ee +SHA512 (mutter-47.5.tar.xz) = a0faade5f29a8ab4f43ecf806e2187a0683bd076ff6296f0bec13ef891f5112eefece2b29302336314da7f4b2748deca0d3b0b5ec8cc761bce7daf87dc089c01