forge
Explore
Log in

Don't you dare go Hollow

ipc: report toplevel ext-image-copy screencast

Browse files at this commit

1bc0e19246374367126ce0b4ff3350ea3469cf0bHigherOrderLogicParent: 3388de7
src/ipc/server.rsmodified+10 -6
@@ -31,7 +31,7 @@ use smithay::utils::SERIAL_COUNTER;
3131 use smithay::wayland::shell::wlr_layer::{KeyboardInteractivity, Layer};
3232
3333 use crate::backend::IpcOutputMap;
34-use crate::handlers::image_copy_capture;
34+use crate::handlers::image_copy_capture::{source_mapped_id, source_output};
3535 use crate::input::pick_window_grab::PickWindowGrab;
3636 use crate::layout::workspace::WorkspaceId;
3737 use crate::niri::State;
@@ -923,8 +923,14 @@ impl State {
923923 .iter()
924924 .map(|s| (s.session_id, s.stream_id, s.session.source(), s.credentials));
925925 for (session_id, stream_id, source, credentials) in output_sessions.chain(cursor_sessions) {
926- let Some(output) = image_copy_capture::source_output(&source) else {
927- continue;
926+ let target = if let Some(output) = source_output(&source) {
927+ niri_ipc::CastTarget::Output {
928+ name: output.name(),
929+ }
930+ } else if let Some(id) = source_mapped_id(&source) {
931+ niri_ipc::CastTarget::Window { id: id.get() }
932+ } else {
933+ niri_ipc::CastTarget::Nothing {}
928934 };
929935
930936 let stream_id = stream_id.get();
@@ -935,9 +941,7 @@ impl State {
935941 session_id: session_id.get(),
936942 stream_id,
937943 kind: niri_ipc::CastKind::ExtImageCopyCapture,
938- target: niri_ipc::CastTarget::Output {
939- name: output.name(),
940- },
944+ target,
941945 is_dynamic_target: false,
942946 is_active: true,
943947 pid: credentials.map(|creds| creds.pid),