From 5e4f12a12b8c54a160d1439bf004a22103826740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Calixte?= Date: Thu, 10 May 2018 18:36:54 +0200 Subject: [PATCH] wayland: fix fullscreen mode --- gtk/src/gtk_s9xwindow.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/gtk/src/gtk_s9xwindow.cpp b/gtk/src/gtk_s9xwindow.cpp index 01f1efce..7e16e4d1 100644 --- a/gtk/src/gtk_s9xwindow.cpp +++ b/gtk/src/gtk_s9xwindow.cpp @@ -1739,11 +1739,14 @@ Snes9xWindow::enter_fullscreen_mode (void) gdk_display_sync (gdk_display_get_default ()); gtk_window_present (GTK_WINDOW (window)); - - set_bypass_compositor (gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (window))), - GDK_COMPAT_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), - 1); - +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_WINDOW (gtk_widget_get_window (GTK_WIDGET (window)))) + { + set_bypass_compositor (gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (window))), + GDK_COMPAT_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), + 1); + } +#endif config->fullscreen = 1; config->rom_loaded = rom_loaded; @@ -1795,9 +1798,14 @@ Snes9xWindow::leave_fullscreen_mode (void) gtk_window_unfullscreen (GTK_WINDOW (window)); - set_bypass_compositor (gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (window))), - GDK_COMPAT_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), - 0); +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_WINDOW (gtk_widget_get_window (GTK_WIDGET (window)))) + { + set_bypass_compositor (gdk_x11_display_get_xdisplay (gtk_widget_get_display (GTK_WIDGET (window))), + GDK_COMPAT_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))), + 0); + } +#endif resize (nfs_width, nfs_height); gtk_window_move (GTK_WINDOW (window), nfs_x, nfs_y);