[Xcb] looking for a short and sweet example of how to use xcb_grab_button.

Micah Nordland mpnordland at gmail.com
Tue Dec 11 10:57:51 PST 2012


So I'm trying to grab buttons in my window manager project. I know I need
to use xcb_grab_button,
and that I need to pass it the event masks that I want, and finally, I need
to handle that button in the event loop. I have this code for grabbing the
button:
    xcb_grab_button(globalconf.conn, 0, _id,
XCB_EVENT_MASK_BUTTON_PRESS|XCB_EVENT_MASK_BUTTON_RELEASE,
                XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC, globalconf.root,
XCB_NONE,
                1,
                XCB_BUTTON_MASK_ANY);

I got it from i3's source, and I do get a button press, but no release, and
after that, mouse input into applications no longer works. This (obviously)
is not what I want, and I *know* that it can be done. I just need to see
how it's done right!

-- 
Praising my Savior all the day long,
Micah Nordland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20121211/e2509f54/attachment.html>


More information about the Xcb mailing list