--- gnome-session/main.c.orig	2017-04-12 07:35:48.000000000 -0700
+++ gnome-session/main.c	2017-07-18 12:43:02.000000000 -0700
@@ -187,6 +187,14 @@
         if (g_getenv ("DBUS_SESSION_BUS_ADDRESS"))
                 return TRUE;
 
+#ifdef __APPLE__
+        /* See if we can get the session DBus address */
+	if (!g_dbus_address_get_for_bus_sync (G_BUS_TYPE_SESSION, NULL, error)) {
+		g_critical("gsm error: %s", (*error)->message);
+		exit(1);
+	}
+	return TRUE;
+#else
         /* Just a sanity check to prevent infinite recursion if
          * dbus-launch fails to set DBUS_SESSION_BUS_ADDRESS 
          */
@@ -211,6 +219,7 @@
                              g_strerror (errno));
                 return FALSE;
         }
+#endif
 
         /* Should not be reached */
         return TRUE;
