From 47f0322c75490caac16451873cd29c8ad2f2aa3b Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Tue, 4 Oct 2022 22:33:15 +0800 Subject: [PATCH] gdk_x11_get_server_time crashes when an invalid window is passed --- src/myipc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/myipc.cpp b/src/myipc.cpp index a8a15df..adf84e7 100755 --- a/src/myipc.cpp +++ b/src/myipc.cpp @@ -44,8 +44,10 @@ void MyRaiseWindow ( wxTopLevelWindow *wnd ) // again from the command line, a dialog that prompts the user to save // the file pops up. After the dialog is closed, opening files from the // command line is unable to bring the editor to the front. - gtk_window_present_with_time ( GTK_WINDOW ( widget ), - gdk_x11_get_server_time ( gwnd ) ); + guint32 time = GDK_IS_X11_WINDOW ( gwnd ) // GDK_BACKEND=x11? + ? gdk_x11_get_server_time ( gwnd ) + : GDK_CURRENT_TIME; + gtk_window_present_with_time ( GTK_WINDOW ( widget ), time ); } #else // __WXGTK__