From 21179c2e30aa80cdf093aa441a69ca6d79ef5e16 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 27 Jun 2016 10:35:17 +0000 Subject: [PATCH] GTK: make Space Navigator actually work. Before this commit, no events would actually be received. --- CHANGELOG.md | 1 + src/platform/gtkmain.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5180231b..414d966a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Bug fixes: * Do not crash when changing autosave interval. * Three.js: correctly respond to controls when browser zoom is used. * OS X: do not completely hide main window when defocused. + * GTK: unbreak 3Dconnexion support. 2.1 --- diff --git a/src/platform/gtkmain.cpp b/src/platform/gtkmain.cpp index 6937193b..5b331809 100644 --- a/src/platform/gtkmain.cpp +++ b/src/platform/gtkmain.cpp @@ -1618,6 +1618,17 @@ int main(int argc, char** argv) { TW->show_all(); GW->show_all(); +#ifdef HAVE_SPACEWARE +#ifdef HAVE_GTK3 + // 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())); +#else + spnav_x11_open(gdk_x11_get_default_xdisplay(), + GDK_WINDOW_XWINDOW(GW->get_window()->gobj())); +#endif +#endif + SS.Init(); if(argc >= 2) {