consolidated border removal code
Browse files
+15 −13 src/window_manager.rs
| @@ -1579,30 +1579,25 @@ impl WindowManager { | ||
| 1579 | 1579 | )?; |
| 1580 | 1580 | |
| 1581 | 1581 | self.fullscreen_windows.insert(window); |
| 1582 | - | |
| 1583 | - self.connection.configure_window( | |
| 1584 | - window, | |
| 1585 | - &x11rb::protocol::xproto::ConfigureWindowAux::new() | |
| 1586 | - .border_width(0), | |
| 1587 | - )?; | |
| 1588 | - | |
| 1589 | 1582 | self.floating_windows.insert(window); |
| 1590 | 1583 | |
| 1591 | 1584 | let monitor_idx = *self.window_monitor.get(&window).unwrap_or(&self.selected_monitor); |
| 1592 | 1585 | let monitor = &self.monitors[monitor_idx]; |
| 1593 | 1586 | |
| 1587 | + if self.show_bar { | |
| 1588 | + if let Some(bar) = self.bars.get(monitor_idx) { | |
| 1589 | + self.connection.unmap_window(bar.window())?; | |
| 1590 | + } | |
| 1591 | + } | |
| 1592 | + | |
| 1594 | 1593 | self.connection.configure_window( |
| 1595 | 1594 | window, |
| 1596 | 1595 | &x11rb::protocol::xproto::ConfigureWindowAux::new() |
| 1596 | + .border_width(0) | |
| 1597 | 1597 | .x(monitor.x) |
| 1598 | 1598 | .y(monitor.y) |
| 1599 | 1599 | .width(monitor.width as u32) |
| 1600 | - .height(monitor.height as u32), | |
| 1601 | - )?; | |
| 1602 | - | |
| 1603 | - self.connection.configure_window( | |
| 1604 | - window, | |
| 1605 | - &x11rb::protocol::xproto::ConfigureWindowAux::new() | |
| 1600 | + .height(monitor.height as u32) | |
| 1606 | 1601 | .stack_mode(x11rb::protocol::xproto::StackMode::ABOVE), |
| 1607 | 1602 | )?; |
| 1608 | 1603 | |
| @@ -1630,6 +1625,13 @@ impl WindowManager { | ||
| 1630 | 1625 | .border_width(self.config.border_width), |
| 1631 | 1626 | )?; |
| 1632 | 1627 | |
| 1628 | + let monitor_idx = *self.window_monitor.get(&window).unwrap_or(&self.selected_monitor); | |
| 1629 | + if self.show_bar { | |
| 1630 | + if let Some(bar) = self.bars.get(monitor_idx) { | |
| 1631 | + self.connection.map_window(bar.window())?; | |
| 1632 | + } | |
| 1633 | + } | |
| 1634 | + | |
| 1633 | 1635 | self.apply_layout()?; |
| 1634 | 1636 | } |
| 1635 | 1637 |