diff --git a/src/main.rs b/src/main.rs index 304574b..51ecafd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,6 +76,22 @@ fn main() -> Result<(), Box> { xcb_util::ewmh::CLIENT_SOURCE_TYPE_NORMAL, ); + debug! {"Grab keyboard, disable tabbing out"} + let xcb_conn = unsafe { + xcb::Connection::from_raw_conn( + window.xcb_connection().unwrap() as *mut xcb::ffi::xcb_connection_t + ) + }; + + xcb::xproto::grab_keyboard( + &xcb_conn, + true, + xcb_window, + xcb::ffi::base::XCB_CURRENT_TIME, + xcb::xproto::GRAB_MODE_ASYNC as u8, + xcb::xproto::GRAB_MODE_ASYNC as u8, + ); + debug! {"Window id: {:?}", window.id()} debug! {"Draw primary state to window"}