summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buttons.rs10
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,