diff --git a/meson.build b/meson.build index 8ff7c03..c7d060a 100644 --- a/meson.build +++ b/meson.build @@ -47,6 +47,13 @@ cairo = dependency('cairo') build_dependencies = [libm, girara, glib, gio, gthread, gmodule, gtk3, cairo] +if host_machine.system() == 'darwin' + gtk_mac_integration = dependency('gtk-mac-integration-gtk3') + build_dependencies += gtk_mac_integration + conf_data.set('GTKOSXAPPLICATION', true) +endif + + # defines defines = [ '-DGETTEXT_PACKAGE="zathura"', @@ -101,6 +108,13 @@ version_header = configure_file( output: 'zathura-version.h', configuration: conf_data ) + +os_dependency_header = configure_file( + input: 'zathura/os-dependency.h.in', + output: 'zathura-os-dependency.h', + configuration: conf_data +) + include_directories = [ include_directories('.') ] @@ -153,6 +167,7 @@ headers = files( 'zathura/types.h', ) headers += version_header +headers += os_dependency_header # zathura helper library libzathura = static_library('zathura', diff --git a/zathura/main.c b/zathura/main.c index 690d88e..1cfd6cb 100644 --- a/zathura/main.c +++ b/zathura/main.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: Zlib */ +#include "zathura-os-dependency.h" #include #include @@ -307,6 +308,19 @@ main(int argc, char* argv[]) goto free_and_ret; } +#ifdef GTKOSXAPPLICATION + GtkosxApplication *zathuraApp; + zathuraApp = g_object_new (GTKOSX_TYPE_APPLICATION, NULL); + gtkosx_application_set_use_quartz_accelerators (zathuraApp, FALSE); + gtkosx_application_ready (zathuraApp); + { + const gchar *id = gtkosx_application_get_bundle_id (); + if (id != NULL) + { + g_print ("TestIntegration Error! Bundle Has ID %s\n", id); + } + } +#endif //GTKOSXAPPLICATION /* run zathura */ gtk_main(); diff --git a/zathura/os-dependency.h.in b/zathura/os-dependency.h.in new file mode 100644 index 0000000..2a71da4 --- /dev/null +++ b/zathura/os-dependency.h.in @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: Zlib */ + +#mesondefine GTKOSXAPPLICATION + +#ifdef GTKOSXAPPLICATION +#include +#endif +