diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-17 06:06:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-17 06:06:54 +0400 |
commit | 60e558393321edf4c8a41376c600981ae8636d24 (patch) | |
tree | 9e6735c24248561f9b29c27f9a6bb223ad451899 /intern | |
parent | 86d4786305613a2639db135e56f800653eefe288 (diff) |
add NULL check for XInput device, since its possible only one is valid.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index de6a1142492..946f45af76f 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -521,9 +521,15 @@ static void setTabletMode(GHOST_SystemX11 *system, GHOST_WindowX11 *window, XID #ifdef WITH_X11_XINPUT static bool checkTabletProximity(Display *display, XDevice *device) { + /* we could have true/false/not-found return value, but for now false is OK */ + /* see: state.c from xinput, to get more data out of the device */ XDeviceState *state; + if (device == NULL) { + return false; + } + state = XQueryDeviceState(display, device); if (state) { |