[gnome-themes-standard] Add runtime checks for X11 specific code
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-themes-standard] Add runtime checks for X11 specific code
- Date: Wed, 19 Dec 2012 21:08:53 +0000 (UTC)
commit 9d37a303658a1c2afab42da17c10316bfbba6cc6
Author: Alexander Larsson <alexl redhat com>
Date: Wed Dec 19 22:08:09 2012 +0100
Add runtime checks for X11 specific code
This way it works if Gtk+ is built with X11 support, but the active
backend is something else.
themes/Adwaita/gtk-3.0/adwaita_engine.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/themes/Adwaita/gtk-3.0/adwaita_engine.c b/themes/Adwaita/gtk-3.0/adwaita_engine.c
index f0f48ac..7d9e23d 100644
--- a/themes/Adwaita/gtk-3.0/adwaita_engine.c
+++ b/themes/Adwaita/gtk-3.0/adwaita_engine.c
@@ -121,8 +121,12 @@ adwaita_engine_wm_changed (AdwaitaEngine *self)
#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);
+ GdkScreen *screen = gdk_screen_get_default ();
+ if (GDK_IS_X11_SCREEN (screen))
+ {
+ name = gdk_x11_screen_get_window_manager_name (screen);
+ is_fallback = (g_strcmp0 (name, "GNOME Shell") != 0);
+ }
#endif
if (is_fallback)
@@ -153,9 +157,12 @@ adwaita_engine_init (AdwaitaEngine *self)
#ifdef GDK_WINDOWING_X11
GdkScreen *screen = gdk_screen_get_default ();
- self->wm_watch_id =
- g_signal_connect_swapped (screen, "window-manager-changed",
- G_CALLBACK (adwaita_engine_wm_changed), self);
+ if (GDK_IS_X11_SCREEN (screen))
+ {
+ 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]