From e766ff741342365c268e112c1d1c68a4fa0bcf19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 5 Nov 2025 15:19:25 +0100 Subject: [PATCH] Update to 49.1.1 Resolves: https://issues.redhat.com/browse/RHEL-124222 --- .gitignore | 1 + ...e-about-permissions-of-tmp-.X11-unix.patch | 31 - ...round-Port-from-gdk-pixbuf-to-glycin.patch | 310 ++ ...w-Compare-input-shape-to-client-rect.patch | 66 - ...etch-a11y-manager-after-parent-post-.patch | 35 - ...stage-views-and-stage-dimension-from.patch | 178 - ...native-Cast-MetaGpu-to-MetaGpuKms-on.patch | 41 - ...native-Fix-crash-with-MUTTER_DEBUG_D.patch | 88 - ...native-Pass-destination-format-to-sc.patch | 48 - ...native-Skip-init_hw_cursor_support_f.patch | 45 - ...ase-Avoid-copying-list-of-connectors.patch | 47 - ...-Add-forlease-config-to-monitors.xml.patch | 338 -- ...Return-for-lease-status-in-GetCurren.patch | 201 - ...-center-initial-setup-fedora-welcome.patch | 28 - ...-gdctl-path-used-for-installed-tests.patch | 50 - ...esh-interval-reporting-in-presentati.patch | 81 - ...arely-used-macros-with-func-equivale.patch | 436 -- ...tor-Special-case-shaped-Java-windows.patch | 35 - ...d-Plumb-color-state-through-backgrou.patch | 223 + ...w-Update-comment-and-variable-name-t.patch | 47 - ...ad-of-checking-permission-modes-for-.patch | 34 - ...native-Store-formats-in-MetaCursorRe.patch | 115 - ...t-MetaUdev-hotplug-handler-after-oth.patch | 48 - ...ssion-Disconnect-on_keymap_changed-o.patch | 41 - ...r-Keep-track-of-the-for-lease-status.patch | 462 -- ...Allow-to-check-if-config-has-a-visib.patch | 80 - ...-stage-Track-overlay-damage-per-view.patch | 266 - ...ndow-Use-getter-for-fullscreen-state.patch | 304 - ...w-Use-correct-bounding-rect-to-deter.patch | 29 - ...native-Probe-formats-supported-by-cu.patch | 176 - ...Configure-for-lease-monitors-in-Appl.patch | 224 - ...d-meta_output_kms_from_kms_connector.patch | 74 - ...ase-test-for-non-non-desktop-hotplug.patch | 166 - 0003-window-Add-a-MetaWindowConfig-type.patch | 395 -- ...name-meta_kms_connector_is_for_lease.patch | 78 - 0004-output-Add-pause-resume-signals.patch | 81 - 0004-window-Use-the-fullscreen-API.patch | 34 - ...connectors-as-unleasable-when-inacti.patch | 171 - ...-Handle-monitors-configured-for-leas.patch | 130 - 0005-window-Use-the-MetaWindowConfig.patch | 1068 ---- 0006-window-Add-a-configure-signal.patch | 94 - ...dow-helper-function-for-MetaWindowCo.patch | 61 - ...onfiguration-Add-MetaWindowConfig-su.patch | 126 - 0009-wayland-Emit-the-configure-signal.patch | 54 - ...window-x11-Emit-the-configure-signal.patch | 115 - a11y-manager.patch | 2157 ------- gdctl-patches.patch | 4940 ----------------- mutter.spec | 108 +- sources | 2 +- 49 files changed, 559 insertions(+), 13403 deletions(-) delete mode 100644 0001-Be-more-verbose-about-permissions-of-tmp-.X11-unix.patch create mode 100644 0001-Revert-background-Port-from-gdk-pixbuf-to-glycin.patch delete mode 100644 0001-Revert-x11-window-Compare-input-shape-to-client-rect.patch delete mode 100644 0001-backend-native-Fetch-a11y-manager-after-parent-post-.patch delete mode 100644 0001-backends-Update-stage-views-and-stage-dimension-from.patch delete mode 100644 0001-cursor-renderer-native-Cast-MetaGpu-to-MetaGpuKms-on.patch delete mode 100644 0001-cursor-renderer-native-Fix-crash-with-MUTTER_DEBUG_D.patch delete mode 100644 0001-cursor-renderer-native-Pass-destination-format-to-sc.patch delete mode 100644 0001-cursor-renderer-native-Skip-init_hw_cursor_support_f.patch delete mode 100644 0001-drm-lease-Avoid-copying-list-of-connectors.patch delete mode 100644 0001-monitor-manager-Add-forlease-config-to-monitors.xml.patch delete mode 100644 0001-monitor-manager-Return-for-lease-status-in-GetCurren.patch delete mode 100644 0001-place-Always-center-initial-setup-fedora-welcome.patch delete mode 100644 0001-tests-Vary-the-gdctl-path-used-for-installed-tests.patch delete mode 100644 0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch delete mode 100644 0001-window-Replace-barely-used-macros-with-func-equivale.patch delete mode 100644 0001-window-actor-Special-case-shaped-Java-windows.patch create mode 100644 0002-Revert-background-Plumb-color-state-through-backgrou.patch delete mode 100644 0002-Revert-x11-window-Update-comment-and-variable-name-t.patch delete mode 100644 0002-Use-access-instead-of-checking-permission-modes-for-.patch delete mode 100644 0002-cursor-renderer-native-Store-formats-in-MetaCursorRe.patch delete mode 100644 0002-drm-lease-Connect-MetaUdev-hotplug-handler-after-oth.patch delete mode 100644 0002-input-capture-session-Disconnect-on_keymap_changed-o.patch delete mode 100644 0002-monitor-Keep-track-of-the-for-lease-status.patch delete mode 100644 0002-monitor-manager-Allow-to-check-if-config-has-a-visib.patch delete mode 100644 0002-stage-Track-overlay-damage-per-view.patch delete mode 100644 0002-window-Use-getter-for-fullscreen-state.patch delete mode 100644 0003-Revert-x11-window-Use-correct-bounding-rect-to-deter.patch delete mode 100644 0003-cursor-renderer-native-Probe-formats-supported-by-cu.patch delete mode 100644 0003-monitor-manager-Configure-for-lease-monitors-in-Appl.patch delete mode 100644 0003-output-kms-Add-meta_output_kms_from_kms_connector.patch delete mode 100644 0003-tests-Add-drm-lease-test-for-non-non-desktop-hotplug.patch delete mode 100644 0003-window-Add-a-MetaWindowConfig-type.patch delete mode 100644 0004-kms-connector-Rename-meta_kms_connector_is_for_lease.patch delete mode 100644 0004-output-Add-pause-resume-signals.patch delete mode 100644 0004-window-Use-the-fullscreen-API.patch delete mode 100644 0005-drm-lease-Treat-connectors-as-unleasable-when-inacti.patch delete mode 100644 0005-native-drm-lease-Handle-monitors-configured-for-leas.patch delete mode 100644 0005-window-Use-the-MetaWindowConfig.patch delete mode 100644 0006-window-Add-a-configure-signal.patch delete mode 100644 0007-window-Add-a-window-helper-function-for-MetaWindowCo.patch delete mode 100644 0008-wayland-window-configuration-Add-MetaWindowConfig-su.patch delete mode 100644 0009-wayland-Emit-the-configure-signal.patch delete mode 100644 0010-window-x11-Emit-the-configure-signal.patch delete mode 100644 a11y-manager.patch delete mode 100644 gdctl-patches.patch diff --git a/.gitignore b/.gitignore index ed9ae72..0e4aa59 100644 --- a/.gitignore +++ b/.gitignore @@ -227,4 +227,5 @@ mutter-2.31.5.tar.bz2 /mutter-47.0.tar.xz /mutter-47.4.tar.xz /mutter-47.5.tar.xz +/mutter-49.1.1.tar.xz /meson-1.5.0.tar.gz diff --git a/0001-Be-more-verbose-about-permissions-of-tmp-.X11-unix.patch b/0001-Be-more-verbose-about-permissions-of-tmp-.X11-unix.patch deleted file mode 100644 index 8c07212..0000000 --- a/0001-Be-more-verbose-about-permissions-of-tmp-.X11-unix.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 26abcb62d4838774956cebaa66465d56e7375904 Mon Sep 17 00:00:00 2001 -From: Nathan Pratta Teodosio -Date: Thu, 29 Aug 2024 09:25:13 +0200 -Subject: [PATCH 1/2] Be more verbose about permissions of /tmp/{,.X11-unix}. - -Part-of: -(cherry picked from commit 4dbaa8178116649076bf542a5eaf42d4ce804e5b) ---- - src/wayland/meta-xwayland.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c -index e405161c1d..98c0d502f5 100644 ---- a/src/wayland/meta-xwayland.c -+++ b/src/wayland/meta-xwayland.c -@@ -545,8 +545,10 @@ ensure_x11_unix_perms (GError **error) - if (x11_tmp.st_uid != tmp.st_uid && x11_tmp.st_uid != getuid ()) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, -- "Wrong ownership for directory \"%s\"", -- X11_TMP_UNIX_DIR); -+ "Wrong ownership for directory \"%s\", owned by %d but " -+ "should be same as %s (owned by (%d)) or %d", -+ X11_TMP_UNIX_DIR, x11_tmp.st_uid, TMP_UNIX_DIR, tmp.st_uid, -+ getuid ()); - return FALSE; - } - --- -2.50.0 - diff --git a/0001-Revert-background-Port-from-gdk-pixbuf-to-glycin.patch b/0001-Revert-background-Port-from-gdk-pixbuf-to-glycin.patch new file mode 100644 index 0000000..8a3d555 --- /dev/null +++ b/0001-Revert-background-Port-from-gdk-pixbuf-to-glycin.patch @@ -0,0 +1,310 @@ +From b8383cd5dae36505f4ad1aea99cb672b7837187b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Florian=20M=C3=BCllner?= +Date: Wed, 5 Nov 2025 17:10:15 +0100 +Subject: [PATCH] Revert "background: Port from gdk-pixbuf to glycin" + +This reverts commit 34d66f86d941dc47101f1f69c54122913442dee2. +--- + meson.build | 4 +- + src/compositor/meta-background-image.c | 166 ++++++------------------- + src/meson.build | 2 +- + 3 files changed, 38 insertions(+), 134 deletions(-) + +diff --git a/meson.build b/meson.build +index 3957cc0d7f..659e8b3dc3 100644 +--- a/meson.build ++++ b/meson.build +@@ -21,7 +21,7 @@ gi_req = '>= 0.9.5' + graphene_req = '>= 1.10.2' + gtk3_req = '>= 3.19.8' + gtk4_req = '>= 4.14.0' +-glycin_req = '>= 2.0.beta.2' ++gdk_pixbuf_req = '>= 2.0' + pango_req = '>= 1.46.0' + cairo_req = '>= 1.10.0' + pangocairo_req = '>= 1.20' +@@ -117,7 +117,7 @@ subproject('gvdb') + + m_dep = cc.find_library('m', required: true) + graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req) +-glycin_dep = dependency('glycin-2', version: glycin_req) ++gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req) + cairo_dep = dependency('cairo', version: cairo_req) + pixman_dep = dependency('pixman-1', version: pixman_req) + gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas', +diff --git a/src/compositor/meta-background-image.c b/src/compositor/meta-background-image.c +index 6cf9187d56..e5c879c892 100644 +--- a/src/compositor/meta-background-image.c ++++ b/src/compositor/meta-background-image.c +@@ -20,11 +20,10 @@ + + #include "compositor/meta-background-image-private.h" + +-#include ++#include + #include + + #include "clutter/clutter.h" +-#include "clutter/clutter-backend-private.h" + #include "compositor/cogl-utils.h" + + enum +@@ -63,7 +62,6 @@ struct _MetaBackgroundImage + gboolean in_cache; + gboolean loaded; + CoglTexture *texture; +- ClutterColorState *color_state; + }; + + G_DEFINE_TYPE (MetaBackgroundImageCache, meta_background_image_cache, G_TYPE_OBJECT); +@@ -117,111 +115,33 @@ meta_background_image_cache_get_default (void) + return cache; + } + +-static CoglPixelFormat +-gly_memory_format_to_cogl (GlyMemoryFormat format) +-{ +- switch ((guint) format) +- { +- case GLY_MEMORY_B8G8R8A8_PREMULTIPLIED: +- return COGL_PIXEL_FORMAT_BGRA_8888_PRE; +- case GLY_MEMORY_A8R8G8B8_PREMULTIPLIED: +- return COGL_PIXEL_FORMAT_ARGB_8888_PRE; +- case GLY_MEMORY_R8G8B8A8_PREMULTIPLIED: +- return COGL_PIXEL_FORMAT_RGBA_8888_PRE; +- case GLY_MEMORY_B8G8R8A8: +- return COGL_PIXEL_FORMAT_BGRA_8888; +- case GLY_MEMORY_A8R8G8B8: +- return COGL_PIXEL_FORMAT_ARGB_8888; +- case GLY_MEMORY_R8G8B8A8: +- return COGL_PIXEL_FORMAT_RGBA_8888; +- case GLY_MEMORY_A8B8G8R8: +- return COGL_PIXEL_FORMAT_ABGR_8888; +- case GLY_MEMORY_R8G8B8: +- return COGL_PIXEL_FORMAT_RGB_888; +- case GLY_MEMORY_B8G8R8: +- return COGL_PIXEL_FORMAT_BGR_888; +- case GLY_MEMORY_R16G16B16A16_PREMULTIPLIED: +- return COGL_PIXEL_FORMAT_RGBA_16161616_PRE; +- case GLY_MEMORY_R16G16B16A16: +- return COGL_PIXEL_FORMAT_RGBA_16161616; +- case GLY_MEMORY_R16G16B16A16_FLOAT: +- return COGL_PIXEL_FORMAT_RGBA_FP_16161616; +- case GLY_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED: +- return COGL_PIXEL_FORMAT_RGBA_FP_32323232_PRE; +- case GLY_MEMORY_R32G32B32A32_FLOAT: +- return COGL_PIXEL_FORMAT_RGBA_FP_32323232; +- default: +- g_assert_not_reached (); +- } +-} +- +-static GlyMemoryFormatSelection +-glycin_supported_memory_formats (void) +-{ +- return GLY_MEMORY_SELECTION_B8G8R8A8_PREMULTIPLIED | +- GLY_MEMORY_SELECTION_A8R8G8B8_PREMULTIPLIED | +- GLY_MEMORY_SELECTION_R8G8B8A8_PREMULTIPLIED | +- GLY_MEMORY_SELECTION_B8G8R8A8 | +- GLY_MEMORY_SELECTION_A8R8G8B8 | +- GLY_MEMORY_SELECTION_R8G8B8A8 | +- GLY_MEMORY_SELECTION_A8B8G8R8 | +- GLY_MEMORY_SELECTION_R8G8B8 | +- GLY_MEMORY_SELECTION_B8G8R8 | +- GLY_MEMORY_SELECTION_R16G16B16A16_PREMULTIPLIED | +- GLY_MEMORY_SELECTION_R16G16B16A16 | +- GLY_MEMORY_SELECTION_R16G16B16A16_FLOAT | +- GLY_MEMORY_SELECTION_R32G32B32A32_FLOAT_PREMULTIPLIED | +- GLY_MEMORY_SELECTION_R32G32B32A32_FLOAT; +-} +- +-static void +-gly_cicp_to_clutter (const GlyCicp *gly_cicp, +- ClutterCicp *clutter_cicp) +-{ +- clutter_cicp->primaries = (ClutterCicpPrimaries) gly_cicp->color_primaries; +- clutter_cicp->transfer = (ClutterCicpTransfer) gly_cicp->transfer_characteristics; +- clutter_cicp->matrix_coefficients = gly_cicp->matrix_coefficients; +- clutter_cicp->video_full_range_flag = gly_cicp->video_full_range_flag; +-} +- + static void + load_file (GTask *task, +- MetaBackgroundImage *source, ++ MetaBackgroundImage *image, + gpointer task_data, + GCancellable *cancellable) + { +- g_autoptr (GFileInputStream) stream = NULL; +- g_autoptr (GlyLoader) loader = NULL; +- g_autoptr (GlyImage) image = NULL; +- GlyFrame *frame; + GError *error = NULL; ++ GdkPixbuf *pixbuf; ++ GFileInputStream *stream; + +- stream = g_file_read (source->file, NULL, &error); ++ stream = g_file_read (image->file, NULL, &error); + if (stream == NULL) + { + g_task_return_error (task, error); + return; + } + +- loader = gly_loader_new_for_stream (G_INPUT_STREAM (stream)); +- +- gly_loader_set_accepted_memory_formats (loader, glycin_supported_memory_formats ()); +- +- image = gly_loader_load (loader, &error); +- if (!image) +- { +- g_task_return_error (task, error); +- return; +- } ++ pixbuf = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (stream), NULL, &error); ++ g_object_unref (stream); + +- frame = gly_image_next_frame (image, &error); +- if (!frame) ++ if (pixbuf == NULL) + { + g_task_return_error (task, error); + return; + } + +- g_task_return_pointer (task, frame, (GDestroyNotify) g_object_unref); ++ g_task_return_pointer (task, pixbuf, (GDestroyNotify) g_object_unref); + } + + static void +@@ -236,16 +156,15 @@ file_loaded (GObject *source_object, + g_autoptr (GError) local_error = NULL; + GTask *task; + CoglTexture *texture; +- g_autoptr (GlyFrame) frame = NULL; ++ GdkPixbuf *pixbuf, *rotated; + int width, height, row_stride; +- GlyMemoryFormat format; +- g_autoptr (GlyCicp) cicp = NULL; +- GBytes *bytes; ++ guchar *pixels; ++ gboolean has_alpha; + + task = G_TASK (result); +- frame = g_task_propagate_pointer (task, &error); ++ pixbuf = g_task_propagate_pointer (task, &error); + +- if (frame == NULL) ++ if (pixbuf == NULL) + { + char *uri = g_file_get_uri (image->file); + g_warning ("Failed to load background '%s': %s", +@@ -254,23 +173,27 @@ file_loaded (GObject *source_object, + goto out; + } + +- width = gly_frame_get_width (frame); +- height = gly_frame_get_height (frame); +- row_stride = gly_frame_get_stride (frame); +- bytes = gly_frame_get_buf_bytes (frame); +- format = gly_frame_get_memory_format (frame); +- cicp = gly_frame_get_color_cicp (frame); ++ rotated = gdk_pixbuf_apply_embedded_orientation (pixbuf); ++ if (rotated != NULL) ++ { ++ g_object_unref (pixbuf); ++ pixbuf = rotated; ++ } ++ ++ width = gdk_pixbuf_get_width (pixbuf); ++ height = gdk_pixbuf_get_height (pixbuf); ++ row_stride = gdk_pixbuf_get_rowstride (pixbuf); ++ pixels = gdk_pixbuf_get_pixels (pixbuf); ++ has_alpha = gdk_pixbuf_get_has_alpha (pixbuf); + + texture = meta_create_texture (width, height, ctx, +- gly_memory_format_has_alpha (format) +- ? COGL_TEXTURE_COMPONENTS_RGBA +- : COGL_TEXTURE_COMPONENTS_RGB, ++ has_alpha ? COGL_TEXTURE_COMPONENTS_RGBA : COGL_TEXTURE_COMPONENTS_RGB, + META_TEXTURE_ALLOW_SLICING); + + if (!cogl_texture_set_data (texture, +- gly_memory_format_to_cogl (format), ++ has_alpha ? COGL_PIXEL_FORMAT_RGBA_8888 : COGL_PIXEL_FORMAT_RGB_888, + row_stride, +- g_bytes_get_data (bytes, NULL), 0, ++ pixels, 0, + &local_error)) + { + g_warning ("Failed to create texture for background: %s", +@@ -280,28 +203,10 @@ file_loaded (GObject *source_object, + + image->texture = texture; + +- if (cicp) +- { +- ClutterCicp clutter_cicp; +- ClutterBackend *clutter_backend = clutter_get_default_backend (); +- ClutterContext *clutter_context = clutter_backend->context; +- g_autoptr (GError) local_error2 = NULL; +- +- gly_cicp_to_clutter (cicp, &clutter_cicp); +- +- image->color_state = +- clutter_color_state_params_new_from_cicp (clutter_context, +- &clutter_cicp, +- &local_error2); +- if (local_error2) +- g_warning ("%s", local_error2->message); +- } +- else +- { +- image->color_state = NULL; +- } +- + out: ++ if (pixbuf != NULL) ++ g_object_unref (pixbuf); ++ + image->loaded = TRUE; + g_signal_emit (image, signals[LOADED], 0); + } +@@ -395,8 +300,6 @@ meta_background_image_finalize (GObject *object) + if (image->file) + g_object_unref (image->file); + +- g_clear_object (&image->color_state); +- + G_OBJECT_CLASS (meta_background_image_parent_class)->finalize (object); + } + +@@ -464,9 +367,10 @@ meta_background_image_get_texture (MetaBackgroundImage *image) + } + + ClutterColorState * +-meta_background_image_get_color_state (MetaBackgroundImage *image) ++meta_background_image_get_color_state (MetaBackgroundImage *image, ++ ClutterContext *ctx) + { + g_return_val_if_fail (META_IS_BACKGROUND_IMAGE (image), NULL); + +- return image->color_state; ++ return NULL; + } +diff --git a/src/meson.build b/src/meson.build +index 508c3416da..c36efc3a1e 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -25,7 +25,7 @@ mutter_pkg_private_deps = [ + gmodule_no_export_dep, + gnome_settings_daemon_dep, + xkbcommon_dep, +- glycin_dep, ++ gdk_pixbuf_dep, + libeis_dep, + libdisplay_info_dep, + ] +-- +2.51.1 + diff --git a/0001-Revert-x11-window-Compare-input-shape-to-client-rect.patch b/0001-Revert-x11-window-Compare-input-shape-to-client-rect.patch deleted file mode 100644 index 2d51f8d..0000000 --- a/0001-Revert-x11-window-Compare-input-shape-to-client-rect.patch +++ /dev/null @@ -1,66 +0,0 @@ -From beff8f13ed0cf16fa0b22f69de75f83e0378fdf1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 22 Jul 2024 12:37:01 +0200 -Subject: [PATCH 1/3] Revert "x11/window: Compare input shape to client rect - when undecorating" - -This reverts commit 1f1538be764ec5018b29d31c4486c0649a4e5068. ---- - src/x11/window-x11.c | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) - -diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c -index adf5075a9b..e7c76dd674 100644 ---- a/src/x11/window-x11.c -+++ b/src/x11/window-x11.c -@@ -2415,7 +2415,6 @@ meta_window_x11_update_input_region (MetaWindow *window) - g_autoptr (MtkRegion) region = NULL; - MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); - MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11); -- MtkRectangle bounding_rect = { 0 }; - Window xwindow; - - if (window->decorated) -@@ -2427,14 +2426,10 @@ meta_window_x11_update_input_region (MetaWindow *window) - return; - } - xwindow = priv->frame->xwindow; -- bounding_rect.width = window->buffer_rect.width; -- bounding_rect.height = window->buffer_rect.height; - } - else - { - xwindow = priv->xwindow; -- bounding_rect.width = priv->client_rect.width; -- bounding_rect.height = priv->client_rect.height; - } - - if (META_X11_DISPLAY_HAS_SHAPE (x11_display)) -@@ -2478,8 +2473,8 @@ meta_window_x11_update_input_region (MetaWindow *window) - else if (n_rects == 1 && - (rects[0].x == 0 && - rects[0].y == 0 && -- rects[0].width == bounding_rect.width && -- rects[0].height == bounding_rect.height)) -+ rects[0].width == window->buffer_rect.width && -+ rects[0].height == window->buffer_rect.height)) - { - /* This is the bounding region case. Keep the - * region as NULL. */ -@@ -2496,6 +2491,13 @@ meta_window_x11_update_input_region (MetaWindow *window) - - if (region != NULL) - { -+ MtkRectangle bounding_rect; -+ -+ bounding_rect.x = 0; -+ bounding_rect.y = 0; -+ bounding_rect.width = window->buffer_rect.width; -+ bounding_rect.height = window->buffer_rect.height; -+ - /* The shape we get back from the client may have coordinates - * outside of the frame. The X SHAPE Extension requires that - * the overall shape the client provides never exceeds the --- -2.44.0.501.g19981daefd.dirty - diff --git a/0001-backend-native-Fetch-a11y-manager-after-parent-post-.patch b/0001-backend-native-Fetch-a11y-manager-after-parent-post-.patch deleted file mode 100644 index 406fd59..0000000 --- a/0001-backend-native-Fetch-a11y-manager-after-parent-post-.patch +++ /dev/null @@ -1,35 +0,0 @@ -From c0b38fa6a28f923b7414de37dd55ecea902ec8ba Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Wed, 26 Mar 2025 14:42:16 +0100 -Subject: [PATCH] backend/native: Fetch a11y manager after parent post init - -The a11y is only initialized after the parent's post_init, so don't -fetch it until after. ---- - src/backends/native/meta-backend-native.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c -index 8732f3f7d2..d1d9da5db3 100644 ---- a/src/backends/native/meta-backend-native.c -+++ b/src/backends/native/meta-backend-native.c -@@ -209,7 +209,7 @@ meta_backend_native_post_init (MetaBackend *backend) - meta_backend_native_get_instance_private (backend_native); - MetaMonitorManager *monitor_manager = - meta_backend_get_monitor_manager (backend); -- MetaA11yManager *a11y_manager = meta_backend_get_a11y_manager (backend); -+ MetaA11yManager *a11y_manager; - - META_BACKEND_CLASS (meta_backend_native_parent_class)->post_init (backend); - -@@ -220,6 +220,7 @@ meta_backend_native_post_init (MetaBackend *backend) - G_CALLBACK (update_viewports), backend); - update_viewports (backend); - -+ a11y_manager = meta_backend_get_a11y_manager (backend); - g_signal_connect_object (a11y_manager, - "a11y-modifiers-changed", - G_CALLBACK (on_a11y_modifiers_changed), --- -2.44.0.501.g19981daefd.dirty - diff --git a/0001-backends-Update-stage-views-and-stage-dimension-from.patch b/0001-backends-Update-stage-views-and-stage-dimension-from.patch deleted file mode 100644 index cf2438a..0000000 --- a/0001-backends-Update-stage-views-and-stage-dimension-from.patch +++ /dev/null @@ -1,178 +0,0 @@ -From cedeee4eb0c252d2450b7174b35f47ff5c27fc8e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Wed, 12 Mar 2025 11:35:17 +0800 -Subject: [PATCH 1/2] backends: Update stage views and stage dimension from - MetaStage - -This reduces the amount of code duplication between the native and -nested backend. ---- - src/backends/meta-stage-impl-private.h | 2 ++ - src/backends/meta-stage-impl.c | 12 ++++++++++++ - src/backends/meta-stage-private.h | 2 ++ - src/backends/meta-stage.c | 16 ++++++++++++++++ - src/backends/native/meta-backend-native.c | 5 +---- - src/backends/native/meta-stage-native.c | 12 ------------ - src/backends/native/meta-stage-native.h | 2 -- - .../x11/nested/meta-backend-x11-nested.c | 11 ++--------- - 8 files changed, 35 insertions(+), 27 deletions(-) - -diff --git a/src/backends/meta-stage-impl-private.h b/src/backends/meta-stage-impl-private.h -index 766c283488..93b8bbad2f 100644 ---- a/src/backends/meta-stage-impl-private.h -+++ b/src/backends/meta-stage-impl-private.h -@@ -64,4 +64,6 @@ MetaBackend * meta_stage_impl_get_backend (MetaStageImpl *stage_impl); - void meta_stage_impl_add_onscreen_frame_info (MetaStageImpl *stage_impl, - ClutterStageView *view); - -+void meta_stage_impl_rebuild_views (MetaStageImpl *stage_impl); -+ - G_END_DECLS -diff --git a/src/backends/meta-stage-impl.c b/src/backends/meta-stage-impl.c -index 945e95ff2b..804d77f25d 100644 ---- a/src/backends/meta-stage-impl.c -+++ b/src/backends/meta-stage-impl.c -@@ -34,6 +34,7 @@ - #include - #include - -+#include "backends/meta-renderer.h" - #include "backends/meta-stage-view-private.h" - #include "clutter/clutter-mutter.h" - #include "cogl/cogl.h" -@@ -907,3 +908,14 @@ meta_stage_impl_get_backend (MetaStageImpl *stage_impl) - - return priv->backend; - } -+ -+void -+meta_stage_impl_rebuild_views (MetaStageImpl *stage_impl) -+{ -+ MetaBackend *backend = meta_stage_impl_get_backend (stage_impl); -+ MetaRenderer *renderer = meta_backend_get_renderer (backend); -+ ClutterActor *stage = meta_backend_get_stage (backend); -+ -+ meta_renderer_rebuild_views (renderer); -+ clutter_stage_clear_stage_views (CLUTTER_STAGE (stage)); -+} -diff --git a/src/backends/meta-stage-private.h b/src/backends/meta-stage-private.h -index 5546cc8ccf..e59ea35c6c 100644 ---- a/src/backends/meta-stage-private.h -+++ b/src/backends/meta-stage-private.h -@@ -68,4 +68,6 @@ META_EXPORT_TEST - void meta_stage_remove_watch (MetaStage *stage, - MetaStageWatch *watch); - -+void meta_stage_rebuild_views (MetaStage *stage); -+ - G_END_DECLS -diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c -index 96224a03b5..32f681c8c5 100644 ---- a/src/backends/meta-stage.c -+++ b/src/backends/meta-stage.c -@@ -494,3 +494,19 @@ meta_stage_remove_watch (MetaStage *stage, - - g_assert (removed); - } -+ -+void -+meta_stage_rebuild_views (MetaStage *stage) -+{ -+ ClutterStageWindow *stage_window = -+ _clutter_stage_get_window (CLUTTER_STAGE (stage)); -+ MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_window); -+ MetaMonitorManager *monitor_manager = -+ meta_backend_get_monitor_manager (stage->backend); -+ int width, height; -+ -+ meta_stage_impl_rebuild_views (stage_impl); -+ -+ meta_monitor_manager_get_screen_size (monitor_manager, &width, &height); -+ clutter_actor_set_size (CLUTTER_ACTOR (stage), width, height); -+} -diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c -index ee02b2783a..85bfeb7810 100644 ---- a/src/backends/native/meta-backend-native.c -+++ b/src/backends/native/meta-backend-native.c -@@ -399,14 +399,11 @@ static void - meta_backend_native_update_stage (MetaBackend *backend) - { - ClutterActor *stage = meta_backend_get_stage (backend); -- ClutterStageWindow *stage_window = -- _clutter_stage_get_window (CLUTTER_STAGE (stage)); -- MetaStageNative *stage_native = META_STAGE_NATIVE (stage_window); - MetaMonitorManager *monitor_manager = - meta_backend_get_monitor_manager (backend); - int width, height; - -- meta_stage_native_rebuild_views (stage_native); -+ meta_stage_rebuild_views (META_STAGE (stage)); - - meta_monitor_manager_get_screen_size (monitor_manager, &width, &height); - clutter_actor_set_size (stage, width, height); -diff --git a/src/backends/native/meta-stage-native.c b/src/backends/native/meta-stage-native.c -index 80d869b920..34849e5b9c 100644 ---- a/src/backends/native/meta-stage-native.c -+++ b/src/backends/native/meta-stage-native.c -@@ -54,18 +54,6 @@ G_DEFINE_TYPE_WITH_CODE (MetaStageNative, meta_stage_native, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW, - clutter_stage_window_iface_init)) - --void --meta_stage_native_rebuild_views (MetaStageNative *stage_native) --{ -- MetaStageImpl *stage_impl = META_STAGE_IMPL (stage_native); -- MetaBackend *backend = meta_stage_impl_get_backend (stage_impl); -- MetaRenderer *renderer = meta_backend_get_renderer (backend); -- ClutterActor *stage = meta_backend_get_stage (backend); -- -- meta_renderer_rebuild_views (renderer); -- clutter_stage_clear_stage_views (CLUTTER_STAGE (stage)); --} -- - static gboolean - meta_stage_native_can_clip_redraws (ClutterStageWindow *stage_window) - { -diff --git a/src/backends/native/meta-stage-native.h b/src/backends/native/meta-stage-native.h -index 18ce3b14bb..cf081a32ea 100644 ---- a/src/backends/native/meta-stage-native.h -+++ b/src/backends/native/meta-stage-native.h -@@ -28,5 +28,3 @@ - #define META_TYPE_STAGE_NATIVE (meta_stage_native_get_type ()) - G_DECLARE_FINAL_TYPE (MetaStageNative, meta_stage_native, - META, STAGE_NATIVE, MetaStageImpl) -- --void meta_stage_native_rebuild_views (MetaStageNative *stage_native); -diff --git a/src/backends/x11/nested/meta-backend-x11-nested.c b/src/backends/x11/nested/meta-backend-x11-nested.c -index ec82f1d1a9..09d2a91cb6 100644 ---- a/src/backends/x11/nested/meta-backend-x11-nested.c -+++ b/src/backends/x11/nested/meta-backend-x11-nested.c -@@ -21,6 +21,7 @@ - - #include "backends/meta-input-settings-dummy.h" - #include "backends/meta-monitor-manager-dummy.h" -+#include "backends/meta-stage-private.h" - #include "backends/x11/nested/meta-backend-x11-nested.h" - #include "backends/x11/nested/meta-cursor-renderer-x11-nested.h" - #include "backends/x11/nested/meta-renderer-x11-nested.h" -@@ -107,16 +108,8 @@ static void - meta_backend_x11_nested_update_stage (MetaBackend *backend) - { - ClutterActor *stage = meta_backend_get_stage (backend); -- MetaRenderer *renderer = meta_backend_get_renderer (backend); -- MetaMonitorManager *monitor_manager = -- meta_backend_get_monitor_manager (backend); -- int width, height; - -- meta_renderer_rebuild_views (renderer); -- clutter_stage_clear_stage_views (CLUTTER_STAGE (stage)); -- -- meta_monitor_manager_get_screen_size (monitor_manager, &width, &height); -- clutter_actor_set_size (stage, width, height); -+ meta_stage_rebuild_views (META_STAGE (stage)); - } - - static void --- -2.44.0.501.g19981daefd.dirty - diff --git a/0001-cursor-renderer-native-Cast-MetaGpu-to-MetaGpuKms-on.patch b/0001-cursor-renderer-native-Cast-MetaGpu-to-MetaGpuKms-on.patch deleted file mode 100644 index 8601b19..0000000 --- a/0001-cursor-renderer-native-Cast-MetaGpu-to-MetaGpuKms-on.patch +++ /dev/null @@ -1,41 +0,0 @@ -From fac0854a4f25e90c26e7b1078a4a6ec305c53f66 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Tue, 18 Feb 2025 17:43:36 +0100 -Subject: [PATCH] cursor-renderer/native: Cast MetaGpu to MetaGpuKms only if it - is one -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes crash in gnome-shell CSS styling test. - -Part-of: ---- - src/backends/native/meta-cursor-renderer-native.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c -index f0c373e7dc..9b079be023 100644 ---- a/src/backends/native/meta-cursor-renderer-native.c -+++ b/src/backends/native/meta-cursor-renderer-native.c -@@ -329,7 +329,7 @@ meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *cursor_renderer, - MetaRendererView *renderer_view = META_RENDERER_VIEW (view); - MetaCrtc *crtc = meta_renderer_view_get_crtc (renderer_view); - MetaCrtcNative *crtc_native = META_CRTC_NATIVE (crtc); -- MetaGpuKms *gpu_kms = META_GPU_KMS (meta_crtc_get_gpu (crtc)); -+ MetaGpu *gpu = meta_crtc_get_gpu (crtc); - ClutterColorState *target_color_state = - clutter_stage_view_get_output_color_state (CLUTTER_STAGE_VIEW (view)); - CursorStageView *cursor_stage_view = NULL; -@@ -339,7 +339,7 @@ meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *cursor_renderer, - g_assert (cursor_stage_view); - - if (!META_IS_CRTC_KMS (crtc) || -- !is_hw_cursor_available_for_gpu (gpu_kms) || -+ !is_hw_cursor_available_for_gpu (META_GPU_KMS (gpu)) || - !meta_crtc_native_is_hw_cursor_supported (crtc_native)) - { - if (cursor_stage_view->has_hw_cursor) --- -2.48.1 - diff --git a/0001-cursor-renderer-native-Fix-crash-with-MUTTER_DEBUG_D.patch b/0001-cursor-renderer-native-Fix-crash-with-MUTTER_DEBUG_D.patch deleted file mode 100644 index f2a5917..0000000 --- a/0001-cursor-renderer-native-Fix-crash-with-MUTTER_DEBUG_D.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 9b44ebf3269a7838d2288753dd66d48ebce8f8e2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 13 Feb 2025 17:36:10 +0100 -Subject: [PATCH] cursor-renderer/native: Fix crash with - MUTTER_DEBUG_DISABLE_HW_CURSORS=1 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Don't try to realize the cursor sprite for the HW cursor when it's set. - -v2: -* Refactor is_hw_cursor_supported helper out of - realize_cursor_sprite_from_wl_buffer_for_crtc. (Jonas Ådahl) -v3: -* Keep meta_crtc_native_is_hw_cursor_supported check in - meta_cursor_renderer_native_update_cursor, to try and avoid - mysterious CI failure. -v4: -* Rename is_hw_cursor_supported → is_hw_cursor_available_for_gpu - and take a MetaGpuKms * parameter. - -Part-of: ---- - .../native/meta-cursor-renderer-native.c | 20 +++++++++++++++---- - 1 file changed, 16 insertions(+), 4 deletions(-) - -diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c -index 2686e811b4..f0c373e7dc 100644 ---- a/src/backends/native/meta-cursor-renderer-native.c -+++ b/src/backends/native/meta-cursor-renderer-native.c -@@ -285,6 +285,19 @@ on_cursor_sprite_texture_changed (MetaCursorSprite *cursor_sprite, - invalidate_cursor_gpu_state (cursor_renderer, cursor_sprite); - } - -+static gboolean -+is_hw_cursor_available_for_gpu (MetaGpuKms *gpu_kms) -+{ -+ MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data; -+ -+ cursor_renderer_gpu_data = -+ meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms); -+ if (!cursor_renderer_gpu_data || cursor_renderer_gpu_data->hw_cursor_broken) -+ return FALSE; -+ -+ return TRUE; -+} -+ - static gboolean - meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *cursor_renderer, - MetaCursorSprite *cursor_sprite) -@@ -316,6 +329,7 @@ meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *cursor_renderer, - MetaRendererView *renderer_view = META_RENDERER_VIEW (view); - MetaCrtc *crtc = meta_renderer_view_get_crtc (renderer_view); - MetaCrtcNative *crtc_native = META_CRTC_NATIVE (crtc); -+ MetaGpuKms *gpu_kms = META_GPU_KMS (meta_crtc_get_gpu (crtc)); - ClutterColorState *target_color_state = - clutter_stage_view_get_output_color_state (CLUTTER_STAGE_VIEW (view)); - CursorStageView *cursor_stage_view = NULL; -@@ -325,6 +339,7 @@ meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *cursor_renderer, - g_assert (cursor_stage_view); - - if (!META_IS_CRTC_KMS (crtc) || -+ !is_hw_cursor_available_for_gpu (gpu_kms) || - !meta_crtc_native_is_hw_cursor_supported (crtc_native)) - { - if (cursor_stage_view->has_hw_cursor) -@@ -1051,16 +1066,13 @@ realize_cursor_sprite_from_wl_buffer_for_crtc (MetaCursorRenderer *renderer - MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (sprite_wayland); - MetaGpu *gpu = meta_crtc_get_gpu (META_CRTC (crtc_kms)); - MetaGpuKms *gpu_kms = META_GPU_KMS (gpu); -- MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data; - CoglTexture *texture; - uint width, height; - MetaWaylandBuffer *buffer; - struct wl_resource *buffer_resource; - struct wl_shm_buffer *shm_buffer; - -- cursor_renderer_gpu_data = -- meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms); -- if (!cursor_renderer_gpu_data || cursor_renderer_gpu_data->hw_cursor_broken) -+ if (!is_hw_cursor_available_for_gpu (gpu_kms)) - return FALSE; - - buffer = meta_cursor_sprite_wayland_get_buffer (sprite_wayland); --- -2.48.1 - diff --git a/0001-cursor-renderer-native-Pass-destination-format-to-sc.patch b/0001-cursor-renderer-native-Pass-destination-format-to-sc.patch deleted file mode 100644 index f520220..0000000 --- a/0001-cursor-renderer-native-Pass-destination-format-to-sc.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 7e4cae2f91f01db5083622b18d7173c8d9bf6540 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 6 Feb 2025 17:34:47 +0100 -Subject: [PATCH 1/3] cursor-renderer/native: Pass destination format to - scale_and_transform -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Preparation for next commit, no functional change intended. - -Part-of: ---- - src/backends/native/meta-cursor-renderer-native.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c -index 103d8e66e1..0db0dde022 100644 ---- a/src/backends/native/meta-cursor-renderer-native.c -+++ b/src/backends/native/meta-cursor-renderer-native.c -@@ -774,6 +774,7 @@ scale_and_transform_cursor_sprite_cpu (MetaCursorRendererNative *cursor_renderer - int height, - int rowstride, - const graphene_matrix_t *matrix, -+ CoglPixelFormat dst_format, - int dst_width, - int dst_height, - GError **error) -@@ -801,7 +802,7 @@ scale_and_transform_cursor_sprite_cpu (MetaCursorRendererNative *cursor_renderer - dst_texture = cogl_texture_2d_new_with_format (cogl_context, - dst_width, - dst_height, -- COGL_PIXEL_FORMAT_BGRA_8888_PRE); -+ dst_format); - offscreen = cogl_offscreen_new_with_texture (dst_texture); - if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (offscreen), error)) - return NULL; -@@ -976,6 +977,7 @@ load_scaled_and_transformed_cursor_sprite (MetaCursorRendererNative *native, - height, - rowstride, - &matrix, -+ COGL_PIXEL_FORMAT_BGRA_8888_PRE, - crtc_dst_width, - crtc_dst_height, - &error); --- -2.48.1 - diff --git a/0001-cursor-renderer-native-Skip-init_hw_cursor_support_f.patch b/0001-cursor-renderer-native-Skip-init_hw_cursor_support_f.patch deleted file mode 100644 index cd544b8..0000000 --- a/0001-cursor-renderer-native-Skip-init_hw_cursor_support_f.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ba3b709e08e155a10abb3e88145fb7a4d342a0aa Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Tue, 11 Feb 2025 15:42:43 +0100 -Subject: [PATCH] cursor-renderer/native: Skip init_hw_cursor_support_for_gpu - for headless -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -By definition, headless means no HW display output, so initializing HW -cursor support makes no sense. - -Fixes hitting the g_warning in tests when there's a GPU device -available, breaking them. - -Part-of: ---- - src/backends/native/meta-cursor-renderer-native.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c -index 7581d9b492..2686e811b4 100644 ---- a/src/backends/native/meta-cursor-renderer-native.c -+++ b/src/backends/native/meta-cursor-renderer-native.c -@@ -1350,12 +1350,17 @@ static void - init_hw_cursor_support_for_gpu (MetaGpuKms *gpu_kms) - { - MetaKmsDevice *kms_device = meta_gpu_kms_get_kms_device (gpu_kms); -+ MetaKms *kms = meta_kms_device_get_kms (kms_device); -+ MetaBackend *backend = meta_kms_get_backend (kms); - MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data; - const MetaFormatInfo *format_info; - struct gbm_device *gbm_device; - uint64_t width, height; - MetaDrmFormatBuf tmp; - -+ if (meta_backend_is_headless (backend)) -+ return; -+ - cursor_renderer_gpu_data = - meta_create_cursor_renderer_native_gpu_data (gpu_kms); - --- -2.48.1 - diff --git a/0001-drm-lease-Avoid-copying-list-of-connectors.patch b/0001-drm-lease-Avoid-copying-list-of-connectors.patch deleted file mode 100644 index c305826..0000000 --- a/0001-drm-lease-Avoid-copying-list-of-connectors.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 21be0a065c983a1c515414e233813b10944db419 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 31 Mar 2025 13:49:08 +0200 -Subject: [PATCH 1/5] drm-lease: Avoid copying list of connectors -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The copied list will be freed, and the copy will be returned, meaning we -can just return the original list directly. - -Part-of: -(cherry picked from commit e1271f5d546a890c78d8a29e84680adcb73750bc) ---- - src/backends/native/meta-drm-lease.c | 9 +-------- - 1 file changed, 1 insertion(+), 8 deletions(-) - -diff --git a/src/backends/native/meta-drm-lease.c b/src/backends/native/meta-drm-lease.c -index 7cddb6c8ed..a135558a0b 100644 ---- a/src/backends/native/meta-drm-lease.c -+++ b/src/backends/native/meta-drm-lease.c -@@ -668,13 +668,6 @@ update_connectors (MetaDrmLeaseManager *lease_manager, - } - } - -- for (l = lease_manager->connectors; l; l = l->next) -- { -- kms_connector = l->data; -- -- removed_connectors = g_list_append (removed_connectors, kms_connector); -- } -- - g_hash_table_iter_init (&iter, lease_manager->leased_connectors); - while (g_hash_table_iter_next (&iter, (gpointer *)&kms_connector, NULL)) - { -@@ -684,7 +677,7 @@ update_connectors (MetaDrmLeaseManager *lease_manager, - leases_to_revoke = g_list_append (leases_to_revoke, lease); - } - -- g_list_free (g_steal_pointer (&lease_manager->connectors)); -+ removed_connectors = g_steal_pointer (&lease_manager->connectors); - lease_manager->connectors = new_connectors; - - g_clear_pointer (&lease_manager->leased_connectors, g_hash_table_unref); --- -2.49.0 - diff --git a/0001-monitor-manager-Add-forlease-config-to-monitors.xml.patch b/0001-monitor-manager-Add-forlease-config-to-monitors.xml.patch deleted file mode 100644 index c5f1e40..0000000 --- a/0001-monitor-manager-Add-forlease-config-to-monitors.xml.patch +++ /dev/null @@ -1,338 +0,0 @@ -From 406de0d6d72bcd68ccc71880e618d933537d755c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Mon, 28 Oct 2024 08:37:12 +0100 -Subject: [PATCH 1/5] monitor-manager: Add forlease config to monitors.xml - -Allow to configure a list of monitors as available for lease in -monitors.xml. - -The monitors available for lease, must be disabled as well. - -Part-of: ---- - src/backends/meta-monitor-config-manager.c | 23 +++++++ - src/backends/meta-monitor-config-manager.h | 2 + - src/backends/meta-monitor-config-store.c | 79 +++++++++++++++++++++- - 3 files changed, 103 insertions(+), 1 deletion(-) - -diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c -index 279169ace9..ecf4ee8202 100644 ---- a/src/backends/meta-monitor-config-manager.c -+++ b/src/backends/meta-monitor-config-manager.c -@@ -1495,6 +1495,8 @@ meta_monitors_config_key_new (GList *logical_monitor_conf - } - } - -+ /* Monitors for lease must be disabled (see meta_verify_monitors_config ()). -+ Therefore, there is no need to include them here. */ - for (l = disabled_monitor_specs; l; l = l->next) - { - MetaMonitorSpec *monitor_spec = l->data; -@@ -1598,6 +1600,7 @@ meta_monitors_config_set_parent_config (MetaMonitorsConfig *config, - MetaMonitorsConfig * - meta_monitors_config_new_full (GList *logical_monitor_configs, - GList *disabled_monitor_specs, -+ GList *for_lease_monitor_specs, - MetaLogicalMonitorLayoutMode layout_mode, - MetaMonitorsConfigFlag flags) - { -@@ -1606,6 +1609,7 @@ meta_monitors_config_new_full (GList *logical_monitor_con - config = g_object_new (META_TYPE_MONITORS_CONFIG, NULL); - config->logical_monitor_configs = logical_monitor_configs; - config->disabled_monitor_specs = disabled_monitor_specs; -+ config->for_lease_monitor_specs = for_lease_monitor_specs; - config->layout_mode = layout_mode; - config->key = meta_monitors_config_key_new (logical_monitor_configs, - disabled_monitor_specs, -@@ -1649,6 +1653,7 @@ meta_monitors_config_new (MetaMonitorManager *monitor_manager, - - return meta_monitors_config_new_full (logical_monitor_configs, - disabled_monitor_specs, -+ NULL, - layout_mode, - flags); - } -@@ -1664,6 +1669,8 @@ meta_monitors_config_finalize (GObject *object) - (GDestroyNotify) meta_logical_monitor_config_free); - g_list_free_full (config->disabled_monitor_specs, - (GDestroyNotify) meta_monitor_spec_free); -+ g_list_free_full (config->for_lease_monitor_specs, -+ (GDestroyNotify) meta_monitor_spec_free); - - G_OBJECT_CLASS (meta_monitors_config_parent_class)->finalize (object); - } -@@ -1907,5 +1914,21 @@ meta_verify_monitors_config (MetaMonitorsConfig *config, - } - } - -+ for (l = config->for_lease_monitor_specs; l; l = l->next) -+ { -+ MetaMonitorSpec *monitor_spec = l->data; -+ gpointer disabled = NULL; -+ -+ disabled = g_list_find_custom (config->disabled_monitor_specs, -+ monitor_spec, -+ (GCompareFunc) meta_monitor_spec_compare); -+ if (!disabled) -+ { -+ g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, -+ "For lease monitor must be explicitly disabled"); -+ return FALSE; -+ } -+ } -+ - return TRUE; - } -diff --git a/src/backends/meta-monitor-config-manager.h b/src/backends/meta-monitor-config-manager.h -index 8d21c8694c..87a29bc2dd 100644 ---- a/src/backends/meta-monitor-config-manager.h -+++ b/src/backends/meta-monitor-config-manager.h -@@ -67,6 +67,7 @@ struct _MetaMonitorsConfig - GList *logical_monitor_configs; - - GList *disabled_monitor_specs; -+ GList *for_lease_monitor_specs; - - MetaMonitorsConfigFlag flags; - -@@ -142,6 +143,7 @@ void meta_monitor_config_manager_save_current (MetaMonitorConfigManager *config_ - META_EXPORT_TEST - MetaMonitorsConfig * meta_monitors_config_new_full (GList *logical_monitor_configs, - GList *disabled_monitors, -+ GList *for_lease_monitors, - MetaLogicalMonitorLayoutMode layout_mode, - MetaMonitorsConfigFlag flags); - -diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c -index 6e8aed1f9e..eb22dc3f36 100644 ---- a/src/backends/meta-monitor-config-store.c -+++ b/src/backends/meta-monitor-config-store.c -@@ -89,6 +89,14 @@ - * Serial C - * - * -+ * -+ * -+ * LVDS3 -+ * Vendor C -+ * Product C -+ * Serial C -+ * -+ * - * - * - * -@@ -158,6 +166,7 @@ typedef enum - STATE_MONITOR_MAXBPC, - STATE_MONITOR_RGB_RANGE, - STATE_DISABLED, -+ STATE_FOR_LEASE, - STATE_POLICY, - STATE_STORES, - STATE_STORE, -@@ -184,6 +193,7 @@ typedef struct - MetaMonitorConfig *current_monitor_config; - MetaLogicalMonitorConfig *current_logical_monitor_config; - GList *current_disabled_monitor_specs; -+ GList *current_for_lease_monitor_specs; - gboolean seen_policy; - gboolean seen_stores; - gboolean seen_dbus; -@@ -333,6 +343,10 @@ handle_start_element (GMarkupParseContext *context, - { - parser->state = STATE_DISABLED; - } -+ else if (g_str_equal (element_name, "forlease")) -+ { -+ parser->state = STATE_FOR_LEASE; -+ } - else - { - enter_unknown_element (parser, element_name, -@@ -578,6 +592,22 @@ handle_start_element (GMarkupParseContext *context, - return; - } - -+ case STATE_FOR_LEASE: -+ { -+ if (!g_str_equal (element_name, "monitorspec")) -+ { -+ g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_UNKNOWN_ELEMENT, -+ "Invalid element '%s' under forlease", element_name); -+ return; -+ } -+ -+ parser->current_monitor_spec = g_new0 (MetaMonitorSpec, 1); -+ parser->monitor_spec_parent_state = STATE_FOR_LEASE; -+ parser->state = STATE_MONITOR_SPEC; -+ -+ return; -+ } -+ - case STATE_POLICY: - { - if (!(parser->extra_config_flags & -@@ -673,6 +703,15 @@ finish_monitor_spec (ConfigParser *parser) - parser->current_monitor_spec); - parser->current_monitor_spec = NULL; - -+ return; -+ } -+ case STATE_FOR_LEASE: -+ { -+ parser->current_for_lease_monitor_specs = -+ g_list_prepend (parser->current_for_lease_monitor_specs, -+ parser->current_monitor_spec); -+ parser->current_monitor_spec = NULL; -+ - return; - } - -@@ -729,12 +768,15 @@ static gboolean - detect_layout_mode_configs (MetaMonitorManager *monitor_manager, - GList *logical_monitor_configs, - GList *disabled_monitor_specs, -+ GList *for_lease_monitor_specs, - MetaMonitorsConfigFlag config_flags, - MetaMonitorsConfig **physical_layout_mode_config, - MetaMonitorsConfig **logical_layout_mode_config, - GError **error) - { -- GList *logical_monitor_configs_copy, *disabled_monitor_specs_copy; -+ GList *logical_monitor_configs_copy; -+ GList *disabled_monitor_specs_copy; -+ GList *for_lease_monitor_specs_copy; - MetaMonitorsConfig *physical_config, *logical_config; - g_autoptr (GError) local_error_physical = NULL; - g_autoptr (GError) local_error_logical = NULL; -@@ -743,12 +785,15 @@ detect_layout_mode_configs (MetaMonitorManager *monitor_manager, - meta_clone_logical_monitor_config_list (logical_monitor_configs); - disabled_monitor_specs_copy = - g_list_copy_deep (disabled_monitor_specs, (GCopyFunc) meta_monitor_spec_clone, NULL); -+ for_lease_monitor_specs_copy = -+ g_list_copy_deep (for_lease_monitor_specs, (GCopyFunc) meta_monitor_spec_clone, NULL); - - derive_logical_monitor_layouts (logical_monitor_configs, - META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL); - physical_config = - meta_monitors_config_new_full (g_steal_pointer (&logical_monitor_configs), - g_steal_pointer (&disabled_monitor_specs), -+ g_steal_pointer (&for_lease_monitor_specs), - META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL, - config_flags); - -@@ -761,6 +806,7 @@ detect_layout_mode_configs (MetaMonitorManager *monitor_manager, - logical_config = - meta_monitors_config_new_full (g_steal_pointer (&logical_monitor_configs_copy), - g_steal_pointer (&disabled_monitor_specs_copy), -+ g_steal_pointer (&for_lease_monitor_specs_copy), - META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL, - config_flags); - -@@ -1207,6 +1253,7 @@ static MetaMonitorsConfig * - attempt_layout_mode_conversion (MetaMonitorManager *monitor_manager, - GList *logical_monitor_configs, - GList *disabled_monitor_specs, -+ GList *for_lease_monitor_specs, - MetaMonitorsConfigFlag config_flags) - { - GList *logical_monitor_configs_copy; -@@ -1251,6 +1298,9 @@ create_full_config: - g_list_copy_deep (disabled_monitor_specs, - (GCopyFunc) meta_monitor_spec_clone, - NULL), -+ g_list_copy_deep (for_lease_monitor_specs, -+ (GCopyFunc) meta_monitor_spec_clone, -+ NULL), - META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL, - config_flags); - -@@ -1438,6 +1488,14 @@ handle_end_element (GMarkupParseContext *context, - return; - } - -+ case STATE_FOR_LEASE: -+ { -+ g_assert (g_str_equal (element_name, "forlease")); -+ -+ parser->state = STATE_CONFIGURATION; -+ return; -+ } -+ - case STATE_CONFIGURATION: - { - MetaMonitorConfigStore *store = parser->config_store; -@@ -1458,6 +1516,7 @@ handle_end_element (GMarkupParseContext *context, - if (!detect_layout_mode_configs (store->monitor_manager, - parser->current_logical_monitor_configs, - parser->current_disabled_monitor_specs, -+ parser->current_for_lease_monitor_specs, - config_flags, - &physical_layout_mode_config, - &logical_layout_mode_config, -@@ -1465,11 +1524,13 @@ handle_end_element (GMarkupParseContext *context, - { - parser->current_logical_monitor_configs = NULL; - parser->current_disabled_monitor_specs = NULL; -+ parser->current_for_lease_monitor_specs = NULL; - return; - } - - parser->current_logical_monitor_configs = NULL; - parser->current_disabled_monitor_specs = NULL; -+ parser->current_for_lease_monitor_specs = NULL; - - if (physical_layout_mode_config) - { -@@ -1487,6 +1548,7 @@ handle_end_element (GMarkupParseContext *context, - attempt_layout_mode_conversion (store->monitor_manager, - physical_layout_mode_config->logical_monitor_configs, - physical_layout_mode_config->disabled_monitor_specs, -+ physical_layout_mode_config->for_lease_monitor_specs, - config_flags); - } - } -@@ -1508,11 +1570,13 @@ handle_end_element (GMarkupParseContext *context, - config = - meta_monitors_config_new_full (parser->current_logical_monitor_configs, - parser->current_disabled_monitor_specs, -+ parser->current_for_lease_monitor_specs, - layout_mode, - config_flags); - - parser->current_logical_monitor_configs = NULL; - parser->current_disabled_monitor_specs = NULL; -+ parser->current_for_lease_monitor_specs = NULL; - - if (!meta_verify_monitors_config (config, store->monitor_manager, - error)) -@@ -1747,6 +1811,7 @@ handle_text (GMarkupParseContext *context, - case STATE_MONITOR_MODE: - case STATE_TRANSFORM: - case STATE_DISABLED: -+ case STATE_FOR_LEASE: - case STATE_POLICY: - case STATE_STORES: - { -@@ -2323,6 +2388,18 @@ generate_config_xml (MetaMonitorConfigStore *config_store) - g_string_append (buffer, " \n"); - } - -+ if (config->for_lease_monitor_specs) -+ { -+ g_string_append (buffer, " \n"); -+ for (l = config->for_lease_monitor_specs; l; l = l->next) -+ { -+ MetaMonitorSpec *monitor_spec = l->data; -+ -+ append_monitor_spec (buffer, monitor_spec, " "); -+ } -+ g_string_append (buffer, " \n"); -+ } -+ - g_string_append (buffer, " \n"); - } - --- -2.48.1 - diff --git a/0001-monitor-manager-Return-for-lease-status-in-GetCurren.patch b/0001-monitor-manager-Return-for-lease-status-in-GetCurren.patch deleted file mode 100644 index 20fe083..0000000 --- a/0001-monitor-manager-Return-for-lease-status-in-GetCurren.patch +++ /dev/null @@ -1,201 +0,0 @@ -From c93e06696fea37303e4d9143ed62a31a97532c51 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Mon, 4 Nov 2024 19:12:19 +0100 -Subject: [PATCH 1/3] monitor-manager: Return for lease status in - GetCurrentState - -Add a new property to the list of monitors returned by the -GetCurrentState D-Bus API indicating whether the monitor is available -for lease or not. - -Part-of: ---- - .../org.gnome.Mutter.DisplayConfig.xml | 1 + - src/backends/meta-monitor-manager.c | 6 + - src/tests/monitor-unit-tests.c | 127 ++++++++++++++++++ - 3 files changed, 134 insertions(+) - -diff --git a/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml b/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml -index 3c28814b16..192c08a796 100644 ---- a/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml -+++ b/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml -@@ -392,6 +392,7 @@ - - "min-refresh-rate" (i): minimum refresh rate of monitor when - Variable Refresh Rate is active (absence - of this means unknown) -+ - "is-for-lease" (b): whether the monitor is for lease or not - - Possible mode flags: - 1 : preferred mode -diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c -index 55816ed7bb..127181df60 100644 ---- a/src/backends/meta-monitor-manager.c -+++ b/src/backends/meta-monitor-manager.c -@@ -2032,6 +2032,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton, - GVariantBuilder monitor_properties_builder; - GList *k; - gboolean is_builtin; -+ gboolean is_for_lease; - const char *display_name; - - current_mode = meta_monitor_get_current_mode (monitor); -@@ -2153,6 +2154,11 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton, - g_variant_new_int32 (min_refresh_rate)); - } - -+ is_for_lease = meta_monitor_is_for_lease (monitor); -+ g_variant_builder_add (&monitor_properties_builder, "{sv}", -+ "is-for-lease", -+ g_variant_new_boolean (is_for_lease)); -+ - g_variant_builder_add (&monitors_builder, MONITOR_FORMAT, - monitor_spec->connector, - monitor_spec->vendor, -diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c -index 0d5d1511ea..1f87c36528 100644 ---- a/src/tests/monitor-unit-tests.c -+++ b/src/tests/monitor-unit-tests.c -@@ -9474,6 +9474,131 @@ meta_test_monitor_custom_for_lease_invalid_config (void) - g_test_assert_expected_messages (); - } - -+static void -+on_proxy_call_cb (GObject *object, -+ GAsyncResult *res, -+ gpointer user_data) -+{ -+ g_autoptr (GError) error = NULL; -+ GVariant **ret = user_data; -+ -+ *ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error); -+ g_assert_no_error (error); -+ g_assert_nonnull (ret); -+} -+ -+static void -+assert_monitor_state (GVariant *state, -+ guint monitor_index, -+ const char *connector, -+ gboolean is_for_lease) -+{ -+ g_autoptr (GVariant) monitors = NULL; -+ g_autoptr (GVariant) monitor = NULL; -+ g_autoptr (GVariant) monitor_spec = NULL; -+ g_autoptr (GVariant) spec_connector = NULL; -+ g_autoptr (GVariant) monitor_properties = NULL; -+ g_autoptr (GVariant) for_lease_property = NULL; -+ -+ monitors = g_variant_get_child_value (state, 1); -+ monitor = g_variant_get_child_value (monitors, monitor_index); -+ -+ monitor_spec = g_variant_get_child_value (monitor, 0); -+ spec_connector = g_variant_get_child_value (monitor_spec, 0); -+ g_assert_cmpstr (g_variant_get_string (spec_connector, NULL), ==, connector); -+ -+ monitor_properties = g_variant_get_child_value (monitor, 2); -+ for_lease_property = g_variant_lookup_value (monitor_properties, -+ "is-for-lease", -+ G_VARIANT_TYPE_BOOLEAN); -+ g_assert (g_variant_get_boolean (for_lease_property) == is_for_lease); -+} -+ -+static void -+meta_test_monitor_custom_for_lease_config_dbus (void) -+{ -+ MonitorTestCaseSetup test_case_setup = { -+ .modes = { -+ { -+ .width = 800, -+ .height = 600, -+ .refresh_rate = 60.0 -+ } -+ }, -+ .n_modes = 1, -+ .outputs = { -+ { -+ .crtc = -1, -+ .modes = { 0 }, -+ .n_modes = 1, -+ .preferred_mode = 0, -+ .possible_crtcs = { 0, 1 }, -+ .n_possible_crtcs = 2, -+ .width_mm = 222, -+ .height_mm = 125, -+ .serial = "0x123456", -+ }, -+ { -+ .crtc = -1, -+ .modes = { 0 }, -+ .n_modes = 1, -+ .preferred_mode = 0, -+ .possible_crtcs = { 0, 1 }, -+ .n_possible_crtcs = 2, -+ .width_mm = 222, -+ .height_mm = 125, -+ .serial = "0x654321" -+ } -+ }, -+ .n_outputs = 2, -+ .crtcs = { -+ { -+ .current_mode = -1 -+ }, -+ { -+ .current_mode = -1 -+ } -+ }, -+ .n_crtcs = 2 -+ }; -+ MetaMonitorTestSetup *test_setup; -+ g_autoptr (GDBusProxy) display_config_proxy = NULL; -+ g_autoptr (GVariant) state = NULL; -+ -+ test_setup = meta_create_monitor_test_setup (test_backend, -+ &test_case_setup, -+ MONITOR_TEST_FLAG_NONE); -+ meta_set_custom_monitor_config (test_context, "forlease.xml"); -+ emulate_hotplug (test_setup); -+ check_monitor_test_clients_state (); -+ -+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION, -+ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, -+ NULL, -+ "org.gnome.Mutter.DisplayConfig", -+ "/org/gnome/Mutter/DisplayConfig", -+ "org.gnome.Mutter.DisplayConfig", -+ NULL, -+ proxy_ready_cb, -+ &display_config_proxy); -+ while (!display_config_proxy) -+ g_main_context_iteration (NULL, TRUE); -+ -+ g_dbus_proxy_call (display_config_proxy, -+ "GetCurrentState", -+ NULL, -+ G_DBUS_CALL_FLAGS_NO_AUTO_START, -+ -1, -+ NULL, -+ on_proxy_call_cb, -+ &state); -+ while (!state) -+ g_main_context_iteration (NULL, TRUE); -+ -+ assert_monitor_state (state, 0, "DP-1", FALSE); -+ assert_monitor_state (state, 1, "DP-2", TRUE); -+} -+ - static gboolean - quit_main_loop (gpointer data) - { -@@ -10704,6 +10829,8 @@ init_monitor_tests (void) - meta_test_monitor_custom_for_lease_config); - add_monitor_test ("/backends/monitor/custom/for-lease-invalid-config", - meta_test_monitor_custom_for_lease_invalid_config); -+ add_monitor_test ("/backends/monitor/custom/for-lease-config-dbus", -+ meta_test_monitor_custom_for_lease_config_dbus); - - add_monitor_test ("/backends/monitor/migrated/rotated", - meta_test_monitor_migrated_rotated); --- -2.48.1 - diff --git a/0001-place-Always-center-initial-setup-fedora-welcome.patch b/0001-place-Always-center-initial-setup-fedora-welcome.patch deleted file mode 100644 index 6ac9da8..0000000 --- a/0001-place-Always-center-initial-setup-fedora-welcome.patch +++ /dev/null @@ -1,28 +0,0 @@ -From cbe6fb86ce1e71c7360974a960db6bf79eb1ebde 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 - ---- - src/core/place.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/core/place.c b/src/core/place.c -index 8a06ccb667..f34ae7f43d 100644 ---- a/src/core/place.c -+++ b/src/core/place.c -@@ -377,6 +377,11 @@ window_place_centered (MetaWindow *window) - - type = window->type; - -+ if (g_strcmp0 (meta_window_get_wm_class (window), "org.gnome.InitialSetup") == 0 || -+ g_strcmp0 (meta_window_get_wm_class (window), "org.fedoraproject.welcome-screen") == 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.44.0.501.g19981daefd.dirty - diff --git a/0001-tests-Vary-the-gdctl-path-used-for-installed-tests.patch b/0001-tests-Vary-the-gdctl-path-used-for-installed-tests.patch deleted file mode 100644 index 135538f..0000000 --- a/0001-tests-Vary-the-gdctl-path-used-for-installed-tests.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 72e1b49cfa0cfea93577a74fe9cf10ac55f6fe45 Mon Sep 17 00:00:00 2001 -From: Daniel van Vugt -Date: Fri, 28 Feb 2025 17:06:12 +0800 -Subject: [PATCH] tests: Vary the gdctl path used for installed tests - -So they don't rely on the source tree. - -Part-of: -(cherry picked from commit c87bf90471730872038b0ee438c8f16c66c62728) ---- - src/tests/meson.build | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/src/tests/meson.build b/src/tests/meson.build -index a91dfb9893..3cc81f3630 100644 ---- a/src/tests/meson.build -+++ b/src/tests/meson.build -@@ -288,6 +288,7 @@ test_cases += [ - 'suite': 'backend', - 'sources': [ 'monitor-dbus-tests.c', ], - 'args': gdctl.full_path(), -+ 'installed_args': bindir / 'gdctl', - }, - { - 'name': 'stage-views', -@@ -1050,6 +1051,12 @@ if have_installed_tests - endforeach - endif - -+ if test_case.has_key('installed_args') -+ args = test_case.get('installed_args', []) -+ else -+ args = test_case.get('args', []) -+ endif -+ - installed_tests_cdata = configuration_data() - installed_tests_cdata.set('apiversion', libmutter_api_version) - installed_tests_cdata.set('libexecdir', libexecdir) -@@ -1058,7 +1065,7 @@ if have_installed_tests - installed_tests_cdata.set('gdctltestresultdir', '/tmp/mutter-gdctl-test-results') - installed_tests_cdata.set('testname', test_case['name']) - installed_tests_cdata.set('testexecutable', 'mutter-' + test_case['name']) -- installed_tests_cdata.set('testargs', ' '.join(test_case.get('args', []))) -+ installed_tests_cdata.set('testargs', ' '.join(args)) - installed_tests_cdata.set('runnerargs', ' '.join(runner_args)) - - configure_file( --- -2.50.1 - diff --git a/0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch b/0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch deleted file mode 100644 index 9531ee1..0000000 --- a/0001-wayland-Fix-refresh-interval-reporting-in-presentati.patch +++ /dev/null @@ -1,81 +0,0 @@ -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/0001-window-Replace-barely-used-macros-with-func-equivale.patch b/0001-window-Replace-barely-used-macros-with-func-equivale.patch deleted file mode 100644 index 3ef5969..0000000 --- a/0001-window-Replace-barely-used-macros-with-func-equivale.patch +++ /dev/null @@ -1,436 +0,0 @@ -From c28f4e53b548b8094ddb83e6e69be835d6133e49 Mon Sep 17 00:00:00 2001 -From: Bilal Elmoussaoui -Date: Mon, 28 Oct 2024 09:44:40 +0100 -Subject: [PATCH 01/10] window: Replace barely used macros with func - equivalents - -To avoid mostly going through struct fields in macros as we might soon -move those first to a WindowConfiguration & maybe even make the window -struct private with time. - -Part-of: -(cherry picked from commit 8e5433d82a3f737374316fef9ea76d60f1125752) ---- - src/compositor/edge-resistance.c | 4 +- - src/compositor/meta-window-drag.c | 19 +++++----- - src/core/constraints.c | 17 +++++---- - src/core/keybindings.c | 6 +-- - src/core/window-private.h | 31 ++++----------- - src/core/window.c | 57 ++++++++++++++++++++++++---- - src/wayland/meta-wayland-gtk-shell.c | 6 +-- - src/wayland/meta-wayland-xdg-shell.c | 2 +- - src/wayland/meta-window-wayland.c | 2 +- - src/x11/session.c | 2 +- - 10 files changed, 88 insertions(+), 58 deletions(-) - -diff --git a/src/compositor/edge-resistance.c b/src/compositor/edge-resistance.c -index 36b448f9ca..f5386e5de5 100644 ---- a/src/compositor/edge-resistance.c -+++ b/src/compositor/edge-resistance.c -@@ -485,7 +485,7 @@ apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data, - auto_snap = flags & META_EDGE_RESISTANCE_SNAP; - keyboard_op = flags & META_EDGE_RESISTANCE_KEYBOARD_OP; - -- if (auto_snap && !META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ if (auto_snap && !meta_window_is_tiled_side_by_side (window)) - { - /* Do the auto snapping instead of normal edge resistance; in all - * cases, we allow snapping to opposite kinds of edges (e.g. left -@@ -520,7 +520,7 @@ apply_edge_resistance_to_each_side (MetaEdgeResistanceData *edge_data, - FALSE, - keyboard_op); - } -- else if (auto_snap && META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ else if (auto_snap && meta_window_is_tiled_side_by_side (window)) - { - MtkRectangle workarea; - guint i; -diff --git a/src/compositor/meta-window-drag.c b/src/compositor/meta-window-drag.c -index 786bfda0f1..2638da59d3 100644 ---- a/src/compositor/meta-window-drag.c -+++ b/src/compositor/meta-window-drag.c -@@ -102,12 +102,12 @@ update_tile_preview_timeout (MetaWindowDrag *window_drag) - { - case META_TILE_LEFT: - case META_TILE_RIGHT: -- if (!META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ if (!meta_window_is_tiled_side_by_side (window)) - needs_preview = TRUE; - break; - - case META_TILE_MAXIMIZED: -- if (!META_WINDOW_MAXIMIZED (window)) -+ if (!meta_window_is_maximized (window)) - needs_preview = TRUE; - break; - -@@ -1247,8 +1247,8 @@ update_move (MetaWindowDrag *window_drag, - window->tile_monitor_number = -1; - } - else if (meta_prefs_get_edge_tiling () && -- !META_WINDOW_MAXIMIZED (window) && -- !META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ !meta_window_is_maximized (window) && -+ !meta_window_is_tiled_side_by_side (window)) - { - update_move_maybe_tile (window_drag, shake_threshold, x, y); - } -@@ -1258,8 +1258,9 @@ update_move (MetaWindowDrag *window_drag, - * loose via X motion. - */ - -- if ((META_WINDOW_MAXIMIZED (window) && ABS (dy) >= shake_threshold) || -- (META_WINDOW_TILED_SIDE_BY_SIDE (window) && (MAX (ABS (dx), ABS (dy)) >= shake_threshold))) -+ if ((meta_window_is_maximized (window) && ABS (dy) >= shake_threshold) || -+ (meta_window_is_tiled_side_by_side (window) && -+ (MAX (ABS (dx), ABS (dy)) >= shake_threshold))) - { - double prop; - -@@ -1294,7 +1295,7 @@ update_move (MetaWindowDrag *window_drag, - /* remaximize window on another monitor if window has been shaken - * loose or it is still maximized (then move straight) - */ -- else if ((window_drag->shaken_loose || META_WINDOW_MAXIMIZED (window)) && -+ else if ((window_drag->shaken_loose || meta_window_is_maximized (window)) && - window->tile_mode != META_TILE_LEFT && window->tile_mode != META_TILE_RIGHT) - { - MetaDisplay *display = meta_window_get_display (window); -@@ -1368,7 +1369,7 @@ update_move (MetaWindowDrag *window_drag, - meta_window_get_frame_rect (window, &old); - - /* Don't allow movement in the maximized directions or while tiled */ -- if (window->maximized_horizontally || META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ if (window->maximized_horizontally || meta_window_is_tiled_side_by_side (window)) - new_x = old.x; - if (window->maximized_vertically) - new_y = old.y; -@@ -1599,7 +1600,7 @@ maybe_maximize_tiled_window (MetaWindow *window) - MtkRectangle work_area; - gint shake_threshold; - -- if (!META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ if (!meta_window_is_tiled_side_by_side (window)) - return; - - shake_threshold = meta_prefs_get_drag_threshold (); -diff --git a/src/core/constraints.c b/src/core/constraints.c -index 4017ecbe07..6f20d087e2 100644 ---- a/src/core/constraints.c -+++ b/src/core/constraints.c -@@ -1217,15 +1217,16 @@ constrain_maximization (MetaWindow *window, - - /* Determine whether constraint applies; exit if it doesn't */ - if ((!window->maximized_horizontally && !window->maximized_vertically) || -- META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ meta_window_is_tiled_side_by_side (window)) - return TRUE; - - /* Calculate target_size = maximized size of (window + frame) */ -- if (META_WINDOW_TILED_MAXIMIZED (window)) -+ if (meta_window_is_maximized (window) && -+ window->tile_mode == META_TILE_MAXIMIZED) - { - meta_window_get_tile_area (window, window->tile_mode, &target_size); - } -- else if (META_WINDOW_MAXIMIZED (window)) -+ else if (meta_window_is_maximized (window)) - { - target_size = info->work_area_monitor; - } -@@ -1304,7 +1305,7 @@ constrain_tiling (MetaWindow *window, - return TRUE; - - /* Determine whether constraint applies; exit if it doesn't */ -- if (!META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ if (!meta_window_is_tiled_side_by_side (window)) - return TRUE; - - /* Calculate target_size - as the tile previews need this as well, we -@@ -1391,8 +1392,8 @@ constrain_size_increments (MetaWindow *window, - return TRUE; - - /* Determine whether constraint applies; exit if it doesn't */ -- if (META_WINDOW_MAXIMIZED (window) || window->fullscreen || -- META_WINDOW_TILED_SIDE_BY_SIDE (window) || -+ if (meta_window_is_maximized (window) || window->fullscreen || -+ meta_window_is_tiled_side_by_side (window) || - info->action_type == ACTION_MOVE) - return TRUE; - -@@ -1522,8 +1523,8 @@ constrain_aspect_ratio (MetaWindow *window, - (double)window->size_hints.max_aspect.y; - constraints_are_inconsistent = minr > maxr; - if (constraints_are_inconsistent || -- META_WINDOW_MAXIMIZED (window) || window->fullscreen || -- META_WINDOW_TILED_SIDE_BY_SIDE (window) || -+ meta_window_is_maximized (window) || window->fullscreen || -+ meta_window_is_tiled_side_by_side (window) || - info->action_type == ACTION_MOVE) - return TRUE; - -diff --git a/src/core/keybindings.c b/src/core/keybindings.c -index 1304531ef5..41559c9719 100644 ---- a/src/core/keybindings.c -+++ b/src/core/keybindings.c -@@ -2198,8 +2198,8 @@ handle_toggle_tiled (MetaDisplay *display, - { - MetaTileMode mode = binding->handler->data; - -- if ((META_WINDOW_TILED_LEFT (window) && mode == META_TILE_LEFT) || -- (META_WINDOW_TILED_RIGHT (window) && mode == META_TILE_RIGHT)) -+ if ((meta_window_is_tiled_left (window) && mode == META_TILE_LEFT) || -+ (meta_window_is_tiled_right (window) && mode == META_TILE_RIGHT)) - { - meta_window_untile (window); - } -@@ -2224,7 +2224,7 @@ handle_toggle_maximized (MetaDisplay *display, - MetaKeyBinding *binding, - gpointer user_data) - { -- if (META_WINDOW_MAXIMIZED (window)) -+ if (meta_window_is_maximized (window)) - meta_window_unmaximize (window, META_MAXIMIZE_BOTH); - else if (window->has_maximize_func) - meta_window_maximize (window, META_MAXIMIZE_BOTH); -diff --git a/src/core/window-private.h b/src/core/window-private.h -index 07fb4d68b5..856ce53c17 100644 ---- a/src/core/window-private.h -+++ b/src/core/window-private.h -@@ -630,29 +630,6 @@ struct _MetaWindowClass - MtkRoundingStrategy rounding_strategy); - }; - --/* These differ from window->has_foo_func in that they consider -- * the dynamic window state such as "maximized", not just the -- * window's type -- */ --#define META_WINDOW_MAXIMIZED(w) ((w)->maximized_horizontally && \ -- (w)->maximized_vertically) --#define META_WINDOW_MAXIMIZED_VERTICALLY(w) ((w)->maximized_vertically) --#define META_WINDOW_MAXIMIZED_HORIZONTALLY(w) ((w)->maximized_horizontally) --#define META_WINDOW_TILED_SIDE_BY_SIDE(w) ((w)->maximized_vertically && \ -- !(w)->maximized_horizontally && \ -- (w)->tile_mode != META_TILE_NONE) --#define META_WINDOW_TILED_LEFT(w) (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \ -- (w)->tile_mode == META_TILE_LEFT) --#define META_WINDOW_TILED_RIGHT(w) (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \ -- (w)->tile_mode == META_TILE_RIGHT) --#define META_WINDOW_TILED_MAXIMIZED(w)(META_WINDOW_MAXIMIZED(w) && \ -- (w)->tile_mode == META_TILE_MAXIMIZED) --#define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->fullscreen) --#define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !(w)->fullscreen) --#define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \ -- (((w)->size_hints.min_width < (w)->size_hints.max_width) || \ -- ((w)->size_hints.min_height < (w)->size_hints.max_height))) -- - void meta_window_unmanage (MetaWindow *window, - guint32 timestamp); - void meta_window_queue (MetaWindow *window, -@@ -909,3 +886,11 @@ void meta_window_protocol_to_stage_point (MetaWindow *window, - int *stage_x, - int *stage_y, - MtkRoundingStrategy rounding_strategy); -+ -+gboolean meta_window_is_maximized (MetaWindow *window); -+ -+gboolean meta_window_is_tiled_side_by_side (MetaWindow *window); -+ -+gboolean meta_window_is_tiled_left (MetaWindow *window); -+ -+gboolean meta_window_is_tiled_right (MetaWindow *window); -diff --git a/src/core/window.c b/src/core/window.c -index 5af39137cb..b1d6426987 100644 ---- a/src/core/window.c -+++ b/src/core/window.c -@@ -2695,7 +2695,7 @@ ensure_size_hints_satisfied (MtkRectangle *rect, - static void - meta_window_save_rect (MetaWindow *window) - { -- if (!(META_WINDOW_MAXIMIZED (window) || META_WINDOW_TILED_SIDE_BY_SIDE (window) || window->fullscreen)) -+ if (!(meta_window_is_maximized (window) || meta_window_is_tiled_side_by_side (window) || window->fullscreen)) - { - /* save size/pos as appropriate args for move_resize */ - if (!window->maximized_horizontally) -@@ -2837,6 +2837,18 @@ meta_window_get_maximized (MetaWindow *window) - (window->maximized_vertically ? META_MAXIMIZE_VERTICAL : 0)); - } - -+/** -+ * meta_window_is_maximized: -+ * @window: a #MetaWindow -+ * -+ * Return value: %TRUE if the window is maximized vertically and horizontally. -+ */ -+gboolean -+meta_window_is_maximized (MetaWindow *window) -+{ -+ return (window->maximized_horizontally && window->maximized_vertically); -+} -+ - /** - * meta_window_is_fullscreen: - * @window: a #MetaWindow -@@ -2937,7 +2949,7 @@ meta_window_get_tile_fraction (MetaWindow *window, - *fraction = 1.; - else if (tile_match) - *fraction = 1. - tile_match->tile_hfraction; -- else if (META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ else if (meta_window_is_tiled_side_by_side (window)) - { - if (window->tile_mode != tile_mode) - *fraction = 1. - window->tile_hfraction; -@@ -2957,7 +2969,7 @@ meta_window_update_tile_fraction (MetaWindow *window, - MtkRectangle work_area; - MetaWindowDrag *window_drag; - -- if (!META_WINDOW_TILED_SIDE_BY_SIDE (window)) -+ if (!meta_window_is_tiled_side_by_side (window)) - return; - - meta_window_get_work_area_for_monitor (window, -@@ -3031,6 +3043,28 @@ update_edge_constraints (MetaWindow *window) - } - } - -+gboolean -+meta_window_is_tiled_side_by_side (MetaWindow *window) -+{ -+ return window->maximized_vertically && -+ !window->maximized_horizontally && -+ window->tile_mode != META_TILE_NONE; -+} -+ -+gboolean -+meta_window_is_tiled_left (MetaWindow *window) -+{ -+ return window->tile_mode == META_TILE_LEFT && -+ meta_window_is_tiled_side_by_side (window); -+} -+ -+gboolean -+meta_window_is_tiled_right (MetaWindow *window) -+{ -+ return window->tile_mode == META_TILE_RIGHT && -+ meta_window_is_tiled_side_by_side (window); -+} -+ - void - meta_window_untile (MetaWindow *window) - { -@@ -4269,7 +4303,7 @@ adjust_size_for_tile_match (MetaWindow *window, - MtkRectangle work_area, rect; - MetaWindow *tile_match = window->tile_match; - -- if (!META_WINDOW_TILED_SIDE_BY_SIDE (window) || !tile_match) -+ if (!meta_window_is_tiled_side_by_side (window) || !tile_match) - return; - - meta_window_get_work_area_for_monitor (window, window->tile_monitor_number, &work_area); -@@ -6077,7 +6111,7 @@ meta_window_get_default_layer (MetaWindow *window) - { - if (window->wm_state_below) - return META_LAYER_BOTTOM; -- else if (window->wm_state_above && !META_WINDOW_MAXIMIZED (window)) -+ else if (window->wm_state_above && !meta_window_is_maximized (window)) - return META_LAYER_TOP; - else if (window->type == META_WINDOW_DESKTOP) - return META_LAYER_DESKTOP; -@@ -7476,13 +7510,22 @@ meta_window_is_above (MetaWindow *window) - gboolean - meta_window_allows_move (MetaWindow *window) - { -- return META_WINDOW_ALLOWS_MOVE (window); -+ return window->has_move_func && !meta_window_is_fullscreen (window); - } - - gboolean - meta_window_allows_resize (MetaWindow *window) - { -- return META_WINDOW_ALLOWS_RESIZE (window); -+ gboolean allows_resize_except_hints, allows_resize; -+ -+ allows_resize_except_hints = window->has_resize_func && -+ !meta_window_is_maximized (window) && -+ !meta_window_is_fullscreen (window); -+ allows_resize = allows_resize_except_hints && -+ (window->size_hints.min_width < window->size_hints.max_width || -+ window->size_hints.min_height < window->size_hints.max_height); -+ -+ return allows_resize; - } - - void -diff --git a/src/wayland/meta-wayland-gtk-shell.c b/src/wayland/meta-wayland-gtk-shell.c -index 9d38dd5cb0..8a82d3507a 100644 ---- a/src/wayland/meta-wayland-gtk-shell.c -+++ b/src/wayland/meta-wayland-gtk-shell.c -@@ -261,7 +261,7 @@ gtk_surface_titlebar_gesture (struct wl_client *client, - if (!window->has_maximize_func) - break; - -- if (META_WINDOW_MAXIMIZED (window)) -+ if (meta_window_is_maximized (window)) - meta_window_unmaximize (window, META_MAXIMIZE_BOTH); - else - meta_window_maximize (window, META_MAXIMIZE_BOTH); -@@ -271,7 +271,7 @@ gtk_surface_titlebar_gesture (struct wl_client *client, - if (!window->has_maximize_func) - break; - -- if (META_WINDOW_MAXIMIZED_HORIZONTALLY (window)) -+ if (meta_window_get_maximized (window) & META_MAXIMIZE_HORIZONTAL) - meta_window_unmaximize (window, META_MAXIMIZE_HORIZONTAL); - else - meta_window_maximize (window, META_MAXIMIZE_HORIZONTAL); -@@ -281,7 +281,7 @@ gtk_surface_titlebar_gesture (struct wl_client *client, - if (!window->has_maximize_func) - break; - -- if (META_WINDOW_MAXIMIZED_VERTICALLY (window)) -+ if (meta_window_get_maximized (window) & META_MAXIMIZE_VERTICAL) - meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL); - else - meta_window_maximize (window, META_MAXIMIZE_VERTICAL); -diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c -index fccd91a593..48f110b7c3 100644 ---- a/src/wayland/meta-wayland-xdg-shell.c -+++ b/src/wayland/meta-wayland-xdg-shell.c -@@ -722,7 +722,7 @@ fill_states (MetaWaylandXdgToplevel *xdg_toplevel, - window_drag = - meta_compositor_get_current_window_drag (window->display->compositor); - -- if (META_WINDOW_MAXIMIZED (window)) -+ if (meta_window_is_maximized (window)) - add_state_value (states, XDG_TOPLEVEL_STATE_MAXIMIZED); - if (meta_window_is_fullscreen (window)) - add_state_value (states, XDG_TOPLEVEL_STATE_FULLSCREEN); -diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c -index 1fd7a0752b..48a6122a30 100644 ---- a/src/wayland/meta-window-wayland.c -+++ b/src/wayland/meta-window-wayland.c -@@ -397,7 +397,7 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, - int bounds_height; - - if (!meta_wayland_surface_get_buffer (wl_window->surface) && -- !META_WINDOW_MAXIMIZED (window) && -+ !meta_window_is_maximized (window) && - window->tile_mode == META_TILE_NONE && - !meta_window_is_fullscreen (window)) - return; -diff --git a/src/x11/session.c b/src/x11/session.c -index 19c0a0236a..fc720d9bc7 100644 ---- a/src/x11/session.c -+++ b/src/x11/session.c -@@ -1029,7 +1029,7 @@ save_state (MetaContext *context) - fputs (" \n", outfile); - - /* Maximized */ -- if (META_WINDOW_MAXIMIZED (window)) -+ if (meta_window_is_maximized (window)) - { - fprintf (outfile, - " \n", --- -2.49.0 - diff --git a/0001-window-actor-Special-case-shaped-Java-windows.patch b/0001-window-actor-Special-case-shaped-Java-windows.patch deleted file mode 100644 index af7242a..0000000 --- a/0001-window-actor-Special-case-shaped-Java-windows.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 51e378c8f28b96b94c8da338b1b0f26cbc32c7f0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Florian=20M=C3=BCllner?= -Date: Fri, 12 May 2017 13:40:31 +0200 -Subject: [PATCH] window-actor: Special-case shaped Java windows - -OpenJDK wrongly assumes that shaping a window implies no shadows. -They got lucky until commit b975676c changed the fallback case, -but now their compliance tests are broken. Make them happy again -by special-casing shaped Java windows. ---- - src/compositor/meta-window-actor-x11.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c -index 2781df09cc..8748f3aa3a 100644 ---- a/src/compositor/meta-window-actor-x11.c -+++ b/src/compositor/meta-window-actor-x11.c -@@ -431,6 +431,14 @@ has_shadow (MetaWindowActorX11 *actor_x11) - if (priv->has_custom_frame_extents) - return FALSE; - -+ /* -+ * OpenJDK wrongly assumes that shaping a window implies no compositor -+ * shadows; make its compliance tests happy to give it what it wants ... -+ */ -+ if (g_strcmp0 (window->res_name, "sun-awt-X11-XWindowPeer") == 0 && -+ priv->shape_region != NULL) -+ return FALSE; -+ - /* - * Generate shadows for all other windows. - */ --- -2.44.0.501.g19981daefd.dirty - diff --git a/0002-Revert-background-Plumb-color-state-through-backgrou.patch b/0002-Revert-background-Plumb-color-state-through-backgrou.patch new file mode 100644 index 0000000..274a674 --- /dev/null +++ b/0002-Revert-background-Plumb-color-state-through-backgrou.patch @@ -0,0 +1,223 @@ +From 7525f5b32799328ef2a2e8509b64dd6b7c264e15 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Florian=20M=C3=BCllner?= +Date: Fri, 7 Nov 2025 15:31:55 +0100 +Subject: [PATCH] Revert "background: Plumb color state through backgrounds" + +This reverts commit e1a1247fb5889181fc64367798b08b54260853cc. +--- + src/compositor/meta-background-actor.c | 25 ------------------ + .../meta-background-content-private.h | 2 -- + src/compositor/meta-background-content.c | 12 +-------- + .../meta-background-image-private.h | 26 ------------------- + src/compositor/meta-background-image.c | 11 +------- + src/compositor/meta-background-private.h | 2 -- + src/compositor/meta-background.c | 17 +----------- + 7 files changed, 3 insertions(+), 92 deletions(-) + delete mode 100644 src/compositor/meta-background-image-private.h + +diff --git a/src/compositor/meta-background-actor.c b/src/compositor/meta-background-actor.c +index cf3d6a037e..71591a7e0f 100644 +--- a/src/compositor/meta-background-actor.c ++++ b/src/compositor/meta-background-actor.c +@@ -22,7 +22,6 @@ + #include "config.h" + + #include "compositor/meta-background-content-private.h" +-#include "compositor/meta-background-private.h" + #include "compositor/meta-cullable.h" + #include "meta/meta-background-actor.h" + +@@ -47,26 +46,6 @@ static void cullable_iface_init (MetaCullableInterface *iface); + G_DEFINE_TYPE_WITH_CODE (MetaBackgroundActor, meta_background_actor, CLUTTER_TYPE_ACTOR, + G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init)); + +-static void +-on_background_changed (MetaBackgroundContent *content, +- GParamSpec *pspec, +- gpointer data) +-{ +- MetaBackgroundActor *self = META_BACKGROUND_ACTOR (data); +- MetaBackground *background; +- ClutterColorState *color_state; +- +- background = meta_background_content_get_background (content); +- if (!background) +- return; +- +- color_state = meta_background_get_color_state (background); +- if (!color_state) +- return; +- +- clutter_actor_set_color_state (CLUTTER_ACTOR (self), color_state); +-} +- + static void + maybe_create_content (MetaBackgroundActor *self) + { +@@ -78,10 +57,6 @@ maybe_create_content (MetaBackgroundActor *self) + content = meta_background_content_new (self->display, self->monitor); + self->content = META_BACKGROUND_CONTENT (content); + clutter_actor_set_content (CLUTTER_ACTOR (self), content); +- g_signal_connect_object (content, "notify::background", +- G_CALLBACK (on_background_changed), self, +- G_CONNECT_DEFAULT); +- on_background_changed (self->content, NULL, self); + } + + static void +diff --git a/src/compositor/meta-background-content-private.h b/src/compositor/meta-background-content-private.h +index ac83784768..36031a43e1 100644 +--- a/src/compositor/meta-background-content-private.h ++++ b/src/compositor/meta-background-content-private.h +@@ -11,5 +11,3 @@ void meta_background_content_cull_unobscured (MetaBackgroundContent *self, + + void meta_background_content_cull_redraw_clip (MetaBackgroundContent *self, + MtkRegion *clip_region); +- +-MetaBackground * meta_background_content_get_background (MetaBackgroundContent *self); +diff --git a/src/compositor/meta-background-content.c b/src/compositor/meta-background-content.c +index 918d5f8112..481765c8e9 100644 +--- a/src/compositor/meta-background-content.c ++++ b/src/compositor/meta-background-content.c +@@ -303,7 +303,6 @@ on_background_changed (MetaBackground *background, + { + invalidate_pipeline (self, CHANGED_BACKGROUND); + clutter_content_invalidate (CLUTTER_CONTENT (self)); +- g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_BACKGROUND]); + } + + static CoglPipeline * +@@ -970,9 +969,7 @@ meta_background_content_class_init (MetaBackgroundContentClass *klass) + properties[PROP_BACKGROUND] = + g_param_spec_object ("background", NULL, NULL, + META_TYPE_BACKGROUND, +- G_PARAM_READWRITE | +- G_PARAM_STATIC_STRINGS | +- G_PARAM_EXPLICIT_NOTIFY); ++ G_PARAM_READWRITE); + + properties[PROP_GRADIENT] = + g_param_spec_boolean ("gradient", NULL, NULL, +@@ -1075,7 +1072,6 @@ meta_background_content_set_background (MetaBackgroundContent *self, + + invalidate_pipeline (self, CHANGED_BACKGROUND); + clutter_content_invalidate (CLUTTER_CONTENT (self)); +- g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_BACKGROUND]); + } + + void +@@ -1233,9 +1229,3 @@ meta_background_content_cull_redraw_clip (MetaBackgroundContent *self, + { + set_clip_region (self, clip_region); + } +- +-MetaBackground * +-meta_background_content_get_background (MetaBackgroundContent *self) +-{ +- return self->background; +-} +diff --git a/src/compositor/meta-background-image-private.h b/src/compositor/meta-background-image-private.h +deleted file mode 100644 +index d29260d389..0000000000 +--- a/src/compositor/meta-background-image-private.h ++++ /dev/null +@@ -1,26 +0,0 @@ +-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ +-/* +- * Copyright 2025 Red Hat, Inc. +- * +- * This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public License as +- * published by the Free Software Foundation; either version 2 of the +- * License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, see . +- * +- * Author: Matthias Clasen +- */ +- +-#pragma once +- +-#include "clutter/clutter.h" +-#include "meta/meta-background-image.h" +- +-ClutterColorState * meta_background_image_get_color_state (MetaBackgroundImage *self); +diff --git a/src/compositor/meta-background-image.c b/src/compositor/meta-background-image.c +index e5c879c892..9ac93fd636 100644 +--- a/src/compositor/meta-background-image.c ++++ b/src/compositor/meta-background-image.c +@@ -18,7 +18,7 @@ + + #include "config.h" + +-#include "compositor/meta-background-image-private.h" ++#include "meta/meta-background-image.h" + + #include + #include +@@ -365,12 +365,3 @@ meta_background_image_get_texture (MetaBackgroundImage *image) + + return image->texture; + } +- +-ClutterColorState * +-meta_background_image_get_color_state (MetaBackgroundImage *image, +- ClutterContext *ctx) +-{ +- g_return_val_if_fail (META_IS_BACKGROUND_IMAGE (image), NULL); +- +- return NULL; +-} +diff --git a/src/compositor/meta-background-private.h b/src/compositor/meta-background-private.h +index 056e274dba..dca3a5d94b 100644 +--- a/src/compositor/meta-background-private.h ++++ b/src/compositor/meta-background-private.h +@@ -9,5 +9,3 @@ CoglTexture * meta_background_get_texture (MetaBackground *self, + int monitor_index, + MtkRectangle *texture_area, + CoglPipelineWrapMode *wrap_mode); +- +-ClutterColorState * meta_background_get_color_state (MetaBackground *self); +diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c +index 18833ff2e8..7e33bc1a9a 100644 +--- a/src/compositor/meta-background.c ++++ b/src/compositor/meta-background.c +@@ -24,11 +24,9 @@ + #include + + #include "backends/meta-backend-private.h" +-#include "clutter/clutter-color-state.h" + #include "compositor/cogl-utils.h" +-#include "compositor/meta-background-image-private.h" +-#include "meta/compositor.h" + #include "meta/display.h" ++#include "meta/meta-background-image.h" + #include "meta/meta-background.h" + #include "meta/meta-monitor-manager.h" + #include "meta/util.h" +@@ -1034,16 +1032,3 @@ meta_background_refresh_all (void) + for (l = all_backgrounds; l; l = l->next) + mark_changed (l->data); + } +- +-ClutterColorState * +-meta_background_get_color_state (MetaBackground *self) +-{ +- g_return_val_if_fail (META_IS_BACKGROUND (self), NULL); +- +- if (self->background_image1) +- return meta_background_image_get_color_state (self->background_image1); +- else if (self->background_image2) +- return meta_background_image_get_color_state (self->background_image2); +- else +- return NULL; +-} +-- +2.51.1 + diff --git a/0002-Revert-x11-window-Update-comment-and-variable-name-t.patch b/0002-Revert-x11-window-Update-comment-and-variable-name-t.patch deleted file mode 100644 index dc2c280..0000000 --- a/0002-Revert-x11-window-Update-comment-and-variable-name-t.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 3a73958f7eab973189441ec9b4a4c96ee6bb8ec7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 22 Jul 2024 12:55:30 +0200 -Subject: [PATCH 2/3] Revert "x11/window: Update comment and variable name to - reflect current behavior" - -This reverts commit e4763d00e8512aeb408ae118597d753f12217487. ---- - src/x11/window-x11.c | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c -index e7c76dd674..b358b64bf2 100644 ---- a/src/x11/window-x11.c -+++ b/src/x11/window-x11.c -@@ -2491,20 +2491,21 @@ meta_window_x11_update_input_region (MetaWindow *window) - - if (region != NULL) - { -- MtkRectangle bounding_rect; -+ MtkRectangle client_area; - -- bounding_rect.x = 0; -- bounding_rect.y = 0; -- bounding_rect.width = window->buffer_rect.width; -- bounding_rect.height = window->buffer_rect.height; -+ client_area.x = 0; -+ client_area.y = 0; -+ client_area.width = window->buffer_rect.width; -+ client_area.height = window->buffer_rect.height; - - /* The shape we get back from the client may have coordinates - * outside of the frame. The X SHAPE Extension requires that - * the overall shape the client provides never exceeds the - * "bounding rectangle" of the window -- the shape that the -- * window would have gotten if it was unshaped. -+ * window would have gotten if it was unshaped. In our case, -+ * this is simply the client area. - */ -- mtk_region_intersect_rectangle (region, &bounding_rect); -+ mtk_region_intersect_rectangle (region, &client_area); - } - - meta_window_set_input_region (window, region); --- -2.44.0.501.g19981daefd.dirty - diff --git a/0002-Use-access-instead-of-checking-permission-modes-for-.patch b/0002-Use-access-instead-of-checking-permission-modes-for-.patch deleted file mode 100644 index 8feec21..0000000 --- a/0002-Use-access-instead-of-checking-permission-modes-for-.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d879589372a7857e1314773ff033ae54060f5648 Mon Sep 17 00:00:00 2001 -From: Nathan Pratta Teodosio -Date: Fri, 13 Jun 2025 11:24:24 +0200 -Subject: [PATCH 2/2] Use 'access' instead of checking permission modes for - /tmp/.X11-unix/. - -The previous version was missing the 200 case with the directory owned by the -current user. - -C.f. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7857, - https://launchpad.net/bugs/2069564. - -Part-of: -(cherry picked from commit 36ca36b48e7efd6846fac7533a4f2e97959a8ad6) ---- - src/wayland/meta-xwayland.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c -index 98c0d502f5..a7d273e53c 100644 ---- a/src/wayland/meta-xwayland.c -+++ b/src/wayland/meta-xwayland.c -@@ -553,7 +553,7 @@ ensure_x11_unix_perms (GError **error) - } - - /* ... be writable ... */ -- if ((x11_tmp.st_mode & 0022) != 0022) -+ if (access (X11_TMP_UNIX_DIR, W_OK) != 0) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED, - "Directory \"%s\" is not writable", --- -2.50.0 - diff --git a/0002-cursor-renderer-native-Store-formats-in-MetaCursorRe.patch b/0002-cursor-renderer-native-Store-formats-in-MetaCursorRe.patch deleted file mode 100644 index 1b5850b..0000000 --- a/0002-cursor-renderer-native-Store-formats-in-MetaCursorRe.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 7c447b2627c3a8050a5189dd876b82ddcf317666 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 6 Feb 2025 17:43:46 +0100 -Subject: [PATCH 2/3] cursor-renderer/native: Store formats in - MetaCursorRendererNativeGpuData -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Instead of hard-coding them everywhere. - -Preparation for next commit, no behaviour change intended. - -Part-of: ---- - .../native/meta-cursor-renderer-native.c | 23 ++++++++++++++----- - 1 file changed, 17 insertions(+), 6 deletions(-) - -diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c -index 0db0dde022..b4a45bfca7 100644 ---- a/src/backends/native/meta-cursor-renderer-native.c -+++ b/src/backends/native/meta-cursor-renderer-native.c -@@ -99,6 +99,8 @@ typedef struct _MetaCursorRendererNativeGpuData - { - gboolean hw_cursor_broken; - -+ uint32_t drm_format; -+ CoglPixelFormat cogl_format; - uint64_t cursor_width; - uint64_t cursor_height; - } MetaCursorRendererNativeGpuData; -@@ -849,7 +851,10 @@ load_scaled_and_transformed_cursor_sprite (MetaCursorRendererNative *native, - { - MetaCursorRendererNativePrivate *priv = - meta_cursor_renderer_native_get_instance_private (native); -+ MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data; - MetaCrtc *crtc = META_CRTC (crtc_kms); -+ MetaGpu *gpu = meta_crtc_get_gpu (crtc); -+ MetaGpuKms *gpu_kms = META_GPU_KMS (gpu); - MetaLogicalMonitor *logical_monitor; - MetaMonitor *monitor; - float monitor_scale; -@@ -873,6 +878,9 @@ load_scaled_and_transformed_cursor_sprite (MetaCursorRendererNative *native, - graphene_point_t hotspot; - int hot_x, hot_y; - -+ cursor_renderer_gpu_data = -+ meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms); -+ - monitor = meta_output_get_monitor (meta_crtc_get_outputs (crtc)->data); - logical_monitor = meta_monitor_get_logical_monitor (monitor); - -@@ -954,7 +962,7 @@ load_scaled_and_transformed_cursor_sprite (MetaCursorRendererNative *native, - - if (width != crtc_dst_width || height != crtc_dst_height || - !graphene_matrix_is_identity (&matrix) || -- gbm_format != GBM_FORMAT_ARGB8888 || -+ gbm_format != cursor_renderer_gpu_data->drm_format || - !clutter_color_state_equals (cursor_color_state, target_color_state)) - { - const MetaFormatInfo *format_info; -@@ -977,7 +985,7 @@ load_scaled_and_transformed_cursor_sprite (MetaCursorRendererNative *native, - height, - rowstride, - &matrix, -- COGL_PIXEL_FORMAT_BGRA_8888_PRE, -+ cursor_renderer_gpu_data->cogl_format, - crtc_dst_width, - crtc_dst_height, - &error); -@@ -989,11 +997,11 @@ load_scaled_and_transformed_cursor_sprite (MetaCursorRendererNative *native, - } - - bpp = -- cogl_pixel_format_get_bytes_per_pixel (COGL_PIXEL_FORMAT_BGRA_8888_PRE, -+ cogl_pixel_format_get_bytes_per_pixel (cursor_renderer_gpu_data->cogl_format, - 0); - cursor_rowstride = crtc_dst_width * bpp; - cursor_data = g_malloc (crtc_dst_height * cursor_rowstride); -- cogl_texture_get_data (texture, COGL_PIXEL_FORMAT_BGRA_8888_PRE, -+ cogl_texture_get_data (texture, cursor_renderer_gpu_data->cogl_format, - cursor_rowstride, - cursor_data); - -@@ -1007,7 +1015,7 @@ load_scaled_and_transformed_cursor_sprite (MetaCursorRendererNative *native, - cursor_rowstride, - &hotspot, - relative_transform, -- GBM_FORMAT_ARGB8888); -+ cursor_renderer_gpu_data->drm_format); - } - else - { -@@ -1020,7 +1028,7 @@ load_scaled_and_transformed_cursor_sprite (MetaCursorRendererNative *native, - rowstride, - &hotspot, - MTK_MONITOR_TRANSFORM_NORMAL, -- GBM_FORMAT_ARGB8888); -+ cursor_renderer_gpu_data->drm_format); - } - - return retval; -@@ -1285,6 +1293,9 @@ init_hw_cursor_support_for_gpu (MetaGpuKms *gpu_kms) - cursor_renderer_gpu_data = - meta_create_cursor_renderer_native_gpu_data (gpu_kms); - -+ cursor_renderer_gpu_data->drm_format = DRM_FORMAT_ARGB8888; -+ cursor_renderer_gpu_data->cogl_format = COGL_PIXEL_FORMAT_BGRA_8888_PRE; -+ - if (!meta_kms_device_get_cursor_size (kms_device, &width, &height)) - { - width = 64; --- -2.48.1 - diff --git a/0002-drm-lease-Connect-MetaUdev-hotplug-handler-after-oth.patch b/0002-drm-lease-Connect-MetaUdev-hotplug-handler-after-oth.patch deleted file mode 100644 index 3dc0b9f..0000000 --- a/0002-drm-lease-Connect-MetaUdev-hotplug-handler-after-oth.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 6bf9926f1c80ad37c38e0412d11014ca95845ddc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 31 Mar 2025 13:50:17 +0200 -Subject: [PATCH 2/5] drm-lease: Connect MetaUdev::hotplug handler after other - handles -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When we receive a hotplug signal emission, we update the state of leased -and leasable resources. Some of this state depends on the current state -of any potential associated monitor (MetaOutput & MetaMonitor). In order -to have an up to date association of MetaOutput's and MetaMonitor's, we -must only update our own state after MetaMonitorManager has had a chance -to. To achieve this, make sure the MetaUdev::hotplug signal handler is -dispatched after MetaMonitorManager's handler by using -g_signal_connect_after(). - -Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3943 -Part-of: -(cherry picked from commit 3ae8a307ffe2580eff7b5dbaa2fab9ca697e51aa) ---- - src/backends/native/meta-drm-lease.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/src/backends/native/meta-drm-lease.c b/src/backends/native/meta-drm-lease.c -index 9b9c6449a0..c6bd2d7380 100644 ---- a/src/backends/native/meta-drm-lease.c -+++ b/src/backends/native/meta-drm-lease.c -@@ -871,10 +871,12 @@ meta_drm_lease_manager_constructed (GObject *object) - MetaMonitorManager *monitor_manager = - meta_backend_get_monitor_manager (backend); - -+ /* Connect to MetaKms::resources-changed using G_CONNECT_AFTER to make sure -+ * MetaMonitorManager state is up to date. */ - lease_manager->resources_changed_handler_id = -- g_signal_connect (kms, "resources-changed", -- G_CALLBACK (on_resources_changed), -- lease_manager); -+ g_signal_connect_after (kms, "resources-changed", -+ G_CALLBACK (on_resources_changed), -+ lease_manager); - lease_manager->lease_changed_handler_id = - g_signal_connect (kms, "lease-changed", - G_CALLBACK (on_lease_changed), --- -2.49.0 - diff --git a/0002-input-capture-session-Disconnect-on_keymap_changed-o.patch b/0002-input-capture-session-Disconnect-on_keymap_changed-o.patch deleted file mode 100644 index 3118573..0000000 --- a/0002-input-capture-session-Disconnect-on_keymap_changed-o.patch +++ /dev/null @@ -1,41 +0,0 @@ -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/0002-monitor-Keep-track-of-the-for-lease-status.patch b/0002-monitor-Keep-track-of-the-for-lease-status.patch deleted file mode 100644 index e187874..0000000 --- a/0002-monitor-Keep-track-of-the-for-lease-status.patch +++ /dev/null @@ -1,462 +0,0 @@ -From f93e85f69b9d63d4bedeaf778d5f620ad64ddab4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Mon, 28 Oct 2024 08:44:35 +0100 -Subject: [PATCH 2/5] monitor: Keep track of the for lease status - -Add a flag to MetaMonitor indicating if the monitor is available for -lease and store/update it from the monitor configuration. - -Also, add unit tests validating that the configuration is applied and -that invalid configurations fail. - -Part-of: ---- - src/backends/meta-monitor-config-manager.c | 10 +- - src/backends/meta-monitor-manager-private.h | 3 + - src/backends/meta-monitor-manager.c | 41 +++++ - src/backends/meta-monitor.c | 19 ++ - src/backends/meta-monitor.h | 6 + - .../native/meta-monitor-manager-native.c | 1 + - .../monitor-configs/forlease-invalid.xml | 32 ++++ - src/tests/monitor-configs/forlease.xml | 40 +++++ - src/tests/monitor-unit-tests.c | 165 ++++++++++++++++++ - 9 files changed, 316 insertions(+), 1 deletion(-) - create mode 100644 src/tests/monitor-configs/forlease-invalid.xml - create mode 100644 src/tests/monitor-configs/forlease.xml - -diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c -index ecf4ee8202..0df193f0a4 100644 ---- a/src/backends/meta-monitor-config-manager.c -+++ b/src/backends/meta-monitor-config-manager.c -@@ -1628,6 +1628,7 @@ meta_monitors_config_new (MetaMonitorManager *monitor_manager, - MetaMonitorsConfigFlag flags) - { - GList *disabled_monitor_specs = NULL; -+ GList *for_lease_monitor_specs = NULL; - GList *monitors; - GList *l; - -@@ -1649,11 +1650,18 @@ meta_monitors_config_new (MetaMonitorManager *monitor_manager, - disabled_monitor_specs = - g_list_prepend (disabled_monitor_specs, - meta_monitor_spec_clone (monitor_spec)); -+ -+ if (meta_monitor_is_for_lease (monitor)) -+ { -+ for_lease_monitor_specs = -+ g_list_prepend (for_lease_monitor_specs, -+ meta_monitor_spec_clone (monitor_spec)); -+ } - } - - return meta_monitors_config_new_full (logical_monitor_configs, - disabled_monitor_specs, -- NULL, -+ for_lease_monitor_specs, - layout_mode, - flags); - } -diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h -index 977ce417cc..66492c2a5f 100644 ---- a/src/backends/meta-monitor-manager-private.h -+++ b/src/backends/meta-monitor-manager-private.h -@@ -345,6 +345,9 @@ META_EXPORT_TEST - void meta_monitor_manager_update_logical_state (MetaMonitorManager *manager, - MetaMonitorsConfig *config); - -+void meta_monitor_manager_update_for_lease_state (MetaMonitorManager *manager, -+ MetaMonitorsConfig *config); -+ - META_EXPORT_TEST - void meta_monitor_manager_update_logical_state_derived (MetaMonitorManager *manager, - MetaMonitorsConfig *config); -diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c -index 4fcc8a696c..55816ed7bb 100644 ---- a/src/backends/meta-monitor-manager.c -+++ b/src/backends/meta-monitor-manager.c -@@ -3824,6 +3824,46 @@ meta_monitor_manager_update_logical_state (MetaMonitorManager *manager, - meta_monitor_manager_rebuild_logical_monitors (manager, config); - } - -+static gboolean -+is_monitor_configured_for_lease (MetaMonitor *monitor, -+ MetaMonitorsConfig *config) -+{ -+ MetaMonitorSpec *monitor_spec; -+ GList *l; -+ -+ monitor_spec = meta_monitor_get_spec (monitor); -+ -+ for (l = config->for_lease_monitor_specs; l; l = l->next) -+ { -+ MetaMonitorSpec *spec = l->data; -+ -+ if (meta_monitor_spec_equals (monitor_spec, spec)) -+ return TRUE; -+ } -+ -+ return FALSE; -+} -+ -+void -+meta_monitor_manager_update_for_lease_state (MetaMonitorManager *manager, -+ MetaMonitorsConfig *config) -+{ -+ GList *l; -+ -+ for (l = manager->monitors; l; l = l->next) -+ { -+ MetaMonitor *monitor = l->data; -+ gboolean is_for_lease; -+ -+ if (config) -+ is_for_lease = is_monitor_configured_for_lease (monitor, config); -+ else -+ is_for_lease = FALSE; -+ -+ meta_monitor_set_for_lease (monitor, is_for_lease); -+ } -+} -+ - void - meta_monitor_manager_rebuild (MetaMonitorManager *manager, - MetaMonitorsConfig *config) -@@ -3838,6 +3878,7 @@ meta_monitor_manager_rebuild (MetaMonitorManager *manager, - old_logical_monitors = manager->logical_monitors; - - meta_monitor_manager_update_logical_state (manager, config); -+ meta_monitor_manager_update_for_lease_state (manager, config); - - ensure_privacy_screen_settings (manager); - -diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c -index b7efabda2c..badde7cea2 100644 ---- a/src/backends/meta-monitor.c -+++ b/src/backends/meta-monitor.c -@@ -67,6 +67,8 @@ typedef struct _MetaMonitorPrivate - MetaLogicalMonitor *logical_monitor; - - char *display_name; -+ -+ gboolean is_for_lease; - } MetaMonitorPrivate; - - G_DEFINE_TYPE_WITH_PRIVATE (MetaMonitor, meta_monitor, G_TYPE_OBJECT) -@@ -2459,3 +2461,20 @@ meta_monitor_get_backlight (MetaMonitor *monitor, - return FALSE; - } - } -+ -+void -+meta_monitor_set_for_lease (MetaMonitor *monitor, -+ gboolean for_lease) -+{ -+ MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor); -+ -+ priv->is_for_lease = for_lease; -+} -+ -+gboolean -+meta_monitor_is_for_lease (MetaMonitor *monitor) -+{ -+ MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor); -+ -+ return priv->is_for_lease; -+} -diff --git a/src/backends/meta-monitor.h b/src/backends/meta-monitor.h -index 01836dc0e7..cc11348b35 100644 ---- a/src/backends/meta-monitor.h -+++ b/src/backends/meta-monitor.h -@@ -349,4 +349,10 @@ META_EXPORT_TEST - gboolean meta_monitor_get_backlight (MetaMonitor *monitor, - int *value); - -+void meta_monitor_set_for_lease (MetaMonitor *monitor, -+ gboolean for_lease); -+ -+META_EXPORT_TEST -+gboolean meta_monitor_is_for_lease (MetaMonitor *monitor); -+ - G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetaMonitorSpec, meta_monitor_spec_free) -diff --git a/src/backends/native/meta-monitor-manager-native.c b/src/backends/native/meta-monitor-manager-native.c -index 668f4e0eb4..21cc1b95be 100644 ---- a/src/backends/native/meta-monitor-manager-native.c -+++ b/src/backends/native/meta-monitor-manager-native.c -@@ -156,6 +156,7 @@ meta_monitor_manager_native_ensure_initial_config (MetaMonitorManager *manager) - config = meta_monitor_manager_ensure_configured (manager); - - meta_monitor_manager_update_logical_state (manager, config); -+ meta_monitor_manager_update_for_lease_state (manager, config); - } - - static void -diff --git a/src/tests/monitor-configs/forlease-invalid.xml b/src/tests/monitor-configs/forlease-invalid.xml -new file mode 100644 -index 0000000000..4a7ff9d5da ---- /dev/null -+++ b/src/tests/monitor-configs/forlease-invalid.xml -@@ -0,0 +1,32 @@ -+ -+ -+ logical -+ -+ 0 -+ 0 -+ 1 -+ yes -+ -+ -+ DP-1 -+ MetaProduct's Inc. -+ MetaMonitor -+ 0x123456 -+ -+ -+ 800 -+ 600 -+ 60 -+ -+ -+ -+ -+ -+ DP-1 -+ MetaProduct's Inc. -+ MetaMonitor -+ 0x123456 -+ -+ -+ -+ -diff --git a/src/tests/monitor-configs/forlease.xml b/src/tests/monitor-configs/forlease.xml -new file mode 100644 -index 0000000000..482f095a6d ---- /dev/null -+++ b/src/tests/monitor-configs/forlease.xml -@@ -0,0 +1,40 @@ -+ -+ -+ logical -+ -+ 0 -+ 0 -+ 1 -+ yes -+ -+ -+ DP-1 -+ MetaProduct's Inc. -+ MetaMonitor -+ 0x123456 -+ -+ -+ 800 -+ 600 -+ 60 -+ -+ -+ -+ -+ -+ DP-2 -+ MetaProduct's Inc. -+ MetaMonitor -+ 0x654321 -+ -+ -+ -+ -+ DP-2 -+ MetaProduct's Inc. -+ MetaMonitor -+ 0x654321 -+ -+ -+ -+ -diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c -index 2414789bab..326dd83855 100644 ---- a/src/tests/monitor-unit-tests.c -+++ b/src/tests/monitor-unit-tests.c -@@ -9176,6 +9176,167 @@ meta_test_monitor_custom_detached_groups (void) - g_assert_cmpstr (error->message, ==, "Logical monitors not adjacent"); - } - -+static void -+meta_test_monitor_custom_for_lease_config (void) -+{ -+ MonitorTestCase test_case = { -+ .setup = { -+ .modes = { -+ { -+ .width = 800, -+ .height = 600, -+ .refresh_rate = 60.0 -+ } -+ }, -+ .n_modes = 1, -+ .outputs = { -+ { -+ .crtc = -1, -+ .modes = { 0 }, -+ .n_modes = 1, -+ .preferred_mode = 0, -+ .possible_crtcs = { 0, 1 }, -+ .n_possible_crtcs = 2, -+ .width_mm = 222, -+ .height_mm = 125, -+ .serial = "0x123456", -+ }, -+ { -+ .crtc = -1, -+ .modes = { 0 }, -+ .n_modes = 1, -+ .preferred_mode = 0, -+ .possible_crtcs = { 0, 1 }, -+ .n_possible_crtcs = 2, -+ .width_mm = 222, -+ .height_mm = 125, -+ .serial = "0x654321" -+ } -+ }, -+ .n_outputs = 2, -+ .crtcs = { -+ { -+ .current_mode = -1 -+ }, -+ { -+ .current_mode = -1 -+ } -+ }, -+ .n_crtcs = 2 -+ }, -+ -+ .expect = { -+ .monitors = { -+ { -+ .outputs = { 0 }, -+ .n_outputs = 1, -+ .modes = { -+ { -+ .width = 800, -+ .height = 600, -+ .refresh_rate = 60.0, -+ .crtc_modes = { -+ { -+ .output = 0, -+ .crtc_mode = 0 -+ } -+ } -+ } -+ }, -+ .n_modes = 1, -+ .current_mode = 0, -+ .width_mm = 222, -+ .height_mm = 125 -+ }, -+ { -+ .outputs = { 1 }, -+ .n_outputs = 1, -+ .modes = { -+ { -+ .width = 800, -+ .height = 600, -+ .refresh_rate = 60.0, -+ .crtc_modes = { -+ { -+ .output = 1, -+ .crtc_mode = 0 -+ } -+ } -+ } -+ }, -+ .n_modes = 1, -+ .current_mode = -1, -+ .width_mm = 222, -+ .height_mm = 125 -+ } -+ }, -+ .n_monitors = 2, -+ .logical_monitors = { -+ { -+ .monitors = { 0 }, -+ .n_monitors = 1, -+ .layout = { .x = 0, .y = 0, .width = 800, .height = 600 }, -+ .scale = 1, -+ .transform = MTK_MONITOR_TRANSFORM_NORMAL -+ }, -+ }, -+ .n_logical_monitors = 1, -+ .primary_logical_monitor = 0, -+ .n_outputs = 2, -+ .crtcs = { -+ { -+ .current_mode = 0, -+ }, -+ { -+ .current_mode = -1, -+ } -+ }, -+ .n_crtcs = 2, -+ .screen_width = 800, -+ .screen_height = 600, -+ } -+ }; -+ MetaMonitorTestSetup *test_setup; -+ MetaBackend *backend = meta_context_get_backend (test_context); -+ MetaMonitorManager *monitor_manager = -+ meta_backend_get_monitor_manager (backend); -+ GList *monitors; -+ MetaMonitor *first_monitor; -+ MetaMonitor *second_monitor; -+ -+ test_setup = meta_create_monitor_test_setup (test_backend, -+ &test_case.setup, -+ MONITOR_TEST_FLAG_NONE); -+ meta_set_custom_monitor_config (test_context, "forlease.xml"); -+ emulate_hotplug (test_setup); -+ -+ META_TEST_LOG_CALL ("Checking monitor configuration", -+ meta_check_monitor_configuration (test_context, -+ &test_case.expect)); -+ check_monitor_test_clients_state (); -+ -+ monitors = meta_monitor_manager_get_monitors (monitor_manager); -+ g_assert_cmpuint (g_list_length (monitors), ==, 2); -+ -+ first_monitor = g_list_nth_data (monitors, 0); -+ second_monitor = g_list_nth_data (monitors, 1); -+ -+ g_assert_true (meta_monitor_is_active (first_monitor)); -+ g_assert_false (meta_monitor_is_for_lease (first_monitor)); -+ -+ g_assert_false (meta_monitor_is_active (second_monitor)); -+ g_assert_true (meta_monitor_is_for_lease (second_monitor)); -+} -+ -+static void -+meta_test_monitor_custom_for_lease_invalid_config (void) -+{ -+ g_test_expect_message ("libmutter-test", G_LOG_LEVEL_WARNING, -+ "*For lease monitor must be explicitly disabled"); -+ meta_set_custom_monitor_config (test_context, "forlease-invalid.xml"); -+ g_test_assert_expected_messages (); -+} -+ - static gboolean - quit_main_loop (gpointer data) - { -@@ -10400,6 +10561,10 @@ init_monitor_tests (void) - meta_test_monitor_custom_lid_switch_config); - add_monitor_test ("/backends/monitor/custom/detached-groups", - meta_test_monitor_custom_detached_groups); -+ add_monitor_test ("/backends/monitor/custom/for-lease-config", -+ meta_test_monitor_custom_for_lease_config); -+ add_monitor_test ("/backends/monitor/custom/for-lease-invalid-config", -+ meta_test_monitor_custom_for_lease_invalid_config); - - add_monitor_test ("/backends/monitor/migrated/rotated", - meta_test_monitor_migrated_rotated); --- -2.48.1 - diff --git a/0002-monitor-manager-Allow-to-check-if-config-has-a-visib.patch b/0002-monitor-manager-Allow-to-check-if-config-has-a-visib.patch deleted file mode 100644 index 60ff034..0000000 --- a/0002-monitor-manager-Allow-to-check-if-config-has-a-visib.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 80a19134ffb5ddd6577f00986aafcaf9db6505b9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Tue, 5 Nov 2024 12:03:49 +0100 -Subject: [PATCH 2/3] monitor-manager: Allow to check if config has a visible - monitor - -Add a new function, similar to meta_logical_monitor_configs_have_monitor() -that, in addition, checks if the monitor is visible. - -Refactor, no functional change. - -Part-of: ---- - src/backends/meta-monitor-config-manager.c | 24 +++++++++++++++++----- - src/backends/meta-monitor-config-manager.h | 4 ++++ - 2 files changed, 23 insertions(+), 5 deletions(-) - -diff --git a/src/backends/meta-monitor-config-manager.c b/src/backends/meta-monitor-config-manager.c -index 0df193f0a4..74aa2df4b1 100644 ---- a/src/backends/meta-monitor-config-manager.c -+++ b/src/backends/meta-monitor-config-manager.c -@@ -1638,14 +1638,12 @@ meta_monitors_config_new (MetaMonitorManager *monitor_manager, - MetaMonitor *monitor = l->data; - MetaMonitorSpec *monitor_spec; - -- if (!monitor_matches_rule (monitor, monitor_manager, -- MONITOR_MATCH_VISIBLE)) -+ if (meta_logical_monitor_configs_have_visible_monitor (monitor_manager, -+ logical_monitor_configs, -+ monitor)) - continue; - - monitor_spec = meta_monitor_get_spec (monitor); -- if (meta_logical_monitor_configs_have_monitor (logical_monitor_configs, -- monitor_spec)) -- continue; - - disabled_monitor_specs = - g_list_prepend (disabled_monitor_specs, -@@ -1889,6 +1887,22 @@ meta_logical_monitor_configs_have_monitor (GList *logical_monitor_conf - return FALSE; - } - -+gboolean -+meta_logical_monitor_configs_have_visible_monitor (MetaMonitorManager *monitor_manager, -+ GList *logical_monitor_configs, -+ MetaMonitor *monitor) -+{ -+ MetaMonitorSpec *monitor_spec; -+ -+ if (!monitor_matches_rule (monitor, monitor_manager, MONITOR_MATCH_VISIBLE)) -+ return TRUE; -+ -+ monitor_spec = meta_monitor_get_spec (monitor); -+ -+ return meta_logical_monitor_configs_have_monitor (logical_monitor_configs, -+ monitor_spec); -+} -+ - static gboolean - meta_monitors_config_is_monitor_enabled (MetaMonitorsConfig *config, - MetaMonitorSpec *monitor_spec) -diff --git a/src/backends/meta-monitor-config-manager.h b/src/backends/meta-monitor-config-manager.h -index 87a29bc2dd..f033ac6555 100644 ---- a/src/backends/meta-monitor-config-manager.h -+++ b/src/backends/meta-monitor-config-manager.h -@@ -187,6 +187,10 @@ META_EXPORT_TEST - gboolean meta_logical_monitor_configs_have_monitor (GList *logical_monitor_configs, - MetaMonitorSpec *monitor_spec); - -+gboolean meta_logical_monitor_configs_have_visible_monitor (MetaMonitorManager *monitor_manager, -+ GList *logical_monitor_configs, -+ MetaMonitor *monitor); -+ - META_EXPORT_TEST - gboolean meta_verify_monitor_mode_spec (MetaMonitorModeSpec *monitor_mode_spec, - GError **error); --- -2.48.1 - diff --git a/0002-stage-Track-overlay-damage-per-view.patch b/0002-stage-Track-overlay-damage-per-view.patch deleted file mode 100644 index ba3b0b3..0000000 --- a/0002-stage-Track-overlay-damage-per-view.patch +++ /dev/null @@ -1,266 +0,0 @@ -From 3e09a7f1717d8c4b0a815fd9673471a52d6328b9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Wed, 12 Mar 2025 11:56:46 +0800 -Subject: [PATCH 2/2] stage: Track overlay damage per view - -The previously painted rectangle of an overlay is not a global state, -but depends on what view it was painted on. There was also an issue -where an overlay being updated but not changing position, e.g. due to a -0,0 pointer movement or an absolute pointer movement with the position -not changing, not properly triggering damage of the old position when it -eventually actually moved. - -Fix this by tracking damage per view, while also fixing the state -tracking to handle unchanged positions. ---- - src/backends/meta-stage.c | 163 +++++++++++++++++++++++++------------- - 1 file changed, 107 insertions(+), 56 deletions(-) - -diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c -index 32f681c8c5..58f15bbb33 100644 ---- a/src/backends/meta-stage.c -+++ b/src/backends/meta-stage.c -@@ -38,6 +38,12 @@ struct _MetaStageWatch - gpointer user_data; - }; - -+typedef struct _MetaOverlayViewState -+{ -+ graphene_rect_t painted_rect; -+ gboolean has_painted_rect; -+} MetaOverlayViewState; -+ - struct _MetaOverlay - { - MetaStage *stage; -@@ -49,8 +55,8 @@ struct _MetaOverlay - - graphene_matrix_t transform; - graphene_rect_t current_rect; -- graphene_rect_t previous_rect; -- gboolean previous_is_valid; -+ -+ GHashTable *view_states; - }; - - struct _MetaStage -@@ -77,6 +83,7 @@ meta_overlay_new (MetaStage *stage) - overlay = g_new0 (MetaOverlay, 1); - overlay->stage = stage; - overlay->pipeline = cogl_pipeline_new (ctx); -+ overlay->view_states = g_hash_table_new_full (NULL, NULL, NULL, g_free); - - return overlay; - } -@@ -86,6 +93,7 @@ meta_overlay_free (MetaOverlay *overlay) - { - if (overlay->pipeline) - g_object_unref (overlay->pipeline); -+ g_hash_table_unref (overlay->view_states); - - g_free (overlay); - } -@@ -115,19 +123,57 @@ meta_overlay_set (MetaOverlay *overlay, - overlay->current_rect = *dst_rect; - } - -+static MetaOverlayViewState * -+get_view_state (MetaOverlay *overlay, -+ ClutterStageView *view) -+{ -+ return g_hash_table_lookup (overlay->view_states, view); -+} -+ -+static MetaOverlayViewState * -+ensure_view_state (MetaOverlay *overlay, -+ ClutterStageView *view) -+{ -+ MetaOverlayViewState *view_state; -+ -+ view_state = get_view_state (overlay, view); -+ -+ if (!view_state) -+ { -+ view_state = g_new0 (MetaOverlayViewState, 1); -+ g_hash_table_insert (overlay->view_states, view, view_state); -+ } -+ -+ return view_state; -+} -+ -+static void -+meta_overlay_invalidate_views (MetaOverlay *overlay) -+{ -+ g_hash_table_remove_all (overlay->view_states); -+} -+ - static void - meta_overlay_paint (MetaOverlay *overlay, - ClutterPaintContext *paint_context) - { -+ ClutterStageView *view; -+ MetaOverlayViewState *view_state = NULL; - CoglFramebuffer *framebuffer; - -- if (!overlay->texture) -- return; -+ view = clutter_paint_context_get_stage_view (paint_context); -+ if (view) -+ view_state = ensure_view_state (overlay, view); - -- if (!overlay->is_visible && -+ if ((!overlay->texture || -+ !overlay->is_visible) && - !(clutter_paint_context_get_paint_flags (paint_context) & - CLUTTER_PAINT_FLAG_FORCE_CURSORS)) -- return; -+ { -+ if (view_state) -+ view_state->has_painted_rect = FALSE; -+ return; -+ } - - framebuffer = clutter_paint_context_get_framebuffer (paint_context); - cogl_framebuffer_draw_rectangle (framebuffer, -@@ -139,10 +185,10 @@ meta_overlay_paint (MetaOverlay *overlay, - (overlay->current_rect.origin.y + - overlay->current_rect.size.height)); - -- if (!graphene_rect_equal (&overlay->previous_rect, &overlay->current_rect)) -+ if (view_state) - { -- overlay->previous_rect = overlay->current_rect; -- overlay->previous_is_valid = TRUE; -+ view_state->painted_rect = overlay->current_rect; -+ view_state->has_painted_rect = TRUE; - } - } - -@@ -343,67 +389,68 @@ meta_stage_new (MetaBackend *backend) - } - - static void --queue_cursor_overlay_redraw_clutter_rect (MetaStage *stage, -- MetaOverlay *overlay, -- graphene_rect_t *rect) -+intersect_and_queue_redraw (ClutterStageView *view, -+ const MtkRectangle *clip) - { -- MtkRectangle clip = { -- .x = (int) floorf (rect->origin.x), -- .y = (int) floorf (rect->origin.y), -- .width = (int) ceilf (rect->size.width), -- .height = (int) ceilf (rect->size.height) -- }; -- GList *l; -+ MtkRectangle view_layout; -+ MtkRectangle view_clip; - -- /* Since we're flooring the coordinates, we need to enlarge the clip by the -- * difference between the actual coordinate and the floored value */ -- clip.width += (int) ceilf (rect->origin.x - clip.x) * 2; -- clip.height += (int) ceilf (rect->origin.y - clip.y) * 2; -+ clutter_stage_view_get_layout (view, &view_layout); - -- for (l = clutter_stage_peek_stage_views (CLUTTER_STAGE (stage)); -- l; -- l = l->next) -+ if (mtk_rectangle_intersect (clip, &view_layout, &view_clip)) - { -- ClutterStageView *view = l->data; -- MtkRectangle view_layout; -- MtkRectangle view_clip; -- -- if (clutter_stage_view_get_default_paint_flags (view) & -- CLUTTER_PAINT_FLAG_NO_CURSORS) -- continue; -- -- if (meta_stage_view_is_cursor_overlay_inhibited (META_STAGE_VIEW (view))) -- return; -+ clutter_stage_view_add_redraw_clip (view, &view_clip); -+ clutter_stage_view_schedule_update (view); -+ } -+} - -- clutter_stage_view_get_layout (view, &view_layout); -+static void -+cursor_rect_to_clip (const graphene_rect_t *cursor_rect, -+ MtkRectangle *clip_rect) -+{ -+ mtk_rectangle_from_graphene_rect (cursor_rect, -+ MTK_ROUNDING_STRATEGY_GROW, -+ clip_rect); - -- if (mtk_rectangle_intersect (&clip, &view_layout, &view_clip)) -- { -- clutter_stage_view_add_redraw_clip (view, &view_clip); -- clutter_stage_view_schedule_update (view); -- } -- } -+ /* Since we're flooring the coordinates, we need to enlarge the clip by the -+ * difference between the actual coordinate and the floored value */ -+ clip_rect->width += (int) ceilf (cursor_rect->origin.x - clip_rect->x) * 2; -+ clip_rect->height += (int) ceilf (cursor_rect->origin.y - clip_rect->y) * 2; - } - - static void - queue_redraw_for_cursor_overlay (MetaStage *stage, - MetaOverlay *overlay) - { -- /* Clear the location the overlay was at before, if we need to. */ -- if (overlay->previous_is_valid) -- { -- queue_cursor_overlay_redraw_clutter_rect (stage, -- overlay, -- &overlay->previous_rect); -- overlay->previous_is_valid = FALSE; -- } -+ GList *l; - -- /* Draw the overlay at the new position */ -- if (overlay->is_visible && overlay->texture) -+ for (l = clutter_stage_peek_stage_views (CLUTTER_STAGE (stage)); -+ l; -+ l = l->next) - { -- queue_cursor_overlay_redraw_clutter_rect (stage, -- overlay, -- &overlay->current_rect); -+ ClutterStageView *view = CLUTTER_STAGE_VIEW (l->data); -+ MetaOverlayViewState *view_state; -+ -+ view_state = ensure_view_state (overlay, view); -+ if (view_state->has_painted_rect) -+ { -+ MtkRectangle clip; -+ -+ cursor_rect_to_clip (&view_state->painted_rect, &clip); -+ intersect_and_queue_redraw (view, &clip); -+ } -+ -+ if (overlay->is_visible && -+ overlay->texture && -+ !(clutter_stage_view_get_default_paint_flags (view) & -+ CLUTTER_PAINT_FLAG_NO_CURSORS) && -+ !meta_stage_view_is_cursor_overlay_inhibited (META_STAGE_VIEW (view))) -+ { -+ MtkRectangle clip; -+ -+ cursor_rect_to_clip (&overlay->current_rect, &clip); -+ intersect_and_queue_redraw (view, &clip); -+ } - } - } - -@@ -509,4 +556,8 @@ meta_stage_rebuild_views (MetaStage *stage) - - meta_monitor_manager_get_screen_size (monitor_manager, &width, &height); - clutter_actor_set_size (CLUTTER_ACTOR (stage), width, height); -+ -+ g_list_foreach (stage->overlays, -+ (GFunc) meta_overlay_invalidate_views, -+ NULL); - } --- -2.44.0.501.g19981daefd.dirty - diff --git a/0002-window-Use-getter-for-fullscreen-state.patch b/0002-window-Use-getter-for-fullscreen-state.patch deleted file mode 100644 index 3f81a67..0000000 --- a/0002-window-Use-getter-for-fullscreen-state.patch +++ /dev/null @@ -1,304 +0,0 @@ -From 427e528f20d5f45075112341fb3dc2a7952cc9b0 Mon Sep 17 00:00:00 2001 -From: Bilal Elmoussaoui -Date: Mon, 28 Oct 2024 10:03:02 +0100 -Subject: [PATCH 02/10] window: Use getter for fullscreen state - -Avoids going through struct field directly as we might replace that with -a WindowConfiguration type soon-ish. - -Part-of: -(cherry picked from commit 0f5ec2ec16da933272833322023578aa029b888a) ---- - src/core/constraints.c | 23 +++++++++++++---------- - src/core/display.c | 2 +- - src/core/keybindings.c | 2 +- - src/core/place.c | 2 +- - src/core/window.c | 22 ++++++++++++---------- - src/x11/window-x11.c | 11 ++++++----- - 6 files changed, 34 insertions(+), 28 deletions(-) - -diff --git a/src/core/constraints.c b/src/core/constraints.c -index 6f20d087e2..200da009db 100644 ---- a/src/core/constraints.c -+++ b/src/core/constraints.c -@@ -461,7 +461,8 @@ setup_constraint_info (MetaBackend *backend, - logical_monitor, - &info->work_area_monitor); - -- if (window->fullscreen && meta_window_has_fullscreen_monitors (window)) -+ if (meta_window_is_fullscreen (window) && -+ meta_window_has_fullscreen_monitors (window)) - { - info->entire_monitor = window->fullscreen_monitors.top->rect; - mtk_rectangle_union (&info->entire_monitor, -@@ -482,7 +483,7 @@ setup_constraint_info (MetaBackend *backend, - else - { - info->entire_monitor = logical_monitor->rect; -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - meta_window_adjust_fullscreen_monitor_rect (window, &info->entire_monitor); - } - -@@ -551,7 +552,7 @@ place_window_if_needed (MetaWindow *window, - !(window->maximized_horizontally || - window->maximized_vertically) && - !window->minimized && -- !window->fullscreen) -+ !meta_window_is_fullscreen (window)) - { - MetaMonitorManager *monitor_manager = - meta_backend_get_monitor_manager (info->backend); -@@ -670,7 +671,7 @@ update_onscreen_requirements (MetaWindow *window, - * the application sends a bunch of configurerequest events). See - * #353699. - */ -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - return; - - /* USABILITY NOTE: Naturally, I only want the require_fully_onscreen, -@@ -1166,7 +1167,7 @@ constrain_modal_dialog (MetaWindow *window, - meta_window_get_placement_rule (window)) - return TRUE; - -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - return TRUE; - - /* We want to center the dialog on the parent, including the decorations -@@ -1354,7 +1355,7 @@ constrain_fullscreen (MetaWindow *window, - return TRUE; - - /* Determine whether constraint applies; exit if it doesn't */ -- if (!window->fullscreen) -+ if (!meta_window_is_fullscreen (window)) - return TRUE; - - monitor = info->entire_monitor; -@@ -1392,7 +1393,8 @@ constrain_size_increments (MetaWindow *window, - return TRUE; - - /* Determine whether constraint applies; exit if it doesn't */ -- if (meta_window_is_maximized (window) || window->fullscreen || -+ if (meta_window_is_maximized (window) || -+ meta_window_is_fullscreen (window) || - meta_window_is_tiled_side_by_side (window) || - info->action_type == ACTION_MOVE) - return TRUE; -@@ -1523,7 +1525,8 @@ constrain_aspect_ratio (MetaWindow *window, - (double)window->size_hints.max_aspect.y; - constraints_are_inconsistent = minr > maxr; - if (constraints_are_inconsistent || -- meta_window_is_maximized (window) || window->fullscreen || -+ meta_window_is_maximized (window) || -+ meta_window_is_fullscreen (window) || - meta_window_is_tiled_side_by_side (window) || - info->action_type == ACTION_MOVE) - return TRUE; -@@ -1765,7 +1768,7 @@ constrain_fully_onscreen (MetaWindow *window, - */ - if (window->type == META_WINDOW_DESKTOP || - window->type == META_WINDOW_DOCK || -- window->fullscreen || -+ meta_window_is_fullscreen (window) || - !window->require_fully_onscreen || - info->is_user_action || - meta_window_get_placement_rule (window)) -@@ -1828,7 +1831,7 @@ constrain_titlebar_visible (MetaWindow *window, - */ - if (window->type == META_WINDOW_DESKTOP || - window->type == META_WINDOW_DOCK || -- window->fullscreen || -+ meta_window_is_fullscreen (window) || - !window->require_titlebar_visible || - unconstrained_user_action || - user_nonnorthern_resize || -diff --git a/src/core/display.c b/src/core/display.c -index 2ab30028fc..6e38d1979d 100644 ---- a/src/core/display.c -+++ b/src/core/display.c -@@ -3156,7 +3156,7 @@ check_fullscreen_func (gpointer data) - if (window->hidden) - continue; - -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - { - covers_monitors = TRUE; - } -diff --git a/src/core/keybindings.c b/src/core/keybindings.c -index 41559c9719..614c96423c 100644 ---- a/src/core/keybindings.c -+++ b/src/core/keybindings.c -@@ -2170,7 +2170,7 @@ handle_toggle_fullscreen (MetaDisplay *display, - MetaKeyBinding *binding, - gpointer user_data) - { -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - meta_window_unmake_fullscreen (window); - else if (window->has_fullscreen_func) - meta_window_make_fullscreen (window); -diff --git a/src/core/place.c b/src/core/place.c -index d420479b5e..1c84994666 100644 ---- a/src/core/place.c -+++ b/src/core/place.c -@@ -945,7 +945,7 @@ meta_window_place (MetaWindow *window, - * be maximized. - */ - if (window->has_maximize_func && window->decorated && -- !window->fullscreen) -+ !meta_window_is_fullscreen (window)) - { - MtkRectangle workarea; - MtkRectangle frame_rect; -diff --git a/src/core/window.c b/src/core/window.c -index b1d6426987..1782c884fa 100644 ---- a/src/core/window.c -+++ b/src/core/window.c -@@ -1461,7 +1461,7 @@ meta_window_unmanage (MetaWindow *window, - meta_window_on_all_workspaces_changed (window); - - #ifdef HAVE_X11_CLIENT -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - { - MetaGroup *group = NULL; - /* If the window is fullscreen, it may be forcing -@@ -2695,7 +2695,9 @@ ensure_size_hints_satisfied (MtkRectangle *rect, - static void - meta_window_save_rect (MetaWindow *window) - { -- if (!(meta_window_is_maximized (window) || meta_window_is_tiled_side_by_side (window) || window->fullscreen)) -+ if (!(meta_window_is_maximized (window) || -+ meta_window_is_tiled_side_by_side (window) || -+ meta_window_is_fullscreen (window))) - { - /* save size/pos as appropriate args for move_resize */ - if (!window->maximized_horizontally) -@@ -2897,7 +2899,7 @@ meta_window_is_monitor_sized (MetaWindow *window) - if (!window->monitor) - return FALSE; - -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - return TRUE; - - if (meta_window_is_screen_sized (window)) -@@ -3396,7 +3398,7 @@ meta_window_set_above (MetaWindow *window, - void - meta_window_make_fullscreen_internal (MetaWindow *window) - { -- if (!window->fullscreen) -+ if (!meta_window_is_fullscreen (window)) - { - meta_topic (META_DEBUG_WINDOW_OPS, - "Fullscreening %s", window->desc); -@@ -3426,7 +3428,7 @@ meta_window_make_fullscreen (MetaWindow *window) - g_return_if_fail (META_IS_WINDOW (window)); - g_return_if_fail (!window->override_redirect); - -- if (!window->fullscreen) -+ if (!meta_window_is_fullscreen (window)) - { - MtkRectangle old_frame_rect, old_buffer_rect; - -@@ -3453,7 +3455,7 @@ meta_window_unmake_fullscreen (MetaWindow *window) - g_return_if_fail (META_IS_WINDOW (window)); - g_return_if_fail (!window->override_redirect); - -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - { - MtkRectangle old_frame_rect, old_buffer_rect, target_rect; - gboolean has_target_size; -@@ -3526,7 +3528,7 @@ meta_window_update_fullscreen_monitors (MetaWindow *window, - meta_window_clear_fullscreen_monitors (window); - } - -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - { - meta_window_queue(window, META_QUEUE_MOVE_RESIZE); - } -@@ -4291,7 +4293,7 @@ meta_window_move_to_monitor (MetaWindow *window, - window->preferred_logical_monitor = - meta_logical_monitor_dup_id (window->monitor); - -- if (window->fullscreen || window->override_redirect) -+ if (meta_window_is_fullscreen (window) || window->override_redirect) - meta_display_queue_check_fullscreen (window->display); - } - -@@ -5740,7 +5742,7 @@ meta_window_recalc_features (MetaWindow *window) - * is not resizable purely due to fullscreen, we don't want to - * disable fullscreen mode. - */ -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - { - window->has_move_func = FALSE; - window->has_resize_func = FALSE; -@@ -5762,7 +5764,7 @@ meta_window_recalc_features (MetaWindow *window) - meta_topic (META_DEBUG_WINDOW_OPS, - "Window %s fullscreen = %d not resizable, maximizable = %d fullscreenable = %d min size %dx%d max size %dx%d", - window->desc, -- window->fullscreen, -+ meta_window_is_fullscreen (window), - window->has_maximize_func, window->has_fullscreen_func, - window->size_hints.min_width, - window->size_hints.min_height, -diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c -index b4a5472c61..8157b1c013 100644 ---- a/src/x11/window-x11.c -+++ b/src/x11/window-x11.c -@@ -2362,7 +2362,7 @@ meta_window_x11_set_net_wm_state (MetaWindow *window) - data[i] = x11_display->atom__NET_WM_STATE_MAXIMIZED_VERT; - ++i; - } -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - { - data[i] = x11_display->atom__NET_WM_STATE_FULLSCREEN; - ++i; -@@ -2417,7 +2417,7 @@ meta_window_x11_set_net_wm_state (MetaWindow *window) - - mtk_x11_error_trap_pop (x11_display->xdisplay); - -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - { - if (meta_window_has_fullscreen_monitors (window)) - { -@@ -2993,7 +2993,7 @@ meta_window_move_resize_request (MetaWindow *window, - (window->decorated || !priv->has_custom_frame_extents) && - mtk_rectangle_equal (&rect, &monitor_rect) && - window->has_fullscreen_func && -- !window->fullscreen) -+ !meta_window_is_fullscreen (window)) - { - /* - meta_topic (META_DEBUG_GEOMETRY, -@@ -3432,7 +3432,8 @@ meta_window_x11_client_message (MetaWindow *window, - gboolean make_fullscreen; - - make_fullscreen = (action == _NET_WM_STATE_ADD || -- (action == _NET_WM_STATE_TOGGLE && !window->fullscreen)); -+ (action == _NET_WM_STATE_TOGGLE && -+ !meta_window_is_fullscreen (window))); - if (make_fullscreen && window->has_fullscreen_func) - meta_window_make_fullscreen (window); - else -@@ -4602,7 +4603,7 @@ meta_window_x11_can_unredirect (MetaWindowX11 *window_x11) - if (!window->monitor) - return FALSE; - -- if (window->fullscreen) -+ if (meta_window_is_fullscreen (window)) - return TRUE; - - if (meta_window_is_screen_sized (window)) --- -2.49.0 - diff --git a/0003-Revert-x11-window-Use-correct-bounding-rect-to-deter.patch b/0003-Revert-x11-window-Use-correct-bounding-rect-to-deter.patch deleted file mode 100644 index c206536..0000000 --- a/0003-Revert-x11-window-Use-correct-bounding-rect-to-deter.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3e6ba58c875055037e45f651bbcf866d2d47d82f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 22 Jul 2024 12:55:44 +0200 -Subject: [PATCH 3/3] Revert "x11/window: Use correct bounding rect to - determine NULL input region" - -This reverts commit 6bd920b355d12395dbf00b99374fc1f23783caaf. ---- - src/x11/window-x11.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c -index b358b64bf2..16dc57eec2 100644 ---- a/src/x11/window-x11.c -+++ b/src/x11/window-x11.c -@@ -2473,8 +2473,8 @@ meta_window_x11_update_input_region (MetaWindow *window) - else if (n_rects == 1 && - (rects[0].x == 0 && - rects[0].y == 0 && -- rects[0].width == window->buffer_rect.width && -- rects[0].height == window->buffer_rect.height)) -+ rects[0].width == priv->client_rect.width && -+ rects[0].height == priv->client_rect.height)) - { - /* This is the bounding region case. Keep the - * region as NULL. */ --- -2.44.0.501.g19981daefd.dirty - diff --git a/0003-cursor-renderer-native-Probe-formats-supported-by-cu.patch b/0003-cursor-renderer-native-Probe-formats-supported-by-cu.patch deleted file mode 100644 index 040cbca..0000000 --- a/0003-cursor-renderer-native-Probe-formats-supported-by-cu.patch +++ /dev/null @@ -1,176 +0,0 @@ -From f459472cfe121d491ee97fd09a8abdd970dc900a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= -Date: Thu, 6 Feb 2025 18:31:16 +0100 -Subject: [PATCH 3/3] cursor-renderer/native: Probe formats supported by cursor - planes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Probe all RGBA 8888 variants. - -If there's a GBM device, prefer a format also supported by GBM, if any. -Fall back to dumb BOs otherwise. - -This allows the HW cursor to work correctly using BGRA8888 on s390x. - -v2: -* Rename get_cursor_format_info → find_cursor_format_info. -* Log device path if we can't find any suitable cursor plane format. -v3: -* Split cursor_planes_support_format helper out of - find_cursor_format_info to make logic clearer. (Sebastian Wick) - -Part-of: ---- - .../native/meta-cursor-renderer-native.c | 101 +++++++++++++++++- - 1 file changed, 96 insertions(+), 5 deletions(-) - -diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c -index b4a45bfca7..7581d9b492 100644 ---- a/src/backends/native/meta-cursor-renderer-native.c -+++ b/src/backends/native/meta-cursor-renderer-native.c -@@ -51,6 +51,7 @@ - #include "backends/native/meta-renderer-native.h" - #include "backends/native/meta-seat-native.h" - #include "common/meta-cogl-drm-formats.h" -+#include "common/meta-drm-format-helpers.h" - #include "core/boxes-private.h" - #include "meta/boxes.h" - #include "meta/meta-backend.h" -@@ -99,6 +100,7 @@ typedef struct _MetaCursorRendererNativeGpuData - { - gboolean hw_cursor_broken; - -+ gboolean use_gbm; - uint32_t drm_format; - CoglPixelFormat cogl_format; - uint64_t cursor_width; -@@ -546,11 +548,13 @@ create_cursor_drm_buffer (MetaGpuKms *gpu_kms, - uint32_t format, - GError **error) - { -- struct gbm_device *gbm_device; -+ MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data = -+ meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms); - -- gbm_device = meta_gbm_device_from_gpu (gpu_kms); -- if (gbm_device) -+ if (cursor_renderer_gpu_data->use_gbm) - { -+ struct gbm_device *gbm_device = meta_gbm_device_from_gpu (gpu_kms); -+ - return create_cursor_drm_buffer_gbm (gpu_kms, device_file, gbm_device, - pixels, - width, height, stride, -@@ -1283,18 +1287,105 @@ on_monitors_changed (MetaMonitorManager *monitors, - meta_cursor_renderer_force_update (renderer); - } - -+static gboolean -+cursor_planes_support_format (MetaKmsDevice *kms_device, -+ const uint32_t format) -+{ -+ gboolean supported = FALSE; -+ GList *l; -+ -+ for (l = meta_kms_device_get_planes (kms_device); l; l = l->next) -+ { -+ MetaKmsPlane *plane = l->data; -+ -+ if (meta_kms_plane_get_plane_type (plane) != META_KMS_PLANE_TYPE_CURSOR) -+ continue; -+ -+ if (!meta_kms_plane_is_format_supported (plane, format)) -+ return FALSE; -+ -+ supported = TRUE; -+ } -+ -+ return supported; -+} -+ -+static const MetaFormatInfo * -+find_cursor_format_info (MetaGpuKms *gpu_kms, -+ struct gbm_device *gbm_device) -+{ -+ MetaKmsDevice *kms_device = meta_gpu_kms_get_kms_device (gpu_kms); -+ uint32_t formats[] = { -+ DRM_FORMAT_ARGB8888, -+ DRM_FORMAT_RGBA8888, -+ DRM_FORMAT_BGRA8888, -+ DRM_FORMAT_ABGR8888 -+ }; -+ int i; -+ -+ for (i = 0; i < G_N_ELEMENTS (formats); i++) -+ { -+ if (gbm_device && -+ !gbm_device_is_format_supported (gbm_device, formats[i], -+ GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE)) -+ { -+ meta_topic (META_DEBUG_KMS, -+ "GBM doesn't support format 0x%x for %s", -+ formats[i], meta_kms_device_get_path (kms_device)); -+ continue; -+ } -+ -+ if (cursor_planes_support_format (kms_device, formats[i])) -+ return meta_format_info_from_drm_format (formats[i]); -+ -+ meta_topic (META_DEBUG_KMS, -+ "Cursor plane doesn't support format 0x%x for %s", -+ formats[i], meta_kms_device_get_path (kms_device)); -+ } -+ -+ return NULL; -+} -+ - static void - init_hw_cursor_support_for_gpu (MetaGpuKms *gpu_kms) - { - MetaKmsDevice *kms_device = meta_gpu_kms_get_kms_device (gpu_kms); - MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data; -+ const MetaFormatInfo *format_info; -+ struct gbm_device *gbm_device; - uint64_t width, height; -+ MetaDrmFormatBuf tmp; - - cursor_renderer_gpu_data = - meta_create_cursor_renderer_native_gpu_data (gpu_kms); - -- cursor_renderer_gpu_data->drm_format = DRM_FORMAT_ARGB8888; -- cursor_renderer_gpu_data->cogl_format = COGL_PIXEL_FORMAT_BGRA_8888_PRE; -+ gbm_device = meta_gbm_device_from_gpu (gpu_kms); -+ format_info = find_cursor_format_info (gpu_kms, gbm_device); -+ if (!format_info && gbm_device) -+ { -+ gbm_device = NULL; -+ format_info = find_cursor_format_info (gpu_kms, NULL); -+ } -+ -+ if (!format_info) -+ { -+ g_warning ("Couldn't find suitable cursor plane format for %s, " -+ "disabling HW cursor", -+ meta_kms_device_get_path (kms_device)); -+ cursor_renderer_gpu_data->hw_cursor_broken = TRUE; -+ return; -+ } -+ -+ cursor_renderer_gpu_data->use_gbm = gbm_device != NULL; -+ cursor_renderer_gpu_data->drm_format = format_info->drm_format; -+ cursor_renderer_gpu_data->cogl_format = format_info->cogl_format; -+ -+ meta_topic (META_DEBUG_KMS, -+ "Using cursor plane format %s (0x%x) for %s, use_gbm=%d", -+ meta_drm_format_to_string (&tmp, format_info->drm_format), -+ format_info->drm_format, -+ meta_kms_device_get_path (kms_device), -+ cursor_renderer_gpu_data->use_gbm); - - if (!meta_kms_device_get_cursor_size (kms_device, &width, &height)) - { --- -2.48.1 - diff --git a/0003-monitor-manager-Configure-for-lease-monitors-in-Appl.patch b/0003-monitor-manager-Configure-for-lease-monitors-in-Appl.patch deleted file mode 100644 index ff64e66..0000000 --- a/0003-monitor-manager-Configure-for-lease-monitors-in-Appl.patch +++ /dev/null @@ -1,224 +0,0 @@ -From 479bb6921da3d7004a74c4c7db999534b32ff214 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Tue, 5 Nov 2024 12:26:42 +0100 -Subject: [PATCH 3/3] monitor-manager: Configure for lease monitors in - ApplyMonitorsConfig - -Add a new property to the ApplyMonitorsConfig D-Bus API allowing to set -a list of monitors for lease. - -Part-of: ---- - .../org.gnome.Mutter.DisplayConfig.xml | 6 ++ - src/backends/meta-monitor-manager.c | 85 ++++++++++++++++++- - src/tests/monitor-unit-tests.c | 60 +++++++++++++ - 3 files changed, 147 insertions(+), 4 deletions(-) - -diff --git a/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml b/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml -index 192c08a796..fec38a34a8 100644 ---- a/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml -+++ b/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml -@@ -501,6 +501,12 @@ - * "layout-mode" (u): layout mode the passed configuration is in; may - only be set when changing the layout mode is - supported (see GetCurrentState). -+ * "monitors-for-lease" (a(ssss)): a list of monitors to be made available for -+ lease. Monitors listed here must not be listed in @logical_monitors: -+ * s connector: connector name (e.g. HDMI-1, DP-1, etc) -+ * s vendor: vendor name -+ * s product: product name -+ * s serial: product serial - --> - - -diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c -index 127181df60..abe1db6649 100644 ---- a/src/backends/meta-monitor-manager.c -+++ b/src/backends/meta-monitor-manager.c -@@ -2713,6 +2713,74 @@ is_valid_layout_mode (MetaLogicalMonitorLayoutMode layout_mode) - return FALSE; - } - -+static GList * -+create_disabled_monitor_specs_for_config (MetaMonitorManager *monitor_manager, -+ GList *logical_monitor_configs) -+{ -+ GList *disabled_monitor_specs = NULL; -+ GList *monitors; -+ GList *l; -+ -+ monitors = meta_monitor_manager_get_monitors (monitor_manager); -+ for (l = monitors; l; l = l->next) -+ { -+ MetaMonitor *monitor = l->data; -+ -+ if (!meta_logical_monitor_configs_have_visible_monitor (monitor_manager, -+ logical_monitor_configs, -+ monitor)) -+ { -+ MetaMonitorSpec *monitor_spec = meta_monitor_get_spec (monitor); -+ -+ disabled_monitor_specs = -+ g_list_prepend (disabled_monitor_specs, -+ meta_monitor_spec_clone (monitor_spec)); -+ } -+ } -+ -+ return disabled_monitor_specs; -+} -+ -+static GList * -+create_for_lease_monitor_specs_from_variant (GVariant *properties_variant) -+{ -+ GList *for_lease_monitor_specs = NULL; -+ g_autoptr (GVariant) for_lease_variant = NULL; -+ GVariantIter iter; -+ char *connector = NULL; -+ char *vendor = NULL; -+ char *product = NULL; -+ char *serial = NULL; -+ -+ if (!properties_variant) -+ return NULL; -+ -+ for_lease_variant = g_variant_lookup_value (properties_variant, -+ "monitors-for-lease", -+ G_VARIANT_TYPE ("a(ssss)")); -+ if (!for_lease_variant) -+ return NULL; -+ -+ g_variant_iter_init (&iter, for_lease_variant); -+ while (g_variant_iter_next (&iter, "(ssss)", &connector, &vendor, &product, &serial)) -+ { -+ MetaMonitorSpec *monitor_spec; -+ -+ monitor_spec = g_new0 (MetaMonitorSpec, 1); -+ *monitor_spec = (MetaMonitorSpec) { -+ .connector = connector, -+ .vendor = vendor, -+ .product = product, -+ .serial = serial -+ }; -+ -+ for_lease_monitor_specs = -+ g_list_append (for_lease_monitor_specs, monitor_spec); -+ } -+ -+ return for_lease_monitor_specs; -+} -+ - static gboolean - meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skeleton, - GDBusMethodInvocation *invocation, -@@ -2730,6 +2798,8 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet - GVariantIter logical_monitor_configs_iter; - MetaMonitorsConfig *config; - GList *logical_monitor_configs = NULL; -+ GList *disabled_monitor_specs = NULL; -+ GList *for_lease_monitor_specs = NULL; - GError *error = NULL; - - if (serial != manager->serial) -@@ -2818,10 +2888,17 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet - logical_monitor_config); - } - -- config = meta_monitors_config_new (manager, -- logical_monitor_configs, -- layout_mode, -- META_MONITORS_CONFIG_FLAG_NONE); -+ disabled_monitor_specs = -+ create_disabled_monitor_specs_for_config (manager, -+ logical_monitor_configs); -+ for_lease_monitor_specs = -+ create_for_lease_monitor_specs_from_variant (properties_variant); -+ -+ config = meta_monitors_config_new_full (logical_monitor_configs, -+ disabled_monitor_specs, -+ for_lease_monitor_specs, -+ layout_mode, -+ META_MONITORS_CONFIG_FLAG_NONE); - if (!meta_verify_monitors_config (config, manager, &error)) - { - g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, -diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c -index 1f87c36528..380f55cc75 100644 ---- a/src/tests/monitor-unit-tests.c -+++ b/src/tests/monitor-unit-tests.c -@@ -9564,6 +9564,10 @@ meta_test_monitor_custom_for_lease_config_dbus (void) - MetaMonitorTestSetup *test_setup; - g_autoptr (GDBusProxy) display_config_proxy = NULL; - g_autoptr (GVariant) state = NULL; -+ uint32_t serial; -+ GVariantBuilder b; -+ g_autoptr (GVariant) apply_config_ret = NULL; -+ g_autoptr (GVariant) new_state = NULL; - - test_setup = meta_create_monitor_test_setup (test_backend, - &test_case_setup, -@@ -9597,6 +9601,62 @@ meta_test_monitor_custom_for_lease_config_dbus (void) - - assert_monitor_state (state, 0, "DP-1", FALSE); - assert_monitor_state (state, 1, "DP-2", TRUE); -+ -+ /* Swap monitor for lease */ -+ serial = g_variant_get_uint32 (g_variant_get_child_value (state, 0)); -+ -+ g_variant_builder_init (&b, G_VARIANT_TYPE ("(uua(iiduba(ssa{sv}))a{sv})")); -+ g_variant_builder_add (&b, "u", serial); /* Serial from GetCurrentState */ -+ g_variant_builder_add (&b, "u", 1); /* Method: Temporary */ -+ -+ /* Logical monitors */ -+ g_variant_builder_open (&b, G_VARIANT_TYPE ("a(iiduba(ssa{sv}))")); -+ g_variant_builder_open (&b, G_VARIANT_TYPE ("(iiduba(ssa{sv}))")); -+ g_variant_builder_add (&b, "i", 0); /* x */ -+ g_variant_builder_add (&b, "i", 0); /* y */ -+ g_variant_builder_add (&b, "d", 1.0); /* Scale */ -+ g_variant_builder_add (&b, "u", 0); /* Transform */ -+ g_variant_builder_add (&b, "b", TRUE); /* Primary */ -+ g_variant_builder_add_parsed (&b, "[(%s, %s, @a{sv} {})]", /* Monitors */ -+ "DP-2", -+ "800x600@60.000"); -+ g_variant_builder_close (&b); -+ g_variant_builder_close (&b); -+ -+ /* Properties */ -+ g_variant_builder_open (&b, G_VARIANT_TYPE ("a{sv}")); -+ g_variant_builder_add_parsed (&b, "{'monitors-for-lease', <[(%s, %s, %s, %s)]>}", -+ "DP-1", -+ "MetaProduct\'s Inc.", -+ "MetaMonitor", -+ "0x123456"); -+ g_variant_builder_close (&b); -+ -+ g_dbus_proxy_call (display_config_proxy, -+ "ApplyMonitorsConfig", -+ g_variant_builder_end (&b), -+ G_DBUS_CALL_FLAGS_NO_AUTO_START, -+ -1, -+ NULL, -+ on_proxy_call_cb, -+ &apply_config_ret); -+ while (!apply_config_ret) -+ g_main_context_iteration (NULL, TRUE); -+ -+ /* Check that monitors changed */ -+ g_dbus_proxy_call (display_config_proxy, -+ "GetCurrentState", -+ NULL, -+ G_DBUS_CALL_FLAGS_NO_AUTO_START, -+ -1, -+ NULL, -+ on_proxy_call_cb, -+ &new_state); -+ while (!new_state) -+ g_main_context_iteration (NULL, TRUE); -+ -+ assert_monitor_state (new_state, 0, "DP-1", TRUE); -+ assert_monitor_state (new_state, 1, "DP-2", FALSE); - } - - static gboolean --- -2.48.1 - diff --git a/0003-output-kms-Add-meta_output_kms_from_kms_connector.patch b/0003-output-kms-Add-meta_output_kms_from_kms_connector.patch deleted file mode 100644 index 359d27a..0000000 --- a/0003-output-kms-Add-meta_output_kms_from_kms_connector.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 863b31cae9be5e8e0467f1a9f93e7348d41f7e88 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Tue, 29 Oct 2024 11:35:17 +0100 -Subject: [PATCH 3/5] output/kms: Add meta_output_kms_from_kms_connector() - -Add a function that returns a MetaOutputKms (if any) from a -MetaKmsConnector. - -Part-of: ---- - src/backends/native/meta-output-kms.c | 19 +++++++++++++++++++ - src/backends/native/meta-output-kms.h | 2 ++ - 2 files changed, 21 insertions(+) - -diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c -index 684cf0e094..27b7533a5e 100644 ---- a/src/backends/native/meta-output-kms.c -+++ b/src/backends/native/meta-output-kms.c -@@ -47,6 +47,8 @@ struct _MetaOutputKms - - G_DEFINE_TYPE (MetaOutputKms, meta_output_kms, META_TYPE_OUTPUT_NATIVE) - -+static GQuark kms_connector_output_kms_quark; -+ - MetaKmsConnector * - meta_output_kms_get_kms_connector (MetaOutputKms *output_kms) - { -@@ -90,6 +92,13 @@ meta_output_kms_can_clone (MetaOutputKms *output_kms, - return TRUE; - } - -+MetaOutputKms * -+meta_output_kms_from_kms_connector (MetaKmsConnector *connector) -+{ -+ return g_object_get_qdata (G_OBJECT (connector), -+ kms_connector_output_kms_quark); -+} -+ - static GBytes * - meta_output_kms_read_edid (MetaOutputNative *output_native) - { -@@ -534,6 +543,16 @@ meta_output_kms_new (MetaGpuKms *gpu_kms, - meta_output_unassign_crtc (output); - } - -+ if (!kms_connector_output_kms_quark) -+ { -+ kms_connector_output_kms_quark = -+ g_quark_from_static_string ("kms-connector-output-kms-quark"); -+ } -+ -+ g_object_set_qdata (G_OBJECT (kms_connector), -+ kms_connector_output_kms_quark, -+ output_kms); -+ - return output_kms; - } - -diff --git a/src/backends/native/meta-output-kms.h b/src/backends/native/meta-output-kms.h -index e0eb60eb4d..4391dc1899 100644 ---- a/src/backends/native/meta-output-kms.h -+++ b/src/backends/native/meta-output-kms.h -@@ -39,6 +39,8 @@ MetaKmsConnector * meta_output_kms_get_kms_connector (MetaOutputKms *output_kms) - - uint32_t meta_output_kms_get_connector_id (MetaOutputKms *output_kms); - -+MetaOutputKms * meta_output_kms_from_kms_connector (MetaKmsConnector *connector); -+ - MetaOutputKms * meta_output_kms_new (MetaGpuKms *gpu_kms, - MetaKmsConnector *kms_connector, - MetaOutput *old_output, --- -2.48.1 - diff --git a/0003-tests-Add-drm-lease-test-for-non-non-desktop-hotplug.patch b/0003-tests-Add-drm-lease-test-for-non-non-desktop-hotplug.patch deleted file mode 100644 index 4c5843b..0000000 --- a/0003-tests-Add-drm-lease-test-for-non-non-desktop-hotplug.patch +++ /dev/null @@ -1,166 +0,0 @@ -From 0c5e21e30ae375fda7a146833c7f412a5c2bd22b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 31 Mar 2025 13:56:13 +0200 -Subject: [PATCH 3/5] tests: Add drm lease test for non non-desktop hotplugs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This tests that https://gitlab.gnome.org/GNOME/mutter/-/issues/3943 -doesn't reproduce by triggering hotplugs in a certain way. - -Part-of: -(cherry picked from commit 2ae93f69eb7228b28519c823cb38b3640a1225e9) ---- - src/backends/native/meta-backend-native.h | 2 + - src/tests/drm-lease-monitor-test.c | 104 ++++++++++++++++++++++ - src/tests/meson.build | 7 ++ - 3 files changed, 113 insertions(+) - create mode 100644 src/tests/drm-lease-monitor-test.c - -diff --git a/src/backends/native/meta-backend-native.h b/src/backends/native/meta-backend-native.h -index 34115d1ba4..6d63a24966 100644 ---- a/src/backends/native/meta-backend-native.h -+++ b/src/backends/native/meta-backend-native.h -@@ -39,8 +39,10 @@ gboolean meta_backend_native_activate_vt (MetaBackendNative *backend_native, - int vt, - GError **error); - -+META_EXPORT_TEST - void meta_backend_native_pause (MetaBackendNative *backend_native); - -+META_EXPORT_TEST - void meta_backend_native_resume (MetaBackendNative *backend_native); - - MetaLauncher * meta_backend_native_get_launcher (MetaBackendNative *native); -diff --git a/src/tests/drm-lease-monitor-test.c b/src/tests/drm-lease-monitor-test.c -new file mode 100644 -index 0000000000..d35f5ba83a ---- /dev/null -+++ b/src/tests/drm-lease-monitor-test.c -@@ -0,0 +1,104 @@ -+/* -+ * Copyright (C) 2025 Red Hat, Inc. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, see . -+ */ -+ -+#include "config.h" -+ -+#include -+ -+#include "backends/meta-monitor-config-manager.h" -+#include "backends/native/meta-backend-native.h" -+#include "backends/native/meta-kms.h" -+#include "backends/native/meta-kms-device.h" -+#include "meta-test/meta-context-test.h" -+#include "tests/drm-mock/drm-mock.h" -+#include "tests/meta-test-utils.h" -+ -+static MetaContext *test_context; -+ -+static void -+fake_udev_hotplug (void) -+{ -+ MetaBackend *backend = meta_context_get_backend (test_context); -+ MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend); -+ MetaUdev *udev = meta_backend_native_get_udev (backend_native); -+ g_autolist (GUdevDevice) devices = NULL; -+ g_autoptr (GError) error = NULL; -+ GList *l; -+ -+ devices = meta_udev_list_drm_devices (udev, -+ META_UDEV_DEVICE_TYPE_CARD, -+ &error); -+ g_assert_no_error (error); -+ g_assert_nonnull (devices); -+ -+ for (l = devices; l; l = l->next) -+ { -+ GUdevDevice *device = l->data; -+ -+ g_signal_emit_by_name (udev, "hotplug", device); -+ } -+} -+ -+static void -+disconnect_connector_filter (gpointer resource, -+ gpointer user_data) -+{ -+ drmModeConnector *drm_connector = resource; -+ -+ drm_connector->connection = DRM_MODE_DISCONNECTED; -+} -+ -+static void -+test_drm_lease_lease_suspend_resume (void) -+{ -+ MetaBackend *backend = meta_context_get_backend (test_context); -+ MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend); -+ -+ meta_backend_native_pause (backend_native); -+ drm_mock_set_resource_filter (DRM_MOCK_CALL_FILTER_GET_CONNECTOR, -+ disconnect_connector_filter, NULL); -+ fake_udev_hotplug (); -+ meta_backend_native_resume (backend_native); -+ -+ drm_mock_unset_resource_filter (DRM_MOCK_CALL_FILTER_GET_CONNECTOR); -+ fake_udev_hotplug (); -+} -+ -+static void -+init_tests (void) -+{ -+ g_test_add_func ("/wayland/drm-lease/suspend-resume", -+ test_drm_lease_lease_suspend_resume); -+} -+ -+int -+main (int argc, -+ char *argv[]) -+{ -+ g_autoptr (MetaContext) context = NULL; -+ -+ context = meta_create_test_context (META_CONTEXT_TEST_TYPE_VKMS, -+ META_CONTEXT_TEST_FLAG_NO_X11); -+ g_assert_true (meta_context_configure (context, &argc, &argv, NULL)); -+ -+ test_context = context; -+ -+ init_tests (); -+ -+ return meta_context_test_run_tests (META_CONTEXT_TEST (context), -+ META_TEST_RUN_FLAG_CAN_SKIP); -+} -diff --git a/src/tests/meson.build b/src/tests/meson.build -index 41218e130e..139baad7a1 100644 ---- a/src/tests/meson.build -+++ b/src/tests/meson.build -@@ -634,6 +634,13 @@ kms_test_cases = [ - wayland_test_utils, - ], - }, -+ { -+ 'name': 'drm-lease-monitor', -+ 'suite': 'backends/native', -+ 'sources': [ -+ 'drm-lease-monitor-test.c', -+ ], -+ }, - ] - - privileged_test_cases += kms_test_cases --- -2.49.0 - diff --git a/0003-window-Add-a-MetaWindowConfig-type.patch b/0003-window-Add-a-MetaWindowConfig-type.patch deleted file mode 100644 index cace9e1..0000000 --- a/0003-window-Add-a-MetaWindowConfig-type.patch +++ /dev/null @@ -1,395 +0,0 @@ -From 22e88d1d773bd71a62b70115c6ad5909d3128671 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 1 Oct 2024 15:49:34 +0200 -Subject: [PATCH 03/10] window: Add a MetaWindowConfig type - -This is intended to be used in place of the window rect and fullscreen -flags. - -That will also allow for a pre-configuration signal to be added, passing -the configuration so that a plugin can tweak the configuration before it -gets applied first. - -Part-of: -(cherry picked from commit 7e098ae671d1a580139fa65e18702d56f169082f) ---- - src/core/meta-window-config-private.h | 23 +++ - src/core/meta-window-config.c | 219 ++++++++++++++++++++++++++ - src/meson.build | 2 + - src/meta/meson.build | 1 + - src/meta/meta-window-config.h | 72 +++++++++ - src/meta/types.h | 1 + - 6 files changed, 318 insertions(+) - create mode 100644 src/core/meta-window-config-private.h - create mode 100644 src/core/meta-window-config.c - create mode 100644 src/meta/meta-window-config.h - -diff --git a/src/core/meta-window-config-private.h b/src/core/meta-window-config-private.h -new file mode 100644 -index 0000000000..ea34b69998 ---- /dev/null -+++ b/src/core/meta-window-config-private.h -@@ -0,0 +1,23 @@ -+/* -+ * Copyright (C) 2024 Red Hat Inc. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, see . -+ * -+ */ -+ -+#pragma once -+ -+#include "meta/meta-window-config.h" -+ -+MetaWindowConfig * meta_window_config_initial_new (void); -diff --git a/src/core/meta-window-config.c b/src/core/meta-window-config.c -new file mode 100644 -index 0000000000..74f5aa81f4 ---- /dev/null -+++ b/src/core/meta-window-config.c -@@ -0,0 +1,219 @@ -+/* -+ * Copyright (C) 2024 Red Hat Inc. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, see . -+ * -+ */ -+ -+#include "config.h" -+ -+#include "core/meta-window-config-private.h" -+ -+/** -+ * MetaWindowConfig: -+ * -+ * An object representing the configuration of a top-level window -+ * -+ */ -+struct _MetaWindowConfig -+{ -+ GObject parent; -+ -+ /* Whether this is an initial window configuration, cannot be changed by the callee */ -+ gboolean is_initial; -+ -+ /* The window geometry */ -+ MtkRectangle rect; -+ -+ gboolean is_fullscreen; -+}; -+ -+G_DEFINE_FINAL_TYPE (MetaWindowConfig, meta_window_config, G_TYPE_OBJECT) -+ -+enum -+{ -+ PROP_0, -+ -+ PROP_RECT, -+ PROP_IS_FULLSCREEN, -+ -+ PROP_LAST, -+}; -+ -+static GParamSpec *obj_props[PROP_LAST]; -+ -+static void -+meta_window_config_get_property (GObject *object, -+ guint prop_id, -+ GValue *value, -+ GParamSpec *pspec) -+{ -+ MetaWindowConfig *window_config = META_WINDOW_CONFIG (object); -+ -+ switch (prop_id) -+ { -+ case PROP_RECT: -+ g_value_set_boxed (value, &window_config->rect); -+ break; -+ case PROP_IS_FULLSCREEN: -+ g_value_set_boolean (value, window_config->is_fullscreen); -+ break; -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+meta_window_config_set_property (GObject *object, -+ guint prop_id, -+ const GValue *value, -+ GParamSpec *pspec) -+{ -+ MetaWindowConfig *window_config = META_WINDOW_CONFIG (object); -+ MtkRectangle *rect; -+ -+ switch (prop_id) -+ { -+ case PROP_RECT: -+ rect = g_value_get_boxed (value); -+ window_config->rect = *rect; -+ break; -+ case PROP_IS_FULLSCREEN: -+ window_config->is_fullscreen = g_value_get_boolean (value); -+ break; -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+meta_window_config_class_init (MetaWindowConfigClass *klass) -+{ -+ GObjectClass *object_class = G_OBJECT_CLASS (klass); -+ -+ object_class->get_property = meta_window_config_get_property; -+ object_class->set_property = meta_window_config_set_property; -+ -+ obj_props[PROP_RECT] = -+ g_param_spec_boxed ("rect", NULL, NULL, -+ MTK_TYPE_RECTANGLE, -+ G_PARAM_READWRITE | -+ G_PARAM_STATIC_STRINGS); -+ -+ obj_props[PROP_IS_FULLSCREEN] = -+ g_param_spec_boolean ("is-fullscreen", NULL, NULL, -+ FALSE, -+ G_PARAM_READWRITE | -+ G_PARAM_STATIC_STRINGS); -+ -+ g_object_class_install_properties (object_class, PROP_LAST, obj_props); -+} -+ -+static void -+meta_window_config_init (MetaWindowConfig *window_config) -+{ -+ window_config->rect = MTK_RECTANGLE_INIT (0, 0, 0, 0); -+} -+ -+gboolean -+meta_window_config_get_is_initial (MetaWindowConfig *window_config) -+{ -+ return window_config->is_initial; -+} -+ -+void -+meta_window_config_set_rect (MetaWindowConfig *window_config, -+ MtkRectangle rect) -+{ -+ window_config->rect = rect; -+} -+ -+MtkRectangle -+meta_window_config_get_rect (MetaWindowConfig *window_config) -+{ -+ return window_config->rect; -+} -+ -+void -+meta_window_config_set_is_fullscreen (MetaWindowConfig *window_config, -+ gboolean is_fullscreen) -+{ -+ window_config->is_fullscreen = is_fullscreen; -+} -+ -+void -+meta_window_config_get_position (MetaWindowConfig *window_config, -+ int *x, -+ int *y) -+{ -+ if (x) -+ *x = window_config->rect.x; -+ if (y) -+ *y = window_config->rect.y; -+} -+ -+void -+meta_window_config_set_position (MetaWindowConfig *window_config, -+ int x, -+ int y) -+{ -+ window_config->rect.x = x; -+ window_config->rect.y = y; -+} -+ -+void -+meta_window_config_get_size (MetaWindowConfig *window_config, -+ int *width, -+ int *height) -+{ -+ if (width) -+ *width = window_config->rect.width; -+ if (height) -+ *height = window_config->rect.height; -+} -+ -+void -+meta_window_config_set_size (MetaWindowConfig *window_config, -+ int width, -+ int height) -+{ -+ window_config->rect.width = width; -+ window_config->rect.height = height; -+} -+ -+gboolean -+meta_window_config_get_is_fullscreen (MetaWindowConfig *window_config) -+{ -+ return window_config->is_fullscreen; -+} -+ -+MetaWindowConfig * -+meta_window_config_new (void) -+{ -+ return g_object_new (META_TYPE_WINDOW_CONFIG, -+ NULL); -+} -+ -+MetaWindowConfig * -+meta_window_config_initial_new (void) -+{ -+ MetaWindowConfig *window_config; -+ -+ window_config = meta_window_config_new (); -+ window_config->is_initial = TRUE; -+ -+ return window_config; -+} -diff --git a/src/meson.build b/src/meson.build -index e3c92aaf27..cd47e10b98 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -377,6 +377,8 @@ mutter_sources = [ - 'core/meta-sound-player.c', - 'core/meta-tablet-action-mapper.c', - 'core/meta-tool-action-mapper.c', -+ 'core/meta-window-config.c', -+ 'core/meta-window-config-private.h', - 'core/meta-workspace-manager.c', - 'core/meta-workspace-manager-private.h', - 'core/place.c', -diff --git a/src/meta/meson.build b/src/meta/meson.build -index 388b756682..bc9b82c8e1 100644 ---- a/src/meta/meson.build -+++ b/src/meta/meson.build -@@ -40,6 +40,7 @@ mutter_public_headers = [ - 'meta-stage.h', - 'meta-startup-notification.h', - 'meta-window-actor.h', -+ 'meta-window-config.h', - 'meta-window-group.h', - 'meta-workspace-manager.h', - 'prefs.h', -diff --git a/src/meta/meta-window-config.h b/src/meta/meta-window-config.h -new file mode 100644 -index 0000000000..4e9d8ad3c3 ---- /dev/null -+++ b/src/meta/meta-window-config.h -@@ -0,0 +1,72 @@ -+/* -+ * Copyright (C) 2024 Red Hat Inc. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, see . -+ * -+ */ -+ -+#pragma once -+ -+#include -+ -+#include "meta/common.h" -+ -+#define META_TYPE_WINDOW_CONFIG (meta_window_config_get_type ()) -+ -+META_EXPORT -+G_DECLARE_FINAL_TYPE (MetaWindowConfig, -+ meta_window_config, -+ META, -+ WINDOW_CONFIG, -+ GObject) -+ -+META_EXPORT -+MetaWindowConfig *meta_window_config_new (void); -+ -+META_EXPORT -+gboolean meta_window_config_get_is_initial (MetaWindowConfig *window_config); -+ -+META_EXPORT -+void meta_window_config_set_rect (MetaWindowConfig *window_config, -+ MtkRectangle rect); -+ -+META_EXPORT -+MtkRectangle meta_window_config_get_rect (MetaWindowConfig *window_config); -+ -+META_EXPORT -+void meta_window_config_get_position (MetaWindowConfig *window_config, -+ int *x, -+ int *y); -+ -+META_EXPORT -+void meta_window_config_set_position (MetaWindowConfig *window_config, -+ int x, -+ int y); -+ -+META_EXPORT -+void meta_window_config_get_size (MetaWindowConfig *window_config, -+ int *width, -+ int *height); -+ -+META_EXPORT -+void meta_window_config_set_size (MetaWindowConfig *window_config, -+ int width, -+ int height); -+ -+META_EXPORT -+void meta_window_config_set_is_fullscreen (MetaWindowConfig *window_config, -+ gboolean is_fullscreen); -+ -+META_EXPORT -+gboolean meta_window_config_get_is_fullscreen (MetaWindowConfig *window_config); -diff --git a/src/meta/types.h b/src/meta/types.h -index 437ae609e2..cf7432ec48 100644 ---- a/src/meta/types.h -+++ b/src/meta/types.h -@@ -36,3 +36,4 @@ typedef struct _MetaSettings MetaSettings; - typedef struct _MetaWorkspaceManager MetaWorkspaceManager; - typedef struct _MetaSelection MetaSelection; - typedef struct _MetaDebugControl MetaDebugControl; -+typedef struct _MetaWindowConfig MetaWindowConfig; --- -2.49.0 - diff --git a/0004-kms-connector-Rename-meta_kms_connector_is_for_lease.patch b/0004-kms-connector-Rename-meta_kms_connector_is_for_lease.patch deleted file mode 100644 index 100ab70..0000000 --- a/0004-kms-connector-Rename-meta_kms_connector_is_for_lease.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 63b7d958f226b05694eeeed7d1a7bc77d84464ae Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Tue, 29 Oct 2024 12:09:21 +0100 -Subject: [PATCH 4/5] kms/connector: Rename meta_kms_connector_is_for_lease() - -Now that connectors can be configured as for lease, rename the function -to meta_kms_connector_is_non_desktop() to make clear that it returns -the hardware configuration rather than the user configuration. - -Part-of: ---- - src/backends/native/meta-drm-lease.c | 4 ++-- - src/backends/native/meta-gpu-kms.c | 2 +- - src/backends/native/meta-kms-connector.c | 2 +- - src/backends/native/meta-kms-connector.h | 2 +- - 4 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/src/backends/native/meta-drm-lease.c b/src/backends/native/meta-drm-lease.c -index 7cddb6c8ed..302147e9bb 100644 ---- a/src/backends/native/meta-drm-lease.c -+++ b/src/backends/native/meta-drm-lease.c -@@ -227,7 +227,7 @@ find_resources_to_lease (MetaDrmLeaseManager *lease_manager, - MetaKmsDevice *connector_device; - - if (!g_list_find (available_connectors, connector) || -- !meta_kms_connector_is_for_lease (connector)) -+ !meta_kms_connector_is_non_desktop (connector)) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - "Failed to find connector %u (%s)", -@@ -645,7 +645,7 @@ update_connectors (MetaDrmLeaseManager *lease_manager, - kms_connector = o->data; - lease = NULL; - -- if (!meta_kms_connector_is_for_lease (kms_connector)) -+ if (!meta_kms_connector_is_non_desktop (kms_connector)) - continue; - - if (g_list_find (lease_manager->connectors, kms_connector)) -diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c -index 3b4356ca6b..c633d6d68e 100644 ---- a/src/backends/native/meta-gpu-kms.c -+++ b/src/backends/native/meta-gpu-kms.c -@@ -355,7 +355,7 @@ init_outputs (MetaGpuKms *gpu_kms) - if (!meta_kms_connector_get_current_state (kms_connector)) - continue; - -- if (meta_kms_connector_is_for_lease (kms_connector)) -+ if (meta_kms_connector_is_non_desktop (kms_connector)) - continue; - - old_output = -diff --git a/src/backends/native/meta-kms-connector.c b/src/backends/native/meta-kms-connector.c -index cc6cd89f56..7723416aa3 100644 ---- a/src/backends/native/meta-kms-connector.c -+++ b/src/backends/native/meta-kms-connector.c -@@ -165,7 +165,7 @@ meta_kms_connector_get_current_state (MetaKmsConnector *connector) - } - - gboolean --meta_kms_connector_is_for_lease (MetaKmsConnector *connector) -+meta_kms_connector_is_non_desktop (MetaKmsConnector *connector) - { - const char *lease_connectors_str; - -diff --git a/src/backends/native/meta-kms-connector.h b/src/backends/native/meta-kms-connector.h -index 84ee7f5c26..328465d0fa 100644 ---- a/src/backends/native/meta-kms-connector.h -+++ b/src/backends/native/meta-kms-connector.h -@@ -102,4 +102,4 @@ MetaKmsMode * meta_kms_connector_get_preferred_mode (MetaKmsConnector *connector - META_EXPORT_TEST - const MetaKmsConnectorState * meta_kms_connector_get_current_state (MetaKmsConnector *connector); - --gboolean meta_kms_connector_is_for_lease (MetaKmsConnector *connector); -+gboolean meta_kms_connector_is_non_desktop (MetaKmsConnector *connector); --- -2.48.1 - diff --git a/0004-output-Add-pause-resume-signals.patch b/0004-output-Add-pause-resume-signals.patch deleted file mode 100644 index 0b2ded6..0000000 --- a/0004-output-Add-pause-resume-signals.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 96d4ce647bd73095a5b0789d224271a912582f21 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 31 Mar 2025 14:55:45 +0200 -Subject: [PATCH 4/5] output: Add pause/resume signals -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -These gets signalled when the logind session becomes inactive/active, -e.g. VT switches. - -Part-of: -(cherry picked from commit 288168f7f73ee84208500fe5e6bda6e9cdbc3a39) ---- - src/backends/native/meta-backend-native.c | 29 +++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c -index 85bfeb7810..b81b53d29e 100644 ---- a/src/backends/native/meta-backend-native.c -+++ b/src/backends/native/meta-backend-native.c -@@ -79,6 +79,16 @@ enum - - static GParamSpec *obj_props[N_PROPS]; - -+enum -+{ -+ PAUSE, -+ RESUME, -+ -+ N_SIGNALS -+}; -+ -+static guint signals[N_SIGNALS]; -+ - typedef struct _MetaBackendNativePrivate - { - MetaBackend parent; -@@ -869,6 +879,21 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass) - G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS); - g_object_class_install_properties (object_class, N_PROPS, obj_props); -+ -+ signals[PAUSE] = -+ g_signal_new ("pause", -+ G_TYPE_FROM_CLASS (klass), -+ G_SIGNAL_RUN_LAST, -+ 0, -+ NULL, NULL, NULL, -+ G_TYPE_NONE, 0); -+ signals[RESUME] = -+ g_signal_new ("resume", -+ G_TYPE_FROM_CLASS (klass), -+ G_SIGNAL_RUN_LAST, -+ 0, -+ NULL, NULL, NULL, -+ G_TYPE_NONE, 0); - } - - static void -@@ -961,6 +986,8 @@ meta_backend_native_pause (MetaBackendNative *backend_native) - COGL_TRACE_BEGIN_SCOPED (MetaBackendNativePause, - "Meta::BackendNative::pause()"); - -+ g_signal_emit (backend_native, signals[PAUSE], 0); -+ - meta_seat_native_release_devices (seat); - meta_renderer_pause (renderer); - meta_udev_pause (priv->udev); -@@ -1004,6 +1031,8 @@ void meta_backend_native_resume (MetaBackendNative *native) - meta_input_settings_maybe_restore_numlock_state (input_settings); - - clutter_seat_ensure_a11y_state (CLUTTER_SEAT (seat)); -+ -+ g_signal_emit (native, signals[RESUME], 0); - } - - static MetaRenderDevice * --- -2.49.0 - diff --git a/0004-window-Use-the-fullscreen-API.patch b/0004-window-Use-the-fullscreen-API.patch deleted file mode 100644 index ea49ba0..0000000 --- a/0004-window-Use-the-fullscreen-API.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 83124a7df40d08b7731842a866adb7249cd44d13 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Fri, 25 Oct 2024 16:46:40 +0200 -Subject: [PATCH 04/10] window: Use the fullscreen API - -Use the meta_window_is_fullscreen() API instead of accessing the -fullscreen field of the MetaWindow structure directly. - -This is both a (small) cleanup and preparation work for the next commit. - -No function change (intended). - -Part-of: -(cherry picked from commit a7ef0b137e194f970975e2653e89630df260348f) ---- - src/core/window.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/core/window.c b/src/core/window.c -index 1782c884fa..d803fbdc1d 100644 ---- a/src/core/window.c -+++ b/src/core/window.c -@@ -368,7 +368,7 @@ meta_window_get_property(GObject *object, - g_value_set_boolean (value, win->decorated); - break; - case PROP_FULLSCREEN: -- g_value_set_boolean (value, win->fullscreen); -+ g_value_set_boolean (value, meta_window_is_fullscreen (win)); - break; - case PROP_MAXIMIZED_HORIZONTALLY: - g_value_set_boolean (value, win->maximized_horizontally); --- -2.49.0 - diff --git a/0005-drm-lease-Treat-connectors-as-unleasable-when-inacti.patch b/0005-drm-lease-Treat-connectors-as-unleasable-when-inacti.patch deleted file mode 100644 index fab2f19..0000000 --- a/0005-drm-lease-Treat-connectors-as-unleasable-when-inacti.patch +++ /dev/null @@ -1,171 +0,0 @@ -From d4f941a053b07b988b79b9f75b2300cadaaf9940 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 31 Mar 2025 15:02:23 +0200 -Subject: [PATCH 5/5] drm-lease: Treat connectors as unleasable when inactive -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When inactive (logind session no longer active, e.g. VT switched to -another user, no longer DRM master) mutter stays dormant and doesn't -try to reconfigure outputs on hotplug events, among other things. That -means we also shouldn't keep leases active, or connectors leasible, when -not active, since dependent state are not kept up to date. - -Address this by, treat all connectors as not leasable when inactive, -which effectively means leases are revoked. - -This fixes a crash when monitors are hot plugged in a certain way when -the session is inactive, which an added test case tests. - -Part-of: -(cherry picked from commit eec0f21e40e4319b24f16eb4f97c783b4f559a3e) ---- - src/backends/native/meta-drm-lease.c | 36 ++++++++++++++++++++++++++++ - src/tests/drm-lease-monitor-test.c | 17 +++++++++++++ - 2 files changed, 53 insertions(+) - -diff --git a/src/backends/native/meta-drm-lease.c b/src/backends/native/meta-drm-lease.c -index c6bd2d7380..6f0c64dae5 100644 ---- a/src/backends/native/meta-drm-lease.c -+++ b/src/backends/native/meta-drm-lease.c -@@ -15,6 +15,8 @@ - * along with this program; if not, see . - */ - -+#include "backends/native/meta-backend-native-types.h" -+#include "backends/native/meta-backend-native.h" - #include "config.h" - - #include "backends/native/meta-drm-lease.h" -@@ -71,6 +73,8 @@ struct _MetaDrmLeaseManager - gulong resources_changed_handler_id; - gulong lease_changed_handler_id; - gulong monitors_changed_handler_id; -+ gulong backend_pause_handler_id; -+ gulong backend_resume_handler_id; - - /* MetaKmsDevice *kms_device */ - GList *devices; -@@ -84,6 +88,8 @@ struct _MetaDrmLeaseManager - * Value: MetaDrmLease *lease - */ - GHashTable *leased_connectors; -+ -+ gboolean is_paused; - }; - - G_DEFINE_TYPE (MetaDrmLeaseManager, meta_drm_lease_manager, G_TYPE_OBJECT) -@@ -665,6 +671,9 @@ update_connectors (MetaDrmLeaseManager *lease_manager, - new_leased_connectors = - g_hash_table_new_similar (lease_manager->leased_connectors); - -+ if (lease_manager->is_paused) -+ goto scanned_resources; -+ - for (l = meta_kms_get_devices (kms); l; l = l->next) - { - MetaKmsDevice *kms_device = l->data; -@@ -697,6 +706,8 @@ update_connectors (MetaDrmLeaseManager *lease_manager, - } - } - -+scanned_resources: -+ - g_hash_table_iter_init (&iter, lease_manager->leased_connectors); - while (g_hash_table_iter_next (&iter, (gpointer *)&kms_connector, NULL)) - { -@@ -862,6 +873,21 @@ on_lease_changed (MetaKms *kms, - update_leases (lease_manager); - } - -+static void -+on_pause (MetaBackendNative *backend_native, -+ MetaDrmLeaseManager *lease_manager) -+{ -+ lease_manager->is_paused = TRUE; -+ update_resources (lease_manager); -+} -+ -+static void -+on_resume (MetaBackendNative *backend_native, -+ MetaDrmLeaseManager *lease_manager) -+{ -+ lease_manager->is_paused = FALSE; -+} -+ - static void - meta_drm_lease_manager_constructed (GObject *object) - { -@@ -870,6 +896,7 @@ meta_drm_lease_manager_constructed (GObject *object) - MetaBackend *backend = meta_kms_get_backend (kms); - MetaMonitorManager *monitor_manager = - meta_backend_get_monitor_manager (backend); -+ MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend); - - /* Connect to MetaKms::resources-changed using G_CONNECT_AFTER to make sure - * MetaMonitorManager state is up to date. */ -@@ -885,6 +912,10 @@ meta_drm_lease_manager_constructed (GObject *object) - g_signal_connect_swapped (monitor_manager, "monitors-changed-internal", - G_CALLBACK (update_resources), - lease_manager); -+ lease_manager->backend_pause_handler_id = -+ g_signal_connect (backend_native, "pause", G_CALLBACK (on_pause), lease_manager); -+ lease_manager->backend_resume_handler_id = -+ g_signal_connect (backend_native, "resume", G_CALLBACK (on_resume), lease_manager); - - lease_manager->leases = - g_hash_table_new_full (NULL, NULL, -@@ -939,11 +970,16 @@ meta_drm_lease_manager_dispose (GObject *object) - MetaBackend *backend = meta_kms_get_backend (kms); - MetaMonitorManager *monitor_manager = - meta_backend_get_monitor_manager (backend); -+ MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend); - - g_clear_signal_handler (&lease_manager->resources_changed_handler_id, kms); - g_clear_signal_handler (&lease_manager->lease_changed_handler_id, kms); - g_clear_signal_handler (&lease_manager->monitors_changed_handler_id, - monitor_manager); -+ g_clear_signal_handler (&lease_manager->backend_pause_handler_id, -+ backend_native); -+ g_clear_signal_handler (&lease_manager->backend_resume_handler_id, -+ backend_native); - - g_list_free_full (g_steal_pointer (&lease_manager->devices), g_object_unref); - g_list_free_full (g_steal_pointer (&lease_manager->connectors), -diff --git a/src/tests/drm-lease-monitor-test.c b/src/tests/drm-lease-monitor-test.c -index d35f5ba83a..9451036c44 100644 ---- a/src/tests/drm-lease-monitor-test.c -+++ b/src/tests/drm-lease-monitor-test.c -@@ -78,11 +78,28 @@ test_drm_lease_lease_suspend_resume (void) - fake_udev_hotplug (); - } - -+static void -+test_drm_lease_lease_suspend_no_resume (void) -+{ -+ MetaBackend *backend = meta_context_get_backend (test_context); -+ MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend); -+ -+ drm_mock_set_resource_filter (DRM_MOCK_CALL_FILTER_GET_CONNECTOR, -+ disconnect_connector_filter, NULL); -+ fake_udev_hotplug (); -+ meta_backend_native_pause (backend_native); -+ -+ drm_mock_unset_resource_filter (DRM_MOCK_CALL_FILTER_GET_CONNECTOR); -+ fake_udev_hotplug (); -+} -+ - static void - init_tests (void) - { - g_test_add_func ("/wayland/drm-lease/suspend-resume", - test_drm_lease_lease_suspend_resume); -+ g_test_add_func ("/wayland/drm-lease/suspend-no-resume", -+ test_drm_lease_lease_suspend_no_resume); - } - - int --- -2.49.0 - diff --git a/0005-native-drm-lease-Handle-monitors-configured-for-leas.patch b/0005-native-drm-lease-Handle-monitors-configured-for-leas.patch deleted file mode 100644 index 4c5482c..0000000 --- a/0005-native-drm-lease-Handle-monitors-configured-for-leas.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 55910e467f42ce9d6e761afd8f50110cb1cc3164 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= -Date: Mon, 28 Oct 2024 08:54:45 +0100 -Subject: [PATCH 5/5] native/drm-lease: Handle monitors configured for lease - -Follow the configuration stored in MetaMonitor and make connectors -configured as for lease available to Wayland clients. - -Part-of: ---- - src/backends/native/meta-drm-lease.c | 45 ++++++++++++++++++++++++++-- - 1 file changed, 43 insertions(+), 2 deletions(-) - -diff --git a/src/backends/native/meta-drm-lease.c b/src/backends/native/meta-drm-lease.c -index 302147e9bb..582f869b3b 100644 ---- a/src/backends/native/meta-drm-lease.c -+++ b/src/backends/native/meta-drm-lease.c -@@ -21,12 +21,14 @@ - - #include - -+#include "backends/meta-logical-monitor.h" - #include "backends/native/meta-crtc-kms.h" - #include "backends/native/meta-kms.h" - #include "backends/native/meta-kms-connector.h" - #include "backends/native/meta-kms-crtc-private.h" - #include "backends/native/meta-kms-device.h" - #include "backends/native/meta-kms-plane.h" -+#include "backends/native/meta-output-kms.h" - - enum - { -@@ -68,6 +70,7 @@ struct _MetaDrmLeaseManager - - gulong resources_changed_handler_id; - gulong lease_changed_handler_id; -+ gulong monitors_changed_handler_id; - - /* MetaKmsDevice *kms_device */ - GList *devices; -@@ -179,6 +182,32 @@ find_plane_to_lease (MetaKmsCrtc *kms_crtc, - return NULL; - } - -+static gboolean -+is_connector_configured_for_lease (MetaKmsConnector *connector) -+{ -+ const MetaKmsConnectorState *connector_state; -+ MetaOutputKms *output_kms; -+ MetaMonitor *monitor; -+ -+ connector_state = meta_kms_connector_get_current_state (connector); -+ if (!connector_state) -+ return FALSE; -+ -+ output_kms = meta_output_kms_from_kms_connector (connector); -+ if (!output_kms) -+ return FALSE; -+ -+ monitor = meta_output_get_monitor (META_OUTPUT (output_kms)); -+ return meta_monitor_is_for_lease (monitor); -+} -+ -+static gboolean -+is_connector_for_lease (MetaKmsConnector *connector) -+{ -+ return meta_kms_connector_is_non_desktop (connector) || -+ is_connector_configured_for_lease (connector); -+} -+ - static gboolean - find_resources_to_lease (MetaDrmLeaseManager *lease_manager, - MetaKmsDevice *kms_device, -@@ -227,7 +256,7 @@ find_resources_to_lease (MetaDrmLeaseManager *lease_manager, - MetaKmsDevice *connector_device; - - if (!g_list_find (available_connectors, connector) || -- !meta_kms_connector_is_non_desktop (connector)) -+ !is_connector_for_lease (connector)) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - "Failed to find connector %u (%s)", -@@ -645,7 +674,7 @@ update_connectors (MetaDrmLeaseManager *lease_manager, - kms_connector = o->data; - lease = NULL; - -- if (!meta_kms_connector_is_non_desktop (kms_connector)) -+ if (!is_connector_for_lease (kms_connector)) - continue; - - if (g_list_find (lease_manager->connectors, kms_connector)) -@@ -845,6 +874,9 @@ meta_drm_lease_manager_constructed (GObject *object) - { - MetaDrmLeaseManager *lease_manager = META_DRM_LEASE_MANAGER (object); - MetaKms *kms = lease_manager->kms; -+ MetaBackend *backend = meta_kms_get_backend (kms); -+ MetaMonitorManager *monitor_manager = -+ meta_backend_get_monitor_manager (backend); - - lease_manager->resources_changed_handler_id = - g_signal_connect (kms, "resources-changed", -@@ -854,6 +886,10 @@ meta_drm_lease_manager_constructed (GObject *object) - g_signal_connect (kms, "lease-changed", - G_CALLBACK (on_lease_changed), - lease_manager); -+ lease_manager->monitors_changed_handler_id = -+ g_signal_connect_swapped (monitor_manager, "monitors-changed-internal", -+ G_CALLBACK (update_resources), -+ lease_manager); - - lease_manager->leases = - g_hash_table_new_full (NULL, NULL, -@@ -905,9 +941,14 @@ meta_drm_lease_manager_dispose (GObject *object) - { - MetaDrmLeaseManager *lease_manager = META_DRM_LEASE_MANAGER (object); - MetaKms *kms = lease_manager->kms; -+ MetaBackend *backend = meta_kms_get_backend (kms); -+ MetaMonitorManager *monitor_manager = -+ meta_backend_get_monitor_manager (backend); - - g_clear_signal_handler (&lease_manager->resources_changed_handler_id, kms); - g_clear_signal_handler (&lease_manager->lease_changed_handler_id, kms); -+ g_clear_signal_handler (&lease_manager->monitors_changed_handler_id, -+ monitor_manager); - - g_list_free_full (g_steal_pointer (&lease_manager->devices), g_object_unref); - g_list_free_full (g_steal_pointer (&lease_manager->connectors), --- -2.48.1 - diff --git a/0005-window-Use-the-MetaWindowConfig.patch b/0005-window-Use-the-MetaWindowConfig.patch deleted file mode 100644 index aeaff6a..0000000 --- a/0005-window-Use-the-MetaWindowConfig.patch +++ /dev/null @@ -1,1068 +0,0 @@ -From d770ad9a7062dfac12a7e8e97219f112dcd08b59 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Mon, 21 Oct 2024 11:11:32 +0200 -Subject: [PATCH 05/10] window: Use the MetaWindowConfig - -This is a fairly large refactoring to replace the window rect and -fullscreen flag with the new MetaWindowConfig object. - -No functional change intended at this point. - -Part-of: -(cherry picked from commit 4c20584b11cab3561c93db64960774f5c8cc2372) ---- - src/compositor/compositor.c | 4 +- - src/compositor/meta-window-actor-wayland.c | 6 +- - src/compositor/meta-window-drag.c | 7 +- - src/core/constraints.c | 16 ++-- - src/core/window-private.h | 8 +- - src/core/window.c | 76 +++++++++++------- - src/tests/wayland-unit-tests.c | 22 ++++-- - .../meta-wayland-window-configuration.c | 6 +- - src/wayland/meta-wayland-xdg-session-state.c | 8 +- - src/wayland/meta-wayland-xdg-shell.c | 4 +- - src/wayland/meta-window-wayland.c | 77 ++++++++++--------- - src/wayland/meta-xwayland-dnd.c | 2 +- - src/x11/meta-x11-frame.c | 2 +- - src/x11/window-props.c | 10 ++- - src/x11/window-x11.c | 52 +++++++------ - 15 files changed, 176 insertions(+), 124 deletions(-) - -diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c -index deac79f915..c9ec062d14 100644 ---- a/src/compositor/compositor.c -+++ b/src/compositor/compositor.c -@@ -1376,11 +1376,13 @@ meta_compositor_flash_window (MetaCompositor *compositor, - CLUTTER_ACTOR (meta_window_actor_from_window (window)); - ClutterActor *flash; - ClutterTransition *transition; -+ int width, height; - - flash = clutter_actor_new (); - clutter_actor_set_accessible_name (flash, "Flash actor"); - clutter_actor_set_background_color (flash, &COGL_COLOR_INIT (0, 0, 0, 255)); -- clutter_actor_set_size (flash, window->rect.width, window->rect.height); -+ meta_window_config_get_size (window->config, &width, &height); -+ clutter_actor_set_size (flash, width, height); - clutter_actor_set_position (flash, - window->custom_frame_extents.left, - window->custom_frame_extents.top); -diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c -index 2af094e340..b2254df6e8 100644 ---- a/src/compositor/meta-window-actor-wayland.c -+++ b/src/compositor/meta-window-actor-wayland.c -@@ -548,6 +548,7 @@ maybe_configure_black_background (MetaWindowActorWayland *self, - ClutterActorIter iter; - float max_width = 0; - float max_height = 0; -+ int width, height; - - if (!meta_window_wayland_is_acked_fullscreen (META_WINDOW_WAYLAND (window))) - return FALSE; -@@ -584,8 +585,9 @@ maybe_configure_black_background (MetaWindowActorWayland *self, - - *surfaces_width = max_width; - *surfaces_height = max_height; -- *background_width = window->rect.width / geometry_scale; -- *background_height = window->rect.height / geometry_scale; -+ meta_window_config_get_size (window->config, &width, &height); -+ *background_width = width / geometry_scale; -+ *background_height = height / geometry_scale; - return TRUE; - } - -diff --git a/src/compositor/meta-window-drag.c b/src/compositor/meta-window-drag.c -index 2638da59d3..04391b6130 100644 ---- a/src/compositor/meta-window-drag.c -+++ b/src/compositor/meta-window-drag.c -@@ -891,9 +891,6 @@ process_keyboard_resize_grab (MetaWindowDrag *window_drag, - if (process_keyboard_resize_grab_op_change (window_drag, window, event)) - return TRUE; - -- width = window->rect.width; -- height = window->rect.height; -- - meta_window_get_frame_rect (window, &frame_rect); - width = frame_rect.width; - height = frame_rect.height; -@@ -1599,6 +1596,7 @@ maybe_maximize_tiled_window (MetaWindow *window) - { - MtkRectangle work_area; - gint shake_threshold; -+ int width; - - if (!meta_window_is_tiled_side_by_side (window)) - return; -@@ -1608,7 +1606,8 @@ maybe_maximize_tiled_window (MetaWindow *window) - meta_window_get_work_area_for_monitor (window, - window->tile_monitor_number, - &work_area); -- if (window->rect.width >= work_area.width - shake_threshold) -+ meta_window_config_get_size (window->config, &width, NULL); -+ if (width >= work_area.width - shake_threshold) - meta_window_maximize (window, META_MAXIMIZE_BOTH); - } - -diff --git a/src/core/constraints.c b/src/core/constraints.c -index 200da009db..9c287c668d 100644 ---- a/src/core/constraints.c -+++ b/src/core/constraints.c -@@ -560,10 +560,12 @@ place_window_if_needed (MetaWindow *window, - MtkRectangle placed_rect; - MetaWorkspace *cur_workspace; - MetaLogicalMonitor *logical_monitor; -+ int x, y; - -+ meta_window_config_get_position (window->config, &x, &y); - placed_rect = (MtkRectangle) { -- .x = window->rect.x, -- .y = window->rect.y, -+ .x = x, -+ .y = y, - .width = info->current.width, - .height = info->current.height - }; -@@ -897,6 +899,7 @@ constrain_custom_rule (MetaWindow *window, - gboolean constraint_satisfied; - MtkRectangle temporary_rect; - MtkRectangle adjusted_unconstrained; -+ MtkRectangle parent_rect; - int adjusted_rel_x; - int adjusted_rel_y; - MetaPlacementRule current_rule; -@@ -911,10 +914,11 @@ constrain_custom_rule (MetaWindow *window, - return TRUE; - - parent = meta_window_get_transient_for (window); -+ parent_rect = meta_window_config_get_rect (parent->config); - if (window->placement.state == META_PLACEMENT_STATE_CONSTRAINED_FINISHED) - { -- placement_rule->parent_rect.x = parent->rect.x; -- placement_rule->parent_rect.y = parent->rect.y; -+ placement_rule->parent_rect.x = parent_rect.x; -+ placement_rule->parent_rect.y = parent_rect.y; - } - parent_x = placement_rule->parent_rect.x; - parent_y = placement_rule->parent_rect.y; -@@ -938,8 +942,8 @@ constrain_custom_rule (MetaWindow *window, - case META_PLACEMENT_STATE_CONSTRAINED_FINISHED: - case META_PLACEMENT_STATE_INVALIDATED: - temporary_rect = (MtkRectangle) { -- .x = parent->rect.x + window->placement.current.rel_x, -- .y = parent->rect.y + window->placement.current.rel_y, -+ .x = parent_rect.x + window->placement.current.rel_x, -+ .y = parent_rect.y + window->placement.current.rel_y, - .width = info->current.width, - .height = info->current.height, - }; -diff --git a/src/core/window-private.h b/src/core/window-private.h -index 856ce53c17..a03b156d67 100644 ---- a/src/core/window-private.h -+++ b/src/core/window-private.h -@@ -38,6 +38,7 @@ - #include "meta/meta-close-dialog.h" - #include "meta/util.h" - #include "meta/window.h" -+#include "meta/meta-window-config.h" - #include "wayland/meta-wayland-types.h" - - typedef struct _MetaWindowQueue MetaWindowQueue; -@@ -311,8 +312,8 @@ struct _MetaWindow - * comment at the top of meta_window_move_resize_internal() for more - * information. */ - -- /* The current window geometry of the window. */ -- MtkRectangle rect; -+ /* The current configuration of the window. */ -+ MetaWindowConfig *config; - - /* The geometry to restore when we unmaximize. */ - MtkRectangle saved_rect; -@@ -401,9 +402,6 @@ struct _MetaWindow - * that to toggle between normal/tiled or maximized/tiled states. */ - guint saved_maximize : 1; - -- /* Whether we're fullscreen */ -- guint fullscreen : 1; -- - /* Whether the window is marked as urgent */ - guint urgent : 1; - -diff --git a/src/core/window.c b/src/core/window.c -index d803fbdc1d..e9c005aeca 100644 ---- a/src/core/window.c -+++ b/src/core/window.c -@@ -331,6 +331,8 @@ meta_window_finalize (GObject *object) - g_clear_pointer (&window->preferred_logical_monitor, - meta_logical_monitor_id_free); - -+ g_clear_object (&window->config); -+ - g_free (window->startup_id); - g_free (window->role); - g_free (window->res_class); -@@ -1021,6 +1023,7 @@ meta_window_constructed (GObject *object) - MetaContext *context = meta_display_get_context (display); - MetaBackend *backend = meta_context_get_backend (context); - MetaWorkspaceManager *workspace_manager = display->workspace_manager; -+ MtkRectangle frame_rect; - - COGL_TRACE_BEGIN_SCOPED (MetaWindowSharedInit, - "Meta::Window::constructed()"); -@@ -1041,9 +1044,10 @@ meta_window_constructed (GObject *object) - meta_window_set_normal_hints (window, NULL); - - /* And this is our unmaximized size */ -- window->saved_rect = window->rect; -- window->saved_rect_fullscreen = window->rect; -- window->unconstrained_rect = window->rect; -+ frame_rect = meta_window_config_get_rect (window->config); -+ window->saved_rect = frame_rect; -+ window->saved_rect_fullscreen = frame_rect; -+ window->unconstrained_rect = frame_rect; - - window->title = NULL; - -@@ -1055,7 +1059,7 @@ meta_window_constructed (GObject *object) - window->maximize_horizontally_after_placement = FALSE; - window->maximize_vertically_after_placement = FALSE; - window->minimize_after_placement = FALSE; -- window->fullscreen = FALSE; -+ meta_window_config_set_is_fullscreen (window->config, FALSE); - window->require_fully_onscreen = TRUE; - window->require_on_single_monitor = TRUE; - window->require_titlebar_visible = TRUE; -@@ -1133,7 +1137,7 @@ meta_window_constructed (GObject *object) - - window->compositor_private = NULL; - -- if (window->rect.width > 0 && window->rect.height > 0) -+ if (frame_rect.width > 0 && frame_rect.height > 0) - { - window->monitor = meta_window_find_monitor_from_frame_rect (window); - window->highest_scale_monitor = -@@ -2076,6 +2080,7 @@ window_would_mostly_be_covered_by_always_above_window (MetaWindow *window) - GList *l; - g_autoptr (MtkRegion) region = NULL; - int window_area, intersection_area, visible_area; -+ MtkRectangle frame_rect; - - region = mtk_region_create (); - windows = meta_workspace_list_windows (workspace); -@@ -2083,13 +2088,15 @@ window_would_mostly_be_covered_by_always_above_window (MetaWindow *window) - { - MetaWindow *other_window = l->data; - -+ frame_rect = meta_window_config_get_rect (other_window->config); - if (other_window->wm_state_above && other_window != window) -- mtk_region_union_rectangle (region, &other_window->rect); -+ mtk_region_union_rectangle (region, &frame_rect); - } - -- window_area = window->rect.width * window->rect.height; -+ frame_rect = meta_window_config_get_rect (window->config); -+ window_area = frame_rect.width * frame_rect.height; - -- mtk_region_intersect_rectangle (region, &window->rect); -+ mtk_region_intersect_rectangle (region, &frame_rect); - intersection_area = calculate_region_area (region); - visible_area = window_area - intersection_area; - -@@ -2333,10 +2340,12 @@ meta_window_show (MetaWindow *window) - window->has_maximize_func) - { - MtkRectangle work_area; -+ MtkRectangle frame_rect; - int window_area; - int work_area_area; - -- window_area = window->rect.width * window->rect.height; -+ frame_rect = meta_window_config_get_rect (window->config); -+ window_area = frame_rect.width * frame_rect.height; - meta_window_get_work_area_current_monitor (window, &work_area); - work_area_area = work_area.width * work_area.height; - -@@ -2699,16 +2708,19 @@ meta_window_save_rect (MetaWindow *window) - meta_window_is_tiled_side_by_side (window) || - meta_window_is_fullscreen (window))) - { -+ MtkRectangle frame_rect; -+ -+ frame_rect = meta_window_config_get_rect (window->config); - /* save size/pos as appropriate args for move_resize */ - if (!window->maximized_horizontally) - { -- window->saved_rect.x = window->rect.x; -- window->saved_rect.width = window->rect.width; -+ window->saved_rect.x = frame_rect.x; -+ window->saved_rect.width = frame_rect.width; - } - if (!window->maximized_vertically) - { -- window->saved_rect.y = window->rect.y; -- window->saved_rect.height = window->rect.height; -+ window->saved_rect.y = frame_rect.y; -+ window->saved_rect.height = frame_rect.height; - } - } - } -@@ -2860,7 +2872,7 @@ meta_window_is_maximized (MetaWindow *window) - gboolean - meta_window_is_fullscreen (MetaWindow *window) - { -- return window->fullscreen; -+ return meta_window_config_get_is_fullscreen (window->config); - } - - /** -@@ -3192,7 +3204,7 @@ unmaximize_window_before_freeing (MetaWindow *window) - - if (window->withdrawn) /* See bug #137185 */ - { -- window->rect = window->saved_rect; -+ meta_window_config_set_rect (window->config, window->saved_rect); - set_net_wm_state (window); - } - #ifdef HAVE_WAYLAND -@@ -3403,9 +3415,9 @@ meta_window_make_fullscreen_internal (MetaWindow *window) - meta_topic (META_DEBUG_WINDOW_OPS, - "Fullscreening %s", window->desc); - -- window->saved_rect_fullscreen = window->rect; -+ window->saved_rect_fullscreen = meta_window_config_get_rect (window->config); - -- window->fullscreen = TRUE; -+ meta_window_config_set_is_fullscreen (window->config, TRUE); - - meta_stack_freeze (window->display->stack); - -@@ -3463,7 +3475,7 @@ meta_window_unmake_fullscreen (MetaWindow *window) - meta_topic (META_DEBUG_WINDOW_OPS, - "Unfullscreening %s", window->desc); - -- window->fullscreen = FALSE; -+ meta_window_config_set_is_fullscreen (window->config, FALSE); - target_rect = window->saved_rect_fullscreen; - - meta_window_frame_size_changed (window); -@@ -3693,11 +3705,14 @@ meta_window_updates_are_frozen (MetaWindow *window) - static void - meta_window_reposition (MetaWindow *window) - { -+ MtkRectangle frame_rect; -+ -+ frame_rect = meta_window_config_get_rect (window->config); - meta_window_move_resize (window, - (META_MOVE_RESIZE_MOVE_ACTION | - META_MOVE_RESIZE_RESIZE_ACTION | - META_MOVE_RESIZE_CONSTRAIN), -- window->rect); -+ frame_rect); - } - - static gboolean -@@ -3863,6 +3878,7 @@ meta_window_update_monitor (MetaWindow *window, - { - MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; - const MetaLogicalMonitor *old, *old_highest_scale; -+ int frame_width, frame_height; - - old = window->monitor; - META_WINDOW_GET_CLASS (window)->update_main_monitor (window, flags); -@@ -3895,8 +3911,9 @@ meta_window_update_monitor (MetaWindow *window, - } - - old_highest_scale = window->highest_scale_monitor; -+ meta_window_config_get_size (window->config, &frame_width, &frame_height); - -- window->highest_scale_monitor = window->rect.width > 0 && window->rect.height > 0 -+ window->highest_scale_monitor = frame_width > 0 && frame_height > 0 - ? meta_window_find_highest_scale_monitor_from_frame_rect (window) - : window->monitor; - -@@ -3935,6 +3952,7 @@ meta_window_move_resize_internal (MetaWindow *window, - MtkRectangle unconstrained_rect; - MtkRectangle constrained_rect; - MtkRectangle temporary_rect; -+ MtkRectangle rect; - int rel_x = 0; - int rel_y = 0; - MetaMoveResizeResultFlags result = 0; -@@ -3954,6 +3972,7 @@ meta_window_move_resize_internal (MetaWindow *window, - - /* We don't need it in the idle queue anymore. */ - meta_window_unqueue (window, META_QUEUE_MOVE_RESIZE); -+ rect = meta_window_config_get_rect (window->config); - - if ((flags & META_MOVE_RESIZE_RESIZE_ACTION) && (flags & META_MOVE_RESIZE_MOVE_ACTION)) - { -@@ -3965,7 +3984,7 @@ meta_window_move_resize_internal (MetaWindow *window, - /* If this is only a resize, then ignore the position given in - * the parameters and instead calculate the new position from - * resizing the old rectangle with the given gravity. */ -- meta_rectangle_resize_with_gravity (&window->rect, -+ meta_rectangle_resize_with_gravity (&rect, - &unconstrained_rect, - gravity, - frame_rect.width, -@@ -3977,21 +3996,21 @@ meta_window_move_resize_internal (MetaWindow *window, - * just use the existing size of the window. */ - unconstrained_rect.x = frame_rect.x; - unconstrained_rect.y = frame_rect.y; -- unconstrained_rect.width = window->rect.width; -- unconstrained_rect.height = window->rect.height; -+ unconstrained_rect.width = rect.width; -+ unconstrained_rect.height = rect.height; - } - else if ((flags & META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE)) - { - /* This is a Wayland buffer acking our size. The new rect is - * just the existing one we have. Ignore the passed-in rect - * completely. */ -- unconstrained_rect = window->rect; -+ unconstrained_rect = rect; - } - else - g_assert_not_reached (); - - constrained_rect = unconstrained_rect; -- temporary_rect = window->rect; -+ temporary_rect = rect; - if (flags & META_MOVE_RESIZE_CONSTRAIN && window->monitor) - { - MtkRectangle old_rect; -@@ -4378,8 +4397,9 @@ gboolean - meta_window_geometry_contains_rect (MetaWindow *window, - MtkRectangle *rect) - { -- return mtk_rectangle_contains_rect (&window->rect, -- rect); -+ MtkRectangle frame_rect = meta_window_config_get_rect (window->config); -+ -+ return mtk_rectangle_contains_rect (&frame_rect, rect); - } - - /** -@@ -4513,7 +4533,7 @@ void - meta_window_get_frame_rect (const MetaWindow *window, - MtkRectangle *rect) - { -- *rect = window->rect; -+ *rect = meta_window_config_get_rect (window->config); - } - - /** -diff --git a/src/tests/wayland-unit-tests.c b/src/tests/wayland-unit-tests.c -index 9c6feee68c..21abad98a1 100644 ---- a/src/tests/wayland-unit-tests.c -+++ b/src/tests/wayland-unit-tests.c -@@ -691,6 +691,7 @@ toplevel_bounds_struts (void) - MetaWindow *window; - MtkRectangle logical_monitor_layout; - MtkRectangle work_area; -+ MtkRectangle frame_rect; - - /* - * This test case makes sure that setting and changing struts result in the -@@ -719,8 +720,9 @@ toplevel_bounds_struts (void) - g_assert_cmpint (work_area.width, ==, logical_monitor_layout.width); - g_assert_cmpint (work_area.height, ==, logical_monitor_layout.height - 10); - -- g_assert_cmpint (window->rect.width, ==, work_area.width - 10); -- g_assert_cmpint (window->rect.height, ==, work_area.height - 10); -+ frame_rect = meta_window_config_get_rect (window->config); -+ g_assert_cmpint (frame_rect.width, ==, work_area.width - 10); -+ g_assert_cmpint (frame_rect.height, ==, work_area.height - 10); - - meta_wayland_test_driver_emit_sync_event (test_driver, 0); - meta_wayland_test_client_finish (wayland_test_client); -@@ -739,8 +741,9 @@ toplevel_bounds_struts (void) - g_assert_cmpint (work_area.width, ==, logical_monitor_layout.width); - g_assert_cmpint (work_area.height, ==, logical_monitor_layout.height); - -- g_assert_cmpint (window->rect.width, ==, work_area.width - 10); -- g_assert_cmpint (window->rect.height, ==, work_area.height - 10); -+ frame_rect = meta_window_config_get_rect (window->config); -+ g_assert_cmpint (frame_rect.width, ==, work_area.width - 10); -+ g_assert_cmpint (frame_rect.height, ==, work_area.height - 10); - - meta_wayland_test_driver_emit_sync_event (test_driver, 0); - meta_wayland_test_client_finish (wayland_test_client); -@@ -774,6 +777,7 @@ toplevel_bounds_monitors (void) - MetaWaylandTestClient *wayland_test_client; - MtkRectangle logical_monitor_layout; - MtkRectangle work_area; -+ MtkRectangle frame_rect; - MetaWindow *window; - - /* -@@ -811,8 +815,9 @@ toplevel_bounds_monitors (void) - g_assert_cmpint (work_area.width, ==, logical_monitor_layout.width); - g_assert_cmpint (work_area.height, ==, logical_monitor_layout.height - 10); - -- g_assert_cmpint (window->rect.width, ==, work_area.width - 10); -- g_assert_cmpint (window->rect.height, ==, work_area.height - 10); -+ frame_rect = meta_window_config_get_rect (window->config); -+ g_assert_cmpint (frame_rect.width, ==, work_area.width - 10); -+ g_assert_cmpint (frame_rect.height, ==, work_area.height - 10); - - meta_wayland_test_driver_emit_sync_event (test_driver, 0); - meta_wayland_test_client_finish (wayland_test_client); -@@ -835,8 +840,9 @@ toplevel_bounds_monitors (void) - g_assert_cmpint (work_area.width, ==, 300); - g_assert_cmpint (work_area.height, ==, 200); - -- g_assert_cmpint (window->rect.width, ==, 300 - 10); -- g_assert_cmpint (window->rect.height, ==, 200 - 10); -+ frame_rect = meta_window_config_get_rect (window->config); -+ g_assert_cmpint (frame_rect.width, ==, 300 - 10); -+ g_assert_cmpint (frame_rect.height, ==, 200 - 10); - - meta_wayland_test_driver_emit_sync_event (test_driver, 0); - meta_wayland_test_client_finish (wayland_test_client); -diff --git a/src/wayland/meta-wayland-window-configuration.c b/src/wayland/meta-wayland-window-configuration.c -index 56fa77ad6b..889072da44 100644 ---- a/src/wayland/meta-wayland-window-configuration.c -+++ b/src/wayland/meta-wayland-window-configuration.c -@@ -34,6 +34,7 @@ meta_wayland_window_configuration_new (MetaWindow *window, - { - MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window); - MetaWaylandWindowConfiguration *configuration; -+ int x, y; - - configuration = g_new0 (MetaWaylandWindowConfiguration, 1); - *configuration = (MetaWaylandWindowConfiguration) { -@@ -50,9 +51,10 @@ meta_wayland_window_configuration_new (MetaWindow *window, - .is_suspended = meta_window_is_suspended (window), - }; - -+ meta_window_config_get_position (window->config, &x, &y); - if (flags & META_MOVE_RESIZE_MOVE_ACTION || -- window->rect.x != rect.x || -- window->rect.y != rect.y) -+ x != rect.x || -+ y != rect.y) - { - configuration->has_position = TRUE; - configuration->x = rect.x; -diff --git a/src/wayland/meta-wayland-xdg-session-state.c b/src/wayland/meta-wayland-xdg-session-state.c -index 33f39dd49a..69a6e250b5 100644 ---- a/src/wayland/meta-wayland-xdg-session-state.c -+++ b/src/wayland/meta-wayland-xdg-session-state.c -@@ -320,10 +320,12 @@ meta_wayland_xdg_session_state_save_window (MetaSessionState *state, - MetaWaylandXdgSessionState *xdg_session_state = - META_WAYLAND_XDG_SESSION_STATE (state); - MetaWaylandXdgToplevelState *toplevel_state; -+ MtkRectangle rect; - - toplevel_state = - meta_wayland_xdg_session_state_ensure_toplevel (xdg_session_state, - name); -+ rect = meta_window_config_get_rect (window->config); - - g_object_get (window, - "minimized", &toplevel_state->is_minimized, -@@ -334,7 +336,7 @@ meta_wayland_xdg_session_state_save_window (MetaSessionState *state, - { - toplevel_state->window_state = WINDOW_STATE_MAXIMIZED; - -- toplevel_state->tiled.rect = window->rect; -+ toplevel_state->tiled.rect = rect; - } - else if (window->tile_mode == META_TILE_LEFT || - window->tile_mode == META_TILE_RIGHT) -@@ -344,13 +346,13 @@ meta_wayland_xdg_session_state_save_window (MetaSessionState *state, - else if (window->tile_mode == META_TILE_RIGHT) - toplevel_state->window_state = WINDOW_STATE_TILED_RIGHT; - -- toplevel_state->tiled.rect = window->rect; -+ toplevel_state->tiled.rect = rect; - } - else - { - toplevel_state->window_state = WINDOW_STATE_FLOATING; - -- toplevel_state->floating.rect = window->rect; -+ toplevel_state->floating.rect = rect; - } - - toplevel_state->workspace_idx = meta_workspace_index (window->workspace); -diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c -index 48f110b7c3..249f08b6dc 100644 ---- a/src/wayland/meta-wayland-xdg-shell.c -+++ b/src/wayland/meta-wayland-xdg-shell.c -@@ -878,8 +878,10 @@ meta_wayland_xdg_toplevel_apply_state (MetaWaylandSurfaceRole *surface_role, - { - MetaWaylandWindowConfiguration *configuration; - int bounds_width, bounds_height, geometry_scale; -+ MtkRectangle rect; - - geometry_scale = meta_window_wayland_get_geometry_scale (window); -+ rect = meta_window_config_get_rect (window->config); - - if (!meta_window_calculate_bounds (window, &bounds_width, &bounds_height)) - { -@@ -891,7 +893,7 @@ meta_wayland_xdg_toplevel_apply_state (MetaWaylandSurfaceRole *surface_role, - { - configuration = - meta_wayland_window_configuration_new (window, -- window->rect, -+ rect, - bounds_width, - bounds_height, - geometry_scale, -diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c -index 48a6122a30..2171f4600c 100644 ---- a/src/wayland/meta-window-wayland.c -+++ b/src/wayland/meta-window-wayland.c -@@ -263,6 +263,7 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, - MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window); - gboolean can_move_now = FALSE; - MtkRectangle configured_rect; -+ MtkRectangle frame_rect; - int geometry_scale; - int new_x; - int new_y; -@@ -281,6 +282,7 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, - * coordinate space so that we can have a scale independent size to pass - * to the Wayland surface. */ - geometry_scale = meta_window_wayland_get_geometry_scale (window); -+ frame_rect = meta_window_config_get_rect (window->config); - - configured_rect.width = constrained_rect.width; - configured_rect.height = constrained_rect.height; -@@ -314,20 +316,21 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, - new_width = unconstrained_rect.width; - new_height = unconstrained_rect.height; - } -- if (window->rect.width != new_width || -- window->rect.height != new_height) -+ if (frame_rect.width != new_width || -+ frame_rect.height != new_height) - { - *result |= META_MOVE_RESIZE_RESULT_RESIZED; -- window->rect.width = new_width; -- window->rect.height = new_height; -+ meta_window_config_set_size (window->config, -+ new_width, new_height); - } - -+ frame_rect = meta_window_config_get_rect (window->config); - window->buffer_rect.width = -- window->rect.width + -+ frame_rect.width + - window->custom_frame_extents.left + - window->custom_frame_extents.right; - window->buffer_rect.height = -- window->rect.height + -+ frame_rect.height + - window->custom_frame_extents.top + - window->custom_frame_extents.bottom; - -@@ -353,8 +356,8 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, - if (flags & META_MOVE_RESIZE_PLACEMENT_CHANGED || - rel_x != wl_window->last_sent_rel_x || - rel_y != wl_window->last_sent_rel_y || -- constrained_rect.width != window->rect.width || -- constrained_rect.height != window->rect.height) -+ constrained_rect.width != frame_rect.width || -+ constrained_rect.height != frame_rect.height) - { - MetaWaylandWindowConfiguration *configuration; - -@@ -388,8 +391,8 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, - break; - } - } -- else if (constrained_rect.width != window->rect.width || -- constrained_rect.height != window->rect.height || -+ else if (constrained_rect.width != frame_rect.width || -+ constrained_rect.height != frame_rect.height || - flags & META_MOVE_RESIZE_STATE_CHANGED) - { - MetaWaylandWindowConfiguration *configuration; -@@ -445,11 +448,10 @@ meta_window_wayland_move_resize_internal (MetaWindow *window, - !!(flags & META_MOVE_RESIZE_STATE_CHANGED); - } - -- if (new_x != window->rect.x || new_y != window->rect.y) -+ if (new_x != frame_rect.x || new_y != frame_rect.y) - { - *result |= META_MOVE_RESIZE_RESULT_MOVED; -- window->rect.x = new_x; -- window->rect.y = new_y; -+ meta_window_config_set_position (window->config, new_x, new_y); - } - - if (window->placement.rule && -@@ -526,7 +528,7 @@ meta_window_wayland_update_main_monitor (MetaWindow *window, - MetaLogicalMonitor *scaled_new; - float from_scale, to_scale; - float scale; -- MtkRectangle rect; -+ MtkRectangle frame_rect; - - from = window->monitor; - -@@ -540,7 +542,8 @@ meta_window_wayland_update_main_monitor (MetaWindow *window, - return; - } - -- if (window->rect.width == 0 || window->rect.height == 0) -+ frame_rect = meta_window_config_get_rect (window->config); -+ if (frame_rect.width == 0 || frame_rect.height == 0) - { - window->monitor = meta_window_find_monitor_from_id (window); - return; -@@ -587,10 +590,9 @@ meta_window_wayland_update_main_monitor (MetaWindow *window, - * changes the main monitor, wait until both the current and the new scale - * will result in the same main monitor. */ - scale = to_scale / from_scale; -- rect = window->rect; -- scale_rect_size (&rect, scale); -+ scale_rect_size (&frame_rect, scale); - scaled_new = -- meta_monitor_manager_get_logical_monitor_from_rect (monitor_manager, &rect); -+ meta_monitor_manager_get_logical_monitor_from_rect (monitor_manager, &frame_rect); - if (to != scaled_new) - return; - -@@ -606,6 +608,7 @@ meta_window_wayland_main_monitor_changed (MetaWindow *window, - int geometry_scale; - float scale_factor; - MetaWaylandSurface *surface; -+ MtkRectangle frame_rect; - - if (!window->monitor) - return; -@@ -629,7 +632,8 @@ meta_window_wayland_main_monitor_changed (MetaWindow *window, - scale_factor = (float) geometry_scale / old_geometry_scale; - - /* Window size. */ -- scale_rect_size (&window->rect, scale_factor); -+ frame_rect = meta_window_config_get_rect (window->config); -+ scale_rect_size (&frame_rect, scale_factor); - scale_rect_size (&window->unconstrained_rect, scale_factor); - scale_rect_size (&window->saved_rect, scale_factor); - scale_size (&window->size_hints.min_width, &window->size_hints.min_height, scale_factor); -@@ -649,9 +653,9 @@ meta_window_wayland_main_monitor_changed (MetaWindow *window, - /* Buffer rect. */ - scale_rect_size (&window->buffer_rect, scale_factor); - window->buffer_rect.x = -- window->rect.x - window->custom_frame_extents.left; -+ frame_rect.x - window->custom_frame_extents.left; - window->buffer_rect.y = -- window->rect.y - window->custom_frame_extents.top; -+ frame_rect.y - window->custom_frame_extents.top; - - meta_compositor_sync_window_geometry (window->display->compositor, - window, -@@ -861,10 +865,6 @@ meta_window_wayland_constructed (GObject *object) - window->client_type = META_WINDOW_CLIENT_TYPE_WAYLAND; - - window->override_redirect = FALSE; -- window->rect.x = 0; -- window->rect.y = 0; -- window->rect.width = 0; -- window->rect.height = 0; - /* size_hints are the "request" */ - window->size_hints.x = 0; - window->size_hints.y = 0; -@@ -878,6 +878,8 @@ meta_window_wayland_constructed (GObject *object) - window->decorated = FALSE; - window->hidden = TRUE; - -+ window->config = meta_window_config_new (); -+ - G_OBJECT_CLASS (meta_window_wayland_parent_class)->constructed (object); - } - -@@ -1105,9 +1107,7 @@ meta_window_wayland_is_resize (MetaWindowWayland *wl_window, - else - { - MetaWindow *window = META_WINDOW (wl_window); -- -- old_width = window->rect.width; -- old_height = window->rect.height; -+ meta_window_config_get_size (window->config, &old_width, &old_height); - } - - return !wl_window->has_last_sent_configuration || -@@ -1178,6 +1178,7 @@ meta_window_wayland_finish_move_resize (MetaWindow *window, - gboolean is_window_being_resized; - gboolean is_client_resize; - MetaWindowDrag *window_drag; -+ MtkRectangle frame_rect; - - /* new_geom is in the logical pixel coordinate space, but MetaWindow wants its - * rects to represent what in turn will end up on the stage, i.e. we need to -@@ -1225,9 +1226,10 @@ meta_window_wayland_finish_move_resize (MetaWindow *window, - meta_grab_op_is_resizing (meta_window_drag_get_grab_op (window_drag)) && - meta_window_drag_get_window (window_drag) == window); - -+ frame_rect = meta_window_config_get_rect (window->config); - rect = (MtkRectangle) { -- .x = window->rect.x, -- .y = window->rect.y, -+ .x = frame_rect.x, -+ .y = frame_rect.y, - .width = new_geom.width, - .height = new_geom.height - }; -@@ -1239,10 +1241,12 @@ meta_window_wayland_finish_move_resize (MetaWindow *window, - if (window->placement.rule) - { - MetaWindow *parent; -+ MtkRectangle parent_rect; - - parent = meta_window_get_transient_for (window); -- rect.x = parent->rect.x + acked_configuration->rel_x; -- rect.y = parent->rect.y + acked_configuration->rel_y; -+ parent_rect = meta_window_config_get_rect (parent->config); -+ rect.x = parent_rect.x + acked_configuration->rel_x; -+ rect.y = parent_rect.y + acked_configuration->rel_y; - } - else - { -@@ -1262,7 +1266,7 @@ meta_window_wayland_finish_move_resize (MetaWindow *window, - rect.x += dx; - rect.y += dy; - -- if (rect.x != window->rect.x || rect.y != window->rect.y) -+ if (rect.x != frame_rect.x || rect.y != frame_rect.y) - flags |= META_MOVE_RESIZE_MOVE_ACTION; - - if (wl_window->has_pending_state_change && acked_configuration) -@@ -1271,7 +1275,7 @@ meta_window_wayland_finish_move_resize (MetaWindow *window, - wl_window->has_pending_state_change = FALSE; - } - -- if (rect.width != window->rect.width || rect.height != window->rect.height) -+ if (rect.width != frame_rect.width || rect.height != frame_rect.height) - { - flags |= META_MOVE_RESIZE_RESIZE_ACTION; - -@@ -1310,8 +1314,9 @@ meta_window_place_with_placement_rule (MetaWindow *window, - window->placement.rule = g_new0 (MetaPlacementRule, 1); - *window->placement.rule = *placement_rule; - -- window->unconstrained_rect.x = window->rect.x; -- window->unconstrained_rect.y = window->rect.y; -+ meta_window_config_get_position (window->config, -+ &window->unconstrained_rect.x, -+ &window->unconstrained_rect.y); - window->unconstrained_rect.width = placement_rule->width; - window->unconstrained_rect.height = placement_rule->height; - -diff --git a/src/wayland/meta-xwayland-dnd.c b/src/wayland/meta-xwayland-dnd.c -index 19e09ce486..97ef4761b1 100644 ---- a/src/wayland/meta-xwayland-dnd.c -+++ b/src/wayland/meta-xwayland-dnd.c -@@ -834,7 +834,7 @@ repick_drop_surface (MetaWaylandCompositor *compositor, - - XMapRaised (xdisplay, dnd_window); - -- frame_rect = focus_window->rect; -+ frame_rect = meta_window_config_get_rect (focus_window->config); - meta_xwayland_stage_to_protocol_rect (manager, - &frame_rect, - &frame_rect); -diff --git a/src/x11/meta-x11-frame.c b/src/x11/meta-x11-frame.c -index 9030a92569..f1451bb655 100644 ---- a/src/x11/meta-x11-frame.c -+++ b/src/x11/meta-x11-frame.c -@@ -88,7 +88,7 @@ meta_window_x11_set_frame_xwindow (MetaWindow *window, - frame->window = window; - frame->xwindow = xframe; - -- frame->rect = window->rect; -+ frame->rect = meta_window_config_get_rect (window->config); - frame->child_x = 0; - frame->child_y = 0; - frame->bottom_height = 0; -diff --git a/src/x11/window-props.c b/src/x11/window-props.c -index 9ee56de715..a162ecd8c8 100644 ---- a/src/x11/window-props.c -+++ b/src/x11/window-props.c -@@ -344,7 +344,11 @@ meta_window_set_custom_frame_extents (MetaWindow *window, - */ - if (is_initial) - { -- meta_window_client_rect_to_frame_rect (window, &window->rect, &window->rect); -+ MtkRectangle frame_rect; -+ -+ frame_rect = meta_window_config_get_rect (window->config); -+ meta_window_client_rect_to_frame_rect (window, &frame_rect, &frame_rect); -+ meta_window_config_set_rect (window->config, frame_rect); - meta_window_client_rect_to_frame_rect (window, &window->unconstrained_rect, &window->unconstrained_rect); - } - } -@@ -791,7 +795,7 @@ reload_net_wm_state (MetaWindow *window, - - window->maximized_horizontally = FALSE; - window->maximized_vertically = FALSE; -- window->fullscreen = FALSE; -+ meta_window_config_set_is_fullscreen (window->config, FALSE); - priv->wm_state_modal = FALSE; - priv->wm_state_skip_taskbar = FALSE; - priv->wm_state_skip_pager = FALSE; -@@ -819,7 +823,7 @@ reload_net_wm_state (MetaWindow *window, - priv->wm_state_skip_pager = TRUE; - else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_FULLSCREEN) - { -- window->fullscreen = TRUE; -+ meta_window_config_set_is_fullscreen (window->config, TRUE); - g_object_notify (G_OBJECT (window), "fullscreen"); - } - else if (value->v.atom_list.atoms[i] == x11_display->atom__NET_WM_STATE_ABOVE) -diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c -index 8157b1c013..d02ca97486 100644 ---- a/src/x11/window-x11.c -+++ b/src/x11/window-x11.c -@@ -671,14 +671,14 @@ meta_window_x11_initialize_state (MetaWindow *window) - } - - /* For override-redirect windows, save the client rect -- * directly. window->rect was assigned from the XWindowAttributes -+ * directly. window->config->rect was assigned from the XWindowAttributes - * in the main meta_window_shared_new. - * - * For normal windows, do a full ConfigureRequest based on the - * window hints, as that's what the ICCCM says to do. - */ -- priv->client_rect = window->rect; -- window->buffer_rect = window->rect; -+ priv->client_rect = meta_window_config_get_rect (window->config); -+ window->buffer_rect = meta_window_config_get_rect (window->config); - - if (!window->override_redirect) - { -@@ -1410,15 +1410,18 @@ meta_window_x11_move_resize_internal (MetaWindow *window, - gboolean configure_frame_first; - gboolean is_configure_request; - MetaWindowDrag *window_drag; -+ MtkRectangle frame_rect; - - is_configure_request = (flags & META_MOVE_RESIZE_CONFIGURE_REQUEST) != 0; - - meta_frame_calc_borders (priv->frame, &borders); - -- size_dx = constrained_rect.width - window->rect.width; -- size_dy = constrained_rect.height - window->rect.height; -+ frame_rect = meta_window_config_get_rect (window->config); -+ size_dx = constrained_rect.width - frame_rect.width; -+ size_dy = constrained_rect.height - frame_rect.height; - -- window->rect = constrained_rect; -+ meta_window_config_set_rect (window->config, constrained_rect); -+ frame_rect = meta_window_config_get_rect (window->config); - - if (priv->frame) - { -@@ -1426,8 +1429,8 @@ meta_window_x11_move_resize_internal (MetaWindow *window, - int new_x, new_y; - - /* Compute new frame size */ -- new_w = window->rect.width + borders.invisible.left + borders.invisible.right; -- new_h = window->rect.height + borders.invisible.top + borders.invisible.bottom; -+ new_w = frame_rect.width + borders.invisible.left + borders.invisible.right; -+ new_h = frame_rect.height + borders.invisible.top + borders.invisible.bottom; - - if (new_w != priv->frame->rect.width || - new_h != priv->frame->rect.height) -@@ -1438,8 +1441,8 @@ meta_window_x11_move_resize_internal (MetaWindow *window, - } - - /* Compute new frame coords */ -- new_x = window->rect.x - borders.invisible.left; -- new_y = window->rect.y - borders.invisible.top; -+ new_x = frame_rect.x - borders.invisible.left; -+ new_y = frame_rect.y - borders.invisible.top; - - if (new_x != priv->frame->rect.x || - new_y != priv->frame->rect.y) -@@ -2176,7 +2179,8 @@ meta_window_x11_constructed (GObject *object) - rect = MTK_RECTANGLE_INIT (attrs.x, attrs.y, attrs.width, attrs.height); - meta_window_protocol_to_stage_rect (window, &rect, &rect); - -- window->rect = rect; -+ window->config = meta_window_config_new (); -+ meta_window_config_set_rect (window->config, rect); - - /* size_hints are the "request" */ - window->size_hints.x = rect.x; -@@ -2729,12 +2733,11 @@ meta_window_x11_get_gravity_position (MetaWindow *window, - int w, h; - int x, y; - -- w = window->rect.width; -- h = window->rect.height; -+ meta_window_config_get_size (window->config, &w, &h); - - if (gravity == META_GRAVITY_STATIC) - { -- frame_extents = window->rect; -+ frame_extents = meta_window_config_get_rect (window->config); - if (priv->frame) - { - frame_extents.x = priv->frame->rect.x + priv->frame->child_x; -@@ -2744,7 +2747,7 @@ meta_window_x11_get_gravity_position (MetaWindow *window, - else - { - if (priv->frame == NULL) -- frame_extents = window->rect; -+ frame_extents = meta_window_config_get_rect (window->config); - else - frame_extents = priv->frame->rect; - } -@@ -2817,10 +2820,11 @@ meta_window_x11_get_session_geometry (MetaWindow *window, - window->size_hints.win_gravity, - x, y); - -- *width = (window->rect.width - window->size_hints.base_width) / -- window->size_hints.width_inc; -- *height = (window->rect.height - window->size_hints.base_height) / -- window->size_hints.height_inc; -+ meta_window_config_get_position (window->config, width, height); -+ *width -= window->size_hints.base_width; -+ *width /= window->size_hints.width_inc; -+ *height -= window->size_hints.base_height; -+ *height /= window->size_hints.height_inc; - } - - static void -@@ -2859,7 +2863,7 @@ meta_window_move_resize_request (MetaWindow *window, - * and otherwise use our current up-to-date position. - * - * Otherwise you get spurious position changes when the app changes -- * size, for example, if window->rect is not in sync with the -+ * size, for example, if window->config->rect is not in sync with the - * server-side position in effect when the configure request was - * generated. - */ -@@ -4347,6 +4351,7 @@ meta_window_x11_configure_notify (MetaWindow *window, - { - MetaWindowX11 *window_x11 = META_WINDOW_X11 (window); - MetaWindowX11Private *priv = meta_window_x11_get_instance_private (window_x11); -+ MtkRectangle rect; - - g_assert (window->override_redirect); - g_assert (priv->frame == NULL); -@@ -4356,10 +4361,11 @@ meta_window_x11_configure_notify (MetaWindow *window, - event->y, - event->width, - event->height), -- &window->rect); -+ &rect); -+ meta_window_config_set_rect (window->config, rect); - -- priv->client_rect = window->rect; -- window->buffer_rect = window->rect; -+ priv->client_rect = rect; -+ window->buffer_rect = rect; - - meta_window_update_monitor (window, META_WINDOW_UPDATE_MONITOR_FLAGS_NONE); - --- -2.49.0 - diff --git a/0006-window-Add-a-configure-signal.patch b/0006-window-Add-a-configure-signal.patch deleted file mode 100644 index 284667a..0000000 --- a/0006-window-Add-a-configure-signal.patch +++ /dev/null @@ -1,94 +0,0 @@ -From e3c023240a6bc7479e9e7a95b083afbfaa08b98b Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Wed, 2 Oct 2024 17:21:40 +0200 -Subject: [PATCH 06/10] window: Add a "configure" signal - -This conveys the initial window configuration. - -Part-of: -(cherry picked from commit d44fd167bb62dc541c6b6215d14d26e84733ab5f) ---- - src/core/window-private.h | 4 ++++ - src/core/window.c | 23 +++++++++++++++++++++++ - 2 files changed, 27 insertions(+) - -diff --git a/src/core/window-private.h b/src/core/window-private.h -index a03b156d67..f7ebb2ad91 100644 ---- a/src/core/window-private.h -+++ b/src/core/window-private.h -@@ -34,6 +34,7 @@ - #include "backends/meta-logical-monitor.h" - #include "clutter/clutter.h" - #include "core/stack.h" -+#include "meta/meta-window-config.h" - #include "meta/compositor.h" - #include "meta/meta-close-dialog.h" - #include "meta/util.h" -@@ -812,6 +813,9 @@ void meta_window_ensure_close_dialog_timeout (MetaWindow *window); - - void meta_window_emit_size_changed (MetaWindow *window); - -+void meta_window_emit_configure (MetaWindow *window, -+ MetaWindowConfig *window_config); -+ - MetaPlacementRule *meta_window_get_placement_rule (MetaWindow *window); - - void meta_window_force_placement (MetaWindow *window, -diff --git a/src/core/window.c b/src/core/window.c -index e9c005aeca..9a70f79f95 100644 ---- a/src/core/window.c -+++ b/src/core/window.c -@@ -81,6 +81,7 @@ - #include "meta/meta-cursor-tracker.h" - #include "meta/meta-enum-types.h" - #include "meta/prefs.h" -+#include "meta/meta-window-config.h" - - #ifdef HAVE_X11_CLIENT - #include "mtk/mtk-x11.h" -@@ -241,6 +242,7 @@ enum - POSITION_CHANGED, - SHOWN, - HIGHEST_SCALE_MONITOR_CHANGED, -+ CONFIGURE, - - LAST_SIGNAL - }; -@@ -733,6 +735,20 @@ meta_window_class_init (MetaWindowClass *klass) - 0, - NULL, NULL, NULL, - G_TYPE_NONE, 0); -+ -+ /** -+ * MetaWindow::configure: -+ * @window: a #MetaWindow -+ * @window_config: a #MetaWindowConfig -+ */ -+ window_signals[CONFIGURE] = -+ g_signal_new ("configure", -+ G_TYPE_FROM_CLASS (object_class), -+ G_SIGNAL_RUN_LAST, -+ 0, -+ NULL, NULL, NULL, -+ G_TYPE_NONE, 1, -+ META_TYPE_WINDOW_CONFIG); - } - - static void -@@ -7590,6 +7606,13 @@ meta_window_get_placement_rule (MetaWindow *window) - return window->placement.rule; - } - -+void -+meta_window_emit_configure (MetaWindow *window, -+ MetaWindowConfig *window_config) -+{ -+ g_signal_emit (window, window_signals[CONFIGURE], 0, window_config); -+} -+ - void - meta_window_force_restore_shortcuts (MetaWindow *window, - ClutterInputDevice *source) --- -2.49.0 - diff --git a/0007-window-Add-a-window-helper-function-for-MetaWindowCo.patch b/0007-window-Add-a-window-helper-function-for-MetaWindowCo.patch deleted file mode 100644 index ec7dbd0..0000000 --- a/0007-window-Add-a-window-helper-function-for-MetaWindowCo.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 05f341932f693e6776074ff7892eae7a1ca33b8c Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Tue, 12 Nov 2024 14:59:38 +0100 -Subject: [PATCH 07/10] window: Add a window helper function for - MetaWindowConfig - -The MetaWindowConfig can indicate whether the configuration reflects on -the initial configuration, before the window is first mapped. - -Add a smaller helper (private) window function to create the appropriate -"type" of MetaWindowConfig depending whether the window was already -showed or not. - -This is preparation work for the following commits where this function -will be used. - -Part-of: -(cherry picked from commit 5a231a4d2789e84d3222354b3fef0718a94c9561) ---- - src/core/window-private.h | 2 ++ - src/core/window.c | 10 ++++++++++ - 2 files changed, 12 insertions(+) - -diff --git a/src/core/window-private.h b/src/core/window-private.h -index f7ebb2ad91..ba1973bd95 100644 ---- a/src/core/window-private.h -+++ b/src/core/window-private.h -@@ -896,3 +896,5 @@ gboolean meta_window_is_tiled_side_by_side (MetaWindow *window); - gboolean meta_window_is_tiled_left (MetaWindow *window); - - gboolean meta_window_is_tiled_right (MetaWindow *window); -+ -+MetaWindowConfig * meta_window_new_window_config (MetaWindow *window); -diff --git a/src/core/window.c b/src/core/window.c -index 9a70f79f95..b0d937dc0e 100644 ---- a/src/core/window.c -+++ b/src/core/window.c -@@ -72,6 +72,7 @@ - #include "core/boxes-private.h" - #include "core/constraints.h" - #include "core/keybindings-private.h" -+#include "core/meta-window-config-private.h" - #include "core/meta-workspace-manager-private.h" - #include "core/place.h" - #include "core/stack.h" -@@ -8246,3 +8247,12 @@ meta_window_get_client_content_rect (MetaWindow *window, - meta_window_frame_rect_to_client_rect (window, rect, rect); - #endif - } -+ -+MetaWindowConfig * -+meta_window_new_window_config (MetaWindow *window) -+{ -+ if (window->showing_for_first_time) -+ return meta_window_config_initial_new (); -+ else -+ return meta_window_config_new (); -+} --- -2.49.0 - diff --git a/0008-wayland-window-configuration-Add-MetaWindowConfig-su.patch b/0008-wayland-window-configuration-Add-MetaWindowConfig-su.patch deleted file mode 100644 index 02dc26b..0000000 --- a/0008-wayland-window-configuration-Add-MetaWindowConfig-su.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 6ca58583b7a53daa4ff97df403c20161a6da17a4 Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Wed, 16 Oct 2024 14:58:37 +0200 -Subject: [PATCH 08/10] wayland/window-configuration: Add MetaWindowConfig - support - -This allows to bridge MetaWaylandWindowConfiguration and -MetaWindowConfig. - -Part-of: -(cherry picked from commit c597feaa67fdcaa971a561e82b9937970c741bbf) ---- - .../meta-wayland-window-configuration.c | 69 +++++++++++++++++++ - .../meta-wayland-window-configuration.h | 8 +++ - 2 files changed, 77 insertions(+) - -diff --git a/src/wayland/meta-wayland-window-configuration.c b/src/wayland/meta-wayland-window-configuration.c -index 889072da44..f92c1b34a7 100644 ---- a/src/wayland/meta-wayland-window-configuration.c -+++ b/src/wayland/meta-wayland-window-configuration.c -@@ -18,6 +18,8 @@ - - #include "config.h" - -+#include "core/meta-window-config-private.h" -+#include "core/window-private.h" - #include "wayland/meta-wayland-window-configuration.h" - #include "wayland/meta-window-wayland.h" - -@@ -123,3 +125,70 @@ meta_wayland_window_configuration_free (MetaWaylandWindowConfiguration *configur - { - g_free (configuration); - } -+ -+MetaWindowConfig * -+meta_window_config_new_from_wayland_window_configuration (MetaWindow *window, -+ MetaWaylandWindowConfiguration *configuration) -+{ -+ MetaWindowConfig *window_config; -+ MtkRectangle rect; -+ -+ window_config = meta_window_new_window_config (window); -+ rect = meta_window_config_get_rect (window->config); -+ meta_window_config_set_rect (window_config, rect); -+ meta_window_config_set_is_fullscreen (window_config, -+ meta_window_config_get_is_fullscreen (window->config)); -+ -+ if (configuration->has_position) -+ meta_window_config_set_position (window_config, -+ configuration->x, -+ configuration->y); -+ -+ if (configuration->has_size && -+ configuration->width > 0 && -+ configuration->height > 0) -+ meta_window_config_set_size (window_config, -+ configuration->width, -+ configuration->height); -+ -+ return window_config; -+} -+ -+MetaWaylandWindowConfiguration * -+meta_wayland_window_configuration_apply_window_config (MetaWindow *window, -+ MetaWaylandWindowConfiguration *configuration, -+ MetaWindowConfig *window_config) -+{ -+ MtkRectangle rect; -+ int prev_x = configuration->x; -+ int prev_y = configuration->y; -+ int prev_width = configuration->width; -+ int prev_height = configuration->height; -+ gboolean is_fullscreen; -+ -+ rect = meta_window_config_get_rect (window_config); -+ configuration->x = rect.x; -+ configuration->y = rect.y; -+ configuration->width = rect.width; -+ configuration->height = rect.height; -+ -+ is_fullscreen = meta_window_config_get_is_fullscreen (window_config); -+ meta_window_config_set_is_fullscreen (window->config, is_fullscreen); -+ configuration->is_fullscreen = is_fullscreen; -+ -+ if (prev_x != configuration->x || prev_y != configuration->y) -+ { -+ configuration->has_position = TRUE; -+ meta_window_config_set_position (window->config, -+ configuration->x, -+ configuration->y); -+ window->placed = TRUE; -+ } -+ -+ if (prev_width != configuration->width || -+ prev_height != configuration->height) -+ configuration->has_size = (configuration->width > 0 && -+ configuration->height > 0); -+ -+ return configuration; -+} -diff --git a/src/wayland/meta-wayland-window-configuration.h b/src/wayland/meta-wayland-window-configuration.h -index fb26344bb0..762816e5ac 100644 ---- a/src/wayland/meta-wayland-window-configuration.h -+++ b/src/wayland/meta-wayland-window-configuration.h -@@ -22,6 +22,7 @@ - #include - - #include "core/window-private.h" -+#include "meta/meta-window-config.h" - #include "wayland/meta-wayland-types.h" - - struct _MetaWaylandWindowConfiguration -@@ -72,3 +73,10 @@ MetaWaylandWindowConfiguration * meta_wayland_window_configuration_new_empty (in - int scale); - - void meta_wayland_window_configuration_free (MetaWaylandWindowConfiguration *configuration); -+ -+MetaWindowConfig * meta_window_config_new_from_wayland_window_configuration (MetaWindow *window, -+ MetaWaylandWindowConfiguration *configuration); -+ -+MetaWaylandWindowConfiguration * meta_wayland_window_configuration_apply_window_config (MetaWindow *window, -+ MetaWaylandWindowConfiguration *configuration, -+ MetaWindowConfig *window_config); --- -2.49.0 - diff --git a/0009-wayland-Emit-the-configure-signal.patch b/0009-wayland-Emit-the-configure-signal.patch deleted file mode 100644 index 8455972..0000000 --- a/0009-wayland-Emit-the-configure-signal.patch +++ /dev/null @@ -1,54 +0,0 @@ -From c80438f489b941496084e196aa2003077121e17e Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Wed, 9 Oct 2024 11:37:57 +0200 -Subject: [PATCH 09/10] wayland: Emit the configure signal - -Emit the configure signal from the xdg_toplevel's apply_state function. - -A plugin gets a chance to tweak the initial configuration before it gets -applied. - -Part-of: -(cherry picked from commit 9927eaa9638c4e678adeb8dbb39b5fbee7a00c86) ---- - src/wayland/meta-wayland-xdg-shell.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c -index 249f08b6dc..5ef548723a 100644 ---- a/src/wayland/meta-wayland-xdg-shell.c -+++ b/src/wayland/meta-wayland-xdg-shell.c -@@ -27,6 +27,7 @@ - #include "compositor/compositor-private.h" - #include "core/boxes-private.h" - #include "core/window-private.h" -+#include "meta/meta-window-config.h" - #include "wayland/meta-wayland-outputs.h" - #include "wayland/meta-wayland-popup.h" - #include "wayland/meta-wayland-private.h" -@@ -877,6 +878,7 @@ meta_wayland_xdg_toplevel_apply_state (MetaWaylandSurfaceRole *surface_role, - if (!xdg_surface_priv->configure_sent) - { - MetaWaylandWindowConfiguration *configuration; -+ g_autoptr (MetaWindowConfig) window_config = NULL; - int bounds_width, bounds_height, geometry_scale; - MtkRectangle rect; - -@@ -908,6 +910,14 @@ meta_wayland_xdg_toplevel_apply_state (MetaWaylandSurfaceRole *surface_role, - geometry_scale); - } - -+ window_config = -+ meta_window_config_new_from_wayland_window_configuration (window, -+ configuration); -+ meta_window_emit_configure (window, window_config); -+ meta_wayland_window_configuration_apply_window_config (window, -+ configuration, -+ window_config); -+ - meta_wayland_xdg_toplevel_send_configure (xdg_toplevel, configuration); - meta_wayland_window_configuration_free (configuration); - return; --- -2.49.0 - diff --git a/0010-window-x11-Emit-the-configure-signal.patch b/0010-window-x11-Emit-the-configure-signal.patch deleted file mode 100644 index d35efdd..0000000 --- a/0010-window-x11-Emit-the-configure-signal.patch +++ /dev/null @@ -1,115 +0,0 @@ -From ab21ff48316e82543d2854f4c024a400ea1c374c Mon Sep 17 00:00:00 2001 -From: Olivier Fourdan -Date: Mon, 21 Oct 2024 10:24:09 +0200 -Subject: [PATCH 10/10] window-x11: Emit the configure signal - -Emit the configure signal for X11 windows as soon as they get created. - -The configuration values then get applied as initial values. - -Part-of: -(cherry picked from commit ad9a192455ed2502153bbb5b7960bafb2ed1fbb5) ---- - src/x11/events.c | 4 ++++ - src/x11/window-x11.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ - src/x11/window-x11.h | 2 ++ - 3 files changed, 54 insertions(+) - -diff --git a/src/x11/events.c b/src/x11/events.c -index 05d04a8c1a..c72d00c3a7 100644 ---- a/src/x11/events.c -+++ b/src/x11/events.c -@@ -1450,6 +1450,8 @@ handle_other_xevent (MetaX11Display *x11_display, - { - window = meta_window_x11_new (display, event->xmap.window, - FALSE, META_COMP_EFFECT_CREATE); -+ if (window) -+ meta_window_x11_configure (window); - } - else if (window && window->restore_focus_on_map && - window->reparents_pending == 0) -@@ -1506,6 +1508,8 @@ handle_other_xevent (MetaX11Display *x11_display, - - window = meta_window_x11_new (display, event->xmaprequest.window, - FALSE, META_COMP_EFFECT_CREATE); -+ if (window) -+ meta_window_x11_configure (window); - } - else - { -diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c -index d02ca97486..8ac7f147b3 100644 ---- a/src/x11/window-x11.c -+++ b/src/x11/window-x11.c -@@ -38,6 +38,7 @@ - #include "compositor/compositor-private.h" - #include "compositor/meta-window-actor-private.h" - #include "core/boxes-private.h" -+#include "core/meta-window-config-private.h" - #include "core/meta-workspace-manager-private.h" - #include "core/window-private.h" - #include "core/workspace-private.h" -@@ -4935,3 +4936,50 @@ meta_window_x11_shutdown_group (MetaWindow *window) - { - remove_window_from_group (window); - } -+ -+void -+meta_window_x11_configure (MetaWindow *window) -+{ -+ MtkRectangle prev_rect; -+ MtkRectangle new_rect; -+ MetaMoveResizeFlags flags; -+ gboolean is_fullscreen; -+ g_autoptr (MetaWindowConfig) window_config = NULL; -+ -+ window_config = meta_window_new_window_config (window); -+ prev_rect = meta_window_config_get_rect (window->config); -+ meta_window_config_set_rect (window_config, prev_rect); -+ is_fullscreen = meta_window_is_fullscreen (window); -+ meta_window_config_set_is_fullscreen (window_config, is_fullscreen); -+ -+ meta_window_emit_configure (window, window_config); -+ new_rect = meta_window_config_get_rect (window_config); -+ -+ meta_topic (META_DEBUG_GEOMETRY, -+ "Window %s pre-configured at (%i,%i) [%ix%i]", -+ window->desc, new_rect.x, new_rect.y, new_rect.width, new_rect.height); -+ -+ if (!mtk_rectangle_equal (&prev_rect, &new_rect)) -+ { -+ window->placed = TRUE; -+ -+ /* Update the size hints to match the new pre-configuration */ -+ window->size_hints.x = new_rect.x; -+ window->size_hints.y = new_rect.y; -+ window->size_hints.width = new_rect.width; -+ window->size_hints.height = new_rect.height; -+ -+ flags = (META_MOVE_RESIZE_MOVE_ACTION | -+ META_MOVE_RESIZE_RESIZE_ACTION | -+ META_MOVE_RESIZE_CONSTRAIN); -+ -+ meta_window_move_resize_internal (window, -+ flags, -+ META_PLACE_FLAG_NONE, -+ window->size_hints.win_gravity, -+ new_rect); -+ } -+ -+ if (meta_window_config_get_is_fullscreen (window_config)) -+ meta_window_make_fullscreen (window); -+} -diff --git a/src/x11/window-x11.h b/src/x11/window-x11.h -index 5fd8517b4c..c92b28b1a0 100644 ---- a/src/x11/window-x11.h -+++ b/src/x11/window-x11.h -@@ -116,3 +116,5 @@ gboolean meta_window_x11_has_alpha_channel (MetaWindow *window); - - META_EXPORT - Window meta_window_x11_get_xwindow (MetaWindow *window); -+ -+void meta_window_x11_configure (MetaWindow *window); --- -2.49.0 - diff --git a/a11y-manager.patch b/a11y-manager.patch deleted file mode 100644 index a1a4904..0000000 --- a/a11y-manager.patch +++ /dev/null @@ -1,2157 +0,0 @@ -From cc92000f1f4ae6c7fcee330ffd38842365bdf811 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 18:36:15 +0100 -Subject: [PATCH 01/14] data: Introduce the DBus interface description for the - a11y manager - -This object will for now only provide a way for assistive technologies -to receive keyboard events, however it is expected that it will be used for -the new a11y communication protocol in the future. - -Part-of: -(cherry picked from commit 84fc62a2806b893b215fcfb287390ced07a98aa7) ---- - data/dbus-interfaces/org.freedesktop.a11y.xml | 92 +++++++++++++++++++ - src/meson.build | 5 + - 2 files changed, 97 insertions(+) - create mode 100644 data/dbus-interfaces/org.freedesktop.a11y.xml - -diff --git a/data/dbus-interfaces/org.freedesktop.a11y.xml b/data/dbus-interfaces/org.freedesktop.a11y.xml -new file mode 100644 -index 0000000000..c60480e89c ---- /dev/null -+++ b/data/dbus-interfaces/org.freedesktop.a11y.xml -@@ -0,0 +1,92 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -diff --git a/src/meson.build b/src/meson.build -index e3c92aaf27..6c19300b8f 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -947,6 +947,11 @@ if mutter_private_enum_sources.length() > 0 - endif - - dbus_interfaces = [ -+ { -+ 'name': 'meta-dbus-a11y', -+ 'interface': 'org.freedesktop.a11y.xml', -+ 'prefix': 'org.freedesktop.a11y', -+ }, - { - 'name': 'meta-dbus-display-config', - 'interface': 'org.gnome.Mutter.DisplayConfig.xml', --- -2.44.0.501.g19981daefd.dirty - - -From 7c4e773276b9cd87373e4231db371849157db325 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 18:37:28 +0100 -Subject: [PATCH 02/14] clutter: Add ClutterEventFlag to notify a11y modifier - click - -Use a Clutter event flag to communicate the the fact that the event -is an a11y modifier first click. The accessibility modifiers will -require special handling in the input and main threads. - -Part-of: -(cherry picked from commit d3a0bbdf524f160b683f5db261382c306e71c58d) ---- - clutter/clutter/clutter-enums.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h -index 9bd508fb67..451e1b8c67 100644 ---- a/clutter/clutter/clutter-enums.h -+++ b/clutter/clutter/clutter-enums.h -@@ -519,6 +519,7 @@ typedef enum /*< flags prefix=CLUTTER_EVENT >*/ - CLUTTER_EVENT_FLAG_RELATIVE_MOTION = 1 << 3, - CLUTTER_EVENT_FLAG_GRAB_NOTIFY = 1 << 4, - CLUTTER_EVENT_FLAG_POINTER_EMULATED = 1 << 5, -+ CLUTTER_EVENT_FLAG_A11Y_MODIFIER_FIRST_CLICK = 1 << 6, - } ClutterEventFlags; - - /** --- -2.44.0.501.g19981daefd.dirty - - -From 7971ccea8aa76745165cdf44f61a19b5f82a17b7 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 18:52:00 +0100 -Subject: [PATCH 03/14] backends/native: Handle a11y modifier presses in - MetaSeatImpl - -The state handling about whether the a11y modifier is a first press (so -could be consumed for other actions), or results in the modifier action -(e.g. caps lock) is performed in the input thread. This information will -be propagated through the CLUTTER_EVENT_FLAG_A11Y_MODIFIER_FIRST_CLICK -flag in the related key events. - -Carlos Garnacho: Drop synchronous wait for configuration changes - -Part-of: -(cherry picked from commit d86796413929bd5d5fb59cb3c2a9ab9d714f70cc) ---- - src/backends/native/meta-seat-impl.c | 133 ++++++++++++++++++++++++++- - src/backends/native/meta-seat-impl.h | 4 + - 2 files changed, 134 insertions(+), 3 deletions(-) - -diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c -index c1e46a0502..0bdf1606fc 100644 ---- a/src/backends/native/meta-seat-impl.c -+++ b/src/backends/native/meta-seat-impl.c -@@ -103,6 +103,14 @@ static guint signals[N_SIGNALS] = { 0 }; - typedef struct _MetaSeatImplPrivate - { - GHashTable *device_files; -+ -+ struct { -+ GHashTable *grabbed_modifiers; -+ GHashTable *pressed_modifiers; -+ uint32_t last_keysym; -+ uint32_t last_keysym_time; -+ gboolean saw_first_release; -+ } a11y; - } MetaSeatImplPrivate; - - static void meta_seat_impl_initable_iface_init (GInitableIface *iface); -@@ -389,6 +397,65 @@ emit_signal (MetaSeatImpl *seat_impl, - (GDestroyNotify) signal_data_free); - } - -+static gboolean -+is_a11y_modifier_first_click (MetaSeatImpl *seat_impl, -+ uint32_t keysym, -+ uint32_t event_time, -+ gboolean is_press) -+{ -+ MetaSeatImplPrivate *priv = meta_seat_impl_get_instance_private (seat_impl); -+ gboolean is_same_keysym = keysym == priv->a11y.last_keysym; -+ gboolean event_soon_enough = -+ event_time - priv->a11y.last_keysym_time < seat_impl->repeat_delay; -+ gboolean is_grabbed_modifier = -+ g_hash_table_contains (priv->a11y.grabbed_modifiers, GUINT_TO_POINTER (keysym)); -+ -+ priv->a11y.last_keysym = keysym; -+ priv->a11y.last_keysym_time = event_time; -+ -+ /* This is not an event for a grabbed modifier */ -+ if (!is_grabbed_modifier) -+ return FALSE; -+ -+ if (!is_press && g_hash_table_contains (priv->a11y.pressed_modifiers, -+ GUINT_TO_POINTER (keysym))) -+ { -+ g_hash_table_remove (priv->a11y.pressed_modifiers, -+ GUINT_TO_POINTER (keysym)); -+ /* This is a release event for a previously pressed modifier */ -+ return FALSE; -+ } -+ -+ if (is_same_keysym && event_soon_enough) -+ { -+ if (is_press && priv->a11y.saw_first_release) -+ { -+ priv->a11y.saw_first_release = FALSE; -+ g_hash_table_add (priv->a11y.pressed_modifiers, -+ GUINT_TO_POINTER (keysym)); -+ -+ /* This is the second press event and it is on time, process -+ * it normally -+ */ -+ return FALSE; -+ } -+ else -+ { -+ priv->a11y.saw_first_release = TRUE; -+ /* This is the first release event, wait for the second press event */ -+ return TRUE; -+ } -+ } -+ else -+ { -+ /* This is either a different modifier, the first press -+ * event, or not on time to progress -+ */ -+ priv->a11y.saw_first_release = FALSE; -+ return TRUE; -+ } -+} -+ - void - meta_seat_impl_notify_key_in_impl (MetaSeatImpl *seat_impl, - ClutterInputDevice *device, -@@ -401,6 +468,8 @@ meta_seat_impl_notify_key_in_impl (MetaSeatImpl *seat_impl, - ClutterEventFlags flags = CLUTTER_EVENT_NONE; - enum xkb_state_component changed_state; - uint32_t keycode; -+ uint32_t keysym; -+ gboolean should_ignore; - - if (state != AUTOREPEAT_VALUE) - { -@@ -421,6 +490,16 @@ meta_seat_impl_notify_key_in_impl (MetaSeatImpl *seat_impl, - flags = CLUTTER_EVENT_FLAG_REPEATED; - } - -+ keycode = meta_xkb_evdev_to_keycode (key); -+ keysym = xkb_state_key_get_one_sym (seat_impl->xkb, keycode); -+ -+ should_ignore = is_a11y_modifier_first_click (seat_impl, -+ keysym, -+ time_us / 1000, -+ state); -+ if (should_ignore) -+ flags |= CLUTTER_EVENT_FLAG_A11Y_MODIFIER_FIRST_CLICK; -+ - event = meta_key_event_new_from_evdev (device, - seat_impl->core_keyboard, - flags, -@@ -428,11 +507,9 @@ meta_seat_impl_notify_key_in_impl (MetaSeatImpl *seat_impl, - seat_impl->button_state, - time_us, key, state); - -- keycode = meta_xkb_evdev_to_keycode (key); -- - /* We must be careful and not pass multiple releases to xkb, otherwise it gets - confused and locks the modifiers */ -- if (state != AUTOREPEAT_VALUE) -+ if (!should_ignore && state != AUTOREPEAT_VALUE) - { - changed_state = xkb_state_update_key (seat_impl->xkb, keycode, - state ? XKB_KEY_DOWN : XKB_KEY_UP); -@@ -2938,6 +3015,9 @@ input_thread (MetaSeatImpl *seat_impl) - NULL, - (GDestroyNotify) meta_device_file_release); - -+ priv->a11y.grabbed_modifiers = g_hash_table_new (NULL, NULL); -+ priv->a11y.pressed_modifiers = g_hash_table_new (NULL, NULL); -+ - seat_impl->input_settings = meta_input_settings_native_new_in_impl (seat_impl); - g_signal_connect_object (seat_impl->input_settings, "kbd-a11y-changed", - G_CALLBACK (kbd_a11y_changed_cb), seat_impl, 0); -@@ -3099,6 +3179,9 @@ destroy_in_impl (GTask *task) - - g_clear_pointer (&priv->device_files, g_hash_table_destroy); - -+ g_clear_pointer (&priv->a11y.grabbed_modifiers, g_hash_table_destroy); -+ g_clear_pointer (&priv->a11y.pressed_modifiers, g_hash_table_destroy); -+ - g_main_loop_quit (seat_impl->input_loop); - g_task_return_boolean (task, TRUE); - -@@ -3820,6 +3903,50 @@ meta_seat_impl_set_viewports (MetaSeatImpl *seat_impl, - g_cond_clear (&data.cond); - } - -+static gboolean -+set_a11y_modifiers (GTask *task) -+{ -+ MetaSeatImpl *seat_impl = g_task_get_source_object (task); -+ MetaSeatImplPrivate *priv = meta_seat_impl_get_instance_private (seat_impl); -+ GArray *modifiers = g_task_get_task_data (task); -+ int i; -+ -+ g_hash_table_remove_all (priv->a11y.grabbed_modifiers); -+ -+ for (i = 0; i < modifiers->len; i++) -+ { -+ uint32_t keysym; -+ -+ keysym = g_array_index (modifiers, uint32_t, i); -+ g_hash_table_add (priv->a11y.grabbed_modifiers, -+ GUINT_TO_POINTER (keysym)); -+ } -+ -+ g_task_return_boolean (task, TRUE); -+ -+ return G_SOURCE_REMOVE; -+} -+ -+void -+meta_seat_impl_set_a11y_modifiers (MetaSeatImpl *seat_impl, -+ const uint32_t *modifiers, -+ int n_modifiers) -+{ -+ g_autoptr (GTask) task = NULL; -+ GArray *modifiers_copy; -+ -+ g_return_if_fail (META_IS_SEAT_IMPL (seat_impl)); -+ -+ modifiers_copy = g_array_new (FALSE, FALSE, sizeof (uint32_t)); -+ g_array_append_vals (modifiers_copy, modifiers, n_modifiers); -+ -+ task = g_task_new (seat_impl, NULL, NULL, NULL); -+ g_task_set_task_data (task, modifiers_copy, -+ (GDestroyNotify) g_array_unref); -+ meta_seat_impl_run_input_task (seat_impl, task, -+ (GSourceFunc) set_a11y_modifiers); -+} -+ - MetaSeatImpl * - meta_seat_impl_new (MetaSeatNative *seat_native, - const char *seat_id, -diff --git a/src/backends/native/meta-seat-impl.h b/src/backends/native/meta-seat-impl.h -index d95fb7176b..7d85fc6fc7 100644 ---- a/src/backends/native/meta-seat-impl.h -+++ b/src/backends/native/meta-seat-impl.h -@@ -263,3 +263,7 @@ void meta_seat_impl_add_virtual_input_device (MetaSeatImpl *seat_impl, - - void meta_seat_impl_remove_virtual_input_device (MetaSeatImpl *seat_impl, - ClutterInputDevice *device); -+ -+void meta_seat_impl_set_a11y_modifiers (MetaSeatImpl *seat_impl, -+ const uint32_t *modifiers, -+ int n_modifiers); --- -2.44.0.501.g19981daefd.dirty - - -From 4615e7ce13211ee7aea8aa83f265a4318356495e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 18:58:41 +0100 -Subject: [PATCH 04/14] backends/native: Plumb a11y modifiers through - MetaSeatNative - -These modifiers will be set by the backend from the main thread, and -need to be handled specially for them to be usable as both modifier -buttons, and their own regular action. - -Carlos Garnacho: pass modifiers as array+lenght instead of hashtable. - -Part-of: -(cherry picked from commit 8c52e243c03c03c4e1fe0c13c730fd24d84a40a6) ---- - src/backends/native/meta-seat-native.c | 8 ++++++++ - src/backends/native/meta-seat-native.h | 4 ++++ - 2 files changed, 12 insertions(+) - -diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c -index d912875684..ed3842bcf1 100644 ---- a/src/backends/native/meta-seat-native.c -+++ b/src/backends/native/meta-seat-native.c -@@ -656,6 +656,14 @@ meta_seat_native_set_viewports (MetaSeatNative *seat, - meta_seat_impl_set_viewports (seat->impl, viewports); - } - -+void -+meta_seat_native_set_a11y_modifiers (MetaSeatNative *seat, -+ const uint32_t *modifiers, -+ int n_modifiers) -+{ -+ meta_seat_impl_set_a11y_modifiers (seat->impl, modifiers, n_modifiers); -+} -+ - void - meta_seat_native_run_impl_task (MetaSeatNative *seat, - GSourceFunc dispatch_func, -diff --git a/src/backends/native/meta-seat-native.h b/src/backends/native/meta-seat-native.h -index e82d0043be..cccfa6ce63 100644 ---- a/src/backends/native/meta-seat-native.h -+++ b/src/backends/native/meta-seat-native.h -@@ -137,3 +137,7 @@ void meta_seat_native_run_impl_task (MetaSeatNative *seat, - GSourceFunc dispatch_func, - gpointer user_data, - GDestroyNotify destroy_notify); -+ -+void meta_seat_native_set_a11y_modifiers (MetaSeatNative *seat, -+ const uint32_t *modifiers, -+ int n_modifiers); --- -2.44.0.501.g19981daefd.dirty - - -From 893688f075578a5d8f660094105a53d20b1143fb Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 19:01:26 +0100 -Subject: [PATCH 05/14] backends: Add MetaA11yManager - -This a11y manager will handle key event emission to screen -readers and other ATs. This initial commit only introduces -the object. - -Carlos Garnacho: Make the object take a ::backend property - -Part-of: -(cherry picked from commit c0c452445236d98fc4297603f269938ba255a206) ---- - src/backends/meta-a11y-manager.c | 102 +++++++++++++++++++++++++++++++ - src/backends/meta-a11y-manager.h | 29 +++++++++ - src/meson.build | 2 + - 3 files changed, 133 insertions(+) - create mode 100644 src/backends/meta-a11y-manager.c - create mode 100644 src/backends/meta-a11y-manager.h - -diff --git a/src/backends/meta-a11y-manager.c b/src/backends/meta-a11y-manager.c -new file mode 100644 -index 0000000000..22de01030d ---- /dev/null -+++ b/src/backends/meta-a11y-manager.c -@@ -0,0 +1,102 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ -+ -+/* -+ * Copyright 2024 GNOME Foundation -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, see . -+ * -+ */ -+ -+#include "config.h" -+ -+#include "backends/meta-a11y-manager.h" -+#include "meta/meta-backend.h" -+#include "meta/meta-context.h" -+#include "meta/util.h" -+ -+#include "meta-dbus-a11y.h" -+ -+enum -+{ -+ A11Y_MODIFIERS_CHANGED, -+ N_SIGNALS -+}; -+ -+static guint signals[N_SIGNALS]; -+ -+enum -+{ -+ PROP_0, -+ PROP_BACKEND, -+ N_PROPS, -+}; -+ -+static GParamSpec *props[N_PROPS]; -+ -+typedef struct _MetaA11yManager -+{ -+ GObject parent; -+ MetaBackend *backend; -+} MetaA11yManager; -+ -+G_DEFINE_TYPE (MetaA11yManager, meta_a11y_manager, G_TYPE_OBJECT) -+ -+static void -+meta_a11y_manager_set_property (GObject *object, -+ guint prop_id, -+ const GValue *value, -+ GParamSpec *pspec) -+{ -+ MetaA11yManager *a11y_manager = META_A11Y_MANAGER (object); -+ -+ switch (prop_id) -+ { -+ case PROP_BACKEND: -+ a11y_manager->backend = g_value_get_object (value); -+ break; -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+meta_a11y_manager_class_init (MetaA11yManagerClass *klass) -+{ -+ GObjectClass *object_class = G_OBJECT_CLASS (klass); -+ -+ object_class->set_property = meta_a11y_manager_set_property; -+ -+ props[PROP_BACKEND] = -+ g_param_spec_object ("backend", NULL, NULL, -+ META_TYPE_BACKEND, -+ G_PARAM_WRITABLE | -+ G_PARAM_CONSTRUCT_ONLY | -+ G_PARAM_STATIC_STRINGS); -+ -+ g_object_class_install_properties (object_class, N_PROPS, props); -+} -+ -+static void -+meta_a11y_manager_init (MetaA11yManager *a11y_manager) -+{ -+} -+ -+MetaA11yManager * -+meta_a11y_manager_new (MetaBackend *backend) -+{ -+ return g_object_new (META_TYPE_A11Y_MANAGER, -+ "backend", backend, -+ NULL); -+} -diff --git a/src/backends/meta-a11y-manager.h b/src/backends/meta-a11y-manager.h -new file mode 100644 -index 0000000000..df5c9a5d21 ---- /dev/null -+++ b/src/backends/meta-a11y-manager.h -@@ -0,0 +1,29 @@ -+/* -+ * Copyright 2024 GNOME Foundation -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, see . -+ * -+ */ -+ -+#pragma once -+ -+#include -+ -+#include "backends/meta-backend-types.h" -+#include "clutter/clutter.h" -+ -+#define META_TYPE_A11Y_MANAGER (meta_a11y_manager_get_type ()) -+G_DECLARE_FINAL_TYPE (MetaA11yManager, meta_a11y_manager, META, A11Y_MANAGER, GObject) -+ -+MetaA11yManager * meta_a11y_manager_new (MetaBackend *backend); -diff --git a/src/meson.build b/src/meson.build -index 6c19300b8f..c57fd935f6 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -193,6 +193,8 @@ mutter_sources = [ - 'backends/edid.h', - 'backends/edid-parse.c', - 'backends/gsm-inhibitor-flag.h', -+ 'backends/meta-a11y-manager.c', -+ 'backends/meta-a11y-manager.h', - 'backends/meta-backend.c', - 'backends/meta-backend-private.h', - 'backends/meta-barrier.c', --- -2.44.0.501.g19981daefd.dirty - - -From 3976dc0c8accf9fcd2968e5980408fca32589a69 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 19:03:10 +0100 -Subject: [PATCH 06/14] backends: Manage MetaA11yManager in MetaBackend - -The MetaBackend will own the MetaA11yManager, being actually -put to use in backend implementations. - -Part-of: -(cherry picked from commit f4ce1e8a462b96e207ff0ba21040c50e91c62cc2) ---- - src/backends/meta-backend-private.h | 3 +++ - src/backends/meta-backend.c | 18 ++++++++++++++++++ - 2 files changed, 21 insertions(+) - -diff --git a/src/backends/meta-backend-private.h b/src/backends/meta-backend-private.h -index 1d2af368bd..411a0a5d57 100644 ---- a/src/backends/meta-backend-private.h -+++ b/src/backends/meta-backend-private.h -@@ -28,6 +28,7 @@ - #include "meta/meta-backend.h" - #include "meta/meta-idle-monitor.h" - #include "meta/meta-orientation-manager.h" -+#include "backends/meta-a11y-manager.h" - #include "backends/meta-backend-types.h" - #include "backends/meta-cursor-renderer.h" - #include "backends/meta-egl.h" -@@ -159,6 +160,8 @@ MetaScreenCast * meta_backend_get_screen_cast (MetaBackend *backend); - - MetaInputCapture * meta_backend_get_input_capture (MetaBackend *backend); - -+MetaA11yManager * meta_backend_get_a11y_manager (MetaBackend *backend); -+ - gboolean meta_backend_grab_device (MetaBackend *backend, - int device_id, - uint32_t timestamp); -diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c -index cdca232abc..2cdc7edf6c 100644 ---- a/src/backends/meta-backend.c -+++ b/src/backends/meta-backend.c -@@ -52,6 +52,7 @@ - - #include - -+#include "backends/meta-a11y-manager.h" - #include "backends/meta-barrier-private.h" - #include "backends/meta-color-manager-private.h" - #include "backends/meta-cursor-renderer.h" -@@ -154,6 +155,7 @@ struct _MetaBackendPrivate - MetaRemoteDesktop *remote_desktop; - #endif - MetaInputCapture *input_capture; -+ MetaA11yManager *a11y_manager; - - #ifdef HAVE_LIBWACOM - WacomDeviceDatabase *wacom_db; -@@ -226,6 +228,7 @@ meta_backend_dispose (GObject *object) - g_clear_object (&priv->input_capture); - g_clear_object (&priv->dbus_session_watcher); - g_clear_object (&priv->remote_access_controller); -+ g_clear_object (&priv->a11y_manager); - g_clear_object (&priv->dnd); - - #ifdef HAVE_LIBWACOM -@@ -607,6 +610,8 @@ meta_backend_real_post_init (MetaBackend *backend) - priv->remote_access_controller, - META_DBUS_SESSION_MANAGER (priv->input_capture)); - -+ priv->a11y_manager = meta_a11y_manager_new (backend); -+ - if (!meta_monitor_manager_is_headless (priv->monitor_manager)) - init_pointer_position (backend); - -@@ -1548,6 +1553,19 @@ meta_backend_get_remote_access_controller (MetaBackend *backend) - return priv->remote_access_controller; - } - -+/** -+ * meta_backend_get_a11y_manager: -+ * -+ * Returns: (transfer none): the #MetaA11yManager -+ */ -+MetaA11yManager * -+meta_backend_get_a11y_manager (MetaBackend *backend) -+{ -+ MetaBackendPrivate *priv = meta_backend_get_instance_private (backend); -+ -+ return priv->a11y_manager; -+} -+ - /** - * meta_backend_is_rendering_hardware_accelerated: - * @backend: A #MetaBackend --- -2.44.0.501.g19981daefd.dirty - - -From b6e5ec24b95f0b389b18927af0956f3b59d7b21d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 19:15:54 +0100 -Subject: [PATCH 07/14] backends: Implement A11y monitor interface - -Implement the org.freedesktop.a11y.KeyboardMonitor interface, -allowing screen readers to interact with Mutter and grab -shortcuts or full keyboard interaction. - -Carlos Garnacho: Move setup to ::constructed. - -Part-of: -(cherry picked from commit 0bcda4ecf47f04cb76fb642f05d498d1dd941e15) ---- - src/backends/meta-a11y-manager.c | 274 +++++++++++++++++++++++++++++++ - 1 file changed, 274 insertions(+) - -diff --git a/src/backends/meta-a11y-manager.c b/src/backends/meta-a11y-manager.c -index 22de01030d..5f8d5b1ee4 100644 ---- a/src/backends/meta-a11y-manager.c -+++ b/src/backends/meta-a11y-manager.c -@@ -44,14 +44,253 @@ enum - - static GParamSpec *props[N_PROPS]; - -+typedef struct _MetaA11yKeystroke -+{ -+ uint32_t keysym; -+ ClutterModifierType modifiers; -+} MetaA11yKeystroke; -+ -+typedef struct _MetaA11yKeyGrabber -+{ -+ MetaA11yManager *manager; -+ GDBusConnection *connection; -+ char *bus_name; -+ guint bus_name_watcher_id; -+ gboolean grab_all; -+ GArray *modifiers; -+ GArray *keystrokes; -+} MetaA11yKeyGrabber; -+ - typedef struct _MetaA11yManager - { - GObject parent; - MetaBackend *backend; -+ guint dbus_name_id; -+ MetaDBusKeyboardMonitor *keyboard_monitor_skeleton; -+ -+ GList *key_grabbers; -+ GHashTable *grabbed_keypresses; -+ GHashTable *all_grabbed_modifiers; - } MetaA11yManager; - - G_DEFINE_TYPE (MetaA11yManager, meta_a11y_manager, G_TYPE_OBJECT) - -+static void -+key_grabber_free (MetaA11yKeyGrabber *grabber) -+{ -+ if (grabber->bus_name_watcher_id) -+ { -+ g_bus_unwatch_name (grabber->bus_name_watcher_id); -+ grabber->bus_name_watcher_id = 0; -+ } -+ -+ g_clear_pointer (&grabber->keystrokes, g_array_unref); -+ g_clear_pointer (&grabber->modifiers, g_array_unref); -+ g_clear_object (&grabber->connection); -+ g_clear_pointer (&grabber->bus_name, g_free); -+ -+ g_free (grabber); -+} -+ -+static void -+rebuild_all_grabbed_modifiers (MetaA11yManager *a11y_manager, -+ MetaA11yKeyGrabber *ignored_grabber) -+{ -+ GList *l; -+ int i; -+ -+ g_hash_table_remove_all (a11y_manager->all_grabbed_modifiers); -+ -+ for (l = a11y_manager->key_grabbers; l; l = l->next) -+ { -+ MetaA11yKeyGrabber *grabber = l->data; -+ -+ if (grabber == ignored_grabber) -+ continue; -+ -+ for (i = 0; i < grabber->modifiers->len; i++) -+ { -+ uint32_t modifier_keysym = g_array_index (grabber->modifiers, uint32_t, i); -+ g_hash_table_add (a11y_manager->all_grabbed_modifiers, -+ GUINT_TO_POINTER (modifier_keysym)); -+ } -+ } -+} -+ -+static void -+key_grabber_bus_name_vanished_callback (GDBusConnection *connection, -+ const char *name, -+ gpointer user_data) -+{ -+ MetaA11yKeyGrabber *grabber = user_data; -+ MetaA11yManager *a11y_manager = grabber->manager; -+ -+ grabber->manager->key_grabbers = -+ g_list_remove (grabber->manager->key_grabbers, grabber); -+ -+ if (grabber->modifiers) -+ { -+ rebuild_all_grabbed_modifiers (a11y_manager, grabber); -+ g_signal_emit (grabber->manager, signals[A11Y_MODIFIERS_CHANGED], 0); -+ } -+ -+ key_grabber_free (grabber); -+} -+ -+static MetaA11yKeyGrabber * -+ensure_key_grabber (MetaA11yManager *a11y_manager, -+ GDBusMethodInvocation *invocation) -+{ -+ GDBusConnection *connection = -+ g_dbus_method_invocation_get_connection (invocation); -+ const char *sender = g_dbus_method_invocation_get_sender (invocation); -+ MetaA11yKeyGrabber *grabber; -+ GList *l; -+ -+ for (l = a11y_manager->key_grabbers; l; l = l->next) -+ { -+ grabber = l->data; -+ -+ if (g_strcmp0 (grabber->bus_name, sender) == 0) -+ return grabber; -+ } -+ -+ grabber = g_new0 (MetaA11yKeyGrabber, 1); -+ grabber->manager = a11y_manager; -+ grabber->bus_name = g_strdup (sender); -+ grabber->connection = g_object_ref (connection); -+ -+ grabber->bus_name_watcher_id = -+ g_bus_watch_name_on_connection (connection, -+ grabber->bus_name, -+ G_BUS_NAME_WATCHER_FLAGS_NONE, -+ NULL, -+ key_grabber_bus_name_vanished_callback, -+ grabber, -+ NULL); -+ -+ a11y_manager->key_grabbers = -+ g_list_prepend (a11y_manager->key_grabbers, grabber); -+ -+ return grabber; -+} -+ -+static gboolean -+handle_grab_keyboard (MetaDBusKeyboardMonitor *skeleton, -+ GDBusMethodInvocation *invocation, -+ MetaA11yManager *a11y_manager) -+{ -+ MetaA11yKeyGrabber *grabber; -+ -+ grabber = ensure_key_grabber (a11y_manager, invocation); -+ grabber->grab_all = TRUE; -+ meta_dbus_keyboard_monitor_complete_grab_keyboard (skeleton, invocation); -+ -+ return G_DBUS_METHOD_INVOCATION_HANDLED; -+} -+ -+static gboolean -+handle_ungrab_keyboard (MetaDBusKeyboardMonitor *skeleton, -+ GDBusMethodInvocation *invocation, -+ MetaA11yManager *a11y_manager) -+{ -+ MetaA11yKeyGrabber *grabber; -+ -+ grabber = ensure_key_grabber (a11y_manager, invocation); -+ grabber->grab_all = FALSE; -+ meta_dbus_keyboard_monitor_complete_ungrab_keyboard (skeleton, invocation); -+ -+ return G_DBUS_METHOD_INVOCATION_HANDLED; -+} -+ -+static gboolean -+handle_set_key_grabs (MetaDBusKeyboardMonitor *skeleton, -+ GDBusMethodInvocation *invocation, -+ GVariant *modifiers, -+ GVariant *keystrokes, -+ MetaA11yManager *a11y_manager) -+{ -+ MetaA11yKeyGrabber *grabber; -+ GVariantIter iter; -+ uint32_t modifier_keysym; -+ MetaA11yKeystroke keystroke; -+ -+ grabber = ensure_key_grabber (a11y_manager, invocation); -+ -+ g_clear_pointer (&grabber->modifiers, g_array_unref); -+ g_clear_pointer (&grabber->keystrokes, g_array_unref); -+ grabber->modifiers = g_array_new (FALSE, FALSE, sizeof (uint32_t)); -+ grabber->keystrokes = g_array_new (FALSE, FALSE, sizeof (MetaA11yKeystroke)); -+ -+ g_variant_iter_init (&iter, modifiers); -+ while (g_variant_iter_next (&iter, "u", &modifier_keysym)) -+ g_array_append_val (grabber->modifiers, modifier_keysym); -+ -+ g_variant_iter_init (&iter, keystrokes); -+ while (g_variant_iter_next (&iter, "(uu)", &keystroke.keysym, -+ &keystroke.modifiers)) -+ g_array_append_val (grabber->keystrokes, keystroke); -+ -+ rebuild_all_grabbed_modifiers (a11y_manager, NULL); -+ g_signal_emit (a11y_manager, signals[A11Y_MODIFIERS_CHANGED], 0); -+ meta_dbus_keyboard_monitor_complete_set_key_grabs (skeleton, invocation); -+ -+ return G_DBUS_METHOD_INVOCATION_HANDLED; -+} -+ -+static void -+on_bus_acquired (GDBusConnection *connection, -+ const char *name, -+ gpointer user_data) -+{ -+ MetaA11yManager *manager = user_data; -+ -+ manager->keyboard_monitor_skeleton = meta_dbus_keyboard_monitor_skeleton_new (); -+ -+ g_signal_connect (manager->keyboard_monitor_skeleton, "handle-grab-keyboard", -+ G_CALLBACK (handle_grab_keyboard), manager); -+ g_signal_connect (manager->keyboard_monitor_skeleton, "handle-ungrab-keyboard", -+ G_CALLBACK (handle_ungrab_keyboard), manager); -+ g_signal_connect (manager->keyboard_monitor_skeleton, "handle-set-key-grabs", -+ G_CALLBACK (handle_set_key_grabs), manager); -+ -+ g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (manager->keyboard_monitor_skeleton), -+ connection, -+ "/org/freedesktop/a11y/Manager", -+ NULL); -+} -+ -+static void -+on_name_acquired (GDBusConnection *connection, -+ const char *name, -+ gpointer user_data) -+{ -+ g_debug ("Acquired name %s", name); -+} -+ -+static void -+on_name_lost (GDBusConnection *connection, -+ const char *name, -+ gpointer user_data) -+{ -+ g_debug ("Lost or failed to acquire name %s", name); -+} -+ -+static void -+meta_a11y_manager_finalize (GObject *object) -+{ -+ MetaA11yManager *a11y_manager = META_A11Y_MANAGER (object); -+ -+ g_list_free_full (a11y_manager->key_grabbers, -+ (GDestroyNotify) key_grabber_free); -+ g_clear_object (&a11y_manager->keyboard_monitor_skeleton); -+ g_clear_pointer (&a11y_manager->grabbed_keypresses, g_hash_table_destroy); -+ g_clear_pointer (&a11y_manager->all_grabbed_modifiers, g_hash_table_destroy); -+ g_bus_unown_name (a11y_manager->dbus_name_id); -+ -+ G_OBJECT_CLASS (meta_a11y_manager_parent_class)->finalize (object); -+} -+ - static void - meta_a11y_manager_set_property (GObject *object, - guint prop_id, -@@ -71,12 +310,47 @@ meta_a11y_manager_set_property (GObject *object, - } - } - -+static void -+meta_a11y_manager_constructed (GObject *object) -+{ -+ MetaA11yManager *a11y_manager = META_A11Y_MANAGER (object); -+ MetaContext *context; -+ -+ g_assert (a11y_manager->backend); -+ context = meta_backend_get_context (a11y_manager->backend); -+ -+ a11y_manager->grabbed_keypresses = g_hash_table_new (NULL, NULL); -+ a11y_manager->all_grabbed_modifiers = g_hash_table_new (NULL, NULL); -+ -+ a11y_manager->dbus_name_id = -+ g_bus_own_name (G_BUS_TYPE_SESSION, -+ "org.freedesktop.a11y.Manager", -+ G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT | -+ (meta_context_is_replacing (context) ? -+ G_BUS_NAME_OWNER_FLAGS_REPLACE : -+ G_BUS_NAME_OWNER_FLAGS_NONE), -+ on_bus_acquired, -+ on_name_acquired, -+ on_name_lost, -+ a11y_manager, -+ NULL); -+} -+ - static void - meta_a11y_manager_class_init (MetaA11yManagerClass *klass) - { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - -+ object_class->finalize = meta_a11y_manager_finalize; - object_class->set_property = meta_a11y_manager_set_property; -+ object_class->constructed = meta_a11y_manager_constructed; -+ -+ signals[A11Y_MODIFIERS_CHANGED] = -+ g_signal_new ("a11y-modifiers-changed", -+ G_TYPE_FROM_CLASS (klass), -+ G_SIGNAL_RUN_LAST, -+ 0, NULL, NULL, NULL, -+ G_TYPE_NONE, 0); - - props[PROP_BACKEND] = - g_param_spec_object ("backend", NULL, NULL, --- -2.44.0.501.g19981daefd.dirty - - -From c60b8ee816991f6ca0ccd6e1c66b19a649a563df Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 19:17:08 +0100 -Subject: [PATCH 08/14] backends: Add MetaA11yManager method to get configured - a11y modifiers - -The ::a11y-modifiers-change method allows tracking for changes in the -configured modifiers, add this method to allow backends to get the -modifiers so that they can be passed along the lower layers. - -Carlos Garnacho: Turn into a method instead of a signal argument, turn -into an array+length instead of a hashtable. - -Part-of: -(cherry picked from commit 1498724774976fad1dbd4e5bc210205cef1faf9d) ---- - src/backends/meta-a11y-manager.c | 24 ++++++++++++++++++++++++ - src/backends/meta-a11y-manager.h | 3 +++ - 2 files changed, 27 insertions(+) - -diff --git a/src/backends/meta-a11y-manager.c b/src/backends/meta-a11y-manager.c -index 5f8d5b1ee4..647962c866 100644 ---- a/src/backends/meta-a11y-manager.c -+++ b/src/backends/meta-a11y-manager.c -@@ -374,3 +374,27 @@ meta_a11y_manager_new (MetaBackend *backend) - "backend", backend, - NULL); - } -+ -+uint32_t * -+meta_a11y_manager_get_modifier_keysyms (MetaA11yManager *a11y_manager, -+ int *n_modifiers) -+{ -+ GArray *modifier_keysyms; -+ GHashTableIter iter; -+ gpointer key; -+ -+ modifier_keysyms = g_array_new (FALSE, FALSE, sizeof (uint32_t)); -+ -+ g_hash_table_iter_init (&iter, a11y_manager->all_grabbed_modifiers); -+ while (g_hash_table_iter_next (&iter, &key, NULL)) -+ { -+ uint32_t keysym = GPOINTER_TO_UINT (key); -+ -+ g_array_append_val (modifier_keysyms, keysym); -+ } -+ -+ if (n_modifiers) -+ *n_modifiers = modifier_keysyms->len; -+ -+ return (uint32_t *) g_array_free (modifier_keysyms, FALSE); -+} -diff --git a/src/backends/meta-a11y-manager.h b/src/backends/meta-a11y-manager.h -index df5c9a5d21..df07c94de2 100644 ---- a/src/backends/meta-a11y-manager.h -+++ b/src/backends/meta-a11y-manager.h -@@ -27,3 +27,6 @@ - G_DECLARE_FINAL_TYPE (MetaA11yManager, meta_a11y_manager, META, A11Y_MANAGER, GObject) - - MetaA11yManager * meta_a11y_manager_new (MetaBackend *backend); -+ -+uint32_t * meta_a11y_manager_get_modifier_keysyms (MetaA11yManager *a11y_manager, -+ int *n_modifiers); --- -2.44.0.501.g19981daefd.dirty - - -From 3ce02680be1fea0c488c9681e87dfafac315fc06 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 19:03:50 +0100 -Subject: [PATCH 09/14] backends/native: Propagate a11y modifiers from - MetaA11yManager - -Listen to changes in MetaA11yManager configured modifiers, and propagate -these along to the MetaSeatNative. This lets the backend keep track of -configuration changes in a11y modifiers. - -Part-of: -(cherry picked from commit 45f6bed7809dadb40df98308b9041fe08b453871) ---- - src/backends/native/meta-backend-native.c | 25 +++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c -index ee02b2783a..8732f3f7d2 100644 ---- a/src/backends/native/meta-backend-native.c -+++ b/src/backends/native/meta-backend-native.c -@@ -38,6 +38,7 @@ - - #include - -+#include "backends/meta-a11y-manager.h" - #include "backends/meta-color-manager.h" - #include "backends/meta-cursor-tracker-private.h" - #include "backends/meta-idle-manager.h" -@@ -183,6 +184,23 @@ update_viewports (MetaBackend *backend) - g_object_unref (viewports); - } - -+static void -+on_a11y_modifiers_changed (MetaA11yManager *a11y_manager, -+ MetaBackend *backend) -+{ -+ MetaSeatNative *seat; -+ ClutterBackend *clutter_backend; -+ g_autofree uint32_t *modifiers; -+ int n_modifiers; -+ -+ clutter_backend = meta_backend_get_clutter_backend (backend); -+ seat = META_SEAT_NATIVE (clutter_backend_get_default_seat (clutter_backend)); -+ modifiers = meta_a11y_manager_get_modifier_keysyms (a11y_manager, -+ &n_modifiers); -+ -+ meta_seat_native_set_a11y_modifiers (seat, modifiers, n_modifiers); -+} -+ - static void - meta_backend_native_post_init (MetaBackend *backend) - { -@@ -191,6 +209,7 @@ meta_backend_native_post_init (MetaBackend *backend) - meta_backend_native_get_instance_private (backend_native); - MetaMonitorManager *monitor_manager = - meta_backend_get_monitor_manager (backend); -+ MetaA11yManager *a11y_manager = meta_backend_get_a11y_manager (backend); - - META_BACKEND_CLASS (meta_backend_native_parent_class)->post_init (backend); - -@@ -200,6 +219,12 @@ meta_backend_native_post_init (MetaBackend *backend) - g_signal_connect_swapped (monitor_manager, "monitors-changed-internal", - G_CALLBACK (update_viewports), backend); - update_viewports (backend); -+ -+ g_signal_connect_object (a11y_manager, -+ "a11y-modifiers-changed", -+ G_CALLBACK (on_a11y_modifiers_changed), -+ backend, -+ G_CONNECT_DEFAULT); - } - - static MetaBackendCapabilities --- -2.44.0.501.g19981daefd.dirty - - -From b03c4412be7fec86f43c975e418556f17398fd75 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Wed, 5 Feb 2025 19:16:41 +0100 -Subject: [PATCH 10/14] backends: Add method to pass key events to screen - readers - -Accessibility shortcuts and keyboard grabs need to be consumed, -and key events propagated to screen readers. Add a function that -does it all at once. - -Part-of: -(cherry picked from commit 800981c40c4f18f496a79227b3d3d5f0cdc195c9) ---- - src/backends/meta-a11y-manager.c | 148 +++++++++++++++++++++++++++++++ - src/backends/meta-a11y-manager.h | 3 + - 2 files changed, 151 insertions(+) - -diff --git a/src/backends/meta-a11y-manager.c b/src/backends/meta-a11y-manager.c -index 647962c866..a6ec4f6f3a 100644 ---- a/src/backends/meta-a11y-manager.c -+++ b/src/backends/meta-a11y-manager.c -@@ -27,6 +27,12 @@ - - #include "meta-dbus-a11y.h" - -+#define MOUSE_BUTTONS_MASK (CLUTTER_BUTTON1_MASK | \ -+ CLUTTER_BUTTON2_MASK | \ -+ CLUTTER_BUTTON3_MASK | \ -+ CLUTTER_BUTTON4_MASK | \ -+ CLUTTER_BUTTON5_MASK) -+ - enum - { - A11Y_MODIFIERS_CHANGED, -@@ -375,6 +381,148 @@ meta_a11y_manager_new (MetaBackend *backend) - NULL); - } - -+static gboolean -+should_grab_keypress (MetaA11yManager *a11y_manager, -+ MetaA11yKeyGrabber *grabber, -+ uint32_t keysym, -+ ClutterModifierType modifiers) -+{ -+ int i; -+ -+ if (grabber->grab_all) -+ return TRUE; -+ -+ if (grabber->modifiers) -+ { -+ for (i = 0; i < grabber->modifiers->len; i++) -+ { -+ uint32_t modifier_keysym; -+ -+ modifier_keysym = g_array_index (grabber->modifiers, uint32_t, i); -+ -+ if (keysym == modifier_keysym || -+ g_hash_table_contains (a11y_manager->grabbed_keypresses, -+ GUINT_TO_POINTER (modifier_keysym))) -+ return TRUE; -+ } -+ } -+ -+ if (grabber->keystrokes) -+ { -+ for (i = 0; i < grabber->keystrokes->len; i++) -+ { -+ MetaA11yKeystroke *keystroke = -+ &(g_array_index (grabber->keystrokes, MetaA11yKeystroke, i)); -+ -+ if (keysym == keystroke->keysym && modifiers == keystroke->modifiers) -+ return TRUE; -+ } -+ } -+ -+ return FALSE; -+} -+ -+static gboolean -+is_grabbed_modifier_key (MetaA11yManager *a11y_manager, -+ uint32_t keysym) -+{ -+ return g_hash_table_contains (a11y_manager->all_grabbed_modifiers, -+ GUINT_TO_POINTER (keysym)); -+} -+ -+static void -+notify_client (MetaA11yManager *a11y_manager, -+ MetaA11yKeyGrabber *key_grabber, -+ gboolean released, -+ ClutterModifierType state, -+ uint32_t keysym, -+ uint32_t unichar, -+ uint32_t keycode) -+{ -+ g_autoptr (GError) error = NULL; -+ -+ if (!g_dbus_connection_emit_signal (key_grabber->connection, -+ key_grabber->bus_name, -+ "/org/freedesktop/a11y/Manager", -+ "org.freedesktop.a11y.KeyboardMonitor", -+ "KeyEvent", -+ g_variant_new ("(buuuq)", -+ released, -+ state, -+ keysym, -+ unichar, -+ (uint16_t) keycode), -+ &error)) -+ g_warning ("Could not emit a11y KeyEvent: %s", error->message); -+} -+ -+gboolean -+meta_a11y_manager_notify_clients (MetaA11yManager *a11y_manager, -+ const ClutterEvent *event) -+{ -+ gboolean a11y_grabbed = FALSE; -+ gboolean released = clutter_event_type (event) == CLUTTER_KEY_RELEASE; -+ /* A grabbed modifier is a11y grabbed if it was not double pressed, otherwise we process it normally */ -+ gboolean is_ignorable = -+ !!(clutter_event_get_flags (event) & -+ CLUTTER_EVENT_FLAG_A11Y_MODIFIER_FIRST_CLICK); -+ /* The Clutter event modifiers mask includes mouse buttons as well, -+ * but they're not expected by ATs, so we filter them out. -+ */ -+ uint32_t keysym = clutter_event_get_key_symbol (event); -+ uint32_t unichar = clutter_event_get_key_unicode (event); -+ uint32_t keycode = clutter_event_get_key_code (event); -+ ClutterModifierType state; -+ GList *l; -+ -+ state = clutter_event_get_state (event) & ~MOUSE_BUTTONS_MASK; -+ -+ for (l = a11y_manager->key_grabbers; l; l = l->next) -+ { -+ MetaA11yKeyGrabber *grabber = l->data; -+ -+ if (should_grab_keypress (a11y_manager, grabber, keysym, state)) -+ { -+ notify_client (a11y_manager, grabber, released, -+ state, keysym, unichar, keycode); -+ } -+ } -+ -+ if (is_grabbed_modifier_key (a11y_manager, keysym) && !is_ignorable) -+ return FALSE; -+ -+ if (released) -+ { -+ if (g_hash_table_contains (a11y_manager->grabbed_keypresses, -+ GUINT_TO_POINTER (keysym))) -+ { -+ g_hash_table_remove (a11y_manager->grabbed_keypresses, -+ GUINT_TO_POINTER (keysym)); -+ a11y_grabbed = TRUE; -+ } -+ } -+ else -+ { -+ if (g_hash_table_contains (a11y_manager->grabbed_keypresses, -+ GUINT_TO_POINTER (keysym))) -+ a11y_grabbed = TRUE; -+ -+ for (l = a11y_manager->key_grabbers; l; l = l->next) -+ { -+ MetaA11yKeyGrabber *grabber = l->data; -+ -+ if (should_grab_keypress (a11y_manager, grabber, keysym, state)) -+ { -+ g_hash_table_add (a11y_manager->grabbed_keypresses, -+ GUINT_TO_POINTER (keysym)); -+ a11y_grabbed = TRUE; -+ } -+ } -+ } -+ -+ return a11y_grabbed; -+} -+ - uint32_t * - meta_a11y_manager_get_modifier_keysyms (MetaA11yManager *a11y_manager, - int *n_modifiers) -diff --git a/src/backends/meta-a11y-manager.h b/src/backends/meta-a11y-manager.h -index df07c94de2..754cb65394 100644 ---- a/src/backends/meta-a11y-manager.h -+++ b/src/backends/meta-a11y-manager.h -@@ -28,5 +28,8 @@ G_DECLARE_FINAL_TYPE (MetaA11yManager, meta_a11y_manager, META, A11Y_MANAGER, GO - - MetaA11yManager * meta_a11y_manager_new (MetaBackend *backend); - -+gboolean meta_a11y_manager_notify_clients (MetaA11yManager *a11y_manager, -+ const ClutterEvent *event); -+ - uint32_t * meta_a11y_manager_get_modifier_keysyms (MetaA11yManager *a11y_manager, - int *n_modifiers); --- -2.44.0.501.g19981daefd.dirty - - -From 921a010f93b4b89d50b7ba97666af367bd8719a6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= -Date: Fri, 7 Feb 2025 14:21:17 +0100 -Subject: [PATCH 11/14] backends: Add a11y interface methods to subscribe to - key event input - -This adds a pair of methods to signal an interest in receiving -all key events without grabbing them, e. g. the previously expected behavior -by screen readers. - -Part-of: -(cherry picked from commit 20c9b8cf0c85dabbe73b5b0ce155729a92f47bb0) ---- - data/dbus-interfaces/org.freedesktop.a11y.xml | 31 +++++++++++- - src/backends/meta-a11y-manager.c | 47 ++++++++++++++++++- - 2 files changed, 75 insertions(+), 3 deletions(-) - -diff --git a/data/dbus-interfaces/org.freedesktop.a11y.xml b/data/dbus-interfaces/org.freedesktop.a11y.xml -index c60480e89c..4f1d210423 100644 ---- a/data/dbus-interfaces/org.freedesktop.a11y.xml -+++ b/data/dbus-interfaces/org.freedesktop.a11y.xml -@@ -16,7 +16,7 @@ - GrabKeyboard: - - Starts grabbing all key events. The client receives the events -- through the KeyEvent signal as always, but the events aren't handled -+ through the KeyEvent signal, and in addition, the events aren't handled - normally by the compositor. This includes changes to the state - of toggles like Caps Lock, Num Lock, and Scroll Lock. - -@@ -33,9 +33,36 @@ - - After calling this method, the key grabs specified in the last call - to SetKeyGrabs, if any, are still in effect. -+ Also, the client will still receive key events through the KeyEvent -+ signal, if it has called WatchKeyboard. - --> - - -+ -+ -+ -+ -+ -+ -