[Xcb] Responding to _NET_WM_PING

Nicholas Allen nick.allen at onlinehome.de
Mon Mar 22 09:41:50 PDT 2010

If I make a copy of the event and then respond it seems to work:

xcb_client_message_event_t pingResponse;

               pingResponse.response_type = XCB_CLIENT_MESSAGE;
               pingResponse.format = 32;
               pingResponse.sequence = clientEvent->sequence;
               pingResponse.window = screen->root;
               pingResponse.type = displayData->WM_PROTOCOLS_ATOM;
               for (int i = 0; i < 5; i++)
                  pingResponse.data.data32[i] = clientEvent->data.data32[i];
               xcb_send_event(connection, false, screen->root,
(const char*)&pingResponse);

Why is it necessary to make a copy of the event? It's a bit misleading
that the standard says to just set the window field and send it back but
this does not work with XCB.

But main thing is problem is solved ;-)


More information about the Xcb mailing list