Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
Michael Sloan
42de4ab54f
Merge branch 'main' into wayland-screenshare 2025-08-07 18:04:54 -06:00
Michael Sloan
4dcb249f7e
Conditionally depend on scap/wayland or scap/x11 features 2025-08-07 15:47:14 -06:00
Michael Sloan
e095f83d2a
Enable use of scap for screen capture on Wayland 2025-07-10 15:21:02 -06:00
Michael Sloan
3538538562
Add install of linux deps for building scap with wayland feature 2025-07-10 15:14:12 -06:00
4 changed files with 114 additions and 13 deletions

98
Cargo.lock generated
View file

@ -518,6 +518,16 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
[[package]]
name = "annotate-snippets"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e"
dependencies = [
"unicode-width 0.1.14",
"yansi-term",
]
[[package]]
name = "anstream"
version = "0.6.18"
@ -2108,6 +2118,7 @@ version = "0.69.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
dependencies = [
"annotate-snippets",
"bitflags 2.9.0",
"cexpr",
"clang-sys",
@ -3578,6 +3589,15 @@ dependencies = [
"unicode-segmentation",
]
[[package]]
name = "cookie-factory"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9885fa71e26b8ab7855e2ec7cae6e9b380edff76cd052e07c683a0319d51b3a2"
dependencies = [
"futures 0.3.31",
]
[[package]]
name = "copilot"
version = "0.1.0"
@ -9445,6 +9465,34 @@ dependencies = [
"redox_syscall 0.5.11",
]
[[package]]
name = "libspa"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65f3a4b81b2a2d8c7f300643676202debd1b7c929dbf5c9bb89402ea11d19810"
dependencies = [
"bitflags 2.9.0",
"cc",
"convert_case 0.6.0",
"cookie-factory",
"libc",
"libspa-sys",
"nix 0.27.1",
"nom 7.1.3",
"system-deps",
]
[[package]]
name = "libspa-sys"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf0d9716420364790e85cbb9d3ac2c950bde16a7dd36f3209b7dfdfc4a24d01f"
dependencies = [
"bindgen 0.69.5",
"cc",
"system-deps",
]
[[package]]
name = "libsqlite3-sys"
version = "0.30.1"
@ -10520,6 +10568,17 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
[[package]]
name = "nix"
version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.9.0",
"cfg-if",
"libc",
]
[[package]]
name = "nix"
version = "0.28.0"
@ -12210,6 +12269,34 @@ dependencies = [
"futures-io",
]
[[package]]
name = "pipewire"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08e645ba5c45109106d56610b3ee60eb13a6f2beb8b74f8dc8186cf261788dda"
dependencies = [
"anyhow",
"bitflags 2.9.0",
"libc",
"libspa",
"libspa-sys",
"nix 0.27.1",
"once_cell",
"pipewire-sys",
"thiserror 1.0.69",
]
[[package]]
name = "pipewire-sys"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "849e188f90b1dda88fe2bfe1ad31fe5f158af2c98f80fb5d13726c44f3f01112"
dependencies = [
"bindgen 0.69.5",
"libspa-sys",
"system-deps",
]
[[package]]
name = "pkcs1"
version = "0.7.5"
@ -14363,8 +14450,10 @@ dependencies = [
"anyhow",
"cocoa 0.25.0",
"core-graphics-helmer-fork",
"dbus",
"log",
"objc",
"pipewire",
"rand 0.8.5",
"screencapturekit",
"screencapturekit-sys",
@ -20331,6 +20420,15 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
[[package]]
name = "yansi-term"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1"
dependencies = [
"winapi",
]
[[package]]
name = "yawc"
version = "0.2.4"

View file

@ -50,6 +50,7 @@ wayland = [
"filedescriptor",
"xkbcommon",
"open",
"scap?/wayland",
]
x11 = [
"blade-graphics",

View file

@ -68,7 +68,6 @@ use super::{
display::WaylandDisplay,
window::{ImeInput, WaylandWindowStatePtr},
};
use crate::platform::{PlatformWindow, blade::BladeContext};
use crate::{
AnyWindowHandle, Bounds, Capslock, CursorStyle, DOUBLE_CLICK_INTERVAL, DevicePixels, DisplayId,
@ -666,7 +665,7 @@ impl LinuxClient for WaylandClient {
#[cfg(feature = "screen-capture")]
fn is_screen_capture_supported(&self) -> bool {
false
true
}
#[cfg(feature = "screen-capture")]
@ -674,17 +673,10 @@ impl LinuxClient for WaylandClient {
&self,
) -> futures::channel::oneshot::Receiver<anyhow::Result<Vec<Rc<dyn crate::ScreenCaptureSource>>>>
{
// TODO: Get screen capture working on wayland. Be sure to try window resizing as that may
// be tricky.
//
// start_scap_default_target_source()
let (sources_tx, sources_rx) = futures::channel::oneshot::channel();
sources_tx
.send(Err(anyhow::anyhow!(
"Wayland screen capture not yet implemented."
)))
.ok();
sources_rx
// todo! Try window resizing as that may have unexpected results.
crate::platform::scap_screen_capture::start_scap_default_target_source(
&self.0.borrow().common.foreground_executor,
)
}
fn open_window(

View file

@ -30,6 +30,8 @@ if [[ -n $apt ]]; then
libwayland-dev
libx11-xcb-dev
libxkbcommon-x11-dev
libdbus-1-dev
libpipewire-0.3-dev
libssl-dev
libzstd-dev
libvulkan1
@ -78,6 +80,8 @@ if [[ -n $dnf ]] || [[ -n $yum ]]; then
wayland-devel
libxcb-devel
libxkbcommon-x11-devel
dbus-devel
pipewire-devel
openssl-devel
libzstd-devel
vulkan-loader
@ -136,6 +140,7 @@ if [[ -n $zyp ]]; then
alsa-devel
clang
cmake
dbus-1-devel
fontconfig-devel
gcc
gcc-c++
@ -151,6 +156,7 @@ if [[ -n $zyp ]]; then
make
mold
openssl-devel
pipewire-devel
sqlite3-devel
tar
wayland-devel
@ -176,6 +182,8 @@ if [[ -n $pacman ]]; then
libgit2
libxcb
libxkbcommon-x11
dbus
libpipewire
openssl
zstd
pkgconf
@ -204,6 +212,8 @@ if [[ -n $xbps ]]; then
fontconfig-devel
libxcb-devel
libxkbcommon-devel
dbus-devel
pipewire-devel
libzstd-devel
openssl-devel
wayland-devel