#17 Backport patch to fix timeout of application startup sequences (rhbz#1692135)
Closed 5 years ago by kathenas. Opened 5 years ago by kathenas.
Unknown source f30  into  f30

@@ -0,0 +1,28 @@

+ From f0b9654deb947e49e42b76d6daa42b86e5b0ec17 Mon Sep 17 00:00:00 2001

+ From: Carlos Garnacho <carlosg@gnome.org>

+ Date: Mon, 18 Mar 2019 11:59:26 +0100

+ Subject: [PATCH] core: Remove startup sequences after timeout

+ 

+ The complete/remove semantics were split to cater for presenting windows,

+ so we must now separately do both here.

+ 

+ Related: https://gitlab.gnome.org/GNOME/mutter/issues/501

+ ---

+  src/core/startup-notification.c | 1 +

+  1 file changed, 1 insertion(+)

+ 

+ diff --git a/src/core/startup-notification.c b/src/core/startup-notification.c

+ index 8bcb0f385..d2d0d1362 100644

+ --- a/src/core/startup-notification.c

+ +++ b/src/core/startup-notification.c

+ @@ -454,6 +454,7 @@ startup_sequence_timeout (void *data)

+                    meta_startup_sequence_get_id (sequence));

+  

+        meta_startup_sequence_complete (sequence);

+ +      meta_startup_notification_remove_sequence (sn, sequence);

+      }

+  

+    g_slist_free (ctod.list);

+ -- 

+ 2.18.1

+ 

@@ -0,0 +1,127 @@

+ From 63124e3e8a675725c729d4a99b994a83517a5c1a Mon Sep 17 00:00:00 2001

+ From: Carlos Garnacho <carlosg@gnome.org>

+ Date: Thu, 18 Oct 2018 02:08:24 +0200

+ Subject: [PATCH] wayland: Defer text_input.done on an idle

+ 

+ IBus naturally doesn't know how to implement the text-input protocol,

+ and some input methods emit event streams that are incompatible with the

+ protocol, if not assumed to be part of an grouped series of events. As

+ IBus doesn't have any API to let us know about such groupings, let's

+ fake it by adding a specially crafted idle callback.

+ 

+ The idle callback has a known limitation; if there is an idle callback

+ with a higher priority, that either doesn't remove itself, or

+ reschedules itself before the next idle, we'll never get triggered.

+ This, however, is unlikely to actually be the bigger problem in such

+ situations, as it'd likely mean we'd have a 100% CPU bug.

+ 

+ https://gitlab.gnome.org/GNOME/gtk/issues/1365

+ ---

+  src/wayland/meta-wayland-text-input.c | 60 ++++++++++++++++++++++++---

+  1 file changed, 54 insertions(+), 6 deletions(-)

+ 

+ diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c

+ index 8681430217..0493760bd1 100644

+ --- a/src/wayland/meta-wayland-text-input.c

+ +++ b/src/wayland/meta-wayland-text-input.c

+ @@ -70,6 +70,8 @@ struct _MetaWaylandTextInput

+    uint32_t content_type_purpose;

+    uint32_t text_change_cause;

+    gboolean enabled;

+ +

+ +  guint done_idle_id;

+  };

+  

+  struct _MetaWaylandTextInputFocus

+ @@ -114,6 +116,52 @@ increment_serial (MetaWaylandTextInput *text_input,

+                         GUINT_TO_POINTER (serial + 1));

+  }

+  

+ +static gboolean

+ +done_idle_cb (gpointer user_data)

+ +{

+ +  ClutterInputFocus *focus = user_data;

+ +  MetaWaylandTextInput *text_input;

+ +  struct wl_resource *resource;

+ +

+ +  text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;

+ +

+ +  wl_resource_for_each (resource, &text_input->focus_resource_list)

+ +    {

+ +      zwp_text_input_v3_send_done (resource,

+ +                                   lookup_serial (text_input, resource));

+ +    }

+ +

+ +  text_input->done_idle_id = 0;

+ +  return G_SOURCE_REMOVE;

+ +}

+ +

+ +static void

+ +meta_wayland_text_input_focus_defer_done (ClutterInputFocus *focus)

+ +{

+ +  MetaWaylandTextInput *text_input;

+ +

+ +  text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;

+ +

+ +  if (text_input->done_idle_id != 0)

+ +    return;

+ +

+ +  /* This operates on 3 principles:

+ +   * - GDBus uses G_PRIORITY_DEFAULT to put messages in the thread default main

+ +   *   context.

+ +   * - All relevant ClutterInputFocus methods are ultimately backed by

+ +   *   DBus methods inside IBus.

+ +   * - We want to run .done after them all. The slightly lower

+ +   *   G_PRIORITY_DEFAULT + 1 priority should ensure we at least group

+ +   *   all messages seen so far.

+ +   *

+ +   * FIXME: .done may be delayed indefinitely if there's a high enough

+ +   *        priority idle source in the main loop. It's unlikely that

+ +   *        recurring idles run at this high priority though.

+ +   */

+ +  text_input->done_idle_id = g_idle_add_full (G_PRIORITY_DEFAULT + 1,

+ +                                              done_idle_cb, focus, NULL);

+ +}

+ +

+  static void

+  meta_wayland_text_input_focus_delete_surrounding (ClutterInputFocus *focus,

+                                                    guint              cursor,

+ @@ -127,9 +175,9 @@ meta_wayland_text_input_focus_delete_surrounding (ClutterInputFocus *focus,

+    wl_resource_for_each (resource, &text_input->focus_resource_list)

+      {

+        zwp_text_input_v3_send_delete_surrounding_text (resource, cursor, len);

+ -      zwp_text_input_v3_send_done (resource,

+ -                                   lookup_serial (text_input, resource));

+      }

+ +

+ +  meta_wayland_text_input_focus_defer_done (focus);

+  }

+  

+  static void

+ @@ -145,9 +193,9 @@ meta_wayland_text_input_focus_commit_text (ClutterInputFocus *focus,

+      {

+        zwp_text_input_v3_send_preedit_string (resource, NULL, 0, 0);

+        zwp_text_input_v3_send_commit_string (resource, text);

+ -      zwp_text_input_v3_send_done (resource,

+ -                                   lookup_serial (text_input, resource));

+      }

+ +

+ +  meta_wayland_text_input_focus_defer_done (focus);

+  }

+  

+  static void

+ @@ -163,9 +211,9 @@ meta_wayland_text_input_focus_set_preedit_text (ClutterInputFocus *focus,

+    wl_resource_for_each (resource, &text_input->focus_resource_list)

+      {

+        zwp_text_input_v3_send_preedit_string (resource, text, cursor, cursor);

+ -      zwp_text_input_v3_send_done (resource,

+ -                                   lookup_serial (text_input, resource));

+      }

+ +

+ +  meta_wayland_text_input_focus_defer_done (focus);

+  }

+  

+  static void

+ -- 

+ 2.19.1

+ 

file modified
+16 -1
@@ -8,7 +8,7 @@

  

  Name:          mutter

  Version:       3.32.0

- Release:       1%{?dist}

+ Release:       4%{?dist}

  Summary:       Window and compositing manager based on Clutter

  

  License:       GPLv2+
@@ -22,6 +22,12 @@

  # Fix building with meson >= 0.50.0

  Patch1:        0001-build-Don-t-use-absolute-paths-with-subdir-keyword.patch

  

+ # Backport work-around for hangul text input bug (rhbz#1632981)

+ Patch2:        0001-wayland-Defer-text_input.done-on-an-idle.patch

+ 

+ # Backport patch to fix timeout of application startup sequences (rhbz#1692135)

+ Patch3:        0001-startup-notification-remove-at-timeout.patch

+ 

  BuildRequires: chrpath

  BuildRequires: pango-devel

  BuildRequires: startup-notification-devel
@@ -163,6 +169,15 @@

  %{_datadir}/mutter-%{mutter_api_version}/tests

  

  %changelog

+ * Wed Apr 17 2019 Phil Wyett <philwyett@kathenas.org> - 3.32.0-4

+ - Backport patch to fix timeout of application startup sequences (rhbz#1692135)

+ 

+ * Tue Apr 16 2019 Adam Williamson <awilliam@redhat.com> - 3.32.0-3

+ - Rebuild with Meson fix for #1699099

+ 

+ * Mon Mar 25 2019 Adam Williamson <awilliam@redhat.com> - 3.32.0-2

+ - Backport work-around for hangul text input bug (rhbz#1632981)

+ 

  * Tue Mar 12 2019 Florian Müllner <fmuellner@redhat.com> - 3.32.0-1

  - Update to 3.32.0

  

Backport patch to fix timeout of application startup sequences (rhbz#1692135)

Not a blocker, so would like it in before freeze hits.

This is second submission of same patch, but was closed as advised 3.32.1 was imminent. That release of mutter has not happened.

rebased onto da87442

5 years ago

Pull-Request has been closed by kathenas

5 years ago