diff --git a/common/init.c b/common/main.c similarity index 98% rename from common/init.c rename to common/main.c index b0e593d8..f4b9c3a2 100644 --- a/common/init.c +++ b/common/main.c @@ -1,8 +1,6 @@ // 19 april 2019 #include "uipriv.h" -// TODO rename this file to main.c - static bool initialized = false; bool uiInit(void *options, uiInitError *err) diff --git a/common/meson.build b/common/meson.build index cdc77527..61537c17 100644 --- a/common/meson.build +++ b/common/meson.build @@ -4,5 +4,5 @@ libui_sources += [ 'common/alloc.c', 'common/errors.c', 'common/events.c', - 'common/init.c', + 'common/main.c', ] diff --git a/common/uipriv.h b/common/uipriv.h index 72293660..3924ce6e 100644 --- a/common/uipriv.h +++ b/common/uipriv.h @@ -28,7 +28,7 @@ extern "C" { #define uiprivSizetPrintf "zu" #endif -// init.c +// main.c extern bool uiprivSysInit(void *options, uiInitError *err); extern bool uiprivInitReturnErrorf(uiInitError *err, const char *msg, ...); extern void uiprivSysQueueMain(void (*f)(void *data), void *data); diff --git a/darwin/main.m b/darwin/main.m index c1d9b6cb..8bc8a8bd 100644 --- a/darwin/main.m +++ b/darwin/main.m @@ -42,7 +42,7 @@ bool uiprivSysInit(void *options, uiInitError *err) { uiprivApp = [uiprivApplication sharedApplication]; if (![NSApp isKindOfClass:[uiprivApplication class]]) - // TODO verify if Info.plist (both in a proper .app bundle and embedded into a standalone binary) can override this and, if so, add that tidbit to this message + // TODO verify if Info.plist (both in a proper .app bundle and embedded into a standalone binary) can override this (or if that only happens if you use NSApplicationMain() instead), and, if so, add that tidbit to this message return uiprivInitReturnErrorf(err, "NSApp is not of type uiprivApplication; was likely already initialized beforehand"); // don't check for a NO return; something (launch services?) causes running from application bundles to always return NO when asking to change activation policy, even if the change is to the same activation policy! @@ -72,7 +72,7 @@ void uiQuit(void) [uiprivApp stop:uiprivApp]; // stop: won't register until another event has passed; let's synthesize one - // TODO instead of using NSApplicationDefined, create a private event type for libui internal use only + // TODO instead of using NSApplicationDefined, create a private event type for libui internal use only; if we can't, set up data1 and data2 so that we can intercept and discard this event if it was accidentally triggered e = [NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint modifierFlags:0