summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-28 18:14:51 +0100
committertcmal <me@aria.rip>2024-09-05 18:16:22 +0100
commit06a9a8f08b59cd17a22e8cb3a8d2815bb2042f3c (patch)
tree641bddde88a14d4a5ecf0d7de37f2fc5ca1f9d76 /src
parentbaa0b5fb9243332ac8837ad6965c7db35934e8c6 (diff)
Fix sending invalid configuration requests sometimes
Diffstat (limited to 'src')
-rw-r--r--src/clients/client.rs4
-rw-r--r--src/clients/mod.rs20
2 files changed, 11 insertions, 13 deletions
diff --git a/src/clients/client.rs b/src/clients/client.rs
index bcf8b60..efdfa6c 100644
--- a/src/clients/client.rs
+++ b/src/clients/client.rs
@@ -51,8 +51,8 @@ impl Client {
window,
x: 0,
y: 0,
- width: 0,
- height: 0,
+ width: 1,
+ height: 1,
border_width: BORDER_WIDTH,
mapped: false,
urgent: false,
diff --git a/src/clients/mod.rs b/src/clients/mod.rs
index 01f3205..7a06210 100644
--- a/src/clients/mod.rs
+++ b/src/clients/mod.rs
@@ -46,7 +46,7 @@ pub type ClientIdx = usize;
impl WM<'_> {
/// Perform configure requests if we're happy with them, or they're for an unmanaged window.
- pub(crate) fn handle_configure_request(&mut self, e: &ConfigureRequestEvent) -> Result<()> {
+ pub(crate) fn handle_configure_request(&mut self, e: &ConfigureRequestEvent) {
if let Some(c) = self.clients.find_client_mut(e.window()) {
// Always allow setting border width
if c.floating() {
@@ -65,26 +65,26 @@ impl WM<'_> {
c.configure_notify(&self.conn);
} else {
let (mut x, mut y, mut width, mut height, mut border_width) =
- (0_i32, 0_i32, 0_u32, 0_u32, 0_u32);
+ (0_i32, 0_i32, 1_u32, 1_u32, 0_u32);
if e.value_mask().contains(ConfigWindowMask::X) {
- x = e.x() as i32;
+ x = i32::from(e.x());
}
if e.value_mask().contains(ConfigWindowMask::Y) {
- y = e.y() as i32;
+ y = i32::from(e.y());
}
if e.value_mask().contains(ConfigWindowMask::HEIGHT) {
- height = e.height() as u32;
+ height = u32::from(e.height());
}
if e.value_mask().contains(ConfigWindowMask::WIDTH) {
- width = e.width() as u32;
+ width = u32::from(e.width());
}
if e.value_mask().contains(ConfigWindowMask::BORDER_WIDTH) {
- border_width = e.border_width() as u32;
+ border_width = u32::from(e.border_width());
}
// Configure it as requested, and sort the rest when we actually map the window
- self.conn.send_and_check_request(&ConfigureWindow {
+ self.conn.send_request(&ConfigureWindow {
window: e.window(),
value_list: &[
ConfigWindow::X(x),
@@ -94,10 +94,8 @@ impl WM<'_> {
ConfigWindow::BorderWidth(border_width),
ConfigWindow::StackMode(e.stack_mode()),
],
- })?;
+ });
}
-
- Ok(())
}
/// Update our monitor geometry if the root window is reconfigured