summaryrefslogtreecommitdiff
path: root/src/clients
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/clients
parent28d1cbca91c35175137ec8f9a9f816f3448467b6 (diff)
remove incorrect flushing of xcb buffer
Diffstat (limited to 'src/clients')
-rw-r--r--src/clients/client.rs8
-rw-r--r--src/clients/hints.rs1
-rw-r--r--src/clients/mod.rs14
3 files changed, 3 insertions, 20 deletions
diff --git a/src/clients/client.rs b/src/clients/client.rs
index 3648f0c..3b33b5f 100644
--- a/src/clients/client.rs
+++ b/src/clients/client.rs
@@ -3,7 +3,7 @@ use xcb::{
ChangeProperty, ChangeWindowAttributes, ConfigWindow, ConfigureNotifyEvent,
ConfigureWindow, Cw, EventMask, MapWindow, SendEvent, SendEventDest, Window,
},
- VoidCookie, VoidCookieChecked, Xid,
+ VoidCookieChecked, Xid,
};
use crate::{config::BORDER_WIDTH, conn_info::Connection};
@@ -43,7 +43,6 @@ impl Client {
}
/// Send a configure configure notify event with the current geometry.
- /// This function does not check for success, so `conn.flush()` should be called after.
pub fn configure_notify(&self, conn: &Connection<'_>) {
conn.send_request(&SendEvent {
destination: SendEventDest::Window(self.window),
@@ -64,7 +63,6 @@ impl Client {
}
/// Set this client's geometry, also updating the X11 window if needed.
- /// This function does not check for success, so `conn.flush()` should be called after.
pub fn set_geom(
&mut self,
conn: &Connection<'_>,
@@ -99,7 +97,6 @@ impl Client {
}
/// Set the border colour of the X11 window to the given value (see `crate::colours::Colours`)
- /// This function does not check for success, so `conn.flush()` should be called after.
pub fn set_border(&self, conn: &Connection<'_>, colour: u32) {
conn.send_request(&ChangeWindowAttributes {
window: self.window(),
@@ -108,7 +105,6 @@ impl Client {
}
/// Ensure this client is currently mapped / visible
- /// This function does not check for success, so `conn.flush()` should be called after.
pub fn ensure_mapped(&mut self, conn: &Connection<'_>) {
if !self.mapped {
conn.send_request(&MapWindow {
@@ -124,7 +120,6 @@ impl Client {
}
/// Set the event mask for this window
- /// This function does not check for success, so `conn.flush()` should be called after.
pub fn set_event_mask(
&self,
conn: &Connection<'_>,
@@ -137,7 +132,6 @@ impl Client {
}
/// Sync the non-geometry related properties with EWMH hints
- /// This function does not check for success, so `conn.flush()` should be called after.
pub fn sync_properties(&mut self, conn: &Connection<'_>, focused: bool) {
let Some(mut hints) = hints::Xwm::get(conn, self.window) else {
return;
diff --git a/src/clients/hints.rs b/src/clients/hints.rs
index 0250401..dd5bcf7 100644
--- a/src/clients/hints.rs
+++ b/src/clients/hints.rs
@@ -60,7 +60,6 @@ impl Xwm {
}
/// Set these WM hints on the given window.
- /// This function does not check for success, so `conn.flush()` should be called after.
pub fn apply(&self, conn: &Connection<'_>, window: Window) {
conn.send_request(&ChangeProperty {
mode: PropMode::Replace,
diff --git a/src/clients/mod.rs b/src/clients/mod.rs
index 70e3798..c7df881 100644
--- a/src/clients/mod.rs
+++ b/src/clients/mod.rs
@@ -30,7 +30,6 @@ impl WM<'_> {
// - Border width
// - Size and position if floating
c.configure_notify(&self.conn);
- self.conn.flush()?;
} else {
// Configure it as requested, and sort the rest when we actually map the window
self.conn.send_and_check_request(&ConfigureWindow {
@@ -53,17 +52,13 @@ impl WM<'_> {
pub(crate) fn handle_configure_notify(&mut self, e: &ConfigureNotifyEvent) -> Result<()> {
if e.window() == self.conn.root() {
self.clients.update_geometry(&self.conn)?;
- self.conn.flush()?;
}
Ok(())
}
/// Removing destroyed windows from the client list and rearrange.
- pub(crate) fn handle_destroy_notify(&mut self, e: &DestroyNotifyEvent) -> Result<()> {
+ pub(crate) fn handle_destroy_notify(&mut self, e: &DestroyNotifyEvent) {
self.clients.unmanage(&self.conn, e.window(), true);
- self.conn.flush()?;
-
- Ok(())
}
/// Map a window, starting to manage it if needed.
@@ -85,13 +80,11 @@ impl WM<'_> {
// Start managing, and map window
self.clients.manage(&self.conn, e.window());
- self.conn.flush()?;
-
Ok(())
}
/// When a window is unmapped, either stop managing it or update its state.
- pub(crate) fn handle_unmap_notify(&mut self, e: &UnmapNotifyEvent) -> Result<()> {
+ pub(crate) fn handle_unmap_notify(&mut self, e: &UnmapNotifyEvent) {
if let Some(c) = self.clients.find_client_mut(e.window()) {
if e.is_from_send_event() {
let cookie = c.set_withdrawn(&self.conn, true);
@@ -100,10 +93,7 @@ impl WM<'_> {
} else {
self.clients.unmanage(&self.conn, e.window(), false);
}
- self.conn.flush()?;
}
-
- Ok(())
}
}