From 87ed4485fe05a2738d30d4de5bf3f7da8746330a Mon Sep 17 00:00:00 2001 From: Dmitry Karasik Date: Sat, 21 Sep 2024 18:47:10 +0200 Subject: [PATCH] don't cause X errors by operating on a dead window --- unix/window.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unix/window.c b/unix/window.c index 25c2e9fe2..968e487ef 100644 --- a/unix/window.c +++ b/unix/window.c @@ -1609,8 +1609,11 @@ apc_window_execute( Handle self, Handle insert_before) while ( prima_one_loop_round( WAIT_IF_NONE, true) && XX-> flags.modal) ; - if ( toplevel) XSetTransientForHint( DISP, X_WINDOW, None); - if ( X_WINDOW) NETWM_SET_MODAL( X_WINDOW, XX-> flags.modal); + if ( PObject(self)->stage == csNormal ) { + if ( toplevel) XSetTransientForHint( DISP, X_WINDOW, None); + if ( X_WINDOW) NETWM_SET_MODAL( X_WINDOW, XX-> flags.modal); + } + unprotect_object( self); return true; }