ipc: report toplevel ext-image-copy screencast
Browse files at this commit1bc0e19246374367126ce0b4ff3350ea3469cf0bParent: 3388de71 changed file +10 -6
- src/ipc/server.rs +10 -6
src/ipc/server.rsmodified+10 -6
| @@ -31,7 +31,7 @@ use smithay::utils::SERIAL_COUNTER; | ||
| 31 | 31 | use smithay::wayland::shell::wlr_layer::{KeyboardInteractivity, Layer}; |
| 32 | 32 | |
| 33 | 33 | use crate::backend::IpcOutputMap; |
| 34 | -use crate::handlers::image_copy_capture; | |
| 34 | +use crate::handlers::image_copy_capture::{source_mapped_id, source_output}; | |
| 35 | 35 | use crate::input::pick_window_grab::PickWindowGrab; |
| 36 | 36 | use crate::layout::workspace::WorkspaceId; |
| 37 | 37 | use crate::niri::State; |
| @@ -923,8 +923,14 @@ impl State { | ||
| 923 | 923 | .iter() |
| 924 | 924 | .map(|s| (s.session_id, s.stream_id, s.session.source(), s.credentials)); |
| 925 | 925 | 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 {} | |
| 928 | 934 | }; |
| 929 | 935 | |
| 930 | 936 | let stream_id = stream_id.get(); |
| @@ -935,9 +941,7 @@ impl State { | ||
| 935 | 941 | session_id: session_id.get(), |
| 936 | 942 | stream_id, |
| 937 | 943 | kind: niri_ipc::CastKind::ExtImageCopyCapture, |
| 938 | - target: niri_ipc::CastTarget::Output { | |
| 939 | - name: output.name(), | |
| 940 | - }, | |
| 944 | + target, | |
| 941 | 945 | is_dynamic_target: false, |
| 942 | 946 | is_active: true, |
| 943 | 947 | pid: credentials.map(|creds| creds.pid), |