diff -r a24465cc7262 -r 6dd780cbc8c6 ui/gtk/window.c --- a/ui/gtk/window.c Sun Jan 15 15:08:07 2017 +0100 +++ b/ui/gtk/window.c Sun Jan 22 11:16:21 2017 +0100 @@ -58,15 +58,24 @@ // TODO: free UiObject nwindows--; +#ifdef GTK2_LEGACY if(nwindows == 0) { gtk_main_quit(); } +#endif } static UiObject* create_window(char *title, void *window_data, UiBool simple) { UcxMempool *mp = ucx_mempool_new(256); - UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject)); + UiObject *obj = ucx_mempool_calloc(mp, 1, sizeof(UiObject)); + +#ifndef GTK2_LEGACY + obj->widget = gtk_application_window_new(ui_get_application()); +#else obj->widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); +#endif + + obj->ctx = uic_context(obj, mp); obj->window = window_data;