[gtk/wip/jtojnar/gdk-x11-darwin: 1232/1232] osx: Fix building gdk-x11



commit 13827765920b2e02ae023ba305d661af047fbecd
Author: Jan Tojnar <jtojnar gmail com>
Date:   Sat Jan 26 12:44:18 2019 +0100

    osx: Fix building gdk-x11
    
    Glib linked against Apple libraries does not provide <gio/gdesktopappinfo.h>
    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 8051229ba5..b9e23df113 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -27,7 +27,9 @@
 #include "gdkprivate-x11.h"
 
 #include <glib.h>
+#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
 #include <gio/gdesktopappinfo.h>
+#endif
 
 #include <string.h>
 #include <unistd.h>
@@ -352,10 +354,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 (),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]