fix(native): support Ubuntu 22 desktop builds

This commit is contained in:
usr-bin-roygbiv
2026-07-23 23:05:29 +00:00
parent fe791607d4
commit 87f37bcb1f
6 changed files with 46 additions and 21 deletions
Generated
+40 -15
View File
@@ -1061,6 +1061,15 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b"
[[package]]
name = "convert_case"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "convert_case"
version = "0.11.0"
@@ -3069,25 +3078,26 @@ dependencies = [
[[package]]
name = "libspa"
version = "0.10.0"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2909f3be29d674e7f10604aff18d1bbe1bb03c4cd61c8a8ba19c0b1d162f7d4e"
checksum = "b6b8cfa2a7656627b4c92c6b9ef929433acd673d5ab3708cda1b18478ac00df4"
dependencies = [
"bitflags 2.13.1",
"cc",
"convert_case 0.8.0",
"cookie-factory",
"libc",
"libspa-sys",
"nix 0.30.1",
"nom 8.0.0",
"rustix 1.1.4",
"system-deps",
]
[[package]]
name = "libspa-sys"
version = "0.10.0"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69ad52764fca54818486f3cf75afec844d1f1a1568c24dcee25d41b1ab007dda"
checksum = "901049455d2eb6decf9058235d745237952f4804bc584c5fcb41412e6adcc6e0"
dependencies = [
"bindgen",
"cc",
@@ -3299,7 +3309,7 @@ version = "3.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a49c513341a61a16a10af6efcce46b30d0822ba2d4fb197d24d33dfc199c78d5"
dependencies = [
"convert_case",
"convert_case 0.11.0",
"ctor",
"napi-derive-backend",
"proc-macro2",
@@ -3313,7 +3323,7 @@ version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4747005fa3e2c9989ac45a723a514c5db2411238b72981a3cda4c701a9dfea17"
dependencies = [
"convert_case",
"convert_case 0.11.0",
"proc-macro2",
"quote",
"semver",
@@ -3370,6 +3380,18 @@ dependencies = [
"libc",
]
[[package]]
name = "nix"
version = "0.30.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
dependencies = [
"bitflags 2.13.1",
"cfg-if",
"cfg_aliases 0.2.2",
"libc",
]
[[package]]
name = "nix"
version = "0.31.3"
@@ -4408,23 +4430,26 @@ dependencies = [
[[package]]
name = "pipewire"
version = "0.10.0"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8585aba8a52ad74ccc633b8e293c1dc4277976bd5d510b925533f34fd6685f38"
checksum = "9688b89abf11d756499f7c6190711d6dbe5a3acdb30c8fbf001d6596d06a8d44"
dependencies = [
"anyhow",
"bitflags 2.13.1",
"libc",
"libspa",
"libspa-sys",
"nix 0.30.1",
"once_cell",
"pipewire-sys",
"rustix 1.1.4",
"thiserror 2.0.19",
]
[[package]]
name = "pipewire-sys"
version = "0.10.0"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2089f245b548723e60325773c27f586b7a2372c79ea941b246cd0d654706adc"
checksum = "cb028afee0d6ca17020b090e3b8fa2d7de23305aef975c7e5192a5050246ea36"
dependencies = [
"bindgen",
"libspa-sys",
@@ -7920,9 +7945,9 @@ dependencies = [
[[package]]
name = "xcap"
version = "0.9.7"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b31c7f57ddfb14983525d9149eaed160de7d3973aaa546f3e19eb3394122b6b"
checksum = "b6ad471d5ba232bc276382d26a9d3b837d6853b7df389058b5bb1e94dcdd248c"
dependencies = [
"dispatch2",
"image",
@@ -7938,7 +7963,7 @@ dependencies = [
"objc2-foundation",
"percent-encoding",
"pipewire",
"rand 0.10.2",
"rand 0.9.5",
"scopeguard",
"serde",
"thiserror 2.0.19",
+2 -2
View File
@@ -61,12 +61,12 @@ xxhash-rust.workspace = true
[target.'cfg(all(target_os = "linux", not(target_env = "musl")))'.dependencies]
enigo = { version = "=0.6.1", default-features = false, features = ["libei_smol"], optional = true }
xcap = { version = "=0.9.7", default-features = false, optional = true }
xcap = { version = "=0.9.6", default-features = false, optional = true }
zbus = { version = "5.18", optional = true }
[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
enigo = { version = "=0.6.1", default-features = false }
xcap = { version = "=0.9.7", default-features = false }
xcap = { version = "=0.9.6", default-features = false }
[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = "0.25"
+1 -1
View File
@@ -870,7 +870,7 @@ impl DesktopWorker {
if backend == ConcreteBackend::Wayland && std::env::var_os("DISPLAY").is_none() {
let error = DesktopError::new(
ErrorCode::BackendUnavailable,
"Wayland capture through xcap 0.9.7 requires an active XWayland DISPLAY; pure Wayland \
"Wayland capture through xcap 0.9.6 requires an active XWayland DISPLAY; pure Wayland \
capture is unavailable",
);
self.record_capture_failure(&error);
+1 -1
View File
@@ -17,7 +17,7 @@ use crate::task;
#[cfg(target_env = "musl")]
const UNSUPPORTED: &str = "DESKTOP_BACKEND_UNAVAILABLE: native desktop capture/input is \
unavailable in the Linux musl build because xcap 0.9.7 requires \
unavailable in the Linux musl build because xcap 0.9.6 requires \
dynamically linked graphical-session libraries; use a Linux glibc \
native-desktop build";
+1 -1
View File
@@ -274,7 +274,7 @@ Computer backend errors begin with a stable code:
Common exact failures:
- `Wayland capture through xcap 0.9.7 requires an active XWayland DISPLAY; pure Wayland capture is unavailable` → enable XWayland or use X11.
- `Wayland capture through xcap 0.9.6 requires an active XWayland DISPLAY; pure Wayland capture is unavailable` → enable XWayland or use X11.
- `Wayland/libei absolute input cannot safely correlate a multi-display XWayland composite` → set a single display or use X11.
- `org.freedesktop.portal.Desktop is not available for native libei input` → start/install the desktop portal in the same user session.
- `macOS Screen Recording permission is not granted for this process` → grant the launching host Screen Recording and restart it.
+1 -1
View File
@@ -162,7 +162,7 @@ Before each coordinate action, native code re-enumerates displays and compares I
| `win32-x64` | Real `DesktopSession` in core addon: xcap, native input, `SendInput` absolute movement over the virtual desktop. |
| Other targets | Native package loader rejects unsupported platform tag. |
Wayland detection wins when `XDG_SESSION_TYPE=wayland` or `WAYLAND_DISPLAY` is set. Capture still requires `DISPLAY` because xcap 0.9.7 uses XWayland. Linux input first verifies the session bus and `org.freedesktop.portal.Desktop`, then initializes Enigo/libei without asking OMP to open a permission prompt. Coordinate input rejects Wayland frames containing more than one selected display.
Wayland detection wins when `XDG_SESSION_TYPE=wayland` or `WAYLAND_DISPLAY` is set. Capture still requires `DISPLAY` because xcap 0.9.6 uses XWayland. Linux input first verifies the session bus and `org.freedesktop.portal.Desktop`, then initializes Enigo/libei without asking OMP to open a permission prompt. Coordinate input rejects Wayland frames containing more than one selected display.
macOS capture calls `CGPreflightScreenCaptureAccess()` without prompting. Input creation also disables automatic permission prompts. Windows sets DPI awareness and maps pointer coordinates with `MOUSEEVENTF_VIRTUALDESK`, supporting negative origins and secondary displays.