| @@ -59,7 +59,6 @@ pub struct WindowManager { |
| 59 |
window_monitor: std::collections::HashMap<Window, usize>, |
59 |
window_monitor: std::collections::HashMap<Window, usize>, |
| 60 |
window_geometries: std::collections::HashMap<Window, (i16, i16, u16, u16)>, |
60 |
window_geometries: std::collections::HashMap<Window, (i16, i16, u16, u16)>, |
| 61 |
gaps_enabled: bool, |
61 |
gaps_enabled: bool, |
| 62 |
- fullscreen_enabled: bool, |
|
|
| 63 |
floating_windows: HashSet<Window>, |
62 |
floating_windows: HashSet<Window>, |
| 64 |
bars: Vec<Bar>, |
63 |
bars: Vec<Bar>, |
| 65 |
monitors: Vec<Monitor>, |
64 |
monitors: Vec<Monitor>, |
| @@ -168,7 +167,6 @@ impl WindowManager { |
| 168 |
window_monitor: std::collections::HashMap::new(), |
167 |
window_monitor: std::collections::HashMap::new(), |
| 169 |
window_geometries: std::collections::HashMap::new(), |
168 |
window_geometries: std::collections::HashMap::new(), |
| 170 |
gaps_enabled, |
169 |
gaps_enabled, |
| 171 |
- fullscreen_enabled: false, |
|
|
| 172 |
floating_windows: HashSet::new(), |
170 |
floating_windows: HashSet::new(), |
| 173 |
bars, |
171 |
bars, |
| 174 |
monitors, |
172 |
monitors, |
| @@ -757,19 +755,19 @@ impl WindowManager { |
| 757 |
} |
755 |
} |
| 758 |
|
756 |
|
| 759 |
fn toggle_fullscreen(&mut self) -> WmResult<()> { |
757 |
fn toggle_fullscreen(&mut self) -> WmResult<()> { |
| 760 |
- self.fullscreen_enabled = !self.fullscreen_enabled; |
758 |
+ if let Some(monitor) = self.monitors.get_mut(self.selected_monitor) { |
|
|
759 |
+ monitor.fullscreen_enabled = !monitor.fullscreen_enabled; |
| 761 |
|
760 |
|
| 762 |
- if self.fullscreen_enabled { |
761 |
+ if let Some(bar) = self.bars.get(self.selected_monitor) { |
| 763 |
- for bar in &self.bars { |
762 |
+ if monitor.fullscreen_enabled { |
| 764 |
- self.connection.unmap_window(bar.window())?; |
763 |
+ self.connection.unmap_window(bar.window())?; |
| 765 |
- } |
764 |
+ } else { |
| 766 |
- } else { |
765 |
+ self.connection.map_window(bar.window())?; |
| 767 |
- for bar in &self.bars { |
766 |
+ } |
| 768 |
- self.connection.map_window(bar.window())?; |
|
|
| 769 |
} |
767 |
} |
| 770 |
- } |
|
|
| 771 |
|
768 |
|
| 772 |
- self.apply_layout()?; |
769 |
+ self.apply_layout()?; |
|
|
770 |
+ } |
| 773 |
Ok(()) |
771 |
Ok(()) |
| 774 |
} |
772 |
} |
| 775 |
|
773 |
|
| @@ -1606,25 +1604,25 @@ impl WindowManager { |
| 1606 |
return Ok(()); |
1604 |
return Ok(()); |
| 1607 |
} |
1605 |
} |
| 1608 |
|
1606 |
|
| 1609 |
- let border_width = if self.fullscreen_enabled { 0 } else { self.config.border_width }; |
|
|
| 1610 |
- |
|
|
| 1611 |
- let gaps = if self.gaps_enabled && !self.fullscreen_enabled { |
|
|
| 1612 |
- GapConfig { |
|
|
| 1613 |
- inner_horizontal: self.config.gap_inner_horizontal, |
|
|
| 1614 |
- inner_vertical: self.config.gap_inner_vertical, |
|
|
| 1615 |
- outer_horizontal: self.config.gap_outer_horizontal, |
|
|
| 1616 |
- outer_vertical: self.config.gap_outer_vertical, |
|
|
| 1617 |
- } |
|
|
| 1618 |
- } else { |
|
|
| 1619 |
- GapConfig { |
|
|
| 1620 |
- inner_horizontal: 0, |
|
|
| 1621 |
- inner_vertical: 0, |
|
|
| 1622 |
- outer_horizontal: 0, |
|
|
| 1623 |
- outer_vertical: 0, |
|
|
| 1624 |
- } |
|
|
| 1625 |
- }; |
|
|
| 1626 |
- |
|
|
| 1627 |
for (monitor_index, monitor) in self.monitors.iter().enumerate() { |
1607 |
for (monitor_index, monitor) in self.monitors.iter().enumerate() { |
|
|
1608 |
+ let border_width = if monitor.fullscreen_enabled { 0 } else { self.config.border_width }; |
|
|
1609 |
+ |
|
|
1610 |
+ let gaps = if self.gaps_enabled && !monitor.fullscreen_enabled { |
|
|
1611 |
+ GapConfig { |
|
|
1612 |
+ inner_horizontal: self.config.gap_inner_horizontal, |
|
|
1613 |
+ inner_vertical: self.config.gap_inner_vertical, |
|
|
1614 |
+ outer_horizontal: self.config.gap_outer_horizontal, |
|
|
1615 |
+ outer_vertical: self.config.gap_outer_vertical, |
|
|
1616 |
+ } |
|
|
1617 |
+ } else { |
|
|
1618 |
+ GapConfig { |
|
|
1619 |
+ inner_horizontal: 0, |
|
|
1620 |
+ inner_vertical: 0, |
|
|
1621 |
+ outer_horizontal: 0, |
|
|
1622 |
+ outer_vertical: 0, |
|
|
1623 |
+ } |
|
|
1624 |
+ }; |
|
|
1625 |
+ |
| 1628 |
let visible: Vec<Window> = self |
1626 |
let visible: Vec<Window> = self |
| 1629 |
.windows |
1627 |
.windows |
| 1630 |
.iter() |
1628 |
.iter() |
| @@ -1645,7 +1643,7 @@ impl WindowManager { |
| 1645 |
.copied() |
1643 |
.copied() |
| 1646 |
.collect(); |
1644 |
.collect(); |
| 1647 |
|
1645 |
|
| 1648 |
- let bar_height = if self.fullscreen_enabled { |
1646 |
+ let bar_height = if monitor.fullscreen_enabled { |
| 1649 |
0 |
1647 |
0 |
| 1650 |
} else { |
1648 |
} else { |
| 1651 |
self.bars |
1649 |
self.bars |