From 9491825ddff7a294d1f49061bae7044e426aeb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 6 Nov 2015 05:38:49 +0100 Subject: Imported Upstream version 1.8.3 --- numlib/ui.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) mode change 100644 => 100755 numlib/ui.c (limited to 'numlib/ui.c') diff --git a/numlib/ui.c b/numlib/ui.c old mode 100644 new mode 100755 index 31fd3b6..a3cdbe8 --- a/numlib/ui.c +++ b/numlib/ui.c @@ -12,7 +12,8 @@ * see the License.txt file for licencing details. * * Typically we need to set things up and then call the - * "normal" main, called "uimain" in ArgyllCMS utils. + * "normal" main, called "uimain" in ArgyllCMS utils, + * created by ui.h #defining main to uimain. */ #ifdef UNIX @@ -48,6 +49,14 @@ # include # include +/* (Duplicate declaration from numsup.h) */ + +/* Tell App Nap that this is user initiated */ +void osx_userinitiated_start(); + +/* Done with user initiated */ +void osx_userinitiated_end(); + /* This is a mechanism to force libui to link */ int ui_initialized = 0; @@ -57,6 +66,9 @@ static char **g_argv; pthread_t ui_thid = 0; /* Thread ID of main thread running io run loop */ pthread_t ui_main_thid = 0; /* Thread ID of thread running application main() */ +extern int uimain(int argc, char *argv[]); + +/* Thread that calls the real application main() */ static void *callMain(void *p) { int rv; @@ -64,8 +76,13 @@ static void *callMain(void *p) { NSAutoreleasePool *tpool = [NSAutoreleasePool new]; + /* Turn App Nap off */ + osx_userinitiated_start(); + rv = uimain(g_argc, g_argv); + osx_userinitiated_end(); + [tpool release]; exit(rv); @@ -204,6 +221,8 @@ int ui_initialized = 0; //# pragma comment( linker, "/subsystem:windows /ENTRY:mainCRTStartup" ) //# pragma comment( linker, "/subsystem:windows /ENTRY:WinMainCRTStartup" ) +extern int uimain(int argc, char *argv[]); + APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, -- cgit v1.2.3