mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
Use windows() instead of with_windows()
This commit is contained in:
+4
-11
@@ -1723,16 +1723,9 @@ impl State {
|
|||||||
(CastTarget::Output(output.downgrade()), size, refresh, false)
|
(CastTarget::Output(output.downgrade()), size, refresh, false)
|
||||||
}
|
}
|
||||||
StreamTargetId::Window { id } => {
|
StreamTargetId::Window { id } => {
|
||||||
let mut window = None;
|
let Some(window) = self.niri.layout.windows().find_map(|(_, mapped)| {
|
||||||
self.niri.layout.with_windows(|mapped, _, _| {
|
(mapped.id().get() == id).then_some(&mapped.window)
|
||||||
if mapped.id().get() != id {
|
}) else {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = Some(mapped.window.clone());
|
|
||||||
});
|
|
||||||
|
|
||||||
let Some(window) = window else {
|
|
||||||
warn!("error starting screencast: requested window is missing");
|
warn!("error starting screencast: requested window is missing");
|
||||||
self.niri.stop_cast(session_id);
|
self.niri.stop_cast(session_id);
|
||||||
return;
|
return;
|
||||||
@@ -1740,7 +1733,7 @@ impl State {
|
|||||||
|
|
||||||
// Use the cached output since it will be present even if the output was
|
// Use the cached output since it will be present even if the output was
|
||||||
// currently disconnected.
|
// currently disconnected.
|
||||||
let Some(output) = self.niri.mapped_cast_output.get(&window) else {
|
let Some(output) = self.niri.mapped_cast_output.get(window) else {
|
||||||
warn!("error starting screencast: requested window is missing");
|
warn!("error starting screencast: requested window is missing");
|
||||||
self.niri.stop_cast(session_id);
|
self.niri.stop_cast(session_id);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user