x11: Fix occasional crash on shutdown

This commit is contained in:
rdb 2022-12-26 19:18:25 +01:00
parent 0747f46055
commit d5fed54a0c
2 changed files with 4 additions and 3 deletions

View File

@ -121,6 +121,7 @@ x11GraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
_override_redirect = False;
_wm_delete_window = x11_pipe->_wm_delete_window;
_net_wm_ping = x11_pipe->_net_wm_ping;
_net_wm_state = x11_pipe->_net_wm_state;
PT(GraphicsWindowInputDevice) device = GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard_mouse");
add_input_device(device);
@ -368,9 +369,7 @@ process_events() {
case PropertyNotify:
//std::cout << "PropertyNotify event: atom = " << event.xproperty.atom << std::endl;
x11GraphicsPipe *x11_pipe;
DCAST_INTO_V(x11_pipe, _pipe);
if (event.xproperty.atom == x11_pipe->_net_wm_state) {
if (event.xproperty.atom == _net_wm_state) {
// currently we're only interested in the net_wm_state type of
// changes and only need to gather property informations once at
// the end after the while loop
@ -516,6 +515,7 @@ process_events() {
}
else if ((Atom)(event.xclient.data.l[0]) == _net_wm_ping &&
event.xclient.window == _xwindow) {
x11GraphicsPipe *x11_pipe;
DCAST_INTO_V(x11_pipe, _pipe);
event.xclient.window = x11_pipe->get_root();
XSendEvent(_display, x11_pipe->get_root(), False, SubstructureRedirectMask | SubstructureNotifyMask, &event);

View File

@ -109,6 +109,7 @@ protected:
Bool _override_redirect;
Atom _wm_delete_window;
Atom _net_wm_ping;
Atom _net_wm_state;
x11GraphicsPipe::pfn_XRRGetScreenInfo _XRRGetScreenInfo;
x11GraphicsPipe::pfn_XRRSetScreenConfig _XRRSetScreenConfig;