focus events question

Steven J Abner pheonix.sja at att.net
Wed Feb 12 22:14:07 UTC 2025


On Tue, Feb 11 2025 at 07:31:38 PM +0000, Steven J Abner 
<pheonix.sja at att.net> wrote:
> popup, a transient window:
>  xcb_map_window();
>  xcb_set_input_focus();
>  xcb_grab_pointer();

 I believe I figured the problem or at least closer to succinctly 
phrasing it. Basically above is what X11 manuals are suggesting, and it 
makes sense. It probably works if no interception of events.
 I've tried ICCCM and EWM suggestions and in various combinations. Even 
placed in XCB_VISIBILITY_NOTIFY so I could grab after the popup was 
mapped. The GrabButton you mentioned fortunately was the key to 
understanding. If using GrabButton one must state the button. 
xcb_grab_pointer has both passive and active grabs. Nowhere does it 
state that the active grab must be done during a button press event. I 
assumed xcb_grab_pointer() was the equivalent of xcb_set_input_focus(). 
This assumption was based on no other functions are listed to receive 
mouse events. Focus in/out are mouse press on windows other than the 
current, root being a window also. For grabs one can receive motion and 
button release. An actual test confirmed that xcb_grab_pointer() is 
useless without a button to hold grab.
 This leaves me with one option, creating a loop directly connected to 
X server. I would need to only use xcb_query_pointer() to obtain the 
mask for the button press bit. The loop would start on leave event, 
polling motion events for query.
 What I seem to need is the function to receive mouse data directly? It 
can send mouse events to the window manager, I don't care, let it have 
its fun. But I need the un-interpreted mouse motion event as described 
by X11 libraries. To use a previous threads topic, I need to hijack the 
hijackers. If the function(s) elude you, maybe the section within 
xcb/xlib code/file that deals with getting/interrupting mouse type 
device firmware/signals such that maybe others can avoid window 
managers also? Maybe even create a xcb_set_input_mouse()?
 Steve




More information about the Xcb mailing list