[BCC'd to open a new issue on gnome.gitlab.org. Re."That old GTK bug"] Attached is a reduced test case which was requested in the now closed issue #221 - quickly sloppily hacked up from simple.c from gtk+-demos. gtk_main is replaced by a loop which calls g_main_context_iteration. X errors are handled via XSetIOErrorHandler and XSetErrorHandler to handle a closed display and continue with the next g_main_context_iteration. To Run the test case: gcc simple.c -Wno-deprecated -Wno-deprecated-declarations -g3 $(pkg-config gtk+-3.0 --cflags --libs ) -lX11 $ DISPLAY=:0 Xephyr :1 $ DISPLAY=:1 G_DEBUG=fatal-warnings ./a.out kill Xephyr The stack trace which you get from killing Xephyr is attached. [Also featured in the code but not relevant to this bug report is the "closed" signal which is expected from when GdkDisplay connection is lost. This signal does not seem to fire]