[rygel] examples: Fix build when wayland backend is disabled in GTK+
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] examples: Fix build when wayland backend is disabled in GTK+
- Date: Sun, 24 Dec 2017 14:21:53 +0000 (UTC)
commit 0ead1ebb099af794bf9619d2849d1daceb1bf9c6
Author: Ting-Wei Lan <lantw src gnome org>
Date: Sun Dec 24 22:00:40 2017 +0800
examples: Fix build when wayland backend is disabled in GTK+
https://bugzilla.gnome.org/show_bug.cgi?id=791921
examples/fullscreen-renderer.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/examples/fullscreen-renderer.c b/examples/fullscreen-renderer.c
index e27e35a..c49bf09 100644
--- a/examples/fullscreen-renderer.c
+++ b/examples/fullscreen-renderer.c
@@ -37,11 +37,16 @@
*/
#include <gst/video/videooverlay.h>
-#include <gdk/gdkx.h>
-#include <gdk/gdkwayland.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#ifdef GDK_WINDOWING_X11
+#include <gdk/gdkx.h>
+#endif
+#ifdef GDK_WINDOWING_WAYLAND
+#include <gdk/gdkwayland.h>
+#endif
+
#include "rygel-renderer-gst.h"
#include "rygel-core.h"
@@ -67,11 +72,17 @@ static void on_realize (GtkWidget *widget, gpointer user_data)
if (!gdk_window_ensure_native (window))
g_error ("Could not create native window for overlay");
+#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_WINDOW (window)) {
window_handle = gdk_wayland_window_get_wl_surface (window);
- } else if (GDK_IS_X11_WINDOW (window)) {
+ } else
+#endif
+#ifdef GDK_WINDOWING_X11
+ if (GDK_IS_X11_WINDOW (window)) {
window_handle = GDK_WINDOW_XID (window);
- } else {
+ } else
+#endif
+ {
g_error ("Unsupported windowing system");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]