|
|
@@ -97,13 +97,36 @@ impl WindowManager { |
| 97 |
97 |
continue; |
| 98 |
98 |
} |
| 99 |
99 |
|
| 100 |
|
- if attrs.map_state == MapState::VIEWABLE || attrs.map_state == MapState::UNMAPPED { |
|
100 |
+ if attrs.map_state == MapState::VIEWABLE { |
| 101 |
101 |
println!( |
| 102 |
|
- " -> Managing window, tagging with {:b}", |
|
102 |
+ " -> Managing VIEWABLE window, tagging with {:b}", |
| 103 |
103 |
self.selected_tags |
| 104 |
104 |
); |
| 105 |
105 |
self.windows.push(window); |
| 106 |
106 |
self.window_tags.insert(window, self.selected_tags); |
|
107 |
+ continue; |
|
108 |
+ } |
|
109 |
+ |
|
110 |
+ if attrs.map_state == MapState::UNMAPPED { |
|
111 |
+ let has_wm_class = match self |
|
112 |
+ .connection |
|
113 |
+ .get_property(false, window, AtomEnum::WM_CLASS, AtomEnum::STRING, 0, 1024)? |
|
114 |
+ .reply() |
|
115 |
+ { |
|
116 |
+ Ok(prop) => !prop.value.is_empty(), |
|
117 |
+ Err(_) => false, |
|
118 |
+ }; |
|
119 |
+ |
|
120 |
+ if has_wm_class { |
|
121 |
+ println!( |
|
122 |
+ " -> Managing UNMAPPED window (has WM_CLASS), tagging with {:b}", |
|
123 |
+ self.selected_tags |
|
124 |
+ ); |
|
125 |
+ self.windows.push(window); |
|
126 |
+ self.window_tags.insert(window, self.selected_tags); |
|
127 |
+ } else { |
|
128 |
+ println!(" -> Skipped UNMAPPED (no WM_CLASS)"); |
|
129 |
+ } |
| 107 |
130 |
} else { |
| 108 |
131 |
println!(" -> Skipped (map_state={:?})", attrs.map_state); |
| 109 |
132 |
} |
|
|
@@ -371,6 +394,7 @@ impl WindowManager { |
| 371 |
394 |
} |
| 372 |
395 |
Ok(None) |
| 373 |
396 |
} |
|
397 |
+ |
| 374 |
398 |
fn apply_layout(&self) -> Result<()> { |
| 375 |
399 |
let screen_width = self.screen.width_in_pixels as u32; |
| 376 |
400 |
let screen_height = self.screen.height_in_pixels as u32; |