More TODO resolution and cross-OS behavioral parity fixes.

This commit is contained in:
Pietro Gagliardi 2015-04-10 14:24:23 -04:00
parent a272619581
commit 47fb015afb
2 changed files with 11 additions and 3 deletions

View File

@ -21,6 +21,5 @@ void uiQuit(void)
subtype:0
data1:0
data2:0];
[NSApp postEvent:e atStart:NO]; // let pending events take priority
// TODO really wait?
[NSApp postEvent:e atStart:NO]; // let pending events take priority (this is what PostQuitMessage() on Windows does so we have to do it here too for parity; thanks to mikeash in irc.freenode.net/#macdev for confirming that this parameter should indeed be NO)
}

View File

@ -8,7 +8,16 @@ void uiMain(void)
gtk_main();
}
void uiQuit(void)
// gtk_main_quit() may run immediately, or it may wait for other pending events; "it depends" (thanks mclasen in irc.gimp.net/#gtk+)
// PostQuitMessage() on Windows always waits, so we must do so too
// we'll do it by using an idle callback
static gboolean quit(gpointer data)
{
gtk_main_quit();
return FALSE;
}
void uiQuit(void)
{
gdk_threads_add_idle(quit, NULL);
}