diff options
author | tcmal <me@aria.rip> | 2024-07-04 22:03:16 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-07-04 22:03:16 +0100 |
commit | d147f26efa31cccf162b939c067ab3b6ed2842e2 (patch) | |
tree | df08c22c20460c895f614ba32955d9c83b639a9c /src/clients/mod.rs | |
parent | 7000d2458b7fbe70967c7b97875f305ec1a10589 (diff) |
inherit monitor from parent for transient windows
Diffstat (limited to 'src/clients/mod.rs')
-rw-r--r-- | src/clients/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/clients/mod.rs b/src/clients/mod.rs index 4b5754b..fe0a4d3 100644 --- a/src/clients/mod.rs +++ b/src/clients/mod.rs @@ -173,8 +173,12 @@ impl ClientState { /// Start managing the given window, adding it to the client list and ensuring its configuration is valid. pub fn manage(&mut self, conn: &Connection<'_>, window: Window) { - // TODO: inherit from parent if window is transient - let mon = self.focused_mon(); + let mut mon = self.focused_mon(); + if let Some(parent) = hints::transient_for(conn, window) { + if let Some((parent_mon, _)) = self.find_client_pos(parent) { + mon = parent_mon; + } + } let Ok(geom) = conn.wait_for_reply(conn.send_request(&GetGeometry { drawable: Drawable::Window(window), @@ -194,6 +198,7 @@ impl ClientState { } = self.mons[mon].screen_info; let c = &mut self.mons[mon].clients[0]; + #[allow(clippy::cast_sign_loss)] c.set_geom( conn, geom.x(), |