Codebase list policykit-1-gnome / d72b254 debian / patches / 0004-Use-fresh-X11-timestamps-when-displaying-authenticat.patch
d72b254

Tree @d72b254 (Download .tar.gz)

0004-Use-fresh-X11-timestamps-when-displaying-authenticat.patch @d72b254raw · history · blame

From: Jeffrey Knockel <jeff250@gmail.com>
Date: Mon, 30 Apr 2018 18:05:20 +0000
Subject: Use fresh X11 timestamps when displaying authentication dialog

This circumvents focus-stealing prevention.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=676076
Bug-Debian: https://bugs.debian.org/684300
Bug-Ubuntu: https://launchpad.net/bugs/946171
---
 src/polkitgnomeauthenticator.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/polkitgnomeauthenticator.c b/src/polkitgnomeauthenticator.c
index 23163b4..e57d76e 100644
--- a/src/polkitgnomeauthenticator.c
+++ b/src/polkitgnomeauthenticator.c
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <pwd.h>
 #include <glib/gi18n.h>
+#include <gdk/gdkx.h>
 
 #include <polkit/polkit.h>
 #include <polkitagent/polkitagent.h>
@@ -306,7 +307,8 @@ session_request (PolkitAgentSession *session,
     }
 
   gtk_widget_show_all (GTK_WIDGET (authenticator->dialog));
-  gtk_window_present (GTK_WINDOW (authenticator->dialog));
+  gtk_window_present_with_time (GTK_WINDOW (authenticator->dialog),
+                                gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (authenticator->dialog))));
   password = polkit_gnome_authentication_dialog_run_until_response_for_prompt (POLKIT_GNOME_AUTHENTICATION_DIALOG (authenticator->dialog),
                                                                                modified_request,
                                                                                echo_on,