[Xcb] Trying to understand sequence of xcb_(leave|enter|focus_in|focus_out)_events

Sam Varshavchik mrsam at courier-mta.com
Mon May 26 17:04:15 PDT 2014

I'm trying to understand the sequence of events I'm getting from xorg-x11 in  
a basic situation involving a pointer button 1 click inside the window.

When the pointer button 1 is pressed inside that window, with the window  
already having keyboard input focus, I see that I'm getting the following  
events, all for the window in question:

- XCB_LEAVE_NOTIFY with detail 0
- XCB_FOCUS_OUT with detail 0
- XCB_ENTER_NOTIFY with detail 0
- XCB_BUTTON_PRESS for button 1.

So, how do I interpret that? The first event is LeaveNotify with detail 0,  
and according to xcb_notify_detail_t is XCB_NOTIFY_DETAIL_ANCESTOR. But  
according to  
a LeaveNotify with detail Ancestor gets generated when a pointer leaves a  
window for its ancestor window. But all I did was click with the pointer  
inside the window. The second event is a FocusOut also with a detail of 0,  
which, I'm reading, would happen when keyboard focus moves to the window's  
ancestor; however I don't think I'm doing anything that should be changing  
the input focus, here.

Then, the third event is an enter from an ancestor window; and then finally  
the button press event I was expecting to see.

Does anyone have any idea what's triggering the unexpected leave/focus  
out/enter event sequence?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20140526/297b0a72/attachment.sig>

More information about the Xcb mailing list