x11: iterate only visuals from the matching screen
This commit is contained in:
parent
bb4aa22cf9
commit
13bb51c7e0
1 changed files with 9 additions and 6 deletions
|
|
@ -511,13 +511,16 @@ impl UnownedWindow {
|
||||||
None => xconn.default_screen_index() as c_int,
|
None => xconn.default_screen_index() as c_int,
|
||||||
};
|
};
|
||||||
|
|
||||||
// An iterator over all of the visuals combined with their depths.
|
let screen_id_usize = usize::try_from(screen_id)
|
||||||
let mut all_visuals = xconn
|
.map_err(|_| NotSupportedError::new("screen id must be non-negative"))?;
|
||||||
.xcb_connection()
|
let screen = xconn.xcb_connection().setup().roots.get(screen_id_usize).ok_or(
|
||||||
.setup()
|
NotSupportedError::new("requested screen id not present in server's response"),
|
||||||
.roots
|
)?;
|
||||||
|
|
||||||
|
// An iterator over the visuals matching screen id combined with their depths.
|
||||||
|
let mut all_visuals = screen
|
||||||
|
.allowed_depths
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|root| &root.allowed_depths)
|
|
||||||
.flat_map(|depth| depth.visuals.iter().map(move |visual| (visual, depth.depth)));
|
.flat_map(|depth| depth.visuals.iter().map(move |visual| (visual, depth.depth)));
|
||||||
|
|
||||||
// creating
|
// creating
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue