diff -r 36f1581b43e2 -r 40dbf1a7526a ui/motif/window.c --- a/ui/motif/window.c Sun Jan 24 12:39:05 2016 +0100 +++ b/ui/motif/window.c Sun Jan 24 18:47:39 2016 +0100 @@ -42,6 +42,19 @@ static int window_default_height = 500; static void window_close_handler(Widget window, void *udata, void *cdata) { + UiObject *obj = udata; + UiEvent ev; + ev.window = obj->window; + ev.document = obj->ctx->document; + ev.obj = obj; + ev.eventdata = NULL; + ev.intval = 0; + + if(obj->ctx->close_callback) { + obj->ctx->close_callback(&ev, obj->ctx->close_data); + } + // TODO: free UiObject + nwindows--; if(nwindows == 0) { ui_exit_mainloop();