diff options
author | tcmal <me@aria.rip> | 2024-08-06 14:23:03 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-06 14:39:52 +0100 |
commit | 5359062bf58a5ff57dfa48492db57f9340ecfbee (patch) | |
tree | 7a2d719cd091d681ca0de88585f1c64ddd305717 /src/clients/mod.rs | |
parent | 9865539d1a490ed403e8daff8c670d9a45673468 (diff) |
Deal with configurerequest properly
Diffstat (limited to 'src/clients/mod.rs')
-rw-r--r-- | src/clients/mod.rs | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/clients/mod.rs b/src/clients/mod.rs index 04355fd..7fdb739 100644 --- a/src/clients/mod.rs +++ b/src/clients/mod.rs @@ -10,13 +10,12 @@ use crate::{ }; use xcb::{ x::{ - self, ChangeProperty, ConfigWindow, ConfigureNotifyEvent, ConfigureRequestEvent, - ConfigureWindow, DeleteProperty, DestroyNotifyEvent, Drawable, EventMask, GetGeometry, - GetWindowAttributes, InputFocus, MapRequestEvent, PropMode, SetInputFocus, - UnmapNotifyEvent, Window, + self, ChangeProperty, ConfigWindow, ConfigWindowMask, ConfigureNotifyEvent, + ConfigureRequestEvent, ConfigureWindow, DeleteProperty, DestroyNotifyEvent, Drawable, + EventMask, GetGeometry, GetWindowAttributes, InputFocus, MapRequestEvent, PropMode, + SetInputFocus, UnmapNotifyEvent, Window, }, - xinerama::{self}, - BaseEvent, Extension, + xinerama, BaseEvent, Extension, }; pub use client::*; @@ -38,6 +37,20 @@ 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<()> { if let Some(c) = self.clients.find_client_mut(e.window()) { + // Always allow setting border width + if c.floating() { + c.set_geom_from(&self.conn, e); + } else if e.value_mask().contains(ConfigWindowMask::BORDER_WIDTH) { + c.set_geom( + &self.conn, + c.x(), + c.y(), + c.height(), + c.width(), + e.border_width(), + ); + } + // TODO: Allow changing some properties: // - Border width // - Size and position if floating |