Add Wayland multi-monitor screen capture functionality (#12900)

* Add Wayland multi-monitor screen capture functionality

* fix wayland capture issues by reverting to CapturerPtr, the problem was that calling Display::all in get_capturer_for_display was dropping the pipewire capturer and causing the video to freeze.

* If running as AppImage or flatpak, ignore the 'multiple' argument

* Comment out warning log with unclear purpose Comment out warning log with unclear purpose

---------

Co-authored-by: fufesou <13586388+fufesou@users.noreply.github.com>
This commit is contained in:
Nathan Saslavsky
2025-09-22 07:53:14 -06:00
committed by GitHub
parent a375766ac2
commit eacb07988d
3 changed files with 112 additions and 64 deletions

View File

@@ -325,7 +325,7 @@ fn get_capturer_monitor(
#[cfg(target_os = "linux")]
{
if !is_x11() {
return super::wayland::get_capturer();
return super::wayland::get_capturer_for_display(current);
}
}
@@ -473,11 +473,20 @@ fn run(vs: VideoService) -> ResultType<()> {
#[cfg(target_os = "linux")]
super::wayland::ensure_inited()?;
#[cfg(target_os = "linux")]
let _wayland_call_on_ret = SimpleCallOnReturn {
b: true,
f: Box::new(|| {
super::wayland::clear();
}),
let _wayland_call_on_ret = {
// Increment active display count when starting
let _display_count = super::wayland::increment_active_display_count();
SimpleCallOnReturn {
b: true,
f: Box::new(|| {
// Decrement active display count and only clear if this was the last display
let remaining_count = super::wayland::decrement_active_display_count();
if remaining_count == 0 {
super::wayland::clear();
}
}),
}
};
#[cfg(windows)]