fepitre / rpms / gtk3

Forked from rpms/gtk3 4 years ago
Clone

Blame SOURCES/0001-gdkseatdefault-Don-t-hide-GdkWindow-on-grab-failure.patch

441813
From 2c8b95a518bea2192145efe11219f2e36091b37a Mon Sep 17 00:00:00 2001
441813
From: Victor Toso <me@victortoso.com>
441813
Date: Thu, 24 May 2018 15:42:47 +0200
441813
Subject: [PATCH] gdkseatdefault: Don't hide GdkWindow on grab failure
441813
441813
Application is not expecting that.
441813
441813
Bug found due gdk_seat_grab() failure on Lock Screen. When user
441813
Unlock the screen, the application is visible but does not receive
441813
enter-event any more on X11/GNOME.
441813
441813
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1485968
441813
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1571422
441813
441813
Signed-off-by: Victor Toso <victortoso@redhat.com>
441813
Signed-off-by: Carlos Garnacho <mrgarnacho@gmail.com>
441813
---
441813
 gdk/gdkseatdefault.c | 6 +++++-
441813
 1 file changed, 5 insertions(+), 1 deletion(-)
441813
441813
diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c
441813
index 91a42cd4af..ce4bdc82d2 100644
441813
--- a/gdk/gdkseatdefault.c
441813
+++ b/gdk/gdkseatdefault.c
441813
@@ -115,8 +115,10 @@ gdk_seat_default_grab (GdkSeat                *seat,
441813
   GdkSeatDefaultPrivate *priv;
441813
   guint32 evtime = event ? gdk_event_get_time (event) : GDK_CURRENT_TIME;
441813
   GdkGrabStatus status = GDK_GRAB_SUCCESS;
441813
+  gboolean was_visible;
441813
 
441813
   priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
441813
+  was_visible = gdk_window_is_visible (window);
441813
 
441813
   if (prepare_func)
441813
     (prepare_func) (seat, window, prepare_func_data);
441813
@@ -163,10 +165,12 @@ gdk_seat_default_grab (GdkSeat                *seat,
441813
         {
441813
           if (capabilities & ~GDK_SEAT_CAPABILITY_KEYBOARD)
441813
             gdk_device_ungrab (priv->master_pointer, evtime);
441813
-          gdk_window_hide (window);
441813
         }
441813
     }
441813
 
441813
+  if (status != GDK_GRAB_SUCCESS && !was_visible)
441813
+    gdk_window_hide (window);
441813
+
441813
   G_GNUC_END_IGNORE_DEPRECATIONS;
441813
 
441813
   return status;
441813
-- 
441813
2.17.0
441813