diff --git a/xwin.c b/xwin.c index f4715fc..750a168 100644 --- a/xwin.c +++ b/xwin.c @@ -2158,6 +2158,7 @@ ui_destroy_window(void) XDestroyIC(g_IC); XDestroyWindow(g_display, g_wnd); + g_wnd = NULL; } void @@ -2294,6 +2295,10 @@ xwin_process_events(void) { XNextEvent(g_display, &xevent); + if (g_wnd == NULL) + /* Ignore events between ui_destroy_window and ui_create_window */ + continue; + if ((g_IC != NULL) && (XFilterEvent(&xevent, None) == True)) { DEBUG_KBD(("Filtering event\n"));