12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTStatus XSendEvent (display, w, propagate, event_mask, event_send)Display *display;Window w;Bool propagate;long event_mask;XEvent *event_send;displaywpropagateevent_maskevent_sendSpecifies the connection to the X server.Specifies the window the event is to be sent to, or PointerWindow, or InputFocus.Specifies a Boolean value.Specifies the event mask.Specifies the event that is to be sent.The XSendEvent function identifies the destination window, determines which clients shouldreceive the specified events, and ignores any active grabs. This function requires you to pass anevent mask. For adiscussion of the valid event mask names, see section 10.3. This function usesthe w argument to identify the destination window asfollows:• Ifwis PointerWindow, the destination window isthe window that contains the pointer.• Ifwis InputFocus and if the focus window contains the pointer, the destination window isthe window that contains the pointer; otherwise, the destination window isthe focus window.To determine which clients should receive the specified events, XSendEvent uses the propagateargument as follows:• Ifevent_mask is the empty set, the event is sent to the client that created the destinationwindow. Ifthat client no longer exists, no event is sent.• Ifpropagate is False, the event is sent to every client selecting on destination any oftheevent types in the event_mask argument.• Ifpropagate is True and no clients have selected on destination any ofthe event types inevent-mask, the destination is replaced with the closest ancestor of destination for whichsome client has selected a type in event-mask and for which no intervening window hasthat type in its do-not-propagate-mask. If no such window exists or if the window isanancestor of the focus window and InputFocus was originally specified as the destination,the event is not sent to any clients. Otherwise, the event is reported to every client selectingon the final destination any ofthe types specified in event_mask.The event in the XEvent structure must be one of the core events or one of the events defined byan extension (or a BadValue error results) so that the X server can correctly byte-swap the contentsas necessary. The contents of the event are otherwise unaltered and unchecked by the Xserver except to force send_event to True in the forwarded event and to set the serial number inthe event correctly; therefore these fields and the display field are ignored by XSendEvent.XSendEvent returns zero if the conversion to wire protocol format failed and returns nonzerootherwise.XSendEvent can generate BadValue and BadWindow errors.240

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!