From 7e3d3a9bae541d0a70c375567b9c9b280c60252e Mon Sep 17 00:00:00 2001 From: tcmal Date: Mon, 15 Jul 2024 19:25:03 +0100 Subject: Handle fullscreen requests sent by clients --- src/clients/mod.rs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/clients/mod.rs') diff --git a/src/clients/mod.rs b/src/clients/mod.rs index 053b4de..597a336 100644 --- a/src/clients/mod.rs +++ b/src/clients/mod.rs @@ -210,13 +210,15 @@ impl ClientState { BORDER_WIDTH, ); c.set_border(conn, conn.colours.border_normal()); + if floating { c.set_floating(conn); } - c.update_window_type(conn, &mon_geom); - c.ensure_mapped(conn); - c.sync_properties(conn, true); + c.sync_hints(conn, true); + c.apply_geometry_hints(conn, &mon_geom); + + c.ensure_mapped(conn); c.set_event_mask( conn, @@ -266,7 +268,7 @@ impl ClientState { self.unfocus(conn); if let Some(new) = self.set_focused(mon, i) { new.set_border(conn, conn.colours.border_focused()); - new.sync_properties(conn, true); + new.sync_hints(conn, true); if !new.never_focus() { conn.send_request(&SetInputFocus { revert_to: InputFocus::PointerRoot, @@ -332,7 +334,7 @@ impl ClientState { if c.tiled() { c.set_floating(conn); } else { - c.set_tiled(); + c.set_tiled(conn); } self.rearrange_monitor(conn, mon); @@ -345,7 +347,7 @@ impl ClientState { if c.tiled() { c.set_fullscreen(conn, &mon_info.screen_info); } else { - c.set_tiled(); + c.set_tiled(conn); } self.rearrange_monitor(conn, mon); @@ -482,6 +484,11 @@ impl ClientState { const fn focused_mon(&self) -> usize { self.focused.0 } + + /// Get the geometry of the monitor with the given index + pub fn mon_geometry(&self, mon: usize) -> MonitorGeometry { + self.mons[mon].screen_info + } } impl Default for ClientState { -- cgit v1.2.3