summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-07-04 22:31:07 +0100
committertcmal <me@aria.rip>2024-07-04 22:31:07 +0100
commit51567ba6c3e41a51a73b439c31c836eb39850fed (patch)
tree4b118aaa2dcaafbf43f07dedc18eaebb59f15261
parent53eacd7996dae397cf02f5bb9a8d849aaeeb7418 (diff)
raise windows when they are made floating
-rw-r--r--src/clients/client.rs10
-rw-r--r--src/clients/mod.rs4
2 files changed, 10 insertions, 4 deletions
diff --git a/src/clients/client.rs b/src/clients/client.rs
index 17cfd4f..d4e2e88 100644
--- a/src/clients/client.rs
+++ b/src/clients/client.rs
@@ -1,7 +1,7 @@
use xcb::{
x::{
ChangeProperty, ChangeWindowAttributes, ConfigWindow, ConfigureNotifyEvent,
- ConfigureWindow, Cw, EventMask, MapWindow, SendEvent, SendEventDest, Window,
+ ConfigureWindow, Cw, EventMask, MapWindow, SendEvent, SendEventDest, StackMode, Window,
},
VoidCookieChecked, Xid,
};
@@ -113,7 +113,13 @@ impl Client {
}
/// Set the floating status.
- pub fn set_floating(&mut self, floating: bool) {
+ pub fn set_floating(&mut self, conn: &Connection<'_>, floating: bool) {
+ if floating != self.floating {
+ conn.send_request(&ConfigureWindow {
+ window: self.window,
+ value_list: &[ConfigWindow::StackMode(StackMode::Above)],
+ });
+ }
self.floating = floating;
}
diff --git a/src/clients/mod.rs b/src/clients/mod.rs
index b6e4dca..86b42f9 100644
--- a/src/clients/mod.rs
+++ b/src/clients/mod.rs
@@ -210,7 +210,7 @@ impl ClientState {
BORDER_WIDTH,
);
c.set_border(conn, conn.colours.border_normal());
- c.set_floating(floating);
+ c.set_floating(conn, floating);
c.ensure_mapped(conn);
// TODO: updatewindowtype
@@ -328,7 +328,7 @@ impl ClientState {
/// Toggle whether the client with the given position is floating
pub fn toggle_floating(&mut self, conn: &Connection<'_>, (mon, pos): (usize, usize)) {
let c = &mut self.mons[mon].clients[pos];
- c.set_floating(!c.floating());
+ c.set_floating(conn, !c.floating());
self.rearrange_monitor(conn, mon);
}