updated normie mode... to match dwms null mode
Browse files
+12 −0 src/window_manager.rs
| @@ -57,6 +57,7 @@ pub struct WindowManager { | ||
| 57 | 57 | layout: Box<dyn Layout>, |
| 58 | 58 | window_tags: std::collections::HashMap<Window, TagMask>, |
| 59 | 59 | window_monitor: std::collections::HashMap<Window, usize>, |
| 60 | + window_geometries: std::collections::HashMap<Window, (i16, i16, u16, u16)>, | |
| 60 | 61 | gaps_enabled: bool, |
| 61 | 62 | fullscreen_window: Option<Window>, |
| 62 | 63 | floating_windows: HashSet<Window>, |
| @@ -164,6 +165,7 @@ impl WindowManager { | ||
| 164 | 165 | layout: Box::new(TilingLayout), |
| 165 | 166 | window_tags: std::collections::HashMap::new(), |
| 166 | 167 | window_monitor: std::collections::HashMap::new(), |
| 168 | + window_geometries: std::collections::HashMap::new(), | |
| 167 | 169 | gaps_enabled, |
| 168 | 170 | fullscreen_window: None, |
| 169 | 171 | floating_windows: HashSet::new(), |
| @@ -941,6 +943,11 @@ impl WindowManager { | ||
| 941 | 943 | return Ok(None); |
| 942 | 944 | } |
| 943 | 945 | |
| 946 | + if let Ok(geom) = self.connection.get_geometry(event.window)?.reply() { | |
| 947 | + self.window_geometries | |
| 948 | + .insert(event.window, (geom.x, geom.y, geom.width, geom.height)); | |
| 949 | + } | |
| 950 | + | |
| 944 | 951 | self.connection.map_window(event.window)?; |
| 945 | 952 | self.connection.change_window_attributes( |
| 946 | 953 | event.window, |
| @@ -1052,6 +1059,10 @@ impl WindowManager { | ||
| 1052 | 1059 | return Ok(()); |
| 1053 | 1060 | } |
| 1054 | 1061 | |
| 1062 | + if self.layout.name() == crate::layout::NORMIE { | |
| 1063 | + return Ok(()); | |
| 1064 | + } | |
| 1065 | + | |
| 1055 | 1066 | let border_width = self.config.border_width; |
| 1056 | 1067 | |
| 1057 | 1068 | let gaps = if self.gaps_enabled { |
| @@ -1135,6 +1146,7 @@ impl WindowManager { | ||
| 1135 | 1146 | self.windows.retain(|&w| w != window); |
| 1136 | 1147 | self.window_tags.remove(&window); |
| 1137 | 1148 | self.window_monitor.remove(&window); |
| 1149 | + self.window_geometries.remove(&window); | |
| 1138 | 1150 | self.floating_windows.remove(&window); |
| 1139 | 1151 | |
| 1140 | 1152 | if self.fullscreen_window == Some(window) { |