File tree 1 file changed +13
-4
lines changed
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -87,11 +87,15 @@ impl X11Api {
87
87
let tree = conn. query_tree ( root) ?. reply ( ) ?;
88
88
let mut result = vec ! [ ] ;
89
89
for window in tree. children {
90
- let attr = conn. get_window_attributes ( window) ?. reply ( ) ?;
91
- if let MapState :: Viewable = attr. map_state {
92
- result. push ( window as WindowId ) ;
90
+ let window_id = window as WindowId ;
91
+ let ( _, _, width, height) = self . get_window_geometry ( & window_id) ?;
92
+ if width > 1 && height > 1 {
93
+ let attr = conn. get_window_attributes ( window) ?. reply ( ) ?;
94
+ if let MapState :: Viewable = attr. map_state {
95
+ result. push ( window as WindowId ) ;
96
+ }
93
97
}
94
- let mut sub_windows = self . get_all_sub_windows ( & ( window as WindowId ) ) ?;
98
+ let mut sub_windows = self . get_all_sub_windows ( & window_id ) ?;
95
99
result. append ( & mut sub_windows) ;
96
100
}
97
101
@@ -363,6 +367,11 @@ mod test {
363
367
let api = X11Api :: new ( ) ?;
364
368
let windows = api. get_visible_windows ( ) ?;
365
369
assert ! ( !windows. is_empty( ) ) ;
370
+ for win in windows {
371
+ let ( _, _, width, height) = api. get_window_geometry ( & win) ?;
372
+ assert ! ( width > 1 ) ;
373
+ assert ! ( height > 1 ) ;
374
+ }
366
375
367
376
Ok ( ( ) )
368
377
}
You can’t perform that action at this time.
0 commit comments