diff options
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(), |