Browse Source

x11display: fix BadWindow if get_pointer called after win close

rdb 7 years ago
parent
commit
f45fa747d1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      panda/src/x11display/x11GraphicsWindow.cxx

+ 2 - 2
panda/src/x11display/x11GraphicsWindow.cxx

@@ -163,8 +163,8 @@ get_pointer(int device) const {
     if (device == 0 && !_dga_mouse_enabled && result._in_window &&
         x11GraphicsPipe::_x_mutex.try_lock()) {
       XEvent event;
-      LightReMutexHolder holder(x11GraphicsPipe::_x_mutex);
-      if (XQueryPointer(_display, _xwindow, &event.xbutton.root,
+      if (_xwindow != None &&
+          XQueryPointer(_display, _xwindow, &event.xbutton.root,
           &event.xbutton.window, &event.xbutton.x_root, &event.xbutton.y_root,
           &event.xbutton.x, &event.xbutton.y, &event.xbutton.state)) {
         double time = ClockObject::get_global_clock()->get_real_time();