Skip to content

Commit 6e3db41

Browse files
capt-marblescsete
authored andcommitted
Update main.c
Adding an extra check to ensure MacOS compatibility
1 parent c616268 commit 6e3db41

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ int main(int argc, char *argv[])
105105
bind_textdomain_codeset(PACKAGE, "UTF-8");
106106
textdomain(PACKAGE);
107107
#endif
108+
109+
/* Auto-detect macOS and set GDK backend to Quartz for native rendering */
110+
#ifdef __APPLE__
111+
/* Only set if not already defined by user */
112+
if (g_getenv("GDK_BACKEND") == NULL) {
113+
g_setenv("GDK_BACKEND", "quartz", 0);
114+
}
115+
#endif
116+
108117
gtk_init(&argc, &argv);
109118

110119
context = g_option_context_new("");

0 commit comments

Comments
 (0)