[gnome-themes-standard] build: fix the build for non-X11 environments
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-themes-standard] build: fix the build for non-X11 environments
- Date: Wed, 17 Oct 2012 20:58:37 +0000 (UTC)
commit b1a067033ae7f14832c3346f261a09edcd637cfb
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Oct 17 14:02:52 2012 -0400
build: fix the build for non-X11 environments
https://bugzilla.gnome.org/show_bug.cgi?id=686305
configure.ac | 2 +-
themes/Adwaita/gtk-2.0/adwaita_engine.c | 7 +++++++
themes/Adwaita/gtk-3.0/adwaita_engine.c | 16 ++++++++++++----
3 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6784db6..ebbcffc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,7 @@ AM_CONDITIONAL(GTK2_ENGINE, test "x$enable_gtk2_engine" = "xyes")
AC_MSG_RESULT([$enable_gtk2_engine])
if test "x$enable_gtk2_engine" = "xyes"; then
- PKG_CHECK_MODULES([GTK2_ENGINE], [gtk+-2.0 gdk-x11-2.0])
+ PKG_CHECK_MODULES([GTK2_ENGINE], [gtk+-2.0 gdk-2.0])
fi
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
diff --git a/themes/Adwaita/gtk-2.0/adwaita_engine.c b/themes/Adwaita/gtk-2.0/adwaita_engine.c
index ab13712..6b102c1 100644
--- a/themes/Adwaita/gtk-2.0/adwaita_engine.c
+++ b/themes/Adwaita/gtk-2.0/adwaita_engine.c
@@ -22,7 +22,10 @@
#include <gmodule.h>
#include <glib.h>
#include <gtk/gtk.h>
+
+#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
+#endif
/***************************************/
/* Register & Initialize Drawing Style */
@@ -49,9 +52,13 @@ G_DEFINE_DYNAMIC_TYPE (AdwaitaStyle, adwaita_style, GTK_TYPE_STYLE)
static gboolean
wm_is_fallback (void)
{
+#ifdef GDK_WINDOWING_X11
const gchar *name;
name = gdk_x11_screen_get_window_manager_name (gdk_screen_get_default ());
return g_strcmp0 (name, "GNOME Shell") != 0;
+#else
+ return TRUE;
+#endif
}
static cairo_t *
diff --git a/themes/Adwaita/gtk-3.0/adwaita_engine.c b/themes/Adwaita/gtk-3.0/adwaita_engine.c
index df44ec8..f0f48ac 100644
--- a/themes/Adwaita/gtk-3.0/adwaita_engine.c
+++ b/themes/Adwaita/gtk-3.0/adwaita_engine.c
@@ -27,7 +27,10 @@
#include <gmodule.h>
#include <math.h>
#include <cairo-gobject.h>
+
+#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
+#endif
#include "adwaita_utils.h"
@@ -114,10 +117,15 @@ fallback_provider_add (AdwaitaEngine *self)
static void
adwaita_engine_wm_changed (AdwaitaEngine *self)
{
+ gboolean is_fallback = TRUE;
+
+#ifdef GDK_WINDOWING_X11
const gchar *name;
name = gdk_x11_screen_get_window_manager_name (gdk_screen_get_default ());
+ is_fallback = (g_strcmp0 (name, "GNOME Shell") != 0);
+#endif
- if (g_strcmp0 (name, "GNOME Shell") != 0)
+ if (is_fallback)
fallback_provider_add (self);
else
fallback_provider_remove (self);
@@ -142,14 +150,14 @@ adwaita_engine_finalize (GObject *obj)
static void
adwaita_engine_init (AdwaitaEngine *self)
{
+#ifdef GDK_WINDOWING_X11
GdkScreen *screen = gdk_screen_get_default ();
- if (!GDK_IS_X11_SCREEN (screen))
- return;
-
self->wm_watch_id =
g_signal_connect_swapped (screen, "window-manager-changed",
G_CALLBACK (adwaita_engine_wm_changed), self);
+#endif
+
adwaita_engine_wm_changed (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]