summaryrefslogtreecommitdiff
path: root/src/focus.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-06-21 21:37:11 +0100
committertcmal <me@aria.rip>2024-06-21 21:37:11 +0100
commit1c893ed1ff1dc26f4dcc425e756d56f752142ebd (patch)
tree3802b2c1ee8b07f41509728372a3461ecb78c433 /src/focus.rs
parent28d1cbca91c35175137ec8f9a9f816f3448467b6 (diff)
remove incorrect flushing of xcb buffer
Diffstat (limited to 'src/focus.rs')
-rw-r--r--src/focus.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/focus.rs b/src/focus.rs
index 0c9512f..65bf65e 100644
--- a/src/focus.rs
+++ b/src/focus.rs
@@ -1,33 +1,27 @@
use xcb::x::{EnterNotifyEvent, FocusInEvent, NotifyDetail, NotifyMode};
-use crate::{error::Result, WM};
+use crate::WM;
impl WM<'_> {
/// When a new window is entered, focus it.
- pub fn handle_enter_notify(&mut self, e: &EnterNotifyEvent) -> Result<()> {
+ pub fn handle_enter_notify(&mut self, e: &EnterNotifyEvent) {
if (e.mode() != NotifyMode::Normal || e.detail() == NotifyDetail::Inferior)
&& e.event() != self.conn.root()
{
- return Ok(());
+ return;
}
if let Some((mon, pos)) = self.clients.find_client_pos(e.event()) {
self.clients.refocus(&self.conn, mon, pos);
- self.conn.flush()?;
}
-
- Ok(())
}
/// When a new window requests focus, focus it.
- pub fn handle_focus_in(&mut self, e: &FocusInEvent) -> Result<()> {
+ pub fn handle_focus_in(&mut self, e: &FocusInEvent) {
if !self.clients.is_focused(e.event()) {
if let Some((mon, pos)) = self.clients.find_client_pos(e.event()) {
self.clients.refocus(&self.conn, mon, pos);
- self.conn.flush()?;
}
}
-
- Ok(())
}
}