So I'm trying to grab buttons in my window manager project. I know I need to use xcb_grab_button,<div>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:</div>

<div><div>    xcb_grab_button(globalconf.conn, 0, _id, XCB_EVENT_MASK_BUTTON_PRESS|XCB_EVENT_MASK_BUTTON_RELEASE,</div><div>                XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC, globalconf.root, XCB_NONE,</div><div>                1,</div>

<div>                XCB_BUTTON_MASK_ANY);</div><div><br></div><div>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!</div>

<div><br></div>-- <br>Praising my Savior all the day long,<div>Micah Nordland</div><br>
</div>