From da7c74af2e678e471165d9142e8e3537af142e3a Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 6 Jan 2017 22:28:44 +0000 Subject: [PATCH] GTK: only attempt to use libspnav on X11. This makes SolveSpace run on Wayland. --- src/platform/gtkmain.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/platform/gtkmain.cpp b/src/platform/gtkmain.cpp index 9fd51b6d..698a3e75 100644 --- a/src/platform/gtkmain.cpp +++ b/src/platform/gtkmain.cpp @@ -1429,10 +1429,12 @@ int main(int argc, char** argv) { if(SetLocale(*langNames++)) break; } -#ifdef HAVE_SPACEWARE - // We don't care if it can't be opened; just continue without. - spnav_x11_open(gdk_x11_get_default_xdisplay(), - gdk_x11_window_get_xid(GW->get_window()->gobj())); +#if defined(HAVE_SPACEWARE) && defined(GDK_WINDOWING_X11) + if(GDK_IS_X11_DISPLAY(Gdk::Display::get_default()->gobj())) { + // We don't care if it can't be opened; just continue without. + spnav_x11_open(gdk_x11_get_default_xdisplay(), + gdk_x11_window_get_xid(GW->get_window()->gobj())); + } #endif SS.Init();