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