summaryrefslogtreecommitdiff
path: root/src/clients/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients/client.rs')
-rw-r--r--src/clients/client.rs20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/clients/client.rs b/src/clients/client.rs
index a7b1a8d..3648f0c 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,
},
- Xid,
+ VoidCookie, VoidCookieChecked, Xid,
};
use crate::{config::BORDER_WIDTH, conn_info::Connection};
@@ -125,11 +125,15 @@ 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<'_>, event_mask: EventMask) {
- conn.send_request(&ChangeWindowAttributes {
+ pub fn set_event_mask(
+ &self,
+ conn: &Connection<'_>,
+ event_mask: EventMask,
+ ) -> VoidCookieChecked {
+ conn.send_request_checked(&ChangeWindowAttributes {
window: self.window(),
value_list: &[Cw::EventMask(event_mask)],
- });
+ })
}
/// Sync the non-geometry related properties with EWMH hints
@@ -150,14 +154,14 @@ impl Client {
}
/// Set the given window as withdrawn / not withdrawn.
- pub fn set_withdrawn(&self, conn: &Connection<'_>, withdrawn: bool) {
- conn.send_request(&ChangeProperty {
+ pub fn set_withdrawn(&self, conn: &Connection<'_>, withdrawn: bool) -> VoidCookieChecked {
+ conn.send_request_checked(&ChangeProperty {
mode: xcb::x::PropMode::Replace,
window: self.window,
property: conn.atoms.wm_state,
r#type: conn.atoms.wm_state,
- data: &[u8::from(!withdrawn), 0_u8],
- });
+ data: &[u32::from(!withdrawn), 0_u32],
+ })
}
pub fn set_urgent(&mut self, urgent: bool) {