From 396f57895f87edfcaf2293b14fc0443a6b3ee74b Mon Sep 17 00:00:00 2001 From: Alexej Kowalew <616b2f@gmail.com> Date: Wed, 5 Jan 2022 21:47:23 +0100 Subject: [PATCH] fix polkit-gnome crashes under wayland --- 08-fresh-x11-timestamps.patch | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/08-fresh-x11-timestamps.patch b/08-fresh-x11-timestamps.patch index 9a282e3..234cc6e 100644 --- a/08-fresh-x11-timestamps.patch +++ b/08-fresh-x11-timestamps.patch @@ -16,13 +16,22 @@ Index: policykit-1-gnome-0.105/src/polkitgnomeauthenticator.c #include #include -@@ -307,7 +308,8 @@ +@@ -307,7 +308,17 @@ } 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)))); ++ GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (authenticator->dialog)); ++ ++ if (GDK_IS_X11_WINDOW (window)) ++ { ++ gtk_window_present_with_time (GTK_WINDOW (authenticator->dialog), gdk_x11_get_server_time (window)); ++ } ++ else ++ { ++ gtk_window_present (GTK_WINDOW (authenticator->dialog)); ++ } ++ password = polkit_gnome_authentication_dialog_run_until_response_for_prompt (POLKIT_GNOME_AUTHENTICATION_DIALOG (authenticator->dialog), modified_request, echo_on,