1xcb_send_event(3)                XCB Requests                xcb_send_event(3)
2
3
4

NAME

6       xcb_send_event - send an event
7

SYNOPSIS

9       #include <xcb/xproto.h>
10
11   Request function
12       xcb_void_cookie_t xcb_send_event(xcb_connection_t *conn,
13              uint8_t propagate, xcb_window_t destination,
14              uint32_t event_mask, const char *event);
15

REQUEST ARGUMENTS

17       conn      The XCB connection to X11.
18
19       propagate If propagate is true and no clients have selected any event
20                 on destination, the destination is replaced with the closest
21                 ancestor of destination for which some client has selected a
22                 type in event_mask and for which no intervening window has
23                 that type in its do-not-propagate-mask. If no such window ex‐
24                 ists or if the window is an ancestor of the focus window and
25                 InputFocus was originally specified as the destination, the
26                 event is not sent to any clients. Otherwise, the event is re‐
27                 ported to every client selecting on the final destination any
28                 of the types specified in event_mask.
29
30       destination
31                 The window to send this event to. Every client which selects
32                 any event within event_mask on destination will get the
33                 event.
34
35                 The special value XCB_SEND_EVENT_DEST_POINTER_WINDOW refers
36                 to the window that contains the mouse pointer.
37
38                 The special value XCB_SEND_EVENT_DEST_ITEM_FOCUS refers to
39                 the window which has the keyboard focus.
40
41       event_mask
42                 Event_mask for determining which clients should receive the
43                 specified event.  See destination and propagate.
44
45       event     The event to send to the specified destination.
46

DESCRIPTION

48       Identifies the destination window, determines which clients should re‐
49       ceive the specified event and ignores any active grabs.
50
51       The event must be one of the core events or an event defined by an ex‐
52       tension, so that the X server can correctly byte-swap the contents as
53       necessary. The contents of event are otherwise unaltered and unchecked
54       except for the send_event field which is forced to 'true'.
55

RETURN VALUE

57       Returns an xcb_void_cookie_t. Errors (if any) have to be handled in the
58       event loop.
59
60       If you want to handle errors directly with xcb_request_check instead,
61       use xcb_send_event_checked. See xcb-requests(3) for details.
62

ERRORS

64       xcb_value_error_t
65                 The given event is neither a core event nor an event defined
66                 by an extension.
67
68       xcb_window_error_t
69                 The specified destination window does not exist.
70

EXAMPLE

72       /*
73        * Tell the given window that it was configured to a size of 800x600 pixels.
74        *
75        */
76       void my_example(xcb_connection_t *conn, xcb_window_t window) {
77           /* Every X11 event is 32 bytes long. Therefore, XCB will copy 32 bytes.
78            * In order to properly initialize these bytes, we allocate 32 bytes even
79            * though we only need less for an xcb_configure_notify_event_t */
80           xcb_configure_notify_event_t *event = calloc(32, 1);
81
82           event->event = window;
83           event->window = window;
84           event->response_type = XCB_CONFIGURE_NOTIFY;
85
86           event->x = 0;
87           event->y = 0;
88           event->width = 800;
89           event->height = 600;
90
91           event->border_width = 0;
92           event->above_sibling = XCB_NONE;
93           event->override_redirect = false;
94
95           xcb_send_event(conn, false, window, XCB_EVENT_MASK_STRUCTURE_NOTIFY,
96                          (char*)event);
97           xcb_flush(conn);
98           free(event);
99       }
100

SEE ALSO

102       xcb-requests(3), xcb-examples(3), xcb_configure_notify_event_t(3)
103

AUTHOR

105       Generated from xproto.xml. Contact xcb@lists.freedesktop.org for cor‐
106       rections and improvements.
107
108
109
110X Version 11                      libxcb 1.13                xcb_send_event(3)
Impressum