From 94dd1d73facc803461b12735a0e095608a59ffa7 Mon Sep 17 00:00:00 2001 From: binary1248 Date: Fri, 14 Aug 2015 23:21:55 +0200 Subject: [PATCH] Fix _NET_WM_PING messages not being replied to properly. --- src/SFML/Window/Unix/WindowImplX11.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp index 40768136..7aaf4e46 100644 --- a/src/SFML/Window/Unix/WindowImplX11.cpp +++ b/src/SFML/Window/Unix/WindowImplX11.cpp @@ -1745,28 +1745,10 @@ bool WindowImplX11::processEvent(XEvent windowEvent) } else if (netWmPing && (windowEvent.xclient.format == 32) && (windowEvent.xclient.data.l[0]) == static_cast(netWmPing)) { - xcb_client_message_event_t event; - // Handle the _NET_WM_PING message, send pong back to WM to show that we are responsive - event.response_type = XCB_CLIENT_MESSAGE; - event.format = windowEvent.xclient.format; - event.window = XCBDefaultRootWindow(m_connection); - event.type = windowEvent.xclient.message_type; - std::memcpy(event.data.data8, windowEvent.xclient.data.b, 20); + windowEvent.xclient.window = XCBDefaultRootWindow(m_connection); - ScopedXcbPtr pongError(xcb_request_check( - m_connection, - xcb_send_event_checked( - m_connection, - 0, - XCBDefaultRootWindow(m_connection), - XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, - reinterpret_cast(&event) - ) - )); - - if (pongError) - err() << "Could not send pong event back to WM" << std::endl; + XSendEvent(m_display, windowEvent.xclient.window, False, SubstructureNotifyMask | SubstructureRedirectMask, &windowEvent); } } break;