Reapply support for X11 screenshare (#28160)

Reapplies #27807 after [revert due to not building on
ARM](https://github.com/zed-industries/zed/pull/28141) by updating scap
to include [a fix to its build on
ARM](08f0a01417)

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This commit is contained in:
Michael Sloan 2025-04-06 11:25:29 -06:00 committed by GitHub
parent 0708d476ca
commit 8cfb9beb17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 618 additions and 47 deletions

View file

@ -28,6 +28,7 @@ use crate::{
Pixels, Platform, PlatformDisplay, PlatformTextSystem, PlatformWindow, Point, Result,
ScreenCaptureSource, Task, WindowAppearance, WindowParams, px,
};
#[cfg(any(feature = "wayland", feature = "x11"))]
pub(crate) const SCROLL_LINES: f32 = 3.0;
@ -50,6 +51,10 @@ pub trait LinuxClient {
#[allow(unused)]
fn display(&self, id: DisplayId) -> Option<Rc<dyn PlatformDisplay>>;
fn primary_display(&self) -> Option<Rc<dyn PlatformDisplay>>;
fn is_screen_capture_supported(&self) -> bool;
fn screen_capture_sources(
&self,
) -> oneshot::Receiver<Result<Vec<Box<dyn ScreenCaptureSource>>>>;
fn open_window(
&self,
@ -230,12 +235,14 @@ impl<P: LinuxClient + 'static> Platform for P {
self.displays()
}
fn is_screen_capture_supported(&self) -> bool {
self.is_screen_capture_supported()
}
fn screen_capture_sources(
&self,
) -> oneshot::Receiver<Result<Vec<Box<dyn ScreenCaptureSource>>>> {
let (mut tx, rx) = oneshot::channel();
tx.send(Err(anyhow!("screen capture not implemented"))).ok();
rx
self.screen_capture_sources()
}
fn active_window(&self) -> Option<AnyWindowHandle> {