Request and process WM_DELETE_WINDOW events, so that clicking on the "close" button is equivalent to calling Graphics.close_graph. Subsequent graphical operations will raise the Graphic_failure exception instead of killing the program on an I/O error. (This is more or less the current behavior of the Win32 implementation of Graphics, if I'm not mistaken.)
In passing, use XPending + XNextEvent instead of XCheckMaskEvent(-1), as the latter ignores client events such as WM_DELETE_WINDOW.
Request and process WM_DELETE_WINDOW events, so that clicking on the "close" button is equivalent to calling
Graphics.close_graph
. Subsequent graphical operations will raise theGraphic_failure
exception instead of killing the program on an I/O error. (This is more or less the current behavior of the Win32 implementation of Graphics, if I'm not mistaken.)In passing, use
XPending
+XNextEvent
instead ofXCheckMaskEvent(-1)
, as the latter ignores client events such as WM_DELETE_WINDOW.Fixes: #41