kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

Blame SOURCES/0001-wayland-Clean-up-xwayland-grabs-even-if-surface-is-g.patch

776610
From 5b9f5329bd922f7048084977102f23ad2845311e Mon Sep 17 00:00:00 2001
776610
From: Olivier Fourdan <ofourdan@redhat.com>
776610
Date: Fri, 3 Aug 2018 10:50:32 +0200
776610
Subject: [PATCH] wayland: Clean up xwayland grabs even if surface is gone
776610
776610
If the surface is gone before `meta_xwayland_keyboard_grab_end()` is
776610
called, we would bail out early leaving an empty grab, which will cause
776610
a segfault as soon as a key is pressed later on.
776610
776610
Make sure we clean up the keyboard grab even if the surface is gone.
776610
776610
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/255
776610
(cherry picked from commit 252dd524390dcdbdd89534c0014d22a796957f55)
776610
---
776610
 src/wayland/meta-xwayland-grab-keyboard.c | 14 +++++++-------
776610
 1 file changed, 7 insertions(+), 7 deletions(-)
776610
776610
diff --git a/src/wayland/meta-xwayland-grab-keyboard.c b/src/wayland/meta-xwayland-grab-keyboard.c
776610
index 42b194a77..db2d5f0bd 100644
776610
--- a/src/wayland/meta-xwayland-grab-keyboard.c
776610
+++ b/src/wayland/meta-xwayland-grab-keyboard.c
776610
@@ -85,6 +85,13 @@ meta_xwayland_keyboard_grab_end (MetaXwaylandKeyboardActiveGrab *active_grab)
776610
 {
776610
   MetaWaylandSeat *seat = active_grab->seat;
776610
 
776610
+  if (seat->keyboard->grab->interface->key == meta_xwayland_keyboard_grab_key)
776610
+    {
776610
+      meta_wayland_keyboard_end_grab (active_grab->keyboard_grab.keyboard);
776610
+      meta_wayland_keyboard_set_focus (active_grab->keyboard_grab.keyboard, NULL);
776610
+      meta_display_sync_wayland_input_focus (meta_get_display ());
776610
+    }
776610
+
776610
   if (!active_grab->surface)
776610
     return;
776610
 
776610
@@ -104,13 +111,6 @@ meta_xwayland_keyboard_grab_end (MetaXwaylandKeyboardActiveGrab *active_grab)
776610
       active_grab->window_associate_handler = 0;
776610
     }
776610
 
776610
-  if (seat->keyboard->grab->interface->key == meta_xwayland_keyboard_grab_key)
776610
-    {
776610
-      meta_wayland_keyboard_end_grab (active_grab->keyboard_grab.keyboard);
776610
-      meta_wayland_keyboard_set_focus (active_grab->keyboard_grab.keyboard, NULL);
776610
-      meta_display_sync_wayland_input_focus (meta_get_display ());
776610
-    }
776610
-
776610
   active_grab->surface = NULL;
776610
 }
776610
 
776610
-- 
776610
2.19.0
776610