From 184cbb73f61916b3dd14e40a10c5700ebb945dec Mon Sep 17 00:00:00 2001 From: tcmal Date: Wed, 28 Aug 2024 18:14:51 +0100 Subject: Fix pointer events being paused after a button press --- src/buttons.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/buttons.rs') 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, -- cgit v1.2.3