From 668c391a8a81b38b18f89fee69b1dae067f98068 Mon Sep 17 00:00:00 2001 From: deepend Date: Wed, 18 Feb 2026 10:46:04 -0700 Subject: [PATCH] Added a dedicated darwin branch in src/fe-gtk/meson.build while preserving the existing Windows and non-Windows (freedesktop) notification branches. In this macOS branch, notifications/notification-osx.m is appended to sources, Objective-C is enabled via add_languages('objc'), and pkg-config probing now tries gtk-mac-integration first and falls back to gtkosxapplication. When either mac integration dependency is found on darwin, Meson now adds that dependency and defines -DHAVE_GTK_MAC in zoitechat_gtk_cflags, which activates the existing #ifdef HAVE_GTK_MAC blocks in the GTK frontend code. Verified the existing source guards that become active with HAVE_GTK_MAC are already present in the requested files: fe-gtk.h (mac header include + extern). fe-gtk.c (global mac app object and mac-specific paths). menu.c (mac menubar/app-menu integration). maingui.c (mac dock attention request). --- src/fe-gtk/meson.build | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/fe-gtk/meson.build b/src/fe-gtk/meson.build index b66dfd73..0096c484 100644 --- a/src/fe-gtk/meson.build +++ b/src/fe-gtk/meson.build @@ -85,6 +85,20 @@ if host_machine.system() == 'windows' # sources: 'notifications/notification-winrt.cpp' #) +elif host_machine.system() == 'darwin' + zoitechat_gtk_sources += 'notifications/notification-osx.m' + add_languages('objc') + + gtk_mac_dep = dependency('gtk-mac-integration', required: false) + if not gtk_mac_dep.found() + gtk_mac_dep = dependency('gtkosxapplication', required: false) + endif + + if gtk_mac_dep.found() + zoitechat_gtk_deps += gtk_mac_dep + zoitechat_gtk_cflags += '-DHAVE_GTK_MAC' + endif + else zoitechat_gtk_sources += 'notifications/notification-freedesktop.c' endif