summaryrefslogtreecommitdiff
path: root/new/main_unix.c
blob: 10af782e6d51f8d1d31914e9e99a1a3aa82d0c26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 6 april 2015
#include "uipriv_unix.h"

// #qo pkg-config: gtk+-3.0

void uiMain(void)
{
	gtk_main();
}

// 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);
}