| @@ -89,8 +89,10 @@ impl WindowManager { |
| 89 |
u16::from(config.modkey).into(), |
89 |
u16::from(config.modkey).into(), |
| 90 |
)?; |
90 |
)?; |
| 91 |
|
91 |
|
|
|
92 |
+ // TODO: identify error types |
| 92 |
let bar = Bar::new(&connection, &screen, screen_number, &config)?; |
93 |
let bar = Bar::new(&connection, &screen, screen_number, &config)?; |
| 93 |
|
94 |
|
|
|
95 |
+ // TODO: identify error types |
| 94 |
let selected_tags = Self::get_saved_selected_tags(&connection, root, config.tags.len())?; |
96 |
let selected_tags = Self::get_saved_selected_tags(&connection, root, config.tags.len())?; |
| 95 |
let gaps_enabled = config.gaps_enabled; |
97 |
let gaps_enabled = config.gaps_enabled; |
| 96 |
|
98 |
|
| @@ -111,6 +113,7 @@ impl WindowManager { |
| 111 |
bar, |
113 |
bar, |
| 112 |
}; |
114 |
}; |
| 113 |
|
115 |
|
|
|
116 |
+ // TODO: identify error types |
| 114 |
window_manager.scan_existing_windows()?; |
117 |
window_manager.scan_existing_windows()?; |
| 115 |
window_manager.update_bar()?; |
118 |
window_manager.update_bar()?; |
| 116 |
|
119 |
|
| @@ -179,6 +182,7 @@ impl WindowManager { |
| 179 |
} |
182 |
} |
| 180 |
|
183 |
|
| 181 |
if attrs.map_state == MapState::VIEWABLE { |
184 |
if attrs.map_state == MapState::VIEWABLE { |
|
|
185 |
+ // TODO: Identify errors |
| 182 |
let tag = self.get_saved_tag(window, net_client_info)?; |
186 |
let tag = self.get_saved_tag(window, net_client_info)?; |
| 183 |
self.windows.push(window); |
187 |
self.windows.push(window); |
| 184 |
self.window_tags.insert(window, tag); |
188 |
self.window_tags.insert(window, tag); |
| @@ -203,6 +207,7 @@ impl WindowManager { |
| 203 |
.is_ok_and(|prop| !prop.value.is_empty()); |
207 |
.is_ok_and(|prop| !prop.value.is_empty()); |
| 204 |
|
208 |
|
| 205 |
if has_wm_class { |
209 |
if has_wm_class { |
|
|
210 |
+ // TODO: Identify errors |
| 206 |
let tag = self.get_saved_tag(window, net_client_info)?; |
211 |
let tag = self.get_saved_tag(window, net_client_info)?; |
| 207 |
self.windows.push(window); |
212 |
self.windows.push(window); |
| 208 |
self.window_tags.insert(window, tag); |
213 |
self.window_tags.insert(window, tag); |
| @@ -211,9 +216,11 @@ impl WindowManager { |
| 211 |
} |
216 |
} |
| 212 |
|
217 |
|
| 213 |
if let Some(&first) = self.windows.first() { |
218 |
if let Some(&first) = self.windows.first() { |
|
|
219 |
+ // TODO: Identify errors |
| 214 |
self.set_focus(Some(first))?; |
220 |
self.set_focus(Some(first))?; |
| 215 |
} |
221 |
} |
| 216 |
|
222 |
|
|
|
223 |
+ // TODO: Identify errors |
| 217 |
self.apply_layout()?; |
224 |
self.apply_layout()?; |
| 218 |
Ok(()) |
225 |
Ok(()) |
| 219 |
} |
226 |
} |
| @@ -295,10 +302,12 @@ impl WindowManager { |
| 295 |
pub fn run(&mut self) -> Result<bool> { |
302 |
pub fn run(&mut self) -> Result<bool> { |
| 296 |
println!("oxwm started on display {}", self.screen_number); |
303 |
println!("oxwm started on display {}", self.screen_number); |
| 297 |
|
304 |
|
|
|
305 |
+ // TODO: Identify errors |
| 298 |
keyboard::setup_keybinds(&self.connection, self.root, &self.config.keybindings)?; |
306 |
keyboard::setup_keybinds(&self.connection, self.root, &self.config.keybindings)?; |
| 299 |
self.update_bar()?; |
307 |
self.update_bar()?; |
| 300 |
|
308 |
|
| 301 |
loop { |
309 |
loop { |
|
|
310 |
+ // TODO: Identify errors |
| 302 |
self.bar.update_blocks()?; |
311 |
self.bar.update_blocks()?; |
| 303 |
|
312 |
|
| 304 |
if let Ok(Some(event)) = self.connection.poll_for_event() { |
313 |
if let Ok(Some(event)) = self.connection.poll_for_event() { |
| @@ -322,6 +331,7 @@ impl WindowManager { |
| 322 |
|
331 |
|
| 323 |
self.connection.map_window(self.bar.window())?; |
332 |
self.connection.map_window(self.bar.window())?; |
| 324 |
|
333 |
|
|
|
334 |
+ // TODO: Identify errors |
| 325 |
self.apply_layout()?; |
335 |
self.apply_layout()?; |
| 326 |
self.update_focus_visuals()?; |
336 |
self.update_focus_visuals()?; |
| 327 |
} else { |
337 |
} else { |
| @@ -356,6 +366,7 @@ impl WindowManager { |
| 356 |
} |
366 |
} |
| 357 |
|
367 |
|
| 358 |
self.bar.invalidate(); |
368 |
self.bar.invalidate(); |
|
|
369 |
+ // TODO: Identify errors |
| 359 |
self.bar |
370 |
self.bar |
| 360 |
.draw(&self.connection, self.selected_tags, occupied_tags)?; |
371 |
.draw(&self.connection, self.selected_tags, occupied_tags)?; |
| 361 |
Ok(()) |
372 |
Ok(()) |
| @@ -545,6 +556,7 @@ impl WindowManager { |
| 545 |
self.connection.flush()?; |
556 |
self.connection.flush()?; |
| 546 |
} |
557 |
} |
| 547 |
|
558 |
|
|
|
559 |
+ // TODO: Indentify errors |
| 548 |
self.update_focus_visuals()?; |
560 |
self.update_focus_visuals()?; |
| 549 |
Ok(()) |
561 |
Ok(()) |
| 550 |
} |
562 |
} |