diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_WindowX11.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowX11.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index 60e12ff78df..5ce5a66bfba 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -35,6 +35,10 @@ #include <X11/cursorfont.h> #include <X11/Xatom.h> +// libspnav +#include <spnav.h> +#include "GHOST_NDOFManagerX11.h" + #if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) || defined (_AIX) #include <strings.h> #endif @@ -269,6 +273,11 @@ GHOST_WindowX11( CWBorderPixel|CWColormap|CWEventMask, &xattributes ); + if (spnav_x11_open(m_display, m_window) == -1) { + fprintf(stderr, "failed to connect to the space navigator daemon\n"); + } else { + m_system->createNDOFAtoms(m_display); + } } else { Window root_return; @@ -297,12 +306,12 @@ GHOST_WindowX11( m_visual->visual, CWBorderPixel|CWColormap|CWEventMask, &xattributes - ); + + ); XSelectInput(m_display , parentWindow, SubstructureNotifyMask); - } - + /* * One of the problem with WM-spec is that can't set a property * to a window that isn't mapped. That is why we can't "just @@ -428,6 +437,8 @@ GHOST_WindowX11( XMapWindow(m_display, m_window); GHOST_PRINT("Mapped window\n"); + + ((GHOST_NDOFManagerX11 *)m_system->getNDOFManager())->setGHOSTWindowX11(this);; XFlush(m_display); } @@ -1258,6 +1269,9 @@ GHOST_WindowX11:: if(m_xtablet.StylusDevice) XCloseDevice(m_display, m_xtablet.StylusDevice); + /*close ndof */ + spnav_close(); + if(m_xtablet.EraserDevice) XCloseDevice(m_display, m_xtablet.EraserDevice); |