cocoa backend postponed
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoIxD 2026-04-26 20:31:09 -07:00
commit 1562c3b89e
3 changed files with 15 additions and 3 deletions

View file

@ -1,7 +1,8 @@
$library_suffix = ".dylib";
set_shared_flag("-dynamiclib");
use_backend("cocoa");
#use_backend("cocoa");
new_object("src/backend/nococoa.m");
add_cflags("-DSTBI_NO_THREAD_LOCALS");
add_ldflags("-framework Cocoa -lobjc");

8
src/backend/nococoa.m Normal file
View file

@ -0,0 +1,8 @@
#include <Mw/Milsko.h>
void MwLLNoCocoaErrorMessage() {
NSAlert* alert = [[NSAlert alloc] init];
[alert setMessageText:@"Milsko applications currently requires XQuartz or cocoa-way. PRs are welcome for anyone who wants to finish the Cocoa backend (prefarably in Objective-C)"];
[alert addButtonWithTitle:@"Ok"];
[alert runModal];
}

View file

@ -967,7 +967,6 @@ int MwLibraryInit(void) {
#ifdef USE_WAYLAND
MwLLWaylandCallInit,
#endif
/* x11 has higher priority then cocoa until it works */
#ifdef USE_X11
MwLLX11CallInit,
#endif
@ -989,6 +988,10 @@ int MwLibraryInit(void) {
if(calls[i]() == 0) return 0;
}
#ifdef __APPLE__
void MwNoCocoaErrorMessage();
MwNoCocoaErrorMessage();
#else
printf("[WARNING] No suitable GUI backend found! Enabled:"
#ifdef USE_COCOA
" Cocoa"
@ -1006,7 +1009,7 @@ int MwLibraryInit(void) {
" ClassicMacOS"
#endif
"\n");
#endif
return 1;
}