diff --git a/0001-Revert-clutter-actor-Cache-stage-relative-instead-of.patch b/0001-Revert-clutter-actor-Cache-stage-relative-instead-of.patch new file mode 100644 index 0000000..9d3846f --- /dev/null +++ b/0001-Revert-clutter-actor-Cache-stage-relative-instead-of.patch @@ -0,0 +1,144 @@ +From d11feddbb29f0bf6de104d8d5c54cf18f3ca96da Mon Sep 17 00:00:00 2001 +From: Alynx Zhou +Date: Thu, 14 Mar 2024 19:20:57 +0800 +Subject: [PATCH] Revert "clutter/actor: Cache stage-relative instead of + absolute modelviews" + +This reverts commit 703bbe0e99dbb688352e0bff396e5cbf2c6af45b. +--- + clutter/clutter/clutter-actor.c | 67 ++++++++++----------------------- + 1 file changed, 20 insertions(+), 47 deletions(-) + +diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c +index dd0d5ceb6..70dea5ca2 100644 +--- a/clutter/clutter/clutter-actor.c ++++ b/clutter/clutter/clutter-actor.c +@@ -612,7 +612,7 @@ struct _ClutterActorPrivate + /* the cached transformation matrix; see apply_transform() */ + graphene_matrix_t transform; + +- graphene_matrix_t stage_relative_modelview; ++ graphene_matrix_t absolute_modelview; + + float resource_scale; + +@@ -776,7 +776,7 @@ struct _ClutterActorPrivate + guint clear_stage_views_needs_stage_views_changed : 1; + guint needs_redraw : 1; + guint needs_finish_layout : 1; +- guint stage_relative_modelview_valid : 1; ++ guint absolute_modelview_valid : 1; + }; + + enum +@@ -2425,7 +2425,7 @@ absolute_geometry_changed (ClutterActor *actor) + { + actor->priv->needs_update_stage_views = TRUE; + actor->priv->needs_visible_paint_volume_update = TRUE; +- actor->priv->stage_relative_modelview_valid = FALSE; ++ actor->priv->absolute_modelview_valid = FALSE; + + actor->priv->needs_finish_layout = TRUE; + /* needs_finish_layout is already TRUE on the whole parent tree thanks +@@ -3047,9 +3047,8 @@ _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self, + graphene_matrix_t *matrix) + { + ClutterActorPrivate *priv = self->priv; +- ClutterActor *stage = _clutter_actor_get_stage_internal (self); +- graphene_matrix_t ancestor_modelview; +- graphene_matrix_t inverse_ancestor_modelview; ++ graphene_matrix_t parent_modelview; ++ graphene_matrix_t inverse_parent_modelview; + + /* Note we terminate before ever calling stage->apply_transform() + * since that would conceptually be relative to the underlying +@@ -3058,63 +3057,37 @@ _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self, + if (self == ancestor) + return; + +- if (!priv->stage_relative_modelview_valid) ++ if (!priv->absolute_modelview_valid) + { +- graphene_matrix_init_identity (&priv->stage_relative_modelview); ++ graphene_matrix_init_identity (&priv->absolute_modelview); + + if (priv->parent != NULL) + { + _clutter_actor_apply_relative_transformation_matrix (priv->parent, +- stage, +- &priv->stage_relative_modelview); ++ NULL, ++ &priv->absolute_modelview); + } + +- _clutter_actor_apply_modelview_transform (self, +- &priv->stage_relative_modelview); ++ _clutter_actor_apply_modelview_transform (self, &priv->absolute_modelview); + +- priv->stage_relative_modelview_valid = TRUE; ++ priv->absolute_modelview_valid = TRUE; + } + + if (ancestor == NULL) + { +- _clutter_actor_apply_modelview_transform (stage, matrix); +- graphene_matrix_multiply (&priv->stage_relative_modelview, matrix, matrix); +- return; +- } +- +- if (ancestor == stage) +- { +- graphene_matrix_multiply (&priv->stage_relative_modelview, matrix, matrix); +- return; +- } +- +- if (ancestor == priv->parent) +- { +- _clutter_actor_apply_modelview_transform (self, matrix); ++ graphene_matrix_multiply (&priv->absolute_modelview, matrix, matrix); + return; + } + +- graphene_matrix_init_identity (&ancestor_modelview); ++ graphene_matrix_init_identity (&parent_modelview); + _clutter_actor_apply_relative_transformation_matrix (ancestor, +- stage, +- &ancestor_modelview); +- +- if (graphene_matrix_near (&priv->stage_relative_modelview, +- &ancestor_modelview, +- FLT_EPSILON)) +- return; +- +- if (graphene_matrix_is_identity (&ancestor_modelview)) +- { +- graphene_matrix_multiply (&priv->stage_relative_modelview, matrix, matrix); +- return; +- } +- +- if (graphene_matrix_inverse (&ancestor_modelview, +- &inverse_ancestor_modelview)) ++ NULL, ++ &parent_modelview); ++ if (graphene_matrix_inverse (&parent_modelview, ++ &inverse_parent_modelview)) + { +- graphene_matrix_multiply (&inverse_ancestor_modelview, matrix, matrix); +- graphene_matrix_multiply (&priv->stage_relative_modelview, matrix, matrix); ++ graphene_matrix_multiply (&inverse_parent_modelview, matrix, matrix); ++ graphene_matrix_multiply (&priv->absolute_modelview, matrix, matrix); + return; + } + +@@ -7469,7 +7442,7 @@ clutter_actor_init (ClutterActor *self) + priv->enable_model_view_transform = TRUE; + + priv->transform_valid = FALSE; +- priv->stage_relative_modelview_valid = FALSE; ++ priv->absolute_modelview_valid = FALSE; + + /* the default is to stretch the content, to match the + * current behaviour of basically all actors. also, it's +-- +2.44.0 + diff --git a/0001-Revert-clutter-stage-Avoid-queueing-stage-updates-wh.patch b/0001-Revert-clutter-stage-Avoid-queueing-stage-updates-wh.patch new file mode 100644 index 0000000..fe3bb09 --- /dev/null +++ b/0001-Revert-clutter-stage-Avoid-queueing-stage-updates-wh.patch @@ -0,0 +1,134 @@ +From 3f3c8876e0494cf7af92ce9b216da70fd4c0c275 Mon Sep 17 00:00:00 2001 +From: Xiaoguang Wang +Date: Tue, 23 Apr 2024 12:28:45 +0800 +Subject: [PATCH] Revert "clutter/stage: Avoid queueing stage updates when + they're already queued" + +This reverts commit 261f516af4e635d4bb263bbbbb2f843f0cbe09de. +--- + clutter/clutter/clutter-stage-private.h | 2 +- + clutter/clutter/clutter-stage-view.c | 2 +- + clutter/clutter/clutter-stage.c | 30 +++++++++---------------- + 3 files changed, 12 insertions(+), 22 deletions(-) + +diff --git a/clutter/clutter/clutter-stage-private.h b/clutter/clutter/clutter-stage-private.h +index c2460b327..f84fb10fe 100644 +--- a/clutter/clutter/clutter-stage-private.h ++++ b/clutter/clutter/clutter-stage-private.h +@@ -61,7 +61,7 @@ void clutter_stage_emit_before_paint (ClutterStage + void clutter_stage_emit_after_paint (ClutterStage *stage, + ClutterStageView *view, + ClutterFrame *frame); +-void clutter_stage_after_update (ClutterStage *stage, ++void clutter_stage_emit_after_update (ClutterStage *stage, + ClutterStageView *view, + ClutterFrame *frame); + +diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c +index 168746dd4..b59d1cc00 100644 +--- a/clutter/clutter/clutter-stage-view.c ++++ b/clutter/clutter/clutter-stage-view.c +@@ -1279,7 +1279,7 @@ handle_frame_clock_frame (ClutterFrameClock *frame_clock, + priv->needs_update_devices = FALSE; + + _clutter_run_repaint_functions (CLUTTER_REPAINT_FLAGS_POST_PAINT); +- clutter_stage_after_update (stage, view, frame); ++ clutter_stage_emit_after_update (stage, view, frame); + + return clutter_frame_get_result (frame); + } +diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c +index 47405872b..f1d40426f 100644 +--- a/clutter/clutter/clutter-stage.c ++++ b/clutter/clutter/clutter-stage.c +@@ -137,8 +137,6 @@ struct _ClutterStagePrivate + + int update_freeze_count; + +- gboolean update_scheduled; +- + GHashTable *pointer_devices; + GHashTable *touch_sequences; + +@@ -528,15 +526,11 @@ clutter_stage_emit_after_paint (ClutterStage *stage, + } + + void +-clutter_stage_after_update (ClutterStage *stage, +- ClutterStageView *view, +- ClutterFrame *frame) ++clutter_stage_emit_after_update (ClutterStage *stage, ++ ClutterStageView *view, ++ ClutterFrame *frame) + { +- ClutterStagePrivate *priv = stage->priv; +- + g_signal_emit (stage, stage_signals[AFTER_UPDATE], 0, view, frame); +- +- priv->update_scheduled = FALSE; + } + + static gboolean +@@ -647,15 +641,19 @@ _clutter_stage_queue_event (ClutterStage *stage, + gboolean copy_event) + { + ClutterStagePrivate *priv; ++ gboolean first_event; + + g_return_if_fail (CLUTTER_IS_STAGE (stage)); + + priv = stage->priv; + ++ first_event = priv->event_queue->length == 0; ++ + g_queue_push_tail (priv->event_queue, + copy_event ? clutter_event_copy (event) : event); + +- clutter_stage_schedule_update (stage); ++ if (first_event) ++ clutter_stage_schedule_update (stage); + } + + gboolean +@@ -818,7 +816,8 @@ clutter_stage_queue_actor_relayout (ClutterStage *stage, + { + ClutterStagePrivate *priv = stage->priv; + +- clutter_stage_schedule_update (stage); ++ if (priv->pending_relayouts == NULL) ++ clutter_stage_schedule_update (stage); + + priv->pending_relayouts = g_slist_prepend (priv->pending_relayouts, + g_object_ref (actor)); +@@ -2532,19 +2531,12 @@ _clutter_stage_get_default_window (void) + void + clutter_stage_schedule_update (ClutterStage *stage) + { +- ClutterStagePrivate *priv = stage->priv; + ClutterStageWindow *stage_window; +- gboolean first_event; + GList *l; + + if (CLUTTER_ACTOR_IN_DESTRUCTION (stage)) + return; + +- first_event = priv->event_queue->length == 0; +- +- if (priv->update_scheduled && !first_event) +- return; +- + stage_window = _clutter_stage_get_window (stage); + if (stage_window == NULL) + return; +@@ -2555,8 +2547,6 @@ clutter_stage_schedule_update (ClutterStage *stage) + + clutter_stage_view_schedule_update (view); + } +- +- priv->update_scheduled = TRUE; + } + + ClutterPaintVolume * +-- +2.44.0 + diff --git a/_service b/_service index 4730be3..6f25d82 100644 --- a/_service +++ b/_service @@ -3,16 +3,16 @@ git https://gitlab.gnome.org/GNOME/mutter.git - 82bd40dcbcc3601da755678778f033bd9a30286d + refs/tags/45.3 @PARENT_TAG@+@TAG_OFFSET@ (.*)\+0 \1 - enable + *.tar - xz + zst diff --git a/_servicedata b/_servicedata deleted file mode 100644 index 07f62df..0000000 --- a/_servicedata +++ /dev/null @@ -1,4 +0,0 @@ - - - https://gitlab.gnome.org/GNOME/mutter.git - 82bd40dcbcc3601da755678778f033bd9a30286d \ No newline at end of file diff --git a/mutter-44.1+2.obscpio b/mutter-44.1+2.obscpio deleted file mode 100644 index 9c1eec6..0000000 --- a/mutter-44.1+2.obscpio +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0b39302a34c8598da2164133f193127686a26b906c851b4423ca6e97cd85faf8 -size 25993229 diff --git a/mutter-45.3.obscpio b/mutter-45.3.obscpio new file mode 100644 index 0000000..9f463dd --- /dev/null +++ b/mutter-45.3.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a83a17f6b454d3247772ed43d5999efe9726d1b09fbc8cceebd8208f599efdc +size 26478093 diff --git a/mutter-Lower-HIDPI_LIMIT-to-144.patch b/mutter-Lower-HIDPI_LIMIT-to-144.patch deleted file mode 100644 index 64e88cb..0000000 --- a/mutter-Lower-HIDPI_LIMIT-to-144.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 1511039a96d158bcf4b731599ae3af3f98b9b166 Mon Sep 17 00:00:00 2001 -From: Chingkai -Date: Thu, 21 Feb 2019 12:39:52 +0800 -Subject: [PATCH] monitor: Lower HIDPI_LIMIT to 144 - ---- - src/backends/meta-monitor.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: mutter-44.beta/src/backends/meta-monitor.c -=================================================================== ---- mutter-44.beta.orig/src/backends/meta-monitor.c -+++ mutter-44.beta/src/backends/meta-monitor.c -@@ -1805,7 +1805,7 @@ meta_monitor_calculate_crtc_pos (MetaMon - } - - /* The minimum resolution at which we turn on a window-scale of 2 */ --#define HIDPI_LIMIT 192 -+#define HIDPI_LIMIT 144 - - /* - * The minimum screen height at which we turn on a window-scale of 2; diff --git a/mutter-SLE-bsc984738-grab-display.patch b/mutter-SLE-bsc984738-grab-display.patch deleted file mode 100644 index fa7aef9..0000000 --- a/mutter-SLE-bsc984738-grab-display.patch +++ /dev/null @@ -1,201 +0,0 @@ -Index: mutter-41.0/src/core/display.c -=================================================================== ---- mutter-41.0.orig/src/core/display.c -+++ mutter-41.0/src/core/display.c -@@ -826,6 +826,8 @@ meta_display_new (MetaContext *context, - display->check_fullscreen_later = 0; - display->work_area_later = 0; - -+ display->server_grab_count = 0; -+ - display->mouse_mode = TRUE; /* Only relevant for mouse or sloppy focus */ - display->allow_terminal_deactivation = TRUE; /* Only relevant for when a - terminal has the focus */ -@@ -1141,6 +1143,50 @@ meta_display_close (MetaDisplay *display - the_display = NULL; - } - -+/* Grab/ungrab routines taken from fvwm. -+ * Calling this function will cause X to ignore all other clients until -+ * you ungrab. This may not be quite as bad as it sounds, yet there is -+ * agreement that avoiding server grabs except when they are clearly needed -+ * is a good thing. -+ * -+ * If you do use such grabs, please clearly explain the necessity for their -+ * usage in a comment. Try to keep their scope extremely limited. In -+ * particular, try to avoid emitting any signals or notifications while -+ * a grab is active (if the signal receiver tries to block on an X request -+ * from another client at this point, you will have a deadlock). -+ */ -+void -+meta_display_grab (MetaDisplay *display) -+{ -+ if (display->server_grab_count == 0) -+ { -+ XGrabServer (display->x11_display->xdisplay); -+ } -+ display->server_grab_count += 1; -+ meta_verbose ("Grabbing display, grab count now %d\n", -+ display->server_grab_count); -+} -+ -+void -+meta_display_ungrab (MetaDisplay *display) -+{ -+ if (display->server_grab_count == 0) -+ meta_bug ("Ungrabbed non-grabbed server\n"); -+ -+ display->server_grab_count -= 1; -+ if (display->server_grab_count == 0) -+ { -+ /* FIXME we want to purge all pending "queued" stuff -+ * at this point, such as window hide/show -+ */ -+ XUngrabServer (display->x11_display->xdisplay); -+ XFlush (display->x11_display->xdisplay); -+ } -+ -+ meta_verbose ("Ungrabbing display, grab count now %d\n", -+ display->server_grab_count); -+} -+ - /** - * meta_display_for_x_display: - * @xdisplay: An X display -Index: mutter-41.0/src/core/display-private.h -=================================================================== ---- mutter-41.0.orig/src/core/display-private.h -+++ mutter-41.0/src/core/display-private.h -@@ -140,6 +140,8 @@ struct _MetaDisplay - GHashTable *stamps; - GHashTable *wayland_windows; - -+ int server_grab_count; -+ - /* serials of leave/unmap events that may - * correspond to an enter event we should - * ignore -@@ -258,6 +260,8 @@ struct _MetaDisplayClass - - MetaDisplay * meta_display_new (MetaContext *context, - GError **error); -+void meta_display_grab (MetaDisplay *display); -+void meta_display_ungrab (MetaDisplay *display); - - void meta_display_manage_all_xwindows (MetaDisplay *display); - void meta_display_unmanage_windows (MetaDisplay *display, -Index: mutter-41.0/src/core/keybindings.c -=================================================================== ---- mutter-41.0.orig/src/core/keybindings.c -+++ mutter-41.0/src/core/keybindings.c -@@ -1253,6 +1253,9 @@ meta_display_grab_window_buttons (MetaDi - { - MetaKeyBindingManager *keys = &display->key_binding_manager; - -+ if (display->server_grab_count > 0) -+ return; -+ - /* Grab Alt + button1 for moving window. - * Grab Alt + button2 for resizing window. - * Grab Alt + button3 for popping up window menu. -@@ -1289,6 +1292,9 @@ meta_display_ungrab_window_buttons (Meta - { - MetaKeyBindingManager *keys = &display->key_binding_manager; - -+ if (display->server_grab_count > 0) -+ return; -+ - if (keys->window_grab_modifiers == 0) - return; - -@@ -1319,6 +1325,9 @@ meta_display_grab_focus_window_button (M - { - MetaKeyBindingManager *keys = &display->key_binding_manager; - -+ if (display->server_grab_count > 0) -+ return; -+ - /* Grab button 1 for activating unfocused windows */ - meta_verbose ("Grabbing unfocused window buttons for %s", window->desc); - -@@ -1343,6 +1352,9 @@ meta_display_ungrab_focus_window_button - { - MetaKeyBindingManager *keys = &display->key_binding_manager; - -+ if (display->server_grab_count > 0) -+ return; -+ - meta_verbose ("Ungrabbing unfocused window buttons for %s", window->desc); - - if (!window->have_focus_click_grab) -@@ -1588,6 +1600,10 @@ meta_window_grab_keys (MetaWindow *wind - - if (meta_is_wayland_compositor ()) - return; -+ -+ if (display->server_grab_count > 0) -+ return; -+ - if (window->all_keys_grabbed) - return; - -@@ -1627,6 +1643,9 @@ meta_window_ungrab_keys (MetaWindow *wi - MetaDisplay *display = window->display; - MetaKeyBindingManager *keys = &display->key_binding_manager; - -+ if (display->server_grab_count > 0) -+ return; -+ - if (window->grab_on_frame && - window->frame != NULL) - change_window_keygrabs (keys, window->frame->xwindow, FALSE); -Index: mutter-41.0/src/x11/meta-x11-display.c -=================================================================== ---- mutter-41.0.orig/src/x11/meta-x11-display.c -+++ mutter-41.0/src/x11/meta-x11-display.c -@@ -1916,7 +1916,7 @@ meta_x11_display_set_input_focus_interna - * we know which is which by making two requests that the server will - * process at the same time. - */ -- XGrabServer (x11_display->xdisplay); -+ meta_display_grab(x11_display->display); - - XSetInputFocus (x11_display->xdisplay, - xwindow, -@@ -1928,8 +1928,7 @@ meta_x11_display_set_input_focus_interna - x11_display->atom__MUTTER_FOCUS_SET, - XA_STRING, 8, PropModeAppend, NULL, 0); - -- XUngrabServer (x11_display->xdisplay); -- XFlush (x11_display->xdisplay); -+ meta_display_ungrab(x11_display->display); - - meta_x11_error_trap_pop (x11_display); - } -Index: mutter-41.0/src/x11/window-x11.c -=================================================================== ---- mutter-41.0.orig/src/x11/window-x11.c -+++ mutter-41.0/src/x11/window-x11.c -@@ -522,6 +522,8 @@ meta_window_x11_manage (MetaWindow *wind - - meta_icon_cache_init (&priv->icon_cache); - -+ meta_display_grab (display); -+ - meta_x11_display_register_x_window (display->x11_display, - &window->xwindow, - window); -@@ -582,6 +584,13 @@ meta_window_x11_manage (MetaWindow *wind - - meta_window_x11_update_shape_region (window); - meta_window_x11_update_input_region (window); -+ -+ meta_display_ungrab (display); -+ -+ /* Perform operations prevented by grab */ -+ if (window->frame) -+ meta_display_grab_window_buttons (display, window->frame->xwindow); -+ meta_window_grab_keys (window); - } - - static void diff --git a/mutter-crash-meta_context_terminate.patch b/mutter-crash-meta_context_terminate.patch deleted file mode 100644 index c96670a..0000000 --- a/mutter-crash-meta_context_terminate.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: mutter-44.beta/src/x11/session.c -=================================================================== ---- mutter-44.beta.orig/src/x11/session.c -+++ mutter-44.beta/src/x11/session.c -@@ -150,7 +150,8 @@ process_ice_messages (GIOChannel *chan - * being cleaned up, since it is owned by libSM. - */ - disconnect (); -- meta_context_terminate (ice_connection->context); -+ if (ice_connection->context != NULL) -+ meta_context_terminate (ice_connection->context); - - return FALSE; - } -Index: mutter-44.beta/src/tests/meson.build -=================================================================== ---- mutter-44.beta.orig/src/tests/meson.build -+++ mutter-44.beta/src/tests/meson.build -@@ -43,6 +43,7 @@ tests_deps = [ - ] - - libmutter_test = shared_library(libmutter_test_name, -+ mutter_enum_types, - mutter_test_sources, - gnu_symbol_visibility: 'hidden', - include_directories: tests_includes, diff --git a/mutter-disable-cvt-s390x.patch b/mutter-disable-cvt-s390x.patch index 9237490..eb16e8b 100644 --- a/mutter-disable-cvt-s390x.patch +++ b/mutter-disable-cvt-s390x.patch @@ -1,29 +1,6 @@ -Index: mutter-44.rc/src/meson.build -=================================================================== ---- mutter-44.rc.orig/src/meson.build -+++ mutter-44.rc/src/meson.build -@@ -912,6 +912,7 @@ if have_profiler - endif - - if have_native_backend -+ if host_machine.cpu_family() != 's390x' - cvt = find_program('cvt') - - gen_default_modes = find_program('backends/native/gen-default-modes.py') -@@ -919,6 +920,9 @@ if have_native_backend - output: 'meta-default-modes.h', - command: [gen_default_modes, '@OUTPUT@'] - ) -+ else -+ default_modes_h = 'backends/native/meta-default-modes.h' -+ endif - mutter_built_sources += default_modes_h - - dbus_interfaces += [ -Index: mutter-44.rc/src/backends/native/meta-default-modes.h -=================================================================== ---- /dev/null -+++ mutter-44.rc/src/backends/native/meta-default-modes.h +diff -druN mutter-45.1.orig/src/backends/native/meta-default-modes-s390x.h mutter-45.1/src/backends/native/meta-default-modes-s390x.h +--- mutter-45.1.orig/src/backends/native/meta-default-modes-s390x.h 1970-01-01 01:00:00.000000000 +0100 ++++ mutter-45.1/src/backends/native/meta-default-modes-s390x.h 2024-01-23 16:35:55.791416596 +0100 @@ -0,0 +1,57 @@ +/* Generated by gen-default-modes.py */ + @@ -82,3 +59,28 @@ Index: mutter-44.rc/src/backends/native/meta-default-modes.h +{ 813000, 2304, 2307, 2312, 2386, 0, 4096, 4440, 4888, 5680, 0, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC, DRM_MODE_TYPE_DEFAULT, "2304x4096_60.00" }, +{ 1276500, 2880, 2883, 2888, 2982, 0, 5120, 5560, 6128, 7136, 0, 0, DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC, DRM_MODE_TYPE_DEFAULT, "2880x5120_60.00" }, +}; +diff -druN mutter-45.1.orig/src/meson.build mutter-45.1/src/meson.build +--- mutter-45.1.orig/src/meson.build 2023-10-31 19:35:00.000000000 +0100 ++++ mutter-45.1/src/meson.build 2024-01-23 18:07:33.487280694 +0100 +@@ -958,6 +958,7 @@ + endif + + if have_native_backend ++ if host_machine.cpu_family() != 's390x' + cvt = find_program('cvt') + + gen_default_modes = find_program('backends/native/gen-default-modes.py') +@@ -965,6 +966,13 @@ + output: 'meta-default-modes.h', + command: [gen_default_modes, '@OUTPUT@'] + ) ++ else ++ default_modes_h = custom_target('meta-default-modes', ++ input: 'backends/native/meta-default-modes-s390x.h', ++ output: 'meta-default-modes.h', ++ command: ['cp', '@INPUT@', '@OUTPUT@'] ++ ) ++ endif + mutter_built_sources += default_modes_h + + dbus_interfaces += [ diff --git a/mutter-fix-initial-suspended-state.patch b/mutter-fix-initial-suspended-state.patch new file mode 100644 index 0000000..2b52488 --- /dev/null +++ b/mutter-fix-initial-suspended-state.patch @@ -0,0 +1,182 @@ +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/core/window.c mutter-45.3.new/src/core/window.c +--- mutter-45.3.old/src/core/window.c 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/core/window.c 2024-06-04 16:54:29.485138788 +0800 +@@ -165,6 +165,8 @@ + MetaTileMode mode); + static void update_edge_constraints (MetaWindow *window); + ++static void set_hidden_suspended_state (MetaWindow *window); ++ + static void initable_iface_init (GInitableIface *initable_iface); + + typedef struct _MetaWindowPrivate +@@ -750,9 +752,6 @@ + static void + meta_window_init (MetaWindow *window) + { +- MetaWindowPrivate *priv = meta_window_get_instance_private (window); +- +- priv->suspend_state = META_WINDOW_SUSPEND_STATE_SUSPENDED; + window->stamp = next_window_stamp++; + meta_prefs_add_listener (prefs_changed_callback, window); + window->is_alive = TRUE; +@@ -1026,6 +1025,7 @@ + meta_window_constructed (GObject *object) + { + MetaWindow *window = META_WINDOW (object); ++ MetaWindowPrivate *priv = meta_window_get_instance_private (window); + MetaDisplay *display = window->display; + MetaContext *context = meta_display_get_context (display); + MetaBackend *backend = meta_context_get_backend (context); +@@ -1381,6 +1381,11 @@ + !window->initially_iconic) + unminimize_window_and_all_transient_parents (window); + ++ /* There is a slim chance we'll hit time out before a extremely slow client ++ * managed to become active, but unlikely enough. */ ++ priv->suspend_state = META_WINDOW_SUSPEND_STATE_HIDDEN; ++ set_hidden_suspended_state (window); ++ + window->constructing = FALSE; + } + +@@ -1716,9 +1721,9 @@ + return TRUE; + } + +-gboolean +-meta_window_should_be_showing_on_workspace (MetaWindow *window, +- MetaWorkspace *workspace) ++ ++static gboolean ++meta_window_is_showable (MetaWindow *window) + { + #ifdef HAVE_WAYLAND + if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND && +@@ -1730,12 +1735,72 @@ + window->decorated && !window->frame) + return FALSE; + +- /* Windows should be showing if they're located on the +- * workspace and they're showing on their own workspace. */ ++ return TRUE; ++} ++ ++/** ++ * meta_window_should_show_on_workspace: ++ * ++ * Tells whether a window should be showing on the passed workspace, without ++ * taking into account whether it can immediately be shown. Whether it can be ++ * shown or not depends on what windowing system it was created from. ++ * ++ * Returns: %TRUE if the window should show. ++ */ ++static gboolean ++meta_window_should_show_on_workspace (MetaWindow *window, ++ MetaWorkspace *workspace) ++{ + return (meta_window_located_on_workspace (window, workspace) && + meta_window_showing_on_its_workspace (window)); + } + ++/** ++ * meta_window_should_show: ++ * ++ * Tells whether a window should be showing on the current workspace, without ++ * taking into account whether it can immediately be shown. Whether it can be ++ * shown or not depends on what windowing system it was created from. ++ * ++ * Returns: %TRUE if the window should show. ++ */ ++gboolean ++meta_window_should_show (MetaWindow *window) ++{ ++ MetaWorkspaceManager *workspace_manager = window->display->workspace_manager; ++ MetaWorkspace *active_workspace = workspace_manager->active_workspace; ++ ++ return meta_window_should_show_on_workspace (window, active_workspace); ++} ++ ++/** ++ * meta_window_should_be_showing_on_workspace: ++ * ++ * Tells whether a window should be showing on the passed workspace, while ++ * taking whether it can be immediately be shown. Whether it can be shown or ++ * not depends on what windowing system it was created from. ++ * ++ * Returns: %TRUE if the window should and can be shown. ++ */ ++gboolean ++meta_window_should_be_showing_on_workspace (MetaWindow *window, ++ MetaWorkspace *workspace) ++{ ++ if (!meta_window_is_showable (window)) ++ return FALSE; ++ ++ return meta_window_should_show_on_workspace (window, workspace); ++} ++ ++/** ++ * meta_window_should_be_showing: ++ * ++ * Tells whether a window should be showing on the current workspace, while ++ * taking whether it can be immediately be shown. Whether it can be shown or ++ * not depends on what windowing system it was created from. ++ * ++ * Returns: %TRUE if the window should and can be shown. ++ */ + gboolean + meta_window_should_be_showing (MetaWindow *window) + { +@@ -2132,6 +2197,19 @@ + } + + static void ++set_hidden_suspended_state (MetaWindow *window) ++{ ++ MetaWindowPrivate *priv = meta_window_get_instance_private (window); ++ ++ priv->suspend_state = META_WINDOW_SUSPEND_STATE_HIDDEN; ++ g_return_if_fail (!priv->suspend_timoeut_id); ++ priv->suspend_timoeut_id = ++ g_timeout_add_seconds (SUSPEND_HIDDEN_TIMEOUT_S, ++ enter_suspend_state_cb, ++ window); ++} ++ ++static void + update_suspend_state (MetaWindow *window) + { + MetaWindowPrivate *priv = meta_window_get_instance_private (window); +@@ -2148,13 +2226,8 @@ + } + else if (priv->suspend_state == META_WINDOW_SUSPEND_STATE_ACTIVE) + { +- priv->suspend_state = META_WINDOW_SUSPEND_STATE_HIDDEN; ++ set_hidden_suspended_state (window); + g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_SUSPEND_STATE]); +- g_return_if_fail (!priv->suspend_timoeut_id); +- priv->suspend_timoeut_id = +- g_timeout_add_seconds (SUSPEND_HIDDEN_TIMEOUT_S, +- enter_suspend_state_cb, +- window); + } + } + +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/core/window-private.h mutter-45.3.new/src/core/window-private.h +--- mutter-45.3.old/src/core/window-private.h 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/core/window-private.h 2024-06-04 16:49:30.834738705 +0800 +@@ -679,9 +679,12 @@ + gboolean meta_window_should_be_showing_on_workspace (MetaWindow *window, + MetaWorkspace *workspace); + +-/* Return whether the window should be currently mapped */ ++META_EXPORT_TEST + gboolean meta_window_should_be_showing (MetaWindow *window); + ++META_EXPORT_TEST ++gboolean meta_window_should_show (MetaWindow *window); ++ + void meta_window_update_struts (MetaWindow *window); + + /* gets position we need to set to stay in current position, diff --git a/mutter-fix-text-input-delete-surrounding.patch b/mutter-fix-text-input-delete-surrounding.patch new file mode 100644 index 0000000..6ab05d4 --- /dev/null +++ b/mutter-fix-text-input-delete-surrounding.patch @@ -0,0 +1,207 @@ +From 27bdf0c577a551254551fdaaf7870c5072707c69 Mon Sep 17 00:00:00 2001 +From: Alynx Zhou +Date: Fri, 25 Nov 2022 15:48:01 +0800 +Subject: [PATCH 1/2] wayland/text-input: Use byte based offset in + delete_surrounding_text + +ClutterInputFocus/GtkIMContext uses char based offset for +delete_surrounding, however, text_input_v3 uses byte based offset for +it. Currently only GTK with mutter can work correctly via text_input_v3 +because they both forget to convert between char based offset and byte +based offset. + +This commit fixes it in mutter by saving committed surrounding text in +MetaWaylandTextInput and converting char based offset to byte based +offset with the UTF-8 encoded surrounding text. + +Fixes . + +Part-of: +--- + src/wayland/meta-wayland-text-input.c | 55 +++++++++++++++++++++++---- + 1 file changed, 47 insertions(+), 8 deletions(-) + +diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c +index b1ceb1a6bb5..2e694dc1eb8 100644 +--- a/src/wayland/meta-wayland-text-input.c ++++ b/src/wayland/meta-wayland-text-input.c +@@ -58,6 +58,20 @@ struct _MetaWaylandTextInput + + GHashTable *resource_serials; + ++ /* This saves the uncommitted middle state of surrounding text from client ++ * between `set_surrounding_text` and `commit`, will be cleared after ++ * committed. ++ */ ++ struct ++ { ++ char *text; ++ uint32_t cursor; ++ uint32_t anchor; ++ } pending_surrounding; ++ ++ /* This is the actual committed surrounding text after `commit`, we need this ++ * to convert between char based offset and byte based offset. ++ */ + struct + { + char *text; +@@ -216,14 +230,32 @@ meta_wayland_text_input_focus_delete_surrounding (ClutterInputFocus *focus, + guint len) + { + MetaWaylandTextInput *text_input; ++ const char *start, *end; ++ const char *before, *after; ++ const char *cursor; + uint32_t before_length; + uint32_t after_length; + struct wl_resource *resource; + ++ /* offset and len are counted by UTF-8 chars, but text_input_v3's lengths are ++ * counted by bytes, so we convert UTF-8 char offsets to pointers here, this ++ * needs the surrounding text ++ */ + text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input; +- before_length = ABS (MIN (offset, 0)); +- after_length = MAX (0, offset + len); +- g_warn_if_fail (ABS (offset) <= len); ++ offset = MIN (offset, 0); ++ ++ start = text_input->surrounding.text; ++ end = start + strlen (text_input->surrounding.text); ++ cursor = start + text_input->surrounding.cursor; ++ ++ before = g_utf8_offset_to_pointer (cursor, offset); ++ g_assert (before >= start); ++ ++ after = g_utf8_offset_to_pointer (cursor, offset + len); ++ g_assert (after <= end); ++ ++ before_length = cursor - before; ++ after_length = after - cursor; + + wl_resource_for_each (resource, &text_input->focus_resource_list) + { +@@ -468,10 +500,10 @@ text_input_set_surrounding_text (struct wl_client *client, + if (!client_matches_focus (text_input, client)) + return; + +- g_free (text_input->surrounding.text); +- text_input->surrounding.text = g_strdup (text); +- text_input->surrounding.cursor = cursor; +- text_input->surrounding.anchor = anchor; ++ g_free (text_input->pending_surrounding.text); ++ text_input->pending_surrounding.text = g_strdup (text); ++ text_input->pending_surrounding.cursor = cursor; ++ text_input->pending_surrounding.anchor = anchor; + text_input->pending_state |= META_WAYLAND_PENDING_STATE_SURROUNDING_TEXT; + } + +@@ -591,7 +623,7 @@ text_input_set_cursor_rectangle (struct wl_client *client, + static void + meta_wayland_text_input_reset (MetaWaylandTextInput *text_input) + { +- g_clear_pointer (&text_input->surrounding.text, g_free); ++ g_clear_pointer (&text_input->pending_surrounding.text, g_free); + text_input->content_type_hint = ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE; + text_input->content_type_purpose = ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL; + text_input->text_change_cause = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD; +@@ -651,6 +683,12 @@ text_input_commit_state (struct wl_client *client, + + if (text_input->pending_state & META_WAYLAND_PENDING_STATE_SURROUNDING_TEXT) + { ++ /* Save the surrounding text for `delete_surrounding_text`. */ ++ g_free (text_input->surrounding.text); ++ text_input->surrounding.text = g_steal_pointer (&text_input->pending_surrounding.text); ++ text_input->surrounding.cursor = text_input->pending_surrounding.cursor; ++ text_input->surrounding.anchor = text_input->pending_surrounding.anchor; ++ /* Pass the surrounding text to Clutter to handle it with input method. */ + clutter_input_focus_set_surrounding (text_input->input_focus, + text_input->surrounding.text, + text_input->surrounding.cursor, +@@ -720,6 +758,7 @@ meta_wayland_text_input_destroy (MetaWaylandTextInput *text_input) + g_object_unref (text_input->input_focus); + g_hash_table_destroy (text_input->resource_serials); + g_clear_pointer (&text_input->preedit.string, g_free); ++ g_clear_pointer (&text_input->pending_surrounding.text, g_free); + g_clear_pointer (&text_input->surrounding.text, g_free); + g_free (text_input); + } +-- +GitLab + + +From 33088d59db742cf802977a9d8ec8b4ea3ca79ea0 Mon Sep 17 00:00:00 2001 +From: Alynx Zhou +Date: Mon, 23 Oct 2023 14:32:21 +0800 +Subject: [PATCH 2/2] wayland/text-input: Pass char based offset to + ClutterInputFocus + +Wayland's text-input-v3 uses byte based offset for cursor and anchor of +surrounding text, but Clutter needs char based offset here. This commit +converts byte based offset to char based offset before passing them to +ClutterInputFocus. + +Fixes . + +Part-of: +--- + src/wayland/meta-wayland-text-input.c | 24 +++++++++++++++++++----- + 1 file changed, 19 insertions(+), 5 deletions(-) + +diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c +index 2e694dc1eb8..c8f50847a88 100644 +--- a/src/wayland/meta-wayland-text-input.c ++++ b/src/wayland/meta-wayland-text-input.c +@@ -122,12 +122,18 @@ static void + meta_wayland_text_input_focus_request_surrounding (ClutterInputFocus *focus) + { + MetaWaylandTextInput *text_input; ++ long cursor, anchor; + ++ /* Clutter uses char offsets but text-input-v3 uses byte offsets. */ + text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input; ++ cursor = g_utf8_strlen (text_input->surrounding.text, ++ text_input->surrounding.cursor); ++ anchor = g_utf8_strlen (text_input->surrounding.text, ++ text_input->surrounding.anchor); + clutter_input_focus_set_surrounding (focus, +- text_input->surrounding.text, +- text_input->surrounding.cursor, +- text_input->surrounding.anchor); ++ text_input->surrounding.text, ++ cursor, ++ anchor); + } + + static uint32_t +@@ -683,16 +689,24 @@ text_input_commit_state (struct wl_client *client, + + if (text_input->pending_state & META_WAYLAND_PENDING_STATE_SURROUNDING_TEXT) + { ++ long cursor, anchor; ++ + /* Save the surrounding text for `delete_surrounding_text`. */ + g_free (text_input->surrounding.text); + text_input->surrounding.text = g_steal_pointer (&text_input->pending_surrounding.text); + text_input->surrounding.cursor = text_input->pending_surrounding.cursor; + text_input->surrounding.anchor = text_input->pending_surrounding.anchor; ++ + /* Pass the surrounding text to Clutter to handle it with input method. */ ++ /* Clutter uses char offsets but text-input-v3 uses byte offsets. */ ++ cursor = g_utf8_strlen (text_input->surrounding.text, ++ text_input->surrounding.cursor); ++ anchor = g_utf8_strlen (text_input->surrounding.text, ++ text_input->surrounding.anchor); + clutter_input_focus_set_surrounding (text_input->input_focus, + text_input->surrounding.text, +- text_input->surrounding.cursor, +- text_input->surrounding.anchor); ++ cursor, ++ anchor); + } + + if (text_input->pending_state & META_WAYLAND_PENDING_STATE_INPUT_RECT) +-- +GitLab + diff --git a/mutter-fix-x11-restart.patch b/mutter-fix-x11-restart.patch new file mode 100644 index 0000000..82a49de --- /dev/null +++ b/mutter-fix-x11-restart.patch @@ -0,0 +1,251 @@ +From b7a1159a1ecd08b5e6aa1279fea84accf846b411 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Fri, 20 Oct 2023 15:44:29 +0800 +Subject: [PATCH 1/4] x11-display: Make subwindow redirection call mode + specific + +This means that for X11 sessions we'll do it before any windows are +mapped, and before any plugin implementation is started. Doing it before +a plugin is started is important, because things that the plugin does +during startup can have consequences on how compositing on Xorg works. + +For the Xwayland case, we'll do it relatively in the setup phase. It +appears to have been harmless to do it later in the post-opened signal, +but there is no harm in doing it as one of the earlier steps. + +Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3089 +--- + src/compositor/meta-compositor-x11.c | 2 ++ + src/wayland/meta-xwayland.c | 1 + + src/x11/meta-x11-display.c | 1 - + 3 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/compositor/meta-compositor-x11.c b/src/compositor/meta-compositor-x11.c +index 1ad3327ddf6..ce7bc1945ce 100644 +--- a/src/compositor/meta-compositor-x11.c ++++ b/src/compositor/meta-compositor-x11.c +@@ -188,6 +188,8 @@ meta_compositor_x11_manage (MetaCompositor *compositor, + + compositor_x11->have_x11_sync_object = meta_sync_ring_init (xdisplay); + ++ meta_x11_display_redirect_windows (x11_display, display); ++ + return TRUE; + } + +diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c +index e95ca564010..83f2fcb25d9 100644 +--- a/src/wayland/meta-xwayland.c ++++ b/src/wayland/meta-xwayland.c +@@ -1170,6 +1170,7 @@ on_x11_display_setup (MetaDisplay *display, + { + MetaX11Display *x11_display = meta_display_get_x11_display (display); + ++ meta_x11_display_redirect_windows (x11_display, display); + meta_xwayland_init_dnd (x11_display); + meta_xwayland_init_xrandr (manager, x11_display); + } +diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c +index 4e98203dd25..c634a71fb2a 100644 +--- a/src/x11/meta-x11-display.c ++++ b/src/x11/meta-x11-display.c +@@ -301,7 +301,6 @@ on_x11_display_opened (MetaX11Display *x11_display, + MetaDisplay *display) + { + meta_display_manage_all_xwindows (display); +- meta_x11_display_redirect_windows (x11_display, display); + } + + static void +-- +GitLab + + +From 77fc07943c3171a5e7a047ca34af46feeca347c2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Fri, 20 Oct 2023 17:03:31 +0800 +Subject: [PATCH 2/4] display: Move X11 initial focus handling to + MetaX11Display + +It's X11 specific, so put it in the X11 display manager object. +--- + src/core/display.c | 34 ---------------------------------- + src/x11/meta-x11-display.c | 25 +++++++++++++++++++++++++ + 2 files changed, 25 insertions(+), 34 deletions(-) + +diff --git a/src/core/display.c b/src/core/display.c +index 0a191c0fbca..b16e50e21de 100644 +--- a/src/core/display.c ++++ b/src/core/display.c +@@ -930,9 +930,6 @@ meta_display_new (MetaContext *context, + MetaDisplay *display; + MetaDisplayPrivate *priv; + guint32 timestamp; +-#ifdef HAVE_X11_CLIENT +- Window old_active_xwindow = None; +-#endif + MetaMonitorManager *monitor_manager; + MetaSettings *settings; + MetaInputCapture *input_capture; +@@ -1048,14 +1045,6 @@ meta_display_new (MetaContext *context, + display->last_focus_time = timestamp; + display->last_user_time = timestamp; + +-#ifdef HAVE_X11 +- if (!meta_is_wayland_compositor ()) +- meta_prop_get_window (display->x11_display, +- display->x11_display->xroot, +- display->x11_display->atom__NET_ACTIVE_WINDOW, +- &old_active_xwindow); +-#endif +- + if (!meta_compositor_manage (display->compositor, error)) + { + g_object_unref (display); +@@ -1076,30 +1065,7 @@ meta_display_new (MetaContext *context, + g_signal_connect (display->gesture_tracker, "state-changed", + G_CALLBACK (gesture_tracker_state_changed), display); + +- /* We know that if mutter is running as a Wayland compositor, +- * we start out with no windows. +- */ +-#ifdef HAVE_X11_CLIENT +- if (!meta_is_wayland_compositor ()) +- meta_display_manage_all_xwindows (display); +- +- if (old_active_xwindow != None) +- { +- MetaWindow *old_active_window; +- old_active_window = meta_x11_display_lookup_x_window (display->x11_display, +- old_active_xwindow); +- if (old_active_window) +- meta_window_focus (old_active_window, timestamp); +- else +- meta_display_unset_input_focus (display, timestamp); +- } +- else +- { +- meta_display_unset_input_focus (display, timestamp); +- } +-#else + meta_display_unset_input_focus (display, timestamp); +-#endif + + g_signal_connect (stage, "notify::is-grabbed", + G_CALLBACK (on_is_grabbed_changed), display); +diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c +index c634a71fb2a..599968a363b 100644 +--- a/src/x11/meta-x11-display.c ++++ b/src/x11/meta-x11-display.c +@@ -300,7 +300,32 @@ static void + on_x11_display_opened (MetaX11Display *x11_display, + MetaDisplay *display) + { ++ Window old_active_xwindow = None; ++ ++ if (!meta_is_wayland_compositor ()) ++ { ++ meta_prop_get_window (display->x11_display, ++ display->x11_display->xroot, ++ display->x11_display->atom__NET_ACTIVE_WINDOW, ++ &old_active_xwindow); ++ } ++ + meta_display_manage_all_xwindows (display); ++ ++ if (old_active_xwindow != None) ++ { ++ MetaWindow *old_active_window; ++ ++ old_active_window = meta_x11_display_lookup_x_window (x11_display, ++ old_active_xwindow); ++ if (old_active_window) ++ { ++ uint32_t timestamp; ++ ++ timestamp = display->x11_display->timestamp; ++ meta_window_focus (old_active_window, timestamp); ++ } ++ } + } + + static void +-- +GitLab + + +From 668eb0d198dba58c7833b09926dce2f043889155 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Tue, 17 Oct 2023 15:46:00 +0800 +Subject: [PATCH 3/4] tests/x11: Fix replace test to catch the second instance + failing + +The test never noticed that the second instance never actually managed +to load; it was looping a multi second retry session trying to redirect +windows, meaning it failed to catch https://gitlab.gnome.org/GNOME/mutter/-/issues/3089. + +Fix the test so that it always waits for mutter to finish loading +successfully, just like it waits fro the first. +--- + src/tests/x11-test.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/tests/x11-test.sh b/src/tests/x11-test.sh +index 59e460fc336..d95b2460f6e 100755 +--- a/src/tests/x11-test.sh ++++ b/src/tests/x11-test.sh +@@ -34,6 +34,9 @@ echo \# Launched with pid $MUTTER2_PID + MUTTER2_PID=$! + wait $MUTTER1_PID + ++echo \# Waiting for the second mutter to finish loading ++gdbus wait --session org.gnome.Mutter.IdleMonitor ++ + sleep 2 + + echo \# Terminating clients > /dev/stderr +-- +GitLab + + +From 8e6f18fcaf63968b0a75bf65da0c00473d71acb3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Mon, 23 Oct 2023 14:47:33 +0800 +Subject: [PATCH 4/4] display: Rename mandatory X11 initialization function + +Simply to make it clear that the renamed function is specific to a +particular X11 initialization mode (mandatory Xwayland), put that in the +name, so that it's easier to understand when this function is relevant. +--- + src/core/display.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/core/display.c b/src/core/display.c +index b16e50e21de..f851f1be372 100644 +--- a/src/core/display.c ++++ b/src/core/display.c +@@ -897,9 +897,9 @@ meta_display_init_x11 (MetaDisplay *display, + } + + static void +-on_x11_initialized (MetaDisplay *display, +- GAsyncResult *result, +- gpointer user_data) ++on_mandatory_x11_initialized (MetaDisplay *display, ++ GAsyncResult *result, ++ gpointer user_data) + { + g_autoptr (GError) error = NULL; + +@@ -1018,7 +1018,7 @@ meta_display_new (MetaContext *context, + if (x11_display_policy == META_X11_DISPLAY_POLICY_MANDATORY) + { + meta_display_init_x11 (display, NULL, +- (GAsyncReadyCallback) on_x11_initialized, ++ (GAsyncReadyCallback) on_mandatory_x11_initialized, + NULL); + } + #endif /* HAVE_XWAYLAND */ +-- +GitLab + diff --git a/mutter-implement-text-input-v1.patch b/mutter-implement-text-input-v1.patch new file mode 100644 index 0000000..538d8fe --- /dev/null +++ b/mutter-implement-text-input-v1.patch @@ -0,0 +1,1095 @@ +diff --unified --recursive --text --new-file --color mutter-45.3.old/clutter/clutter/clutter-enums.h mutter-45.3.new/clutter/clutter/clutter-enums.h +--- mutter-45.3.old/clutter/clutter/clutter-enums.h 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/clutter/clutter/clutter-enums.h 2024-05-21 16:47:09.832458185 +0800 +@@ -1423,6 +1423,9 @@ + CLUTTER_INPUT_CONTENT_HINT_SENSITIVE_DATA = 1 << 7, + CLUTTER_INPUT_CONTENT_HINT_LATIN = 1 << 8, + CLUTTER_INPUT_CONTENT_HINT_MULTILINE = 1 << 9, ++ CLUTTER_INPUT_CONTENT_HINT_DEFAULT = 1 << 10, ++ CLUTTER_INPUT_CONTENT_HINT_PASSWORD = 1 << 11, ++ CLUTTER_INPUT_CONTENT_HINT_AUTO_CORRECTION = 1 << 12, + } ClutterInputContentHintFlags; + + typedef enum +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/core/events.c mutter-45.3.new/src/core/events.c +--- mutter-45.3.old/src/core/events.c 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/core/events.c 2024-05-21 16:50:33.437595102 +0800 +@@ -241,6 +241,7 @@ + #ifdef HAVE_WAYLAND + MetaWaylandCompositor *wayland_compositor; + MetaWaylandTextInput *wayland_text_input = NULL; ++ MetaWaylandTextInputV1 *wayland_text_input_v1 = NULL; + #endif + + #ifdef HAVE_WAYLAND +@@ -249,6 +250,8 @@ + { + wayland_text_input = + meta_wayland_compositor_get_text_input (wayland_compositor); ++ wayland_text_input_v1 = ++ meta_wayland_compositor_get_text_input_v1 (wayland_compositor); + } + #endif + +@@ -293,10 +296,10 @@ + } + + #ifdef HAVE_WAYLAND +- if (wayland_text_input && +- !has_grab && ++ if (!has_grab && + !meta_compositor_get_current_window_drag (compositor) && +- meta_wayland_text_input_update (wayland_text_input, event)) ++ ((wayland_text_input && meta_wayland_text_input_update (wayland_text_input, event)) || ++ (wayland_text_input_v1 && meta_wayland_text_input_v1_update (wayland_text_input_v1, event)))) + { + bypass_wayland = bypass_clutter = TRUE; + goto out; +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/meson.build mutter-45.3.new/src/meson.build +--- mutter-45.3.old/src/meson.build 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/meson.build 2024-05-21 16:47:09.832458185 +0800 +@@ -692,6 +692,8 @@ + 'wayland/meta-wayland-tablet-tool.h', + 'wayland/meta-wayland-text-input.c', + 'wayland/meta-wayland-text-input.h', ++ 'wayland/meta-wayland-text-input-v1.c', ++ 'wayland/meta-wayland-text-input-v1.h', + 'wayland/meta-wayland-touch.c', + 'wayland/meta-wayland-touch.h', + 'wayland/meta-wayland-transaction.c', +@@ -1073,6 +1075,7 @@ + ['single-pixel-buffer', 'staging', 'v1', ], + ['tablet', 'unstable', 'v2', ], + ['text-input', 'unstable', 'v3', ], ++ ['text-input', 'unstable', 'v1', ], + ['viewporter', 'stable', ], + ['xdg-activation', 'staging', 'v1', ], + ['xdg-foreign', 'unstable', 'v1', ], +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/wayland/meta-wayland.c mutter-45.3.new/src/wayland/meta-wayland.c +--- mutter-45.3.old/src/wayland/meta-wayland.c 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/wayland/meta-wayland.c 2024-05-21 16:47:09.832458185 +0800 +@@ -804,6 +804,7 @@ + meta_wayland_keyboard_shortcuts_inhibit_init (compositor); + meta_wayland_surface_inhibit_shortcuts_dialog_init (); + meta_wayland_text_input_init (compositor); ++ meta_wayland_text_input_v1_init (compositor); + meta_wayland_init_presentation_time (compositor); + meta_wayland_activation_init (compositor); + meta_wayland_transaction_init (compositor); +@@ -970,6 +971,12 @@ + } + } + ++MetaWaylandTextInputV1 * ++meta_wayland_compositor_get_text_input_v1 (MetaWaylandCompositor *compositor) ++{ ++ return compositor->seat->text_input_v1; ++} ++ + static void + on_scheduled_association_unmanaged (MetaWindow *window, + gpointer user_data) +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/wayland/meta-wayland.h mutter-45.3.new/src/wayland/meta-wayland.h +--- mutter-45.3.old/src/wayland/meta-wayland.h 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/wayland/meta-wayland.h 2024-05-21 16:47:09.832458185 +0800 +@@ -26,6 +26,7 @@ + #include "meta/types.h" + #include "meta/meta-wayland-compositor.h" + #include "wayland/meta-wayland-text-input.h" ++#include "wayland/meta-wayland-text-input-v1.h" + #include "wayland/meta-wayland-types.h" + + META_EXPORT_TEST +@@ -88,6 +89,7 @@ + MetaWindow *window); + + MetaWaylandTextInput * meta_wayland_compositor_get_text_input (MetaWaylandCompositor *compositor); ++MetaWaylandTextInputV1 * meta_wayland_compositor_get_text_input_v1 (MetaWaylandCompositor *compositor); + + #ifdef HAVE_XWAYLAND + void meta_wayland_compositor_notify_surface_id (MetaWaylandCompositor *compositor, +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/wayland/meta-wayland-seat.c mutter-45.3.new/src/wayland/meta-wayland-seat.c +--- mutter-45.3.old/src/wayland/meta-wayland-seat.c 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/wayland/meta-wayland-seat.c 2024-05-21 16:51:15.168867935 +0800 +@@ -225,6 +225,8 @@ + NULL); + + seat->text_input = meta_wayland_text_input_new (seat); ++ /* Chromium/Electron-based apps only support text-input-v1. */ ++ seat->text_input_v1 = meta_wayland_text_input_v1_new (seat); + + meta_wayland_data_device_init (&seat->data_device, seat); + meta_wayland_data_device_primary_init (&seat->primary_data_device, seat); +@@ -264,6 +266,7 @@ + g_object_unref (seat->touch); + + meta_wayland_text_input_destroy (seat->text_input); ++ meta_wayland_text_input_v1_destroy (seat->text_input_v1); + + g_free (seat); + } +@@ -371,7 +374,10 @@ + if (event_type == CLUTTER_BUTTON_PRESS || + event_type == CLUTTER_TOUCH_BEGIN) + { +- meta_wayland_text_input_handle_event (seat->text_input, event); ++ gboolean handled = FALSE; ++ handled = meta_wayland_text_input_handle_event (seat->text_input, event); ++ if (!handled) ++ handled = meta_wayland_text_input_v1_handle_event (seat->text_input_v1, event); + } + + switch (event_type) +@@ -403,7 +409,8 @@ + case CLUTTER_IM_COMMIT: + case CLUTTER_IM_DELETE: + case CLUTTER_IM_PREEDIT: +- if (meta_wayland_text_input_handle_event (seat->text_input, event)) ++ if (meta_wayland_text_input_handle_event (seat->text_input, event) || ++ meta_wayland_text_input_v1_handle_event (seat->text_input_v1, event)) + return TRUE; + + break; +@@ -432,6 +439,7 @@ + meta_wayland_tablet_seat_set_pad_focus (tablet_seat, surface); + + meta_wayland_text_input_set_focus (seat->text_input, surface); ++ /* text-input-v1 will set focused surface on activate. */ + } + + gboolean +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/wayland/meta-wayland-seat.h mutter-45.3.new/src/wayland/meta-wayland-seat.h +--- mutter-45.3.old/src/wayland/meta-wayland-seat.h 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/wayland/meta-wayland-seat.h 2024-05-21 16:47:09.832458185 +0800 +@@ -29,6 +29,7 @@ + #include "wayland/meta-wayland-pointer.h" + #include "wayland/meta-wayland-tablet-tool.h" + #include "wayland/meta-wayland-text-input.h" ++#include "wayland/meta-wayland-text-input-v1.h" + #include "wayland/meta-wayland-touch.h" + #include "wayland/meta-wayland-types.h" + +@@ -47,6 +48,7 @@ + MetaWaylandDataDevicePrimary primary_data_device; + + MetaWaylandTextInput *text_input; ++ MetaWaylandTextInputV1 *text_input_v1; + + guint capabilities; + }; +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/wayland/meta-wayland-text-input-v1.c mutter-45.3.new/src/wayland/meta-wayland-text-input-v1.c +--- mutter-45.3.old/src/wayland/meta-wayland-text-input-v1.c 1970-01-01 08:00:00.000000000 +0800 ++++ mutter-45.3.new/src/wayland/meta-wayland-text-input-v1.c 2024-05-21 16:47:09.832458185 +0800 +@@ -0,0 +1,859 @@ ++/* ++ * Copyright (C) 2024 SUSE LLC ++ * ++ * 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: Alynx Zhou ++ */ ++ ++#include "config.h" ++#include "wayland/meta-wayland-text-input-v1.h" ++ ++#include ++ ++#include "compositor/meta-surface-actor-wayland.h" ++#include "wayland/meta-wayland-private.h" ++#include "wayland/meta-wayland-seat.h" ++#include "wayland/meta-wayland-versions.h" ++ ++#include "text-input-unstable-v1-server-protocol.h" ++ ++/* ++ * Main difference between text-input-v1 and text-input-v3: ++ * text-input-v1 is not required to be double-buffered, we are expected to send ++ * response immediately after we receive requests, while text-input-v3 requires ++ * us to hold pending state and apply on commit, and all responses are applied ++ * after we send done. ++ * ++ * This implementation is incomplete, but it do make IME work. ++ * ++ * Things won't be implemented (Reminders for myself): ++ * - set_preferred_language (We don't have equivalence in ClutterInputMethod.) ++ * - invoke_action (No description about what button and index are.) ++ * - input_panel_state (We don't set this from ClutterInputFocus to text_input, ++ * we only set this from text_input to ClutterInputFocus.) ++ * - cursor_position (We don't have equivalence in ClutterInputMethod.) ++ * - language (We don't have equivalence in ClutterInputMethod.) ++ * - text_direction (We don't have equivalence in ClutterInputMethod.) ++ * - keysym (This matches keysym request in input-method-v1, but we only have ++ * forward_key in ClutterInputMethod, which is more like key request in ++ * input-method-v1 and will finally become a keyboard key event, we don't have ++ * equivalence for this in ClutterInputMethod.) ++ * - modifiers_map (This is used by keysym and we don't support keysym.) ++ */ ++ ++struct _MetaWaylandTextInputV1 ++{ ++ MetaWaylandSeat *seat; ++ ClutterInputFocus *input_focus; ++ ++ struct wl_list resource_list; ++ struct wl_list focus_resource_list; ++ MetaWaylandSurface *surface; ++ struct wl_listener surface_listener; ++ ++ GHashTable *resource_serials; ++ ++ struct ++ { ++ char *text; ++ uint32_t cursor; ++ uint32_t anchor; ++ } surrounding; ++}; ++ ++#define META_TYPE_WAYLAND_TEXT_INPUT_V1_FOCUS (meta_wayland_text_input_v1_focus_get_type ()) ++G_DECLARE_FINAL_TYPE (MetaWaylandTextInputV1Focus, meta_wayland_text_input_v1_focus, ++ META, WAYLAND_TEXT_INPUT_V1_FOCUS, ClutterInputFocus) ++ ++struct _MetaWaylandTextInputV1Focus ++{ ++ ClutterInputFocus parent_instance; ++ MetaWaylandTextInputV1 *text_input; ++}; ++G_DEFINE_TYPE (MetaWaylandTextInputV1Focus, meta_wayland_text_input_v1_focus, ++ CLUTTER_TYPE_INPUT_FOCUS) ++ ++static MetaBackend * ++backend_from_text_input_v1 (MetaWaylandTextInputV1 *text_input) ++{ ++ MetaWaylandSeat *seat = text_input->seat; ++ MetaWaylandCompositor *compositor = meta_wayland_seat_get_compositor (seat); ++ MetaContext *context = meta_wayland_compositor_get_context (compositor); ++ ++ return meta_context_get_backend (context); ++} ++ ++static uint32_t ++get_serial (MetaWaylandTextInputV1 *text_input, ++ struct wl_resource *resource) ++{ ++ return GPOINTER_TO_UINT (g_hash_table_lookup (text_input->resource_serials, ++ resource)); ++} ++ ++static void ++set_serial (MetaWaylandTextInputV1 *text_input, ++ struct wl_resource *resource, ++ uint32_t serial) ++{ ++ g_hash_table_insert (text_input->resource_serials, resource, ++ GUINT_TO_POINTER (serial)); ++} ++ ++static void ++text_input_v1_send_preedit_string (struct wl_resource *resource, ++ uint32_t serial, ++ const char *text, ++ unsigned int cursor) ++{ ++ gsize pos = 0; ++ ++ /* Chromium does not accept NULL as preedit/commit string... */ ++ text = text ? text : ""; ++ pos = g_utf8_offset_to_pointer (text, cursor) - text; ++ ++ /* We really don't need so much styles... */ ++ zwp_text_input_v1_send_preedit_styling (resource, 0, strlen (text), ++ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_UNDERLINE); ++ zwp_text_input_v1_send_preedit_cursor (resource, pos); ++ zwp_text_input_v1_send_preedit_string (resource, serial, text, text); ++} ++ ++static void ++meta_wayland_text_input_v1_focus_set_preedit_text (ClutterInputFocus *focus, ++ const gchar *text, ++ unsigned int cursor, ++ unsigned int anchor) ++{ ++ MetaWaylandTextInputV1 *text_input; ++ struct wl_resource *resource; ++ ++ text_input = META_WAYLAND_TEXT_INPUT_V1_FOCUS (focus)->text_input; ++ ++ wl_resource_for_each (resource, &text_input->focus_resource_list) ++ { ++ text_input_v1_send_preedit_string (resource, ++ get_serial (text_input, resource), ++ text, ++ cursor); ++ } ++} ++ ++static void ++meta_wayland_text_input_v1_focus_request_surrounding (ClutterInputFocus *focus) ++{ ++ MetaWaylandTextInputV1 *text_input; ++ long cursor, anchor; ++ ++ /* Clutter uses char offsets but text-input-v1 uses byte offsets. */ ++ text_input = META_WAYLAND_TEXT_INPUT_V1_FOCUS (focus)->text_input; ++ cursor = g_utf8_strlen (text_input->surrounding.text, ++ text_input->surrounding.cursor); ++ anchor = g_utf8_strlen (text_input->surrounding.text, ++ text_input->surrounding.anchor); ++ clutter_input_focus_set_surrounding (focus, ++ text_input->surrounding.text, ++ cursor, ++ anchor); ++} ++ ++static void ++text_input_v1_send_commit_string (struct wl_resource *resource, ++ uint32_t serial, ++ const char *text) ++{ ++ /* Chromium does not accept NULL as preedit/commit string... */ ++ text = text ? text : ""; ++ ++ zwp_text_input_v1_send_commit_string (resource, serial, text); ++} ++ ++static void ++meta_wayland_text_input_v1_focus_delete_surrounding (ClutterInputFocus *focus, ++ int offset, ++ guint len) ++{ ++ MetaWaylandTextInputV1 *text_input; ++ struct wl_resource *resource; ++ const char *start, *end; ++ const char *before, *after; ++ const char *cursor; ++ ++ /* ++ * offset and len are counted by UTF-8 chars, but text-input-v1's lengths are ++ * counted by bytes, so we convert UTF-8 char offsets to pointers here, this ++ * needs the surrounding text ++ */ ++ text_input = META_WAYLAND_TEXT_INPUT_V1_FOCUS (focus)->text_input; ++ offset = MIN (offset, 0); ++ ++ start = text_input->surrounding.text; ++ end = start + strlen (text_input->surrounding.text); ++ cursor = start + text_input->surrounding.cursor; ++ ++ before = g_utf8_offset_to_pointer (cursor, offset); ++ g_assert (before >= start); ++ ++ after = g_utf8_offset_to_pointer (cursor, offset + len); ++ g_assert (after <= end); ++ ++ wl_resource_for_each (resource, &text_input->focus_resource_list) ++ { ++ zwp_text_input_v1_send_delete_surrounding_text (resource, ++ before - cursor, ++ after - before); ++ /* ++ * text-input-v1 says delete_surrounding belongs to next commit, so an ++ * empty commit is required. ++ */ ++ text_input_v1_send_commit_string (resource, ++ get_serial (text_input, resource), ++ NULL); ++ } ++} ++ ++static void ++meta_wayland_text_input_v1_focus_commit_text (ClutterInputFocus *focus, ++ const gchar *text) ++{ ++ MetaWaylandTextInputV1 *text_input; ++ struct wl_resource *resource; ++ ++ text_input = META_WAYLAND_TEXT_INPUT_V1_FOCUS (focus)->text_input; ++ ++ wl_resource_for_each (resource, &text_input->focus_resource_list) ++ { ++ /* ++ * You have to clear preedit string after committing string, otherwise ++ * some apps (I reproduced with Code OSS) will send you empty surrounding ++ * text and breaks delete_surrounding_text. ++ */ ++ text_input_v1_send_commit_string (resource, ++ get_serial (text_input, resource), ++ text); ++ /* Clear preedit string because we already committed. */ ++ text_input_v1_send_preedit_string (resource, ++ get_serial (text_input, resource), ++ NULL, ++ 0); ++ } ++} ++ ++static void ++meta_wayland_text_input_v1_focus_class_init (MetaWaylandTextInputV1FocusClass *klass) ++{ ++ ClutterInputFocusClass *focus_class = CLUTTER_INPUT_FOCUS_CLASS (klass); ++ ++ focus_class->request_surrounding = meta_wayland_text_input_v1_focus_request_surrounding; ++ focus_class->delete_surrounding = meta_wayland_text_input_v1_focus_delete_surrounding; ++ focus_class->commit_text = meta_wayland_text_input_v1_focus_commit_text; ++ focus_class->set_preedit_text = meta_wayland_text_input_v1_focus_set_preedit_text; ++} ++ ++static void ++meta_wayland_text_input_v1_focus_init (MetaWaylandTextInputV1Focus *focus) ++{ ++} ++ ++static ClutterInputFocus * ++meta_wayland_text_input_focus_new (MetaWaylandTextInputV1 *text_input) ++{ ++ MetaWaylandTextInputV1Focus *focus; ++ ++ focus = g_object_new (META_TYPE_WAYLAND_TEXT_INPUT_V1_FOCUS, NULL); ++ focus->text_input = text_input; ++ ++ return CLUTTER_INPUT_FOCUS (focus); ++} ++ ++static void ++move_resources (struct wl_list *destination, struct wl_list *source) ++{ ++ wl_list_insert_list (destination, source); ++ wl_list_init (source); ++} ++ ++static void ++move_resources_for_client (struct wl_list *destination, ++ struct wl_list *source, ++ struct wl_client *client) ++{ ++ struct wl_resource *resource, *tmp; ++ wl_resource_for_each_safe (resource, tmp, source) ++ { ++ if (wl_resource_get_client (resource) == client) ++ { ++ wl_list_remove (wl_resource_get_link (resource)); ++ wl_list_insert (destination, wl_resource_get_link (resource)); ++ } ++ } ++} ++ ++static void ++meta_wayland_text_input_v1_set_focus (MetaWaylandTextInputV1 *text_input, ++ MetaWaylandSurface *surface) ++{ ++ if (text_input->surface == surface) ++ return; ++ ++ if (text_input->surface) ++ { ++ if (!wl_list_empty (&text_input->focus_resource_list)) ++ { ++ ClutterInputFocus *focus = text_input->input_focus; ++ ClutterInputMethod *input_method; ++ struct wl_resource *resource; ++ ++ if (clutter_input_focus_is_focused (focus)) ++ { ++ input_method = clutter_backend_get_input_method (clutter_get_default_backend ()); ++ clutter_input_focus_reset (focus); ++ clutter_input_method_focus_out (input_method); ++ } ++ ++ wl_resource_for_each (resource, &text_input->focus_resource_list) ++ { ++ zwp_text_input_v1_send_leave (resource); ++ } ++ ++ move_resources (&text_input->resource_list, ++ &text_input->focus_resource_list); ++ } ++ ++ wl_list_remove (&text_input->surface_listener.link); ++ text_input->surface = NULL; ++ } ++ ++ if (surface && surface->resource) ++ { ++ struct wl_resource *focus_surface_resource; ++ ++ text_input->surface = surface; ++ focus_surface_resource = text_input->surface->resource; ++ wl_resource_add_destroy_listener (focus_surface_resource, ++ &text_input->surface_listener); ++ ++ move_resources_for_client (&text_input->focus_resource_list, ++ &text_input->resource_list, ++ wl_resource_get_client (focus_surface_resource)); ++ ++ if (!wl_list_empty (&text_input->focus_resource_list)) ++ { ++ struct wl_resource *resource; ++ ++ wl_resource_for_each (resource, &text_input->focus_resource_list) ++ { ++ zwp_text_input_v1_send_enter (resource, surface->resource); ++ } ++ } ++ } ++} ++ ++static void ++text_input_v1_handle_focus_surface_destroy (struct wl_listener *listener, ++ void *data) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_container_of (listener, text_input, surface_listener); ++ ++ meta_wayland_text_input_v1_set_focus (text_input, NULL); ++} ++ ++static void ++text_input_v1_destructor (struct wl_resource *resource) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ++ g_hash_table_remove (text_input->resource_serials, resource); ++ wl_list_remove (wl_resource_get_link (resource)); ++} ++ ++static gboolean ++client_matches_focus (MetaWaylandTextInputV1 *text_input, ++ struct wl_client *client) ++{ ++ if (!text_input->surface) ++ return FALSE; ++ ++ return client == wl_resource_get_client (text_input->surface->resource); ++} ++ ++static void ++text_input_v1_activate (struct wl_client *client, ++ struct wl_resource *resource, ++ struct wl_resource *seat_resource, ++ struct wl_resource *surface_resource) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ MetaWaylandSurface *surface; ++ ClutterInputFocus *focus = text_input->input_focus; ++ ClutterInputMethod *input_method; ++ ++ /* ++ * Don't use client_matches_focus() here because we have no focused surface if ++ * not activated in text-input-v1. ++ */ ++ ++ surface = wl_resource_get_user_data (surface_resource); ++ meta_wayland_text_input_v1_set_focus (text_input, surface); ++ ++ input_method = clutter_backend_get_input_method (clutter_get_default_backend ()); ++ ++ if (input_method) ++ { ++ if (!clutter_input_focus_is_focused (focus)) ++ clutter_input_method_focus_in (input_method, focus); ++ ++ clutter_input_focus_set_can_show_preedit (focus, TRUE); ++ } ++} ++ ++static void ++text_input_v1_deactivate (struct wl_client *client, ++ struct wl_resource *resource, ++ struct wl_resource *seat_resource) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ClutterInputFocus *focus = text_input->input_focus; ++ ClutterInputMethod *input_method; ++ ++ if (!client_matches_focus (text_input, client)) ++ return; ++ ++ meta_wayland_text_input_v1_set_focus (text_input, NULL); ++ ++ input_method = clutter_backend_get_input_method (clutter_get_default_backend ()); ++ if (input_method && clutter_input_focus_is_focused (focus)) ++ { ++ clutter_input_focus_reset (focus); ++ clutter_input_method_focus_out (input_method); ++ } ++} ++ ++static void ++text_input_v1_show_input_panel (struct wl_client *client, ++ struct wl_resource *resource) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ClutterInputFocus *focus = text_input->input_focus; ++ ++ if (!client_matches_focus (text_input, client)) ++ return; ++ ++ clutter_input_focus_set_input_panel_state (focus, ++ CLUTTER_INPUT_PANEL_STATE_ON); ++} ++ ++static void ++text_input_v1_hide_input_panel (struct wl_client *client, ++ struct wl_resource *resource) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ClutterInputFocus *focus = text_input->input_focus; ++ ++ if (!client_matches_focus (text_input, client)) ++ return; ++ ++ clutter_input_focus_set_input_panel_state (focus, ++ CLUTTER_INPUT_PANEL_STATE_OFF); ++} ++ ++static void ++text_input_v1_set_surrounding_text (struct wl_client *client, ++ struct wl_resource *resource, ++ const char *text, ++ uint32_t cursor, ++ uint32_t anchor) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ClutterInputFocus *focus = text_input->input_focus; ++ long char_cursor, char_anchor; ++ ++ if (!client_matches_focus (text_input, client)) ++ return; ++ ++ /* Save the surrounding text for `delete_surrounding_text`. */ ++ g_free (text_input->surrounding.text); ++ text_input->surrounding.text = g_strdup (text); ++ text_input->surrounding.cursor = cursor; ++ text_input->surrounding.anchor = anchor; ++ ++ /* Pass the surrounding text to Clutter to handle it with input method. */ ++ /* Clutter uses char offsets but text-input-v1 uses byte offsets. */ ++ char_cursor = g_utf8_strlen (text_input->surrounding.text, ++ text_input->surrounding.cursor); ++ char_anchor = g_utf8_strlen (text_input->surrounding.text, ++ text_input->surrounding.anchor); ++ clutter_input_focus_set_surrounding (focus, ++ text_input->surrounding.text, ++ char_cursor, ++ char_anchor); ++} ++ ++static void ++text_input_v1_reset (struct wl_client *client, ++ struct wl_resource *resource) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ClutterInputFocus *focus = text_input->input_focus; ++ ++ if (!client_matches_focus (text_input, client)) ++ return; ++ ++ /* ++ * This means text was changed outside of normal input method flow, but we are ++ * still focusing the same text entry, so we only reset states, but don't ++ * reset focus, cursor position and panel visibility. ++ */ ++ g_clear_pointer (&text_input->surrounding.text, g_free); ++ clutter_input_focus_set_surrounding (focus, NULL, 0, 0); ++ clutter_input_focus_set_content_hints (focus, 0); ++ clutter_input_focus_set_content_purpose (focus, ++ CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL); ++} ++ ++static ClutterInputContentHintFlags ++translate_hints (uint32_t hints) ++{ ++ ClutterInputContentHintFlags clutter_hints = 0; ++ ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_DEFAULT) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_DEFAULT; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_PASSWORD) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_PASSWORD; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_COMPLETION; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CORRECTION) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_AUTO_CORRECTION; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CAPITALIZATION) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_LOWERCASE) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_LOWERCASE; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_UPPERCASE) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_UPPERCASE; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_TITLECASE) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_TITLECASE; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_HIDDEN_TEXT) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_HIDDEN_TEXT; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_SENSITIVE_DATA) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_SENSITIVE_DATA; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_LATIN) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_LATIN; ++ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_MULTILINE) ++ clutter_hints |= CLUTTER_INPUT_CONTENT_HINT_MULTILINE; ++ ++ return clutter_hints; ++} ++ ++static ClutterInputContentPurpose ++translate_purpose (uint32_t purpose) ++{ ++ switch (purpose) ++ { ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NORMAL: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ALPHA: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_ALPHA; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DIGITS: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_DIGITS; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NUMBER: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_NUMBER; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PHONE: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_PHONE; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_URL: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_URL; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_EMAIL: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_EMAIL; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NAME: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_NAME; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PASSWORD: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_PASSWORD; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATE: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_DATE; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TIME: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_TIME; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATETIME: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_DATETIME; ++ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TERMINAL: ++ return CLUTTER_INPUT_CONTENT_PURPOSE_TERMINAL; ++ } ++ ++ g_warn_if_reached (); ++ return CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL; ++} ++ ++static void ++text_input_v1_set_content_type (struct wl_client *client, ++ struct wl_resource *resource, ++ uint32_t hint, ++ uint32_t purpose) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ClutterInputFocus *focus = text_input->input_focus; ++ ++ if (!client_matches_focus (text_input, client)) ++ return; ++ ++ clutter_input_focus_set_content_hints (focus, translate_hints (hint)); ++ clutter_input_focus_set_content_purpose (focus, translate_purpose (purpose)); ++} ++ ++static void ++text_input_v1_set_cursor_rectangle (struct wl_client *client, ++ struct wl_resource *resource, ++ int32_t x, ++ int32_t y, ++ int32_t width, ++ int32_t height) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ClutterInputFocus *focus = text_input->input_focus; ++ MtkRectangle rect = (MtkRectangle) { x, y, width, height }; ++ graphene_rect_t cursor_rect; ++ float x1, y1, x2, y2; ++ ++ if (!client_matches_focus (text_input, client)) ++ return; ++ ++ meta_wayland_surface_get_absolute_coordinates (text_input->surface, ++ rect.x, rect.y, &x1, &y1); ++ meta_wayland_surface_get_absolute_coordinates (text_input->surface, ++ rect.x + rect.width, ++ rect.y + rect.height, ++ &x2, &y2); ++ ++ graphene_rect_init (&cursor_rect, x1, y1, x2 - x1, y2 - y1); ++ clutter_input_focus_set_cursor_location (focus, &cursor_rect); ++} ++ ++static void ++text_input_v1_set_preferred_lanaguage (struct wl_client *client, ++ struct wl_resource *resource, ++ const char *language) ++{ ++ /* ClutterInputMethod does not support this so this is useless. */ ++} ++ ++/* ++ * text-input-v1 is not required to be double-buffered!!!!!!!!!!!!!!!!!!!!!!!!!! ++ * commit_state just means "I am giving you a new serial and you should use ++ * this". It can work without commit_state, chromium does not send this. ++ */ ++static void ++text_input_v1_commit_state (struct wl_client *client, ++ struct wl_resource *resource, ++ uint32_t serial) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ++ if (!client_matches_focus (text_input, client)) ++ return; ++ ++ set_serial (text_input, resource, serial); ++} ++ ++static void ++text_input_v1_invoke_action (struct wl_client *client, ++ struct wl_resource *resource, ++ uint32_t button, ++ uint32_t index) ++{ ++ /* There is no doc about what button and index are, I am not an invoker. */ ++} ++ ++static struct zwp_text_input_v1_interface meta_text_input_v1_interface = { ++ text_input_v1_activate, ++ text_input_v1_deactivate, ++ text_input_v1_show_input_panel, ++ text_input_v1_hide_input_panel, ++ text_input_v1_reset, ++ text_input_v1_set_surrounding_text, ++ text_input_v1_set_content_type, ++ text_input_v1_set_cursor_rectangle, ++ text_input_v1_set_preferred_lanaguage, ++ text_input_v1_commit_state, ++ text_input_v1_invoke_action ++}; ++ ++void ++meta_wayland_text_input_v1_destroy (MetaWaylandTextInputV1 *text_input) ++{ ++ meta_wayland_text_input_v1_set_focus (text_input, NULL); ++ g_object_unref (text_input->input_focus); ++ g_hash_table_destroy (text_input->resource_serials); ++ g_clear_pointer (&text_input->surrounding.text, g_free); ++ g_free (text_input); ++} ++ ++static void ++meta_wayland_text_input_v1_create_new_resource (MetaWaylandTextInputV1 *text_input, ++ struct wl_client *client, ++ uint32_t id) ++{ ++ struct wl_resource *text_input_resource; ++ ++ text_input_resource = wl_resource_create (client, ++ &zwp_text_input_v1_interface, ++ META_ZWP_TEXT_INPUT_V1_VERSION, ++ id); ++ ++ wl_resource_set_implementation (text_input_resource, ++ &meta_text_input_v1_interface, ++ text_input, text_input_v1_destructor); ++ ++ if (text_input->surface && ++ wl_resource_get_client (text_input->surface->resource) == client) ++ { ++ wl_list_insert (&text_input->focus_resource_list, ++ wl_resource_get_link (text_input_resource)); ++ ++ zwp_text_input_v1_send_enter (text_input_resource, ++ text_input->surface->resource); ++ } ++ else ++ { ++ wl_list_insert (&text_input->resource_list, ++ wl_resource_get_link (text_input_resource)); ++ } ++} ++ ++static void ++text_input_manager_v1_get_text_input (struct wl_client *client, ++ struct wl_resource *resource, ++ uint32_t id) ++{ ++ MetaWaylandTextInputV1 *text_input = wl_resource_get_user_data (resource); ++ ++ meta_wayland_text_input_v1_create_new_resource (text_input, client, id); ++} ++ ++static struct zwp_text_input_manager_v1_interface meta_text_input_manager_v1_interface = { ++ text_input_manager_v1_get_text_input ++}; ++ ++static void ++bind_text_input_v1 (struct wl_client *client, ++ void *data, ++ uint32_t version, ++ uint32_t id) ++{ ++ MetaWaylandTextInputV1 *text_input = data; ++ struct wl_resource *resource; ++ ++ resource = wl_resource_create (client, ++ &zwp_text_input_manager_v1_interface, ++ META_ZWP_TEXT_INPUT_V1_VERSION, ++ id); ++ wl_resource_set_implementation (resource, ++ &meta_text_input_manager_v1_interface, ++ text_input, NULL); ++} ++ ++gboolean ++meta_wayland_text_input_v1_init (MetaWaylandCompositor *compositor) ++{ ++ return (wl_global_create (compositor->wayland_display, ++ &zwp_text_input_manager_v1_interface, ++ META_ZWP_TEXT_INPUT_V1_VERSION, ++ compositor->seat->text_input_v1, ++ bind_text_input_v1) != NULL); ++} ++ ++MetaWaylandTextInputV1 * ++meta_wayland_text_input_v1_new (MetaWaylandSeat *seat) ++{ ++ MetaWaylandTextInputV1 *text_input; ++ ++ text_input = g_new0 (MetaWaylandTextInputV1, 1); ++ text_input->input_focus = meta_wayland_text_input_focus_new (text_input); ++ text_input->seat = seat; ++ ++ wl_list_init (&text_input->resource_list); ++ wl_list_init (&text_input->focus_resource_list); ++ text_input->surface_listener.notify = text_input_v1_handle_focus_surface_destroy; ++ ++ text_input->resource_serials = g_hash_table_new (NULL, NULL); ++ ++ return text_input; ++} ++ ++/* This function eats key events and will send them to input method. */ ++gboolean ++meta_wayland_text_input_v1_update (MetaWaylandTextInputV1 *text_input, ++ const ClutterEvent *event) ++{ ++ ClutterInputFocus *focus = text_input->input_focus; ++ ClutterEventType event_type; ++ ++ if (!text_input->surface || !clutter_input_focus_is_focused (focus)) ++ return FALSE; ++ ++ event_type = clutter_event_type (event); ++ ++ if (event_type == CLUTTER_KEY_PRESS || ++ event_type == CLUTTER_KEY_RELEASE) ++ { ++ gboolean filtered = FALSE; ++ ++ filtered = clutter_input_focus_filter_event (focus, event); ++ ++ return filtered; ++ } ++ ++ return FALSE; ++} ++ ++gboolean ++meta_wayland_text_input_v1_handle_event (MetaWaylandTextInputV1 *text_input, ++ const ClutterEvent *event) ++{ ++ ClutterInputFocus *focus = text_input->input_focus; ++ ClutterEventType event_type; ++ gboolean retval; ++ ++ if (!text_input->surface || !clutter_input_focus_is_focused (focus)) ++ return FALSE; ++ ++ event_type = clutter_event_type (event); ++ ++ retval = clutter_input_focus_process_event (focus, event); ++ ++ if (event_type == CLUTTER_BUTTON_PRESS || event_type == CLUTTER_TOUCH_BEGIN) ++ { ++ MetaWaylandSurface *surface = NULL; ++ MetaBackend *backend; ++ ClutterStage *stage; ++ ClutterActor *actor; ++ ++ backend = backend_from_text_input_v1 (text_input); ++ stage = CLUTTER_STAGE (meta_backend_get_stage (backend)); ++ ++ actor = clutter_stage_get_device_actor (stage, ++ clutter_event_get_device (event), ++ clutter_event_get_event_sequence (event)); ++ ++ if (META_IS_SURFACE_ACTOR_WAYLAND (actor)) ++ { ++ MetaSurfaceActorWayland *actor_wayland = ++ META_SURFACE_ACTOR_WAYLAND (actor); ++ ++ surface = meta_surface_actor_wayland_get_surface (actor_wayland); ++ ++ if (surface == text_input->surface) ++ clutter_input_focus_reset (focus); ++ } ++ } ++ ++ return retval; ++} +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/wayland/meta-wayland-text-input-v1.h mutter-45.3.new/src/wayland/meta-wayland-text-input-v1.h +--- mutter-45.3.old/src/wayland/meta-wayland-text-input-v1.h 1970-01-01 08:00:00.000000000 +0800 ++++ mutter-45.3.new/src/wayland/meta-wayland-text-input-v1.h 2024-05-21 16:47:09.832458185 +0800 +@@ -0,0 +1,38 @@ ++/* ++ * Copyright (C) 2024 SUSE LLC ++ * ++ * 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: Alynx Zhou ++ */ ++ ++#pragma once ++ ++#include ++ ++#include "meta/window.h" ++#include "wayland/meta-wayland-types.h" ++ ++typedef struct _MetaWaylandTextInputV1 MetaWaylandTextInputV1; ++ ++MetaWaylandTextInputV1 * meta_wayland_text_input_v1_new (MetaWaylandSeat *seat); ++void meta_wayland_text_input_v1_destroy (MetaWaylandTextInputV1 *text_input); ++ ++gboolean meta_wayland_text_input_v1_init (MetaWaylandCompositor *compositor); ++ ++gboolean meta_wayland_text_input_v1_update (MetaWaylandTextInputV1 *text_input, ++ const ClutterEvent *event); ++ ++gboolean meta_wayland_text_input_v1_handle_event (MetaWaylandTextInputV1 *text_input, ++ const ClutterEvent *event); +diff --unified --recursive --text --new-file --color mutter-45.3.old/src/wayland/meta-wayland-versions.h mutter-45.3.new/src/wayland/meta-wayland-versions.h +--- mutter-45.3.old/src/wayland/meta-wayland-versions.h 2024-01-07 07:34:55.000000000 +0800 ++++ mutter-45.3.new/src/wayland/meta-wayland-versions.h 2024-05-21 16:47:09.832458185 +0800 +@@ -49,6 +49,7 @@ + #define META_ZXDG_OUTPUT_V1_VERSION 3 + #define META_ZWP_XWAYLAND_KEYBOARD_GRAB_V1_VERSION 1 + #define META_ZWP_TEXT_INPUT_V3_VERSION 1 ++#define META_ZWP_TEXT_INPUT_V1_VERSION 1 + #define META_WP_VIEWPORTER_VERSION 1 + #define META_ZWP_PRIMARY_SELECTION_V1_VERSION 1 + #define META_WP_PRESENTATION_VERSION 1 diff --git a/mutter.changes b/mutter.changes index 3608016..8cbfbba 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,400 @@ +------------------------------------------------------------------- +Tue Jun 4 08:57:08 UTC 2024 - Alynx Zhou + +- Add mutter-fix-initial-suspended-state.patch: With Qt 6.7 some + apps cannot shown on launch, this patch fixes the initial + suspended state to make those windows visible + (glgo#GNOME/mutter!3475, bsc#1223393). + +------------------------------------------------------------------- +Tue May 21 08:26:15 UTC 2024 - Alynx Zhou + +- Add mutter-implement-text-input-v1.patch: This allows input + method to work in Chromium/Electron-based apps with Wayland Ozone + platform, which only has text-input-v1 support + (glgo#GNOME/mutter!3751, bsc#1219505). + +------------------------------------------------------------------- +Sun Apr 28 01:22:43 UTC 2024 - Xiaoguang Wang + +- Add 0001-Revert-clutter-stage-Avoid-queueing-stage-updates-wh.patch: + Reverting commit 261f516a to fix black screen on Xorg when logging + in or logging out (glgo#GNOME/mutter#3452 bsc#1222612). + +------------------------------------------------------------------- +Fri Mar 15 07:09:11 UTC 2024 - Alynx Zhou + +- Add 0001-Revert-clutter-actor-Cache-stage-relative-instead-of.patch: + This leads into partial update while switching VT (from TTY to + GNOME) on X11 session with fbdev driver used ( + glgo#GNOME/mutter#3302, bsc#1219546). + +------------------------------------------------------------------- +Thu Feb 1 09:28:37 UTC 2024 - Alynx Zhou + +- Drop mutter-SLE-bsc984738-grab-display.patch: It blocks non-CSD + apps with GNOME 45, and the latest LTS Oracle Installer works + fine without it, the original bug is not a problem (bsc#1218935). + +------------------------------------------------------------------- +Wed Jan 24 13:54:15 UTC 2024 - Eugenio Paolantonio + +- mutter-SLE-bsc984738-grab-display.patch: + * Temporary disable this SLE-only patch as it makes mutter + 45 lock-up on non-CSD apps (bsc#1218935) + +------------------------------------------------------------------- +Tue Jan 23 17:35:28 UTC 2024 - Eugenio Paolantonio + +- Rebase mutter-disable-cvt-s390x.patch for mutter 45.x. + +------------------------------------------------------------------- +Wed Jan 10 08:53:06 UTC 2024 - Dominique Leuenberger + +- Update to version 45.3: + + Fix handling of relative mode for tablets. + + Fix forcing EGLStream with NVIDIA proprietary driver. + + Sync geometry only when window is mapped. + + Improve repick due to transform changes. + + wayland/client: Add make_desktop() method. + + Fix occasional artifacts at top of X11 fullscreen windows. + + background: Fix background color around image. + + Fixed crashes. + + Plugged leaks. + + Misc. bug fixes and cleanups. + + Updated translations. + +------------------------------------------------------------------- +Thu Dec 21 08:23:54 UTC 2023 - Alynx Zhou + +- Add mutter-fix-text-input-delete-surrounding.patch: text-input-v3 + requrires byte based offset but Clutter uses char based offset + for delete_surrounding_text, fix it by converting before passing + arguments (glgo#GNOME/mutter#2146, glgo#GNOME/mutter!2712). + +------------------------------------------------------------------- +Mon Dec 18 06:47:32 UTC 2023 - Alynx Zhou + +- Add mutter-fix-x11-restart.patch: glgo#GNOME/mutter!2445 breaks + restarting under x11 accidentally because it redirects subwindows + after redirecting windows, this patch fix it by redirecting + subwindows first (glgo#GNOME/gnome-shell#7050, + glgo#GNOME/mutter!3329). + +------------------------------------------------------------------- +Thu Dec 7 15:09:40 UTC 2023 - Dominique Leuenberger + +- Update to version 45.2: + + Disable HW cursor when inhibited by backend. + + Fix disabling check-alive timeout. + + Propagate focus appearance to all ancestors. + + Fix tablets on X11 having the wrong device. + + Fixed crash. + + Updated translations. + +------------------------------------------------------------------- +Sun Dec 3 15:54:07 UTC 2023 - Yifan Jiang + +- Rebase mutter-SLE-bsc984738-grab-display.patch. + +------------------------------------------------------------------- +Tue Nov 28 11:57:17 UTC 2023 - Dominique Leuenberger + +- Use %patch -p N instead of deprecated %patchN. + +------------------------------------------------------------------- +Wed Nov 1 09:38:49 UTC 2023 - Bjørn Lie + +- Update to version 45.1: + + Fix filtering keybinding events in presence of grabs + + Fix direct scanout support when using integer scaling + + Fix capitalization of some keys when caps lock is on + + Fix vsync regression + + Fix visibility of software cursors when using direct scanout + + Fix artifacts at the bottom of some surfaces + + Discard monitor configs with fractional scale when unusable + + Apply track point settings + + xwayland: Enable XDG portal only when not nested + + Inhibit real-time scheduling when mode setting + + Don't delay frame updates after idle period + + Fix running Xwayland in headless setup with nvidia driver + + wayland: Send keyboard modifiers after the enter event + + Fixed crashes + + Misc. bug fixes and cleanups + + Updated translations. + +------------------------------------------------------------------- +Thu Oct 26 18:23:21 UTC 2023 - bjorn.lie@gmail.com + +- Update to version 45.0+61: + + backend: + - Introduce helpers for turning from/to clutter/evdev buttons + - Use helper to translate from/to clutter/evdev button codes + + clutter/frame-clock: + - Simplify next_presentation_time_us calculation + - Start next update ASAP after idle period + + cogl/onscreen: Add missing error untrap calls + + input-capture: + - Check barriers don't extend into nonexisting monitors + - Fix off-by-one for barrier validation + + renderer/native: + - Add a new has_addfb2 property + - Send modifiers even without AddFb2 + + screen-cast/stream-src: + - Assert that dmabuf handle lookup succeeds + - Calculate stride after adding handle to hash table + + tests/clutter/event-delivery: Avoid race with stage update + + tests/clutter/frame-clock*: Use + clutter_frame_get_target_presentation_time + + wayland/dma-buf: Advertise INVALID modifier without AddFb2 + + wayland: Send keyboard modifiers after the enter event + + input-capture: Add more barrier tests, mostly for invalid + barriers + +------------------------------------------------------------------- +Fri Oct 13 09:27:31 UTC 2023 - bjorn.lie@gmail.com + +- Update to version 45.0+45: + + kms/impl-device/atomic: + - Fix blob size + - Fix stack overflow + + kms/impl-device: Inhibit real-time scheduling when mode setting + + monitor-manager/native: Update assignments on empty-config too + + renderer/native: + - Clear old pending mode sets when unsetting all modes + - Fold mode unsetting into renamed unset_modes() + + tests/dbusmock-templates/rtkit: Add MakeThreadHighPriority + + tests/kms/render: Add test for setting empty config + + thread: + - Allow turning off rt scheduling for running thread + - For consistency, s/real_time/realtime/ + + Updated translations. + +------------------------------------------------------------------- +Mon Oct 9 20:50:24 UTC 2023 - Bjørn Lie + +- Drop mutter-crash-meta_context_terminate.patch: Closed upstream + via https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2609 + +------------------------------------------------------------------- +Sat Sep 16 22:09:37 UTC 2023 - Bjørn Lie + +- Update to version 45.0: + + Fix focus-follows-mouse mode + + Optimize applying relative transformation matrix + + Add support for P010 YCbCr format + + Fix hardware cursor stuttering on Raspberry Pi + + Fix input in multi-monitor remote desktop sessions with libei + + Fixed crashes + + Misc. bug fixes and cleanups + + Updated translations. +- Drop mutter-trap-dpms-errors.patch: Fixed upstream. +- Change compression of tarball in service and spec to zst from xz. +- Add pkgconfig(libdisplay-info) BuildRequires and pass + libdisplay_info=true to meson setup: New optional dependency, + build libdisplay-info support. + +------------------------------------------------------------------- +Thu Sep 14 02:51:54 UTC 2023 - Alynx Zhou + +- Add mutter-trap-dpms-errors.patch: Apparently DPMSForceLevel() + can fail if DPMS is not enabled, so trap errors of DPMS because + they are not critical and should not block user session. + (bsc#1215273, glgo#GNOME/mutter!3160) + +------------------------------------------------------------------- +Thu Sep 7 22:56:54 UTC 2023 - Luciano Santos + +- Replace sysprof-4 with sysprof-6 pkgconfig() BuildRequires to + follow up the upstream change. And build without the profiler + feature (using bcond_with profiler), as it's not meant for + general use. + +------------------------------------------------------------------- +Wed Sep 6 19:09:15 UTC 2023 - Bjørn Lie + +- Update to version 45.rc: + + Fix possible redraw freeze in fullscreen windows + + Fix restoring focus when leaving the overview + + Support alpha-composited window screencasts + + Fix some XWayland windows not getting mapped + + Fix cursor movement on rotated screens + + Avoid global lock in stage signals + + Implemented suspended xdg_toplevel state + + Support idle_inhibit protocol + + Do not trigger repick during relayout + + Fix redraw issue when buffer age is unavailable + + Add Meta Toolkit (MTK) library + + Fix possible window freeze during resize operations + + Fixes to tablet cursor visibility on Wayland + + Improve support for input capture and emulated input + + Use headless mode when seat ID is unset + + Fix unresponsive touchscreen after titlebar drag + + Fix absolute pointer events on virtual monitor streams + + Fix disabling CRTCs in disable-only mode updates + + Cache multi-texture shader snippets + + Fixed crashes + + Plugged leaks + + Misc. bug fixes and cleanups + + Updated translations. +- Drop mutter-fix-clipped-redraw.patch: Fixed upstream. + +------------------------------------------------------------------- +Mon Sep 4 17:43:47 UTC 2023 - Bjørn Lie + +- Update to version 45.beta.1: + + Fix blitting from premultiplied to opaque formats + + Fix Super key not going to overview in GNOME Shell + + Use ClutterEvent in ClutterActor class event vmethod signatures + + Misc. bug fixes and cleanups + + Updated translations. + +------------------------------------------------------------------- +Mon Sep 4 16:43:28 UTC 2023 - Bjørn Lie + +- Update to version 45.beta: + + Support input capture and emulated input with libei + + Add KMS thread + + Fix touch move operations on subsurfaces + + Fix unexpected cursor changes over non-resizable windows + + Improve render time estimates + + Fix flickering when DRI driver isn't available + + Fix restoring maximized state of SSD windows + + Add support for YUV formats + + Fix xwayland-allow-byte-swapped-clients setting + + Misc. bug fixes and cleanups + + Updated translations. +- Add pkgconfig(libeis-1.0) BuildRequires: New dependency. + +------------------------------------------------------------------- +Mon Sep 4 15:32:03 UTC 2023 - Bjørn Lie + +- Update to version 45.alpha: + + Fix DND in some server-side decorated windows + + Optionally use libdisplay-info for EDID parsing + + Optimize partial surface updates + + Fix redrawing regression in non-DMA remote sessions + + Avoid race condition in xwayland-on-demand + + Do not unminimize windows with initial IconicState + + Implement physical pixel rounding of wayland surfaces + + Fix mispositioning of some X11 fullscreen windows + + Fix legacy fullscreen windows appearing on all monitors + + Improve support for display-attached tablets + + Fix stuck cursor in some clients + + Avoid unexpected orientation changes around suspend/resume + + Fix oversized input region around Xwayland windows + + Re-enable client modifiers with amdgpu driver + + Fix sysprof tracing in non-main threads + + Fix X11 client input region issues + + Optimize finish-layout step during stage updating + + Fix profiling repeatedly + + Ensure preferred monitor mode is always included + + Fully initialize input device state during init + + Forward modifiers to IM alongside regular key events + + Fix window focus unexpectedly moving to secondary monitor when + changing workspaces + + Avoid rapidly toggling dynamic max render time + + Fix dynamic max render time blocking with direct scanout + + Mirror window placement in RTL locales + + Fix screencast with fractionally scaled surfaces + + Reipmlement strict focus mode policy + + Fixed crashes + + Plugged leaks + + Misc. bug fixes and cleanups + + Updated translations. +- Bump api_major to 13 following upstream changes. + +------------------------------------------------------------------- +Mon Sep 4 14:28:19 UTC 2023 - Bjørn Lie + +- Update to version 44.4: + + Fix xwayland-allow-byte-swapped-clients setting. + + Fix restoring focus when leaving the overview. + + Fix touch move operations on subsurfaces. + + Fix flickering when DRI driver isn't available. + + Fix unexpected cursor changes over non-resizable windows. + + Fix restoring maximized state of SSD windows. + + Fix window focus unexpectedly moving to secondary monitor when + changing workspaces. + + Fixed crash. + + Misc. bug fixes and cleanups. + + Updated translations. + +------------------------------------------------------------------- +Tue Aug 29 09:50:53 UTC 2023 - Alynx Zhou + +- Add mutter-fix-clipped-redraw.patch: Previous refactor forget + to check has_buffer_age, which leads into force full redraw and + causes redraw issue with xterm on qemu. This patch fixes it. + (bsc#1210744, glgo#GNOME/mutter!3221) +- Drop mutter-revert-window_draw_issues.patch: Proper fix is added. + +------------------------------------------------------------------- +Tue Aug 22 09:24:36 UTC 2023 - Dominique Leuenberger + +- Add mutter-revert-window_draw_issues.patch: Revert commit + 43cee4b6: Do clipped redraws when drawing offscreen + (boo#1210744, glgo#GNOME/mutter#2771). + +------------------------------------------------------------------- +Thu Aug 17 09:36:34 UTC 2023 - Yifan Jiang + +- Disable %autopatch on SLE which has not the macro ready. +- Rebase mutter-SLE-bsc984738-grab-display.patch. +- Drop mutter-Lower-HIDPI_LIMIT-to-144.patch (fate#326682, + bsc#112546). The upstream has reworked the logic of scale factor + selection based on actual screen size, see: + https://gitlab.gnome.org/GNOME/mutter/-/commit/2f1dd049bfbbb60e0b3c2351e9ba1d014205551f + +------------------------------------------------------------------- +Thu Jul 6 18:10:34 UTC 2023 - Bjørn Lie + +- Update to version 44.3: + + Ensure preferred monitor mode is always included. + + Avoid rapidly toggling dynamic max render time. + + Fix dynamic max render time blocking with direct scanout. + + Misc. bug fixes. + + Updated translations. + +------------------------------------------------------------------- +Mon Jun 05 07:34:52 UTC 2023 - bjorn.lie@gmail.com + +- Update to version 44.2: + + Fix DND in some server-side decorated windows + + Fix redrawing regression in non-DMA remote sessions + + Avoid race condition in xwayland-on-demand + + Do not unminimize windows with initial IconicState + + Fix mispositioning of some X11 fullscreen windows + + Fix legacy fullscreen windows appearing on all monitors + + Improve support for display-attached tablets + + Fix stuck cursor in some clients + + Avoid unexpected orientation changes around suspend/resume + + Fix oversized input region around Xwayland windows + + Fix X11 client input region issues + + Plugged leak + + Fixed crashes + + Misc. bug fixes and cleanups + + Updated translations. +- Drop patches fixed upstream: + + mutter-do-not-unminimize-windows-with-initial-iconic.patch + + mutter-fix-wacom-tablet-crash.patch + +------------------------------------------------------------------- +Tue May 23 07:41:44 UTC 2023 - Alynx Zhou + +- Add mutter-do-not-unminimize-windows-with-initial-iconic.patch: + mutter used to unminimize windows with initial IconicState, which + is a workaround for some old wine games, it breaks apps like + xterm starts with -iconic, this patch revert it (bsc#1193190, + glgo#GNOME/mutter!3001). + +------------------------------------------------------------------- +Wed May 17 03:01:48 UTC 2023 - Alynx Zhou + +- Add mutter-fix-wacom-tablet-crash.patch: Use clutter error trap + to fix x11 error of some input device configuration like wacom + tablet (bsc#1211413, glgo#GNOME/mutter#2796). + ------------------------------------------------------------------- Tue May 09 09:30:19 UTC 2023 - bjorn.lie@gmail.com diff --git a/mutter.obsinfo b/mutter.obsinfo index 8fb91a5..046fa59 100644 --- a/mutter.obsinfo +++ b/mutter.obsinfo @@ -1,4 +1,4 @@ name: mutter -version: 44.1+2 -mtime: 1683227330 -commit: 82bd40dcbcc3601da755678778f033bd9a30286d +version: 45.3 +mtime: 1704584095 +commit: 5012d22cb96ba22c4133e2e488ea1f5241fb50e2 diff --git a/mutter.spec b/mutter.spec index 1fc32fa..5a8c721 100644 --- a/mutter.spec +++ b/mutter.spec @@ -1,7 +1,7 @@ # # spec file for package mutter # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,36 +16,42 @@ # -%bcond_without profiler +%bcond_with profiler -%define api_major 12 +%define api_major 13 %define api_minor 0 %define libmutter libmutter-%{api_major}-%{api_minor} Name: mutter -Version: 44.1+2 +Version: 45.3 Release: 0 Summary: Window and compositing manager based on Clutter License: GPL-2.0-or-later Group: System/GUI/GNOME URL: https://www.gnome.org -Source0: %{name}-%{version}.tar.xz +Source0: %{name}-%{version}.tar.zst # PATCH-FIX-UPSTREAM mutter-disable-cvt-s390x.patch bsc#1158128 fcrozat@suse.com -- Do not search for cvt on s390x, it doesn't exist there Patch1: mutter-disable-cvt-s390x.patch # PATCH-FIX-OPENSUSE mutter-window-actor-Special-case-shaped-Java-windows.patch -- window-actor: Special-case shaped Java windows Patch2: mutter-window-actor-Special-case-shaped-Java-windows.patch -# PATCH-FIX-UPSTREAM mutter-crash-meta_context_terminate.patch bsc#1199382 glgo#GNOME/mutter#2267 xwang@suse.com -- Fix SIGSEGV in meta_context_terminate -Patch3: mutter-crash-meta_context_terminate.patch +# PATCH-FIX-UPSTREAM mutter-fix-x11-restart.patch glgo#GNOME/gnome-shell#7050 glgo#GNOME/mutter!3329 alynx.zhou@suse.com -- Fix crash on restarting mutter under x11 +Patch3: mutter-fix-x11-restart.patch +# PATCH-FIX-UPSTREAM mutter-fix-text-input-delete-surrounding.patch glgo#GNOME/mutter#2146 glgo#GNOME/mutter!2712 alynx.zhou@suse.com -- Fix delete_surrounding_text of text-input-v3 +Patch4: mutter-fix-text-input-delete-surrounding.patch +# PATCH-FIX-OPENSUSE 0001-Revert-clutter-actor-Cache-stage-relative-instead-of.patch glgo#GNOME/mutter#3302 bsc#1219546 alynx.zhou@suse.com -- Fix partial update on VT switch +Patch5: 0001-Revert-clutter-actor-Cache-stage-relative-instead-of.patch +# PATCH-FIX-UPSTREAM 0001-Revert-clutter-stage-Avoid-queueing-stage-updates-wh.patch glgo#GNOME/mutter#3452 bsc#1222612 xwang@suse.com -- Fix blank screen on Xorg when logging in or logging out +Patch6: 0001-Revert-clutter-stage-Avoid-queueing-stage-updates-wh.patch +# PATCH-FEATURE-OPENSUSE mutter-implement-text-input-v1.patch glgo#GNOME/mutter!3751 bsc#1219505 alynx.zhou@suse.com -- Allow input method to work in Wayland Chromium +Patch7: mutter-implement-text-input-v1.patch +# PATCH-FIX-UPSTREAM mutter-fix-initial-suspended-state.patch glgo#GNOME/mutter!3475 bsc#1223393 alynx.zhou@suse.com -- Fix initial suspended state for some Qt 6.7 window +Patch8: mutter-fix-initial-suspended-state.patch ## SLE-only patches start at 1000 # PATCH-FEATURE-SLE mutter-SLE-bell.patch FATE#316042 bnc#889218 idonmez@suse.com -- make audible bell work out of the box. Patch1000: mutter-SLE-bell.patch # PATCH-FIX-SLE mutter-SLE-relax-some-constraints-on-CSD-windows.patch bnc#883491 cxiong@suse.com -- Relax some constraints on window positioning for CSD windows s.t. they can be placed at the very top of the monitor. Patch1001: mutter-SLE-relax-some-constraints-on-CSD-windows.patch -# PATCH-FIX-SLE mutter-SLE-bsc984738-grab-display.patch bsc#984738 bgo#769387 hpj@suse.com -- Revert a upstream commit to avoid X11 race condition that results in wrong dialog sizes. -Patch1002: mutter-SLE-bsc984738-grab-display.patch -# PATCH-NEEDS-REBASE mutter-Lower-HIDPI_LIMIT-to-144.patch fate#326682, bsc#1125467 qkzhu@suse.com -- Lower HIDPI_LIMIT to 144 WAS -Patch1003: mutter-Lower-HIDPI_LIMIT-to-144.patch BuildRequires: Mesa-libGLESv3-devel BuildRequires: fdupes @@ -74,7 +80,9 @@ BuildRequires: pkgconfig(gudev-1.0) >= 232 BuildRequires: pkgconfig(json-glib-1.0) >= 0.12.0 BuildRequires: pkgconfig(lcms2) >= 2.6 BuildRequires: pkgconfig(libcanberra-gtk3) >= 0.26 +BuildRequires: pkgconfig(libdisplay-info) BuildRequires: pkgconfig(libdrm) >= 2.4.83 +BuildRequires: pkgconfig(libeis-1.0) BuildRequires: pkgconfig(libinput) >= 1.15.0 BuildRequires: pkgconfig(libpipewire-0.3) >= 0.3.21 BuildRequires: pkgconfig(libstartup-notification-1.0) >= 0.7 @@ -84,8 +92,8 @@ BuildRequires: pkgconfig(libwacom) >= 0.13 BuildRequires: pkgconfig(pango) >= 1.2.0 BuildRequires: pkgconfig(sm) %if %{with profiler} -BuildRequires: pkgconfig(sysprof-4) -BuildRequires: pkgconfig(sysprof-capture-4) >= 3.37.3 +BuildRequires: pkgconfig(sysprof-6) +BuildRequires: pkgconfig(sysprof-capture-4) >= 3.37.2 %endif BuildRequires: pkgconfig(udev) BuildRequires: pkgconfig(upower-glib) >= 0.99.0 @@ -142,10 +150,22 @@ applications that want to make use of the mutter library. %prep %autosetup -N +%if !0%{?sle_version} %autopatch -p1 -M 999 +%else +%patch -P 1 -p1 +%patch -P 2 -p1 +%patch -P 3 -p1 +%patch -P 4 -p1 +%patch -P 5 -p1 +%patch -P 6 -p1 +%patch -P 7 -p1 +%patch -P 8 -p1 +%endif # SLE-only patches and translations. %if 0%{?sle_version} -%autopatch -p1 -m 1000 +%patch -P 1000 -p1 +%patch -P 1001 -p1 %endif %build @@ -157,6 +177,7 @@ applications that want to make use of the mutter library. -Dtests=false \ -Dinstalled_tests=false \ -Dxwayland_initfd=auto \ + -Dlibdisplay_info=true \ %if %{with profiler} -Dprofiler=true \ %else @@ -185,6 +206,7 @@ applications that want to make use of the mutter library. %{_libdir}/mutter-%{api_major}/libmutter-clutter-%{api_major}.so.* %{_libdir}/mutter-%{api_major}/libmutter-cogl-pango-%{api_major}.so.* %{_libdir}/mutter-%{api_major}/libmutter-cogl-%{api_major}.so.* +%{_libdir}/mutter-%{api_major}/libmutter-mtk-%{api_major}.so.* %{_libdir}/mutter-%{api_major}/plugins/libdefault.so # These typelibs are not split out since they are private to mutter @@ -193,6 +215,7 @@ applications that want to make use of the mutter library. %{_libdir}/mutter-%{api_major}/Cogl-%{api_major}.typelib %{_libdir}/mutter-%{api_major}/CoglPango-%{api_major}.typelib %{_libdir}/mutter-%{api_major}/Meta-%{api_major}.typelib +%{_libdir}/mutter-%{api_major}/Mtk-%{api_major}.typelib %{_libdir}/libmutter-%{api_major}.so.* %dir %{_libdir}/mutter-%{api_major}/ @@ -217,14 +240,17 @@ applications that want to make use of the mutter library. %{_libdir}/mutter-%{api_major}/Clutter-%{api_major}.gir %{_libdir}/mutter-%{api_major}/Cogl-%{api_major}.gir %{_libdir}/mutter-%{api_major}/CoglPango-%{api_major}.gir +%{_libdir}/mutter-%{api_major}/Mtk-%{api_major}.gir %{_libdir}/mutter-%{api_major}/libmutter-clutter-%{api_major}.so %{_libdir}/mutter-%{api_major}/libmutter-cogl-pango-%{api_major}.so %{_libdir}/mutter-%{api_major}/libmutter-cogl-%{api_major}.so +%{_libdir}/mutter-%{api_major}/libmutter-mtk-%{api_major}.so %{_libdir}/libmutter-%{api_major}.so %{_libdir}/pkgconfig/libmutter-%{api_major}.pc %{_libdir}/pkgconfig/mutter-clutter-%{api_major}.pc %{_libdir}/pkgconfig/mutter-cogl-%{api_major}.pc %{_libdir}/pkgconfig/mutter-cogl-pango-%{api_major}.pc +%{_libdir}/pkgconfig/mutter-mtk-%{api_major}.pc %files lang -f %{name}.lang