@@ -645,17 +645,25 @@ impl WindowManager { |
| 645 | 645 | let gap_inner = self.config.gap_inner as i16; |
| 646 | 646 | let half_gap = gap_inner / 2; |
| 647 | 647 | |
| 648 | | - // Calculate combined struts from all dock windows |
| 649 | | - let mut strut_left: u32 = 0; |
| 650 | | - let mut strut_right: u32 = 0; |
| 651 | | - let mut strut_top: u32 = 0; |
| 652 | | - let mut strut_bottom: u32 = 0; |
| 653 | | - for strut in self.dock_struts.values() { |
| 654 | | - strut_left = strut_left.max(strut.left); |
| 655 | | - strut_right = strut_right.max(strut.right); |
| 656 | | - strut_top = strut_top.max(strut.top); |
| 657 | | - strut_bottom = strut_bottom.max(strut.bottom); |
| 658 | | - } |
| 648 | + // Calculate reserved space for bars/panels |
| 649 | + // If bar_height is set, use it directly; otherwise use struts from dock windows |
| 650 | + let (strut_left, strut_right, strut_top, strut_bottom) = if self.config.bar_height > 0 { |
| 651 | + // Manual bar height overrides struts (assumes bar at top) |
| 652 | + (0u32, 0u32, self.config.bar_height, 0u32) |
| 653 | + } else { |
| 654 | + // Calculate combined struts from all dock windows |
| 655 | + let mut left: u32 = 0; |
| 656 | + let mut right: u32 = 0; |
| 657 | + let mut top: u32 = 0; |
| 658 | + let mut bottom: u32 = 0; |
| 659 | + for strut in self.dock_struts.values() { |
| 660 | + left = left.max(strut.left); |
| 661 | + right = right.max(strut.right); |
| 662 | + top = top.max(strut.top); |
| 663 | + bottom = bottom.max(strut.bottom); |
| 664 | + } |
| 665 | + (left, right, top, bottom) |
| 666 | + }; |
| 659 | 667 | |
| 660 | 668 | // Collect visible workspaces (one per monitor) |
| 661 | 669 | let visible_workspaces: Vec<(usize, Rect)> = self.monitors |