summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorblank X <[email protected]>2021-08-31 11:50:11 +0700
committerraveit65 <[email protected]>2021-09-17 17:40:51 +0200
commit9461e9bcd8f78f0e97475bc628b0b30ad4fd1354 (patch)
treefd6367c493b7749a823245d65b8077c3853842cf /src
parent110ab5c5f7da852f0d254ba1eb14596103cfd990 (diff)
downloadmate-polkit-9461e9bcd8f78f0e97475bc628b0b30ad4fd1354.tar.bz2
mate-polkit-9461e9bcd8f78f0e97475bc628b0b30ad4fd1354.tar.xz
Fix segfault from gdk_x11_get_server_time if not on X11
This commit will call gtk_window_present_with_time (along with gdk_x11_get_server_time) if on X11, or just gtk_window_present if not to prevent a segmentation fault from occuring
Diffstat (limited to 'src')
-rw-r--r--src/polkitmateauthenticator.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/polkitmateauthenticator.c b/src/polkitmateauthenticator.c
index 3ba3b98..5e54c13 100644
--- a/src/polkitmateauthenticator.c
+++ b/src/polkitmateauthenticator.c
@@ -308,8 +308,12 @@ session_request (PolkitAgentSession *session,
}
gtk_widget_show_all (GTK_WIDGET (authenticator->dialog));
- gtk_window_present_with_time (GTK_WINDOW (authenticator->dialog),
- gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (authenticator->dialog))));
+ if (GDK_IS_X11_WINDOW (gtk_widget_get_window (GTK_WIDGET (authenticator->dialog))))
+ gtk_window_present_with_time (GTK_WINDOW (authenticator->dialog),
+ gdk_x11_get_server_time (gtk_widget_get_window (GTK_WIDGET (authenticator->dialog))));
+ else
+ gtk_window_present (GTK_WINDOW (authenticator->dialog));
+
password = polkit_mate_authentication_dialog_run_until_response_for_prompt (POLKIT_MATE_AUTHENTICATION_DIALOG (authenticator->dialog),
modified_request,
echo_on,