[sushi] Don't assume X
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi] Don't assume X
- Date: Sat, 14 Nov 2015 19:04:51 +0000 (UTC)
commit 020ed8545003b44d1bfae542b3965ddad473106a
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Nov 12 15:01:58 2015 -0500
Don't assume X
We must do a runtime check for X11, before calling gdk_x11 api.
This does not fix sushi under Wayland, but it gets it far enough
to show a window.
https://bugzilla.gnome.org/show_bug.cgi?id=758030
src/libsushi/sushi-utils.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/libsushi/sushi-utils.c b/src/libsushi/sushi-utils.c
index e3e054d..ede75e8 100644
--- a/src/libsushi/sushi-utils.c
+++ b/src/libsushi/sushi-utils.c
@@ -25,7 +25,11 @@
#include "sushi-utils.h"
+#include <gtk/gtk.h>
+
+#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
+#endif
/**
* sushi_create_foreign_window:
@@ -36,10 +40,12 @@
GdkWindow *
sushi_create_foreign_window (guint xid)
{
- GdkWindow *retval;
+ GdkWindow *retval = NULL;
- retval = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (),
- xid);
+#ifdef GDK_WINDOWING_X11
+ if (GDK_IS_X11_DISPLAY (gdk_display_get_default ()))
+ retval = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (), xid);
+#endif
return retval;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]