Commit 020ed854 authored by Matthias Clasen's avatar Matthias Clasen Committed by Cosimo Cecchi
Browse files

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
parent 1805ca70
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment