From feb20b877d82db6ec79e96fd3a3cc81e3c4365fa Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 26 Jan 2019 12:44:18 +0100 Subject: osx: Fix building gdk-x11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Glib linked against Apple libraries does not provide header. When building X11 GTK backend on MacOS against such Glib, it fails because it cannot find the header. X11 backend is still required by programs like vim or Emacs. Let’s use the same trick gtk-launch.c uses to solve this issue. https://github.com/NixOS/nixpkgs/issues/54424 --- gdk/x11/gdkapplaunchcontext-x11.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c index adc11bf4ec..0828aa7438 100644 --- a/gdk/x11/gdkapplaunchcontext-x11.c +++ b/gdk/x11/gdkapplaunchcontext-x11.c @@ -27,7 +27,9 @@ #include "gdkdisplay-x11.h" #include +#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__) #include +#endif #include #include @@ -349,10 +351,16 @@ gdk_x11_app_launch_context_get_startup_notify_id (GAppLaunchContext *context, else workspace_str = NULL; +#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__) if (G_IS_DESKTOP_APP_INFO (info)) application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info)); else application_id = NULL; +#else + /* GDesktopAppInfo files are not available with Cocoa + * and startup-notification-spec only cares about desktop files. */ + application_id = NULL; +#endif startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu", g_get_prgname (), -- cgit v1.2.1