forge
Explore
Log in

Don't you dare go Hollow

Update bounds of toplevel windows

Browse files at this commit

497e52da5933b437e87aea8278d36ed68ae08d59Ivan MolodetskikhParent: 994bc64
src/layout.rsmodified+15 -4
@@ -1603,15 +1603,19 @@ impl<W: LayoutElement> Workspace<W> {
16031603 }
16041604 }
16051605
1606+ fn toplevel_bounds(&self) -> Size<i32, Logical> {
1607+ Size::from((
1608+ max(self.working_area.size.w - self.options.gaps * 2, 1),
1609+ max(self.working_area.size.h - self.options.gaps * 2, 1),
1610+ ))
1611+ }
1612+
16061613 pub fn configure_new_window(&self, window: &Window) {
16071614 let width = ColumnWidth::default().resolve(&self.options, self.working_area.size.w);
16081615 let height = self.working_area.size.h - self.options.gaps * 2;
16091616 let size = Size::from((max(width, 1), max(height, 1)));
16101617
1611- let bounds = Size::from((
1612- max(self.working_area.size.w - self.options.gaps * 2, 1),
1613- max(self.working_area.size.h - self.options.gaps * 2, 1),
1614- ));
1618+ let bounds = self.toplevel_bounds();
16151619
16161620 window.toplevel().with_pending_state(|state| {
16171621 state.size = Some(size);
@@ -2071,10 +2075,17 @@ impl<W: LayoutElement> Workspace<W> {
20712075
20722076 impl Workspace<Window> {
20732077 fn refresh(&self) {
2078+ let bounds = self.toplevel_bounds();
2079+
20742080 for (col_idx, col) in self.columns.iter().enumerate() {
20752081 for (win_idx, win) in col.windows.iter().enumerate() {
20762082 let active = self.active_column_idx == col_idx && col.active_window_idx == win_idx;
20772083 win.set_activated(active);
2084+
2085+ win.toplevel().with_pending_state(|state| {
2086+ state.bounds = Some(bounds);
2087+ });
2088+
20782089 win.toplevel().send_pending_configure();
20792090 win.refresh();
20802091 }