diff options
author | tcmal <me@aria.rip> | 2024-08-28 18:14:51 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-30 18:18:16 +0100 |
commit | 184cbb73f61916b3dd14e40a10c5700ebb945dec (patch) | |
tree | 30622e008d70a14d71d463754ec763c13382d6a5 | |
parent | 0178e6d6ee7782748c575cb1d058e82c6c1a9473 (diff) |
Fix pointer events being paused after a button press
-rw-r--r-- | src/buttons.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/buttons.rs b/src/buttons.rs index 050ec5f..cc8cc74 100644 --- a/src/buttons.rs +++ b/src/buttons.rs @@ -3,8 +3,9 @@ use crate::{config::BUTTON_BINDS, conn_info::Connection, debug, Error, Result, WM}; use xcb::{ x::{ - self, ButtonIndex, ButtonPressEvent, Cursor, EventMask, GrabButton, GrabMode, GrabPointer, - ModMask, MotionNotifyEvent, QueryPointer, UngrabButton, UngrabPointer, Window, + self, Allow, AllowEvents, ButtonIndex, ButtonPressEvent, Cursor, EventMask, GrabButton, + GrabMode, GrabPointer, ModMask, MotionNotifyEvent, QueryPointer, UngrabButton, + UngrabPointer, Window, }, Xid, }; @@ -12,6 +13,11 @@ use xcb::{ impl WM<'_> { /// Dispatch the given button press event according to [`self::BUTTON_BINDS`] pub fn handle_button_press(&mut self, e: &ButtonPressEvent) { + self.conn.send_request(&AllowEvents { + mode: Allow::ReplayPointer, + time: x::CURRENT_TIME, + }); + let button = match e.detail() { 1 => ButtonIndex::N1, 2 => ButtonIndex::N2, |