From f45fa747d1cdf9e19a25fdaa7b7fedcf23348ef8 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 17 Jul 2018 23:01:44 +0200 Subject: [PATCH] x11display: fix BadWindow if get_pointer called after win close --- panda/src/x11display/x11GraphicsWindow.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/x11display/x11GraphicsWindow.cxx b/panda/src/x11display/x11GraphicsWindow.cxx index d1f49eedc3..45c04909a2 100644 --- a/panda/src/x11display/x11GraphicsWindow.cxx +++ b/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();