Package: release.debian.org Severity: normal Tags: bullseye User: release.debian....@packages.debian.org Usertags: pu X-Debbugs-Cc: debian-gtk-gn...@lists.debian.org
I updated mutter and gnome-shell along the 3.38.x branch in unstable while we're waiting for the gnome-shell 40 transition to be ready, and I think it could make sense to backport them to bullseye and take the benefit of upstream's stable-branch maintenance. [ Reason ] New upstream bugfix release backported from unstable. [ Impact ] If not updated, assorted bugs fixed on upstream's 3.38.x stable branch remain unfixed: - xwayland: Check permissions on /tmp/.X11-unix before use - Ensure valid window texture size after viewport changes - kms: Avoid using common video modes if they exceed the available bandwidth - Fix damage propagation for rotated transforms with viewport - Improve Wayland subsurface reordering Additionally, this version fixes an intermittent FTBFS caused by a race condition in the build system, which for whatever reason seems to happen most often on s390x (presumably its CPU speed : I/O speed ratio is one where we happen to lose the race more often than on other architectures). [ Tests ] autopkgtests pass, routine use of GNOME on a desktop seems fine, and the version it's based on has been in unstable for a while with no new bug reports. [ Risks ] It's a key package and high-visibility, but upstream's stable branches tend to be good about sticking to bugfix-only. "Drop unnecessary -dev dependency on libudev-dev" could conceivably cause FTBFS in related packages, but I've checked the -dev package and its only mentions of udev are in documentation, so this seems harmless. [ Checklist ] [x] *all* changes are documented in the d/changelog [x] I reviewed all changes and I approve them [x] attach debdiff against the package in (old)stable - I have edited this to exclude the content of the Russian translation update [x] the issue is verified as fixed in unstable [ Changes ] * New upstream release, as described above * Add patch from upstream 40.1 to fix FTBFS seen on s390x * Update GLib build-dependency (no practical effect, the new dependency is already in bullseye) * Partial fixes for build-dependencies on non-Linux ports [ Other info ] I can revert the build-dependency changes if necessary, but they seem harmless, and minimal delta from unstable to this bullseye backport seems good too; so I'd prefer to upload the version that has had more testing as-is if that's OK. I have also proposed a gnome-shell update. These have only been tested together, although they should be separable.
diffstat for mutter-3.38.4 mutter-3.38.6 NEWS | 21 debian/changelog | 41 debian/control | 13 debian/control.in | 13 debian/gbp.conf | 2 debian/patches/meson-add-back-default_driver-option.patch | 2 debian/patches/monitor-manager-Don-t-include-generated-code-in-header-fi.patch | 67 + debian/patches/series | 1 meson.build | 4 po/ru.po | 453 ++++++---- src/backends/native/meta-output-kms.c | 15 src/compositor/meta-shaped-texture-private.h | 2 src/compositor/meta-shaped-texture.c | 53 - src/compositor/meta-window-actor-wayland.c | 63 - src/compositor/region-utils.c | 4 src/wayland/meta-wayland-actor-surface.c | 2 src/wayland/meta-wayland-subsurface.c | 16 src/wayland/meta-wayland-subsurface.h | 2 src/wayland/meta-xwayland.c | 82 + 19 files changed, 622 insertions(+), 234 deletions(-) diff -Nru mutter-3.38.4/debian/changelog mutter-3.38.6/debian/changelog --- mutter-3.38.4/debian/changelog 2021-03-17 09:52:33.000000000 +0000 +++ mutter-3.38.6/debian/changelog 2021-09-01 21:25:34.000000000 +0100 @@ -1,3 +1,44 @@ +mutter (3.38.6-2~deb11u1) bullseye; urgency=medium + + * Rebuild for bullseye + + -- Simon McVittie <s...@debian.org> Wed, 01 Sep 2021 21:25:34 +0100 + +mutter (3.38.6-2) unstable; urgency=medium + + * Team upload + * d/p/monitor-manager-Don-t-include-generated-code-in-header-fi.patch: + Add patch from upstream 40.1 to fix FTBFS seen on s390x. + Thanks to Adrian Bunk. + + -- Simon McVittie <s...@debian.org> Thu, 26 Aug 2021 16:12:19 +0100 + +mutter (3.38.6-1) unstable; urgency=medium + + [ Marco Trevisan ] + * d/gbp.conf, d/control.in: Update VCS details for debian/unstable branch + + [ Simon McVittie ] + * New upstream release + - xwayland: Check permissions on /tmp/.X11-unix + - Ensure valid window texture size after viewport changes + - kms: Improve handling of common video modes that might exceed the + possible bandwidth + - Fix damage propagation for rotated transforms with viewport + - Improve Wayland subsurface reordering + * Update GLib build-dependency (no practical effect, the new dependency + is already in bullseye) + + [ Laurent Bigonville ] + * Fixes for non-Linux ports: + - Build-depend on libegl1-mesa-dev on all architectures (not just Linux). + It is required for EGL support. + - Only build-depend on udev on Linux architectures + - Only depend on libwayland on Linux architectures + - Drop unnecessary -dev dependency on libudev-dev + + -- Simon McVittie <s...@debian.org> Thu, 26 Aug 2021 08:54:46 +0100 + mutter (3.38.4-1) unstable; urgency=medium * Team upload diff -Nru mutter-3.38.4/debian/control mutter-3.38.6/debian/control --- mutter-3.38.4/debian/control 2021-03-17 09:52:33.000000000 +0000 +++ mutter-3.38.6/debian/control 2021-09-01 21:25:34.000000000 +0100 @@ -25,14 +25,14 @@ libcanberra-gtk3-dev, libdrm-dev (>= 2.4.83) [linux-any], libegl-dev, - libegl1-mesa-dev (>= 17) [linux-any], + libegl1-mesa-dev (>= 17), libfribidi-dev (>= 1.0.0), libgbm-dev (>= 17.3) [linux-any], libgdk-pixbuf-2.0-dev | libgdk-pixbuf2.0-dev, libgirepository1.0-dev (>= 0.9.12), libgl1-mesa-dev (>= 7.1~rc3-1~), libgles2-mesa-dev (>= 7.1~rc3-1~) | libgles2-dev, - libglib2.0-dev (>= 2.61.1), + libglib2.0-dev (>= 2.64.0), libgnome-desktop-3-dev (>= 3.36.0), libgraphene-1.0-dev (>= 1.9.3), libgtk-3-dev (>= 3.19.8), @@ -69,7 +69,7 @@ libxt-dev, meson (>= 0.51), pkg-config (>= 0.22), - udev, + udev [linux-any], wayland-protocols (>= 1.19) [linux-any], xauth <!nocheck>, xkb-data, @@ -79,8 +79,8 @@ zenity Rules-Requires-Root: no Standards-Version: 4.5.1 -Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git -Vcs-Browser: https://salsa.debian.org/gnome-team/mutter +Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git -b debian/unstable +Vcs-Browser: https://salsa.debian.org/gnome-team/mutter/tree/debian/unstable Package: mutter Architecture: any @@ -175,8 +175,7 @@ libjson-glib-dev, libmutter-7-0 (= ${binary:Version}), libpango1.0-dev, - libudev-dev, - libwayland-dev, + libwayland-dev [linux-any], libx11-dev, libxcomposite-dev, libxdamage-dev, diff -Nru mutter-3.38.4/debian/control.in mutter-3.38.6/debian/control.in --- mutter-3.38.4/debian/control.in 2021-03-17 09:52:33.000000000 +0000 +++ mutter-3.38.6/debian/control.in 2021-09-01 21:25:34.000000000 +0100 @@ -21,14 +21,14 @@ libcanberra-gtk3-dev, libdrm-dev (>= 2.4.83) [linux-any], libegl-dev, - libegl1-mesa-dev (>= 17) [linux-any], + libegl1-mesa-dev (>= 17), libfribidi-dev (>= 1.0.0), libgbm-dev (>= 17.3) [linux-any], libgdk-pixbuf-2.0-dev | libgdk-pixbuf2.0-dev, libgirepository1.0-dev (>= 0.9.12), libgl1-mesa-dev (>= 7.1~rc3-1~), libgles2-mesa-dev (>= 7.1~rc3-1~) | libgles2-dev, - libglib2.0-dev (>= 2.61.1), + libglib2.0-dev (>= 2.64.0), libgnome-desktop-3-dev (>= 3.36.0), libgraphene-1.0-dev (>= 1.9.3), libgtk-3-dev (>= 3.19.8), @@ -65,7 +65,7 @@ libxt-dev, meson (>= 0.51), pkg-config (>= 0.22), - udev, + udev [linux-any], wayland-protocols (>= 1.19) [linux-any], xauth <!nocheck>, xkb-data, @@ -75,8 +75,8 @@ zenity Rules-Requires-Root: no Standards-Version: 4.5.1 -Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git -Vcs-Browser: https://salsa.debian.org/gnome-team/mutter +Vcs-Git: https://salsa.debian.org/gnome-team/mutter.git -b debian/unstable +Vcs-Browser: https://salsa.debian.org/gnome-team/mutter/tree/debian/unstable Package: mutter Architecture: any @@ -171,8 +171,7 @@ libjson-glib-dev, libmutter-7-0 (= ${binary:Version}), libpango1.0-dev, - libudev-dev, - libwayland-dev, + libwayland-dev [linux-any], libx11-dev, libxcomposite-dev, libxdamage-dev, diff -Nru mutter-3.38.4/debian/gbp.conf mutter-3.38.6/debian/gbp.conf --- mutter-3.38.4/debian/gbp.conf 2021-03-17 09:52:33.000000000 +0000 +++ mutter-3.38.6/debian/gbp.conf 2021-09-01 21:25:34.000000000 +0100 @@ -1,6 +1,6 @@ [DEFAULT] pristine-tar = True -debian-branch = debian/master +debian-branch = debian/bullseye upstream-branch = upstream/3.38.x upstream-vcs-tag = %(version)s diff -Nru mutter-3.38.4/debian/patches/meson-add-back-default_driver-option.patch mutter-3.38.6/debian/patches/meson-add-back-default_driver-option.patch --- mutter-3.38.4/debian/patches/meson-add-back-default_driver-option.patch 2021-03-17 09:52:33.000000000 +0000 +++ mutter-3.38.6/debian/patches/meson-add-back-default_driver-option.patch 2021-09-01 21:25:34.000000000 +0100 @@ -44,7 +44,7 @@ input: 'cogl-config.h.meson', output: 'cogl-config.h', diff --git a/meson.build b/meson.build -index 2604ec9..4d8bdaf 100644 +index 3b328c8..ced0b83 100644 --- a/meson.build +++ b/meson.build @@ -224,6 +224,8 @@ if have_wayland_eglstream diff -Nru mutter-3.38.4/debian/patches/monitor-manager-Don-t-include-generated-code-in-header-fi.patch mutter-3.38.6/debian/patches/monitor-manager-Don-t-include-generated-code-in-header-fi.patch --- mutter-3.38.4/debian/patches/monitor-manager-Don-t-include-generated-code-in-header-fi.patch 1970-01-01 01:00:00.000000000 +0100 +++ mutter-3.38.6/debian/patches/monitor-manager-Don-t-include-generated-code-in-header-fi.patch 2021-09-01 21:25:34.000000000 +0100 @@ -0,0 +1,67 @@ +From: =?utf-8?q?Jonas_=C3=85dahl?= <jad...@gmail.com> +Date: Mon, 12 Apr 2021 11:46:30 +0200 +Subject: monitor-manager: Don't include generated code in header file + +Meson doesn't seem to handle depending on generated headers, at least +when those headers are pulled in indirectly via another header file. + +Luckily, we don't actually need to include the generated D-Bus boiler +plate in meta-monitor-manager-private.h, since the MetaMonitorManager +type no longer is based on the D-Bus service skeleton. + +So, by moving the inclusion of the generated D-Bus header file into +meta-monitor-manager.c, we should hopefully get rid of the sporadic +build issues. + +Bug: https://gitlab.gnome.org/GNOME/mutter/-/issues/1682 +Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1819> +Origin: upstream, 40.1, commit:91117bb052ed0d69c8ea4159c1df15c814d90627 +--- + src/backends/meta-monitor-manager-private.h | 6 +++--- + src/backends/meta-monitor-manager.c | 2 ++ + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h +index ac3bc94..ddc3a41 100644 +--- a/src/backends/meta-monitor-manager-private.h ++++ b/src/backends/meta-monitor-manager-private.h +@@ -35,8 +35,6 @@ + #include "meta/display.h" + #include "meta/meta-monitor-manager.h" + +-#include "meta-dbus-display-config.h" +- + #define META_MONITOR_MANAGER_MIN_SCREEN_WIDTH 640 + #define META_MONITOR_MANAGER_MIN_SCREEN_HEIGHT 480 + +@@ -98,6 +96,8 @@ struct _MetaOutputAssignment + #define META_IS_MONITOR_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MONITOR_MANAGER)) + #define META_MONITOR_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MONITOR_MANAGER, MetaMonitorManagerClass)) + ++typedef struct _MetaDBusDisplayConfig MetaDBusDisplayConfig; ++ + G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetaMonitorManager, g_object_unref) + + struct _MetaMonitorManager +@@ -184,7 +184,7 @@ struct _MetaMonitorManager + */ + struct _MetaMonitorManagerClass + { +- MetaDBusDisplayConfigSkeletonClass parent_class; ++ GObjectClass parent_class; + + GBytes* (*read_edid) (MetaMonitorManager *, + MetaOutput *); +diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c +index 1beb658..548ca80 100644 +--- a/src/backends/meta-monitor-manager.c ++++ b/src/backends/meta-monitor-manager.c +@@ -60,6 +60,8 @@ + #include "meta/main.h" + #include "meta/meta-x11-errors.h" + ++#include "meta-dbus-display-config.h" ++ + #define DEFAULT_DISPLAY_CONFIGURATION_TIMEOUT 20 + + enum diff -Nru mutter-3.38.4/debian/patches/series mutter-3.38.6/debian/patches/series --- mutter-3.38.4/debian/patches/series 2021-03-17 09:52:33.000000000 +0000 +++ mutter-3.38.6/debian/patches/series 2021-09-01 21:25:34.000000000 +0100 @@ -1,3 +1,4 @@ +monitor-manager-Don-t-include-generated-code-in-header-fi.patch theme-use-gtk_render_icon_suface-to-paint-button-icon.patch theme-load-icons-as-Gtk-does-with-fallback-and-RTL-suppor.patch meson-add-back-default_driver-option.patch diff -Nru mutter-3.38.4/meson.build mutter-3.38.6/meson.build --- mutter-3.38.4/meson.build 2021-03-15 19:33:09.319134500 +0000 +++ mutter-3.38.6/meson.build 2021-08-18 00:29:42.687382700 +0100 @@ -1,5 +1,5 @@ project('mutter', 'c', - version: '3.38.4', + version: '3.38.6', meson_version: '>= 0.51.0', license: 'GPLv2+' ) @@ -15,7 +15,7 @@ # generic version requirements fribidi_req = '>= 1.0.0' -glib_req = '>= 2.61.1' +glib_req = '>= 2.64.0' gi_req = '>= 0.9.5' graphene_req = '>= 1.9.3' gtk3_req = '>= 3.19.8' diff -Nru mutter-3.38.4/NEWS mutter-3.38.6/NEWS --- mutter-3.38.4/NEWS 2021-03-15 19:33:09.232137000 +0000 +++ mutter-3.38.6/NEWS 2021-08-18 00:29:42.621382500 +0100 @@ -1,3 +1,24 @@ +3.38.6 +====== +* Misc. bug fixes [James; !1907] + +Contributors: + James Dominic P. Guana + +Translators: + Alexey Rubtsov [ru] + +3.38.5 +====== +* xwayland: Check permissions on /tmp/.X11-unix [Jonas, Olivier; !1788] +* Ensure valid window texture size after viewport changes [Robert; !1808] +* kms: Don't add common modes that exceed the max bandwidth [Robert; !1834] +* Misc. bug fixes [Jonas, Robert; !1825, !1837] + +Contributors: + Jonas Ã…dahl, Olivier Fourdan, Robert Mader + + 3.38.4 ====== * Do not ping unmanaging windows [Florian; gnome-shell#2467] diff -Nru mutter-3.38.4/po/ru.po mutter-3.38.6/po/ru.po diff -Nru mutter-3.38.4/src/backends/native/meta-output-kms.c mutter-3.38.6/src/backends/native/meta-output-kms.c --- mutter-3.38.4/src/backends/native/meta-output-kms.c 2021-03-15 19:33:09.390132700 +0000 +++ mutter-3.38.6/src/backends/native/meta-output-kms.c 2021-08-18 00:29:42.743383000 +0100 @@ -147,10 +147,12 @@ MetaCrtcMode *crtc_mode; GPtrArray *array; float refresh_rate; + float bandwidth; unsigned i; unsigned max_hdisplay = 0; unsigned max_vdisplay = 0; float max_refresh_rate = 0.0; + float max_bandwidth = 0.0; for (i = 0; i < output_info->n_modes; i++) { @@ -159,9 +161,11 @@ drm_mode = meta_crtc_mode_kms_get_drm_mode (crtc_mode_kms); refresh_rate = meta_calculate_drm_mode_refresh_rate (drm_mode); + bandwidth = refresh_rate * drm_mode->hdisplay * drm_mode->vdisplay; max_hdisplay = MAX (max_hdisplay, drm_mode->hdisplay); max_vdisplay = MAX (max_vdisplay, drm_mode->vdisplay); max_refresh_rate = MAX (max_refresh_rate, refresh_rate); + max_bandwidth = MAX (max_bandwidth, bandwidth); } max_refresh_rate = MAX (max_refresh_rate, 60.0); @@ -174,9 +178,11 @@ { drm_mode = &meta_default_landscape_drm_mode_infos[i]; refresh_rate = meta_calculate_drm_mode_refresh_rate (drm_mode); + bandwidth = refresh_rate * drm_mode->hdisplay * drm_mode->vdisplay; if (drm_mode->hdisplay > max_hdisplay || drm_mode->vdisplay > max_vdisplay || - refresh_rate > max_refresh_rate) + refresh_rate > max_refresh_rate || + bandwidth > max_bandwidth) continue; crtc_mode = meta_gpu_kms_get_mode_from_drm_mode (gpu_kms, @@ -190,9 +196,11 @@ { drm_mode = &meta_default_portrait_drm_mode_infos[i]; refresh_rate = meta_calculate_drm_mode_refresh_rate (drm_mode); + bandwidth = refresh_rate * drm_mode->hdisplay * drm_mode->vdisplay; if (drm_mode->hdisplay > max_hdisplay || drm_mode->vdisplay > max_vdisplay || - refresh_rate > max_refresh_rate) + refresh_rate > max_refresh_rate || + bandwidth > max_bandwidth) continue; crtc_mode = meta_gpu_kms_get_mode_from_drm_mode (gpu_kms, @@ -259,9 +267,6 @@ output_info->preferred_mode = output_info->modes[i]; } - /* Presume that if the output supports scaling, then we have - * a panel fitter capable of adjusting any mode to suit. - */ if (connector_state->has_scaling) add_common_modes (output_info, gpu_kms); diff -Nru mutter-3.38.4/src/compositor/meta-shaped-texture.c mutter-3.38.6/src/compositor/meta-shaped-texture.c --- mutter-3.38.4/src/compositor/meta-shaped-texture.c 2021-03-15 19:33:09.404132100 +0000 +++ mutter-3.38.6/src/compositor/meta-shaped-texture.c 2021-08-18 00:29:42.753383000 +0100 @@ -220,8 +220,8 @@ } } -static void -ensure_size_valid (MetaShapedTexture *stex) +void +meta_shaped_texture_ensure_size_valid (MetaShapedTexture *stex) { if (stex->size_invalid) update_size (stex); @@ -596,7 +596,7 @@ int sample_width, sample_height; gboolean debug_paint_opaque_region; - ensure_size_valid (stex); + meta_shaped_texture_ensure_size_valid (stex); dst_width = stex->dst_width; dst_height = stex->dst_height; @@ -910,7 +910,7 @@ { MetaShapedTexture *stex = META_SHAPED_TEXTURE (content); - ensure_size_valid (stex); + meta_shaped_texture_ensure_size_valid (stex); if (width) *width = stex->dst_width; @@ -985,6 +985,8 @@ cairo_rectangle_int_t *clip) { MetaMonitorTransform inverted_transform; + int scaled_and_transformed_width; + int scaled_and_transformed_height; if (stex->texture == NULL) return FALSE; @@ -1001,12 +1003,21 @@ META_ROUNDING_STRATEGY_SHRINK, clip); + if (meta_monitor_transform_is_rotated (stex->transform)) + { + scaled_and_transformed_width = stex->tex_height / stex->buffer_scale; + scaled_and_transformed_height = stex->tex_width / stex->buffer_scale; + } + else + { + scaled_and_transformed_width = stex->tex_width / stex->buffer_scale; + scaled_and_transformed_height = stex->tex_height / stex->buffer_scale; + } inverted_transform = meta_monitor_transform_invert (stex->transform); - ensure_size_valid (stex); meta_rectangle_transform (clip, inverted_transform, - stex->dst_width, - stex->dst_height, + scaled_and_transformed_width, + scaled_and_transformed_height, clip); if (stex->has_viewport_src_rect || stex->has_viewport_dst_size) @@ -1027,8 +1038,8 @@ viewport = (graphene_rect_t) { .origin.x = 0, .origin.y = 0, - .size.width = stex->tex_width, - .size.height = stex->tex_height, + .size.width = scaled_and_transformed_width, + .size.height = scaled_and_transformed_height, }; } @@ -1039,8 +1050,8 @@ } else { - dst_width = (float) stex->tex_width; - dst_height = (float) stex->tex_height; + dst_width = (float) viewport.size.width; + dst_height = (float) viewport.size.height; } inverted_viewport = (graphene_rect_t) { @@ -1215,7 +1226,7 @@ cairo_region_get_extents (stex->opaque_region, &opaque_rect); - ensure_size_valid (stex); + meta_shaped_texture_ensure_size_valid (stex); return meta_rectangle_equal (&opaque_rect, &(MetaRectangle) { @@ -1260,10 +1271,14 @@ graphene_rect_t *src_rect) { if (!stex->has_viewport_src_rect || - stex->viewport_src_rect.origin.x != src_rect->origin.x || - stex->viewport_src_rect.origin.y != src_rect->origin.y || - stex->viewport_src_rect.size.width != src_rect->size.width || - stex->viewport_src_rect.size.height != src_rect->size.height) + !G_APPROX_VALUE (stex->viewport_src_rect.origin.x, + src_rect->origin.x, FLT_EPSILON) || + !G_APPROX_VALUE (stex->viewport_src_rect.origin.y, + src_rect->origin.y, FLT_EPSILON) || + !G_APPROX_VALUE (stex->viewport_src_rect.size.width, + src_rect->size.width, FLT_EPSILON) || + !G_APPROX_VALUE (stex->viewport_src_rect.size.height, + src_rect->size.height, FLT_EPSILON)) { stex->has_viewport_src_rect = TRUE; stex->viewport_src_rect = *src_rect; @@ -1477,7 +1492,7 @@ if (texture == NULL) return NULL; - ensure_size_valid (stex); + meta_shaped_texture_ensure_size_valid (stex); if (stex->dst_width == 0 || stex->dst_height == 0) return NULL; @@ -1635,7 +1650,7 @@ { g_return_val_if_fail (META_IS_SHAPED_TEXTURE (stex), 0); - ensure_size_valid (stex); + meta_shaped_texture_ensure_size_valid (stex); return stex->dst_width; } @@ -1651,7 +1666,7 @@ { g_return_val_if_fail (META_IS_SHAPED_TEXTURE (stex), 0); - ensure_size_valid (stex); + meta_shaped_texture_ensure_size_valid (stex); return stex->dst_height; } diff -Nru mutter-3.38.4/src/compositor/meta-shaped-texture-private.h mutter-3.38.6/src/compositor/meta-shaped-texture-private.h --- mutter-3.38.4/src/compositor/meta-shaped-texture-private.h 2021-03-15 19:33:09.404132100 +0000 +++ mutter-3.38.6/src/compositor/meta-shaped-texture-private.h 2021-08-18 00:29:42.753383000 +0100 @@ -71,4 +71,6 @@ void meta_shaped_texture_set_opaque_region (MetaShapedTexture *stex, cairo_region_t *opaque_region); +void meta_shaped_texture_ensure_size_valid (MetaShapedTexture *stex); + #endif diff -Nru mutter-3.38.4/src/compositor/meta-window-actor-wayland.c mutter-3.38.6/src/compositor/meta-window-actor-wayland.c --- mutter-3.38.4/src/compositor/meta-window-actor-wayland.c 2021-03-15 19:33:09.406132200 +0000 +++ mutter-3.38.6/src/compositor/meta-window-actor-wayland.c 2021-08-18 00:29:42.754382800 +0100 @@ -32,37 +32,36 @@ G_DEFINE_TYPE (MetaWindowActorWayland, meta_window_actor_wayland, META_TYPE_WINDOW_ACTOR) -static gboolean -remove_surface_actor_from_children (GNode *node, - gpointer data) +typedef struct _SurfaceTreeTraverseData { - MetaWaylandSurface *surface = node->data; - MetaSurfaceActor *surface_actor = meta_wayland_surface_get_actor (surface); - MetaWindowActor *window_actor = data; - ClutterActor *parent; - - parent = clutter_actor_get_parent (CLUTTER_ACTOR (surface_actor)); - if (!parent) - return FALSE; - - g_return_val_if_fail (parent == CLUTTER_ACTOR (window_actor), FALSE); - - clutter_actor_remove_child (CLUTTER_ACTOR (window_actor), - CLUTTER_ACTOR (surface_actor)); - - return FALSE; -} + MetaWindowActor *window_actor; + int index; +} SurfaceTreeTraverseData; static gboolean -add_surface_actor_to_children (GNode *node, - gpointer data) +set_surface_actor_index (GNode *node, + gpointer data) { MetaWaylandSurface *surface = node->data; MetaSurfaceActor *surface_actor = meta_wayland_surface_get_actor (surface); - MetaWindowActor *window_actor = data; + SurfaceTreeTraverseData *traverse_data = data; - clutter_actor_add_child (CLUTTER_ACTOR (window_actor), - CLUTTER_ACTOR (surface_actor)); + if (clutter_actor_contains (CLUTTER_ACTOR (traverse_data->window_actor), + CLUTTER_ACTOR (surface_actor))) + { + clutter_actor_set_child_at_index ( + CLUTTER_ACTOR (traverse_data->window_actor), + CLUTTER_ACTOR (surface_actor), + traverse_data->index); + } + else + { + clutter_actor_insert_child_at_index ( + CLUTTER_ACTOR (traverse_data->window_actor), + CLUTTER_ACTOR (surface_actor), + traverse_data->index); + } + traverse_data->index++; return FALSE; } @@ -75,20 +74,18 @@ MetaWaylandSurface *surface = meta_surface_actor_wayland_get_surface ( META_SURFACE_ACTOR_WAYLAND (surface_actor)); GNode *root_node = surface->subsurface_branch_node; + SurfaceTreeTraverseData traverse_data; + traverse_data = (SurfaceTreeTraverseData) { + .window_actor = actor, + .index = 0, + }; g_node_traverse (root_node, G_IN_ORDER, G_TRAVERSE_LEAVES, -1, - remove_surface_actor_from_children, - actor); - - g_node_traverse (root_node, - G_IN_ORDER, - G_TRAVERSE_LEAVES, - -1, - add_surface_actor_to_children, - actor); + set_surface_actor_index, + &traverse_data); } static void diff -Nru mutter-3.38.4/src/compositor/region-utils.c mutter-3.38.6/src/compositor/region-utils.c --- mutter-3.38.4/src/compositor/region-utils.c 2021-03-15 19:33:09.407132100 +0000 +++ mutter-3.38.6/src/compositor/region-utils.c 2021-08-18 00:29:42.755382800 +0100 @@ -428,8 +428,8 @@ { viewport_region = cairo_region_copy (region); - if (G_APPROX_VALUE (src_rect->origin.x, 0, FLT_EPSILON) || - G_APPROX_VALUE (src_rect->origin.y, 0, FLT_EPSILON)) + if (!G_APPROX_VALUE (src_rect->origin.x, 0, FLT_EPSILON) || + !G_APPROX_VALUE (src_rect->origin.y, 0, FLT_EPSILON)) { cairo_region_translate (viewport_region, (int) src_rect->origin.x, diff -Nru mutter-3.38.4/src/wayland/meta-wayland-actor-surface.c mutter-3.38.6/src/wayland/meta-wayland-actor-surface.c --- mutter-3.38.4/src/wayland/meta-wayland-actor-surface.c 2021-03-15 19:33:09.443131200 +0000 +++ mutter-3.38.6/src/wayland/meta-wayland-actor-surface.c 2021-08-18 00:29:42.783383000 +0100 @@ -271,6 +271,8 @@ meta_surface_actor_reset_viewport_dst_size (surface_actor); } + meta_shaped_texture_ensure_size_valid (stex); + META_WAYLAND_SURFACE_FOREACH_SUBSURFACE (surface, subsurface_surface) { MetaWaylandActorSurface *actor_surface; diff -Nru mutter-3.38.4/src/wayland/meta-wayland-subsurface.c mutter-3.38.6/src/wayland/meta-wayland-subsurface.c --- mutter-3.38.4/src/wayland/meta-wayland-subsurface.c 2021-03-15 19:33:09.449131000 +0000 +++ mutter-3.38.6/src/wayland/meta-wayland-subsurface.c 2021-08-18 00:29:42.787383000 +0100 @@ -343,11 +343,11 @@ } static void -subsurface_handle_pending_surface_destroyed (struct wl_listener *listener, - void *data) +subsurface_handle_pending_subsurface_destroyed (struct wl_listener *listener, + void *data) { MetaWaylandSubsurfacePlacementOp *op = - wl_container_of (listener, op, surface_destroy_listener); + wl_container_of (listener, op, subsurface_destroy_listener); op->surface = NULL; } @@ -366,7 +366,7 @@ meta_wayland_subsurface_placement_op_free (MetaWaylandSubsurfacePlacementOp *op) { if (op->surface) - wl_list_remove (&op->surface_destroy_listener.link); + wl_list_remove (&op->subsurface_destroy_listener.link); if (op->sibling) wl_list_remove (&op->sibling_destroy_listener.link); g_free (op); @@ -384,12 +384,12 @@ op->placement = placement; op->surface = surface; op->sibling = sibling; - op->surface_destroy_listener.notify = - subsurface_handle_pending_surface_destroyed; + op->subsurface_destroy_listener.notify = + subsurface_handle_pending_subsurface_destroyed; op->sibling_destroy_listener.notify = subsurface_handle_pending_sibling_destroyed; - wl_resource_add_destroy_listener (surface->resource, - &op->surface_destroy_listener); + wl_resource_add_destroy_listener (surface->wl_subsurface, + &op->subsurface_destroy_listener); wl_resource_add_destroy_listener (sibling->resource, &op->sibling_destroy_listener); diff -Nru mutter-3.38.4/src/wayland/meta-wayland-subsurface.h mutter-3.38.6/src/wayland/meta-wayland-subsurface.h --- mutter-3.38.4/src/wayland/meta-wayland-subsurface.h 2021-03-15 19:33:09.449131000 +0000 +++ mutter-3.38.6/src/wayland/meta-wayland-subsurface.h 2021-08-18 00:29:42.787383000 +0100 @@ -40,7 +40,7 @@ MetaWaylandSubsurfacePlacement placement; MetaWaylandSurface *surface; MetaWaylandSurface *sibling; - struct wl_listener surface_destroy_listener; + struct wl_listener subsurface_destroy_listener; struct wl_listener sibling_destroy_listener; } MetaWaylandSubsurfacePlacementOp; diff -Nru mutter-3.38.4/src/wayland/meta-xwayland.c mutter-3.38.6/src/wayland/meta-xwayland.c --- mutter-3.38.4/src/wayland/meta-xwayland.c 2021-03-15 19:33:09.454131000 +0000 +++ mutter-3.38.6/src/wayland/meta-xwayland.c 2021-08-18 00:29:42.791383000 +0100 @@ -30,6 +30,7 @@ #include <glib-unix.h> #include <glib.h> #include <sys/socket.h> +#include <sys/stat.h> #include <sys/un.h> #if defined(HAVE_SYS_RANDOM) #include <sys/random.h> @@ -48,6 +49,9 @@ #include "wayland/meta-xwayland-surface.h" #include "x11/meta-x11-display-private.h" +#define X11_TMP_UNIX_DIR "/tmp/.X11-unix" +#define X11_TMP_UNIX_PATH "/tmp/.X11-unix/X" + static int display_number_override = -1; static void meta_xwayland_stop_xserver (MetaXWaylandManager *manager); @@ -260,7 +264,7 @@ addr.sun_family = AF_LOCAL; name_size = snprintf (addr.sun_path, sizeof addr.sun_path, - "%c/tmp/.X11-unix/X%d", 0, display); + "%c%s%d", 0, X11_TMP_UNIX_PATH, display); size = offsetof (struct sockaddr_un, sun_path) + name_size; if (bind (fd, (struct sockaddr *) &addr, size) < 0) { @@ -295,7 +299,7 @@ addr.sun_family = AF_LOCAL; name_size = snprintf (addr.sun_path, sizeof addr.sun_path, - "/tmp/.X11-unix/X%d", display) + 1; + "%s%d", X11_TMP_UNIX_PATH, display) + 1; size = offsetof (struct sockaddr_un, sun_path) + name_size; unlink (addr.sun_path); if (bind (fd, (struct sockaddr *) &addr, size) < 0) @@ -414,9 +418,70 @@ } static gboolean +ensure_x11_unix_perms (GError **error) +{ + struct stat buf; + + if (lstat (X11_TMP_UNIX_DIR, &buf) != 0) + { + g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), + "Failed to check permissions on directory \"%s\": %s", + X11_TMP_UNIX_DIR, g_strerror (errno)); + return FALSE; + } + + /* If the directory already exists, it should belong to root or ourselves ... */ + if (buf.st_uid != 0 && buf.st_uid != getuid ()) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, + "Wrong ownership for directory \"%s\"", + X11_TMP_UNIX_DIR); + return FALSE; + } + + /* ... be writable ... */ + if ((buf.st_mode & 0022) != 0022) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, + "Directory \"%s\" is not writable", + X11_TMP_UNIX_DIR); + return FALSE; + } + + /* ... and have the sticky bit set */ + if ((buf.st_mode & 01000) != 01000) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, + "Directory \"%s\" is missing the sticky bit", + X11_TMP_UNIX_DIR); + return FALSE; + } + + return TRUE; +} + +static gboolean +ensure_x11_unix_dir (GError **error) +{ + if (mkdir (X11_TMP_UNIX_DIR, 01777) != 0) + { + if (errno == EEXIST) + return ensure_x11_unix_perms (error); + + g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), + "Failed to create directory \"%s\": %s", + X11_TMP_UNIX_DIR, g_strerror (errno)); + return FALSE; + } + + return TRUE; +} + +static gboolean choose_xdisplay (MetaXWaylandManager *manager, MetaXWaylandConnection *connection) { + g_autoptr (GError) error = NULL; int display = 0; char *lock_file = NULL; gboolean fatal = FALSE; @@ -426,6 +491,13 @@ else if (g_getenv ("RUNNING_UNDER_GDM")) display = 1024; + if (!ensure_x11_unix_dir (&error)) + { + g_warning ("Failed to ensure X11 socket directory: %s", + error->message); + return FALSE; + } + do { lock_file = create_lock_file (display, &display); @@ -925,10 +997,12 @@ g_cancellable_cancel (manager->xserver_died_cancellable); - snprintf (path, sizeof path, "/tmp/.X11-unix/X%d", manager->public_connection.display_index); + snprintf (path, sizeof path, "%s%d", X11_TMP_UNIX_PATH, + manager->public_connection.display_index); unlink (path); - snprintf (path, sizeof path, "/tmp/.X11-unix/X%d", manager->private_connection.display_index); + snprintf (path, sizeof path, "%s%d", X11_TMP_UNIX_PATH, + manager->private_connection.display_index); unlink (path); g_clear_pointer (&manager->public_connection.name, g_free);