diff options
author | tcmal <me@aria.rip> | 2024-07-15 19:25:03 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-07-15 20:44:58 +0100 |
commit | 7e3d3a9bae541d0a70c375567b9c9b280c60252e (patch) | |
tree | e353cecf2229790697fdbdfafd458b47b2e6278e /src/clients/mod.rs | |
parent | 4f97eac4f9983c8cfa6ee506a3a20b0abb33f2a3 (diff) |
Handle fullscreen requests sent by clients
Diffstat (limited to 'src/clients/mod.rs')
-rw-r--r-- | src/clients/mod.rs | 19 |
1 files changed, 13 insertions, 6 deletions
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 { |