[Xcb] Responding to _NET_WM_PING

Vincent Torri vtorri at univ-evry.fr
Mon Mar 22 11:38:18 PDT 2010



On Mon, 22 Mar 2010, Nicholas Allen wrote:

> Actually it seems it doesn't work even when I remove the '&'. So copying
> the event seems to be necessary...

what I does:

xcb_client_message_event_t ev;

i fill ev. For example:

    ev.response_type = XCB_CLIENT_MESSAGE | 0x80;
    ev.format = 32;
    ev.sequence = 0;
    ev.window = window;
    ev.type = ECORE_X_ATOM_WM_PROTOCOLS;
    ev.data.data32[0] = ECORE_X_ATOM_NET_WM_PING;
    ev.data.data32[1] = _ecore_xcb_event_last_time;
    ev.data.data32[2] = window;
    ev.data.data32[3] = 0;
    ev.data.data32[4] = 0;
    ev.data.data32[5] = 0;

then i send the event:

    xcb_send_event(_ecore_xcb_conn, 0, window, XCB_EVENT_MASK_NO_EVENT, 
(const char *)&ev);

It works quite well. Adapt this code to what you want.

Vincent Torri

>
> Nick
>
> Peter Harris wrote:
>> On 2010-03-22 12:13, Nicholas Allen wrote:
>>
>>>          xcb_client_message_event_t* clientEvent =
>>>
>>
>> clientEvent is a pointer to xcb_client_message_event_t.
>>
>>
>>>                xcb_send_event(connection, false, screen->root,
>>> XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT,
>>> (const char*)&clientEvent);
>>>
>>
>> &clientEvent is a pointer to a pointer to xcb_client_message_event_t.
>>
>> I'm pretty sure that's not what xcb_send_event expects. Does it work if
>> you drop the extra '&'?
>>
>> Peter Harris
>>
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
>
>


More information about the Xcb mailing list