diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b375b03d..486d98fa6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -248,3 +248,12 @@ jobs: use-cross: ${{ matrix.job.use-cross }} command: test args: --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}} + + # drm and unix-file-copy-paste are off by default, so the run above compiles none of their tests. + - name: Run drm and unix-file-copy-paste tests + if: matrix.job.target == 'x86_64-unknown-linux-gnu' + shell: bash + run: | + cargo test --locked --target=${{ matrix.job.target }} --lib --features drm,drm-wake + cargo test --locked --target=${{ matrix.job.target }} -p scrap --features drm + cargo test --locked --target=${{ matrix.job.target }} -p clipboard --features unix-file-copy-paste diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index 081efd377..9f891b54b 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -2045,6 +2045,23 @@ jobs: name: bridge-artifact path: ./ + # The container's meson is too old to build libdrmtap, so build it here from the pin in + # build.py and hand the .so to the container below via DRMTAP_PREBUILT_DIR. + - name: Build libdrmtap + if: matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true' + run: | + sudo apt-get install -y meson ninja-build pkg-config \ + libdrm-dev libegl1-mesa-dev libgles2-mesa-dev + python3 - <<'PY' + import importlib.util, sys + spec = importlib.util.spec_from_file_location("b", "build.py") + b = importlib.util.module_from_spec(spec) + sys.argv = ["build.py"] + spec.loader.exec_module(b) + print(f"::notice::built {b.build_libdrmtap_so()}") + PY + shell: bash + - uses: rustdesk-org/run-on-arch-action@d3fcfbb632b84cf7f6bc772bfaaa2c2f4f8789a8 # no release tag; commit 2026-05-26 name: Build rustdesk id: vcpkg @@ -2120,13 +2137,15 @@ jobs: # start build pushd /workspace export VCPKG_ROOT=/opt/artifacts/vcpkg + # use the .so built on the runner; build.py checks it is the pinned checkout + export DRMTAP_PREBUILT_DIR=/workspace/third_party/libdrmtap/build-pkg if [[ "${{ matrix.job.arch }}" == "aarch64" ]]; then export JOBS="--jobs 3" else export JOBS="" fi echo $JOBS - cargo build --locked --lib $JOBS --features hwcodec,flutter,unix-file-copy-paste --release + cargo build --locked --lib $JOBS --features hwcodec,flutter,unix-file-copy-paste,drm,drm-wake --release rm -rf target/release/deps target/release/build rm -rf ~/.cargo @@ -2193,6 +2212,22 @@ jobs: mv "$name" "${name%%.deb}-${{ matrix.job.arch }}.deb" done + # The rpm must carry libdrmtap, and must not inherit its glibc requirement: the spec + # excludes /usr/lib/rustdesk from auto-requires, so hosts whose glibc is older than the + # runner's still install it. Everything else here is built against this container's + # glibc 2.27 (the x86_64 Flutter engine needs 2.18), so on x86_64 any 2.28+ requirement + # can only have come from libdrmtap; the aarch64 flutter-elinux engine is not measured. + check_rpm_drm() { + if ! rpm -qlp "$1" | grep -qx /usr/lib/rustdesk/libdrmtap.so.0; then + echo "::error::$1 has no /usr/lib/rustdesk/libdrmtap.so.0" + exit 1 + fi + if [[ "${{ matrix.job.arch }}" == "x86_64" ]] && rpm -qpR "$1" | grep -E 'GLIBC_2\.(2[89]|[3-9][0-9])'; then + echo "::error::$1 requires a newer glibc than its build container; libdrmtap's requirements leaked in" + exit 1 + fi + } + # rpm package echo -e "start packaging fedora package" pushd /workspace @@ -2204,6 +2239,7 @@ jobs: HBB=`pwd` rpmbuild ./res/rpm-flutter.spec -bb pushd ~/rpmbuild/RPMS/${{ matrix.job.arch }} for name in rustdesk*??.rpm; do + check_rpm_drm "$name" mv "$name" /workspace/"${name%%.rpm}.rpm" done @@ -2218,9 +2254,41 @@ jobs: HBB=`pwd` rpmbuild ./res/rpm-flutter-suse.spec -bb pushd ~/rpmbuild/RPMS/${{ matrix.job.arch }} for name in rustdesk*??.rpm; do + check_rpm_drm "$name" mv "$name" /workspace/"${name%%.rpm}-suse.rpm" done + # build.py can exit 0 on some inner failures, so check the artifact rather than the status: + # the deb must carry libdrmtap and a binary that dlopens it. + - name: Check the deb carries libdrmtap + if: matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true' + run: | + set -euo pipefail + # Resolve by glob, not from env.VERSION: build.py names the deb from Cargo.toml, so a + # hardcoded name fails with a bare exit 1 the first time those two drift. + shopt -s nullglob + debs=(rustdesk-*-${{ matrix.job.arch }}.deb) + if [ "${#debs[@]}" -ne 1 ]; then + echo "::error::expected one rustdesk-*-${{ matrix.job.arch }}.deb, found ${#debs[@]}: ${debs[*]-none}" + exit 1 + fi + deb="${debs[0]}" + contents="$(dpkg -c "$deb")" + if [[ ! "$contents" =~ usr/lib/rustdesk/libdrmtap\.so\.0\.[0-9]+\.[0-9]+ ]]; then + echo "::error::$deb has no versioned libdrmtap.so.0.x.y" + exit 1 + fi + if [[ "$contents" != *"usr/lib/rustdesk/libdrmtap.so.0 ->"* ]]; then + echo "::error::$deb has no libdrmtap.so.0 soname symlink" + exit 1 + fi + rm -rf /tmp/deb && dpkg-deb -R "$deb" /tmp/deb + if ! grep -qF /usr/lib/rustdesk/libdrmtap.so.0 /tmp/deb/usr/share/rustdesk/lib/librustdesk.so; then + echo "::error::$deb was not built with the drm feature" + exit 1 + fi + shell: bash + - name: Publish debian/rpm package if: env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 @@ -2231,9 +2299,11 @@ jobs: rustdesk-*.deb rustdesk-*.rpm + # x86_64 also uploads on a PR (upload-artifact false), where it is the only way to get at the + # deb that was just built. - name: Upload deb uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - if: env.UPLOAD_ARTIFACT == 'true' + if: env.UPLOAD_ARTIFACT == 'true' || matrix.job.arch == 'x86_64' with: name: rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.deb path: rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.deb @@ -2257,6 +2327,26 @@ jobs: scripts: | cd res && HBB=`pwd`/.. FLUTTER=1 makepkg -f + # PKGBUILD skips libdrmtap when it finds none, so check the package like the deb and the rpms. + - name: Check the archlinux package carries libdrmtap + if: matrix.job.arch == 'x86_64' && env.UPLOAD_ARTIFACT == 'true' + run: | + set -euo pipefail + shopt -s nullglob + pkgs=(res/rustdesk-${{ env.VERSION }}*.zst) + if [ "${#pkgs[@]}" -eq 0 ]; then + echo "::error::no archlinux package was built" + exit 1 + fi + for pkg in "${pkgs[@]}"; do + contents="$(tar --zstd -tf "$pkg")" + if ! grep -qx 'usr/lib/rustdesk/libdrmtap.so.0' <<<"$contents"; then + echo "::error::$pkg has no /usr/lib/rustdesk/libdrmtap.so.0" + exit 1 + fi + done + shell: bash + - name: Publish archlinux package if: matrix.job.arch == 'x86_64' && env.UPLOAD_ARTIFACT == 'true' uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 @@ -2266,330 +2356,6 @@ jobs: files: | res/rustdesk-${{ env.VERSION }}*.zst - # Same build as build-rustdesk-linux x86_64 -- same vcpkg/ffmpeg, same ubuntu18.04 container, same - # rust and flutter -- only with the drm feature on, so it ships as the separate - # rustdesk-unattended-wayland deb. libdrmtap is built on the runner because bionic's meson is too - # old for it. A separate job rather than a matrix entry of build-rustdesk-linux: appimage and - # flatpak need that job, and a failure here must not skip them. - build-rustdesk-linux-drm: - needs: [generate-bridge] - name: build rustdesk linux drm x86_64 - runs-on: ubuntu-22.04 - steps: - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - - name: Maximize build space - run: | - sudo rm -rf /opt/ghc - sudo rm -rf /usr/local/lib/android - sudo rm -rf /usr/share/dotnet - sudo apt-get update -y - sudo apt-get install -y nasm - sudo apt-get install -y qemu-user-static - - - name: Checkout source code - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - with: - submodules: recursive - - - name: Set Swap Space - uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0 - with: - swap-size-gb: 12 - - - name: Free Space - run: | - df -h - free -m - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 - with: - toolchain: ${{ env.RUST_VERSION }} - targets: x86_64-unknown-linux-gnu - components: "rustfmt" - - - name: Save Rust toolchain version - run: | - RUST_TOOLCHAIN_VERSION=$(cargo --version | awk '{print $2}') - echo "RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION" >> $GITHUB_ENV - - - name: Disable rust bridge build - run: | - # only build cdylib - sed -i "s/\[\"cdylib\", \"staticlib\", \"rlib\"\]/\[\"cdylib\"\]/g" Cargo.toml - - - name: Restore bridge files - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: bridge-artifact - path: ./ - - - name: Setup vcpkg with Github Actions binary cache - uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11 - with: - vcpkgDirectory: /opt/artifacts/vcpkg - vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }} - doNotCache: false - - - name: Install vcpkg dependencies - run: | - sudo apt install -y libva-dev && apt show libva-dev - if ! $VCPKG_ROOT/vcpkg \ - install \ - --triplet x64-linux \ - --x-install-root="$VCPKG_ROOT/installed"; then - find "${VCPKG_ROOT}/" -name "*.log" | while read -r _1; do - echo "$_1:" - echo "======" - cat "$_1" - echo "======" - echo "" - done - exit 1 - fi - head -n 100 "${VCPKG_ROOT}/buildtrees/ffmpeg/build-x64-linux-rel-out.log" || true - shell: bash - - # The container's meson is too old to build libdrmtap, so build it here from the pin in - # build.py and hand the .so to the container below via DRMTAP_PREBUILT_DIR. - - name: Build libdrmtap - run: | - sudo apt-get install -y meson ninja-build pkg-config \ - libdrm-dev libegl1-mesa-dev libgles2-mesa-dev - python3 - <<'PY' - import importlib.util, sys - spec = importlib.util.spec_from_file_location("b", "build.py") - b = importlib.util.module_from_spec(spec) - sys.argv = ["build.py"] - spec.loader.exec_module(b) - print(f"::notice::built {b.build_libdrmtap_so()}") - PY - shell: bash - - - uses: rustdesk-org/run-on-arch-action@d3fcfbb632b84cf7f6bc772bfaaa2c2f4f8789a8 # no release tag; commit 2026-05-26 - name: Build rustdesk - id: vcpkg - with: - arch: x86_64 - distro: ubuntu18.04 - githubToken: ${{ github.token }} - setup: | - ls -l "${PWD}" - ls -l /opt/artifacts/vcpkg/installed - dockerRunArgs: | - --volume "${PWD}:/workspace" - --volume "/opt/artifacts:/opt/artifacts" - shell: /bin/bash - install: | - apt-get update -y - echo -e "installing deps" - apt-get install -y \ - build-essential \ - clang \ - cmake \ - curl \ - gcc \ - git \ - g++ \ - libayatana-appindicator3-dev \ - libasound2-dev \ - libclang-10-dev \ - libgstreamer1.0-dev \ - libgstreamer-plugins-base1.0-dev \ - libgtk-3-dev \ - libpulse-dev \ - libva-dev \ - libxcb-randr0-dev \ - libxcb-shape0-dev \ - libxcb-xfixes0-dev \ - libxdo-dev \ - libxfixes-dev \ - llvm-10-dev \ - nasm \ - ninja-build \ - pkg-config \ - tree \ - python3 \ - rpm \ - unzip \ - wget \ - xz-utils \ - libssl-dev - # we have libopus compiled by us. - apt-get remove -y libopus-dev || true - # output devs - ls -l ./ - tree -L 3 /opt/artifacts/vcpkg/installed - run: | - # disable git safe.directory - git config --global --add safe.directory "*" - # rust - pushd /opt - # do not use rustup, because memory overflow in qemu - wget -O rust.tar.gz https://static.rust-lang.org/dist/rust-${{env.RUST_TOOLCHAIN_VERSION}}-x86_64-unknown-linux-gnu.tar.gz - tar -zxvf rust.tar.gz > /dev/null && rm rust.tar.gz - cd rust-${{env.RUST_TOOLCHAIN_VERSION}}-x86_64-unknown-linux-gnu && ./install.sh - rm -rf rust-${{env.RUST_TOOLCHAIN_VERSION}}-x86_64-unknown-linux-gnu - # edit config - mkdir -p ~/.cargo/ - echo """ - [source.crates-io] - registry = 'https://github.com/rust-lang/crates.io-index' - """ > ~/.cargo/config - cat ~/.cargo/config - # start build - pushd /workspace - export VCPKG_ROOT=/opt/artifacts/vcpkg - # use the .so built on the runner; build.py checks it is the pinned checkout - export DRMTAP_PREBUILT_DIR=/workspace/third_party/libdrmtap/build-pkg - # ask build.py for the features so this line and the packaging line cannot drift - FEATURES=$(python3 ./build.py --flutter --drm --hwcodec --unix-file-copy-paste --print-features) - # an empty or error-shaped value would silently build a stock binary - for want in drm drm-wake; do - case ",$FEATURES," in - *",$want,"*) ;; - *) echo "::error::build.py returned no '$want' feature: $FEATURES"; exit 1 ;; - esac - done - # Run the drm-gated unit tests HERE, because nowhere else does. The ordinary linux CI - # runs the suite, but `drm` is opt-in, so every test behind that feature -- the cursor - # rotation and hotspot ones especially -- has no continuous coverage at all otherwise. - # Debug rather than --release: these are pure logic tests and the release build is - # already the slow part of this job. - # A MINIMAL feature set, not the production $FEATURES: these are pure logic tests of - # the drm paths, and pulling hwcodec in makes the test binary fail to link at all - # (undefined reference to fcntl64 in this container), so the tests never run. - # - # Two packages, because `cargo test --lib` at the root builds the ROOT package only: - # the provenance tests live in libs/scrap and would never be selected from here. The - # ordinary linux CI runs --workspace but without the drm feature, so these are not - # covered there either. - # - # awk sums the counts rather than bc, which this container does not install. - # - # A cargo test FILTER that matches nothing exits 0, so a rename would turn this into a - # green no-op. Assert each command actually ran something. - run_drm_tests() { - local desc="$1"; shift - local out - out=$("$@" 2>&1) || { echo "$out"; echo "::error::drm tests failed: $desc"; exit 1; } - local ran - ran=$(echo "$out" | awk '/^running [0-9]+ tests?$/ { n += $2 } END { print n+0 }') - echo "$desc ran $ran tests" - if [ "$ran" -lt 1 ]; then - echo "::error::$desc selected no tests; it was renamed or removed" - exit 1 - fi - } - run_drm_tests "rustdesk drm_capturer_tests" \ - cargo test --locked --lib --features drm drm_capturer_tests - run_drm_tests "rustdesk ipc::test" \ - cargo test --locked --lib --features drm ipc::test - run_drm_tests "rustdesk cursor_pos_tests" \ - cargo test --locked --lib --features drm cursor_pos_tests - run_drm_tests "rustdesk peer_abs_sample_tests" \ - cargo test --locked --lib --features drm peer_abs_sample_tests - run_drm_tests "rustdesk input_map_tests" \ - cargo test --locked --lib --features drm input_map_tests - run_drm_tests "rustdesk drm_pacing_tests" \ - cargo test --locked --lib --features drm drm_pacing_tests - run_drm_tests "scrap hotspot_provenance_tests" \ - cargo test --locked -p scrap --features drm hotspot_provenance_tests - run_drm_tests "scrap hotspot_guess_tests" \ - cargo test --locked -p scrap --features drm hotspot_guess_tests - run_drm_tests "scrap crtc_refresh_tests" \ - cargo test --locked -p scrap --features drm crtc_refresh_tests - run_drm_tests "scrap plane_rotation_tests" \ - cargo test --locked -p scrap --features drm plane_rotation_tests - run_drm_tests "scrap drmtap_dl::tests" \ - cargo test --locked -p scrap --features drm drmtap_dl::tests - # Opt-in like drm, and this container already builds with it. - run_drm_tests "clipboard unix-file-copy-paste" \ - cargo test --locked -p clipboard --features unix-file-copy-paste - cargo build --locked --lib --features "$FEATURES" --release - rm -rf target/release/deps target/release/build - rm -rf ~/.cargo - - # Setup Flutter - # disable git safe.directory - git config --global --add safe.directory "*" - export PATH=/opt/flutter/bin:$PATH - pushd /opt - wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz - tar xf flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz - flutter doctor -v - - if [[ "3.24.5" == ${{ env.FLUTTER_VERSION }} ]]; then - pushd /opt/flutter - git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff - popd - fi - - # build flutter - pushd /workspace - export CARGO_INCREMENTAL=0 - export DEB_ARCH=amd64 - python3 ./build.py --flutter --drm --hwcodec --unix-file-copy-paste --skip-cargo - for name in rustdesk*??.deb; do - mv "$name" "${name%%.deb}-x86_64.deb" - done - - # build.py can exit 0 on some inner failures, so check the artifact rather than the status. - # The package name is the informed consent for consent-free capture, so a stock binary must - # never ship under it: assert the bundled library AND the dlopen path in the binary. - - name: Check the deb is a drm build - run: | - set -euo pipefail - # Resolve by glob, not from env.VERSION: build.py names the deb from Cargo.toml, so a - # hardcoded name fails with a bare exit 1 the first time those two drift. - shopt -s nullglob - debs=(rustdesk-unattended-wayland-*-x86_64.deb) - if [ "${#debs[@]}" -ne 1 ]; then - echo "::error::expected one rustdesk-unattended-wayland-*-x86_64.deb, found ${#debs[@]}: ${debs[*]-none}" - exit 1 - fi - deb="${debs[0]}" - echo "DRM_DEB=$deb" >> "$GITHUB_ENV" - contents="$(dpkg -c "$deb")" - if [[ ! "$contents" =~ usr/lib/rustdesk/libdrmtap\.so\.0\.[0-9]+\.[0-9]+ ]]; then - echo "::error::$deb has no versioned libdrmtap.so.0.x.y" - exit 1 - fi - if [[ "$contents" != *"usr/lib/rustdesk/libdrmtap.so.0 ->"* ]]; then - echo "::error::$deb has no libdrmtap.so.0 soname symlink" - exit 1 - fi - rm -rf /tmp/deb && dpkg-deb -R "$deb" /tmp/deb - if ! grep -qF /usr/lib/rustdesk/libdrmtap.so.0 /tmp/deb/usr/share/rustdesk/lib/librustdesk.so; then - echo "::error::$deb was not built with the drm feature" - exit 1 - fi - shell: bash - - - name: Publish debian package - if: env.UPLOAD_ARTIFACT == 'true' - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 - with: - prerelease: true - tag_name: ${{ env.TAG_NAME }} - files: | - ${{ env.DRM_DEB }} - - # No UPLOAD_ARTIFACT gate: on a PR this is the only way to get at the deb that was just built. - # always(), because a deb that failed the check above is the one most worth downloading. - - name: Upload deb - if: always() && env.DRM_DEB != '' - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ${{ env.DRM_DEB }} - path: ${{ env.DRM_DEB }} - build-rustdesk-linux-sciter: if: ${{ inputs.upload-artifact }} needs: [validate-update-metadata-keys] diff --git a/AGENTS.md b/AGENTS.md index 735d8587f..f05ee611c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -193,8 +193,8 @@ A refactor added to cover a corner case rarely converges. Each new counter, time * If the test diff is more than twice the fix, cut it back to the tests that pin the reported behavior. A state that needs long setup to reach is usually too rare to fix. * When the number of tests needed to describe the behavior keeps growing, the implementation is too complex: simplify it instead of adding tests. * Dart tests go in `flutter/test/*_test.dart`, nowhere else: CI runs `flutter test` over that directory and nothing outside it. It runs on the VM, so a `@TestOn('browser')` suite runs in no CI job. -* Rust unit tests go in a `#[cfg(test)]` module beside the code. CI runs `cargo test --workspace` with the default features on x86_64 Linux, `cargo test --lib` on the root package with the release feature set on macOS and Windows plus `-p clipboard` there, and on Linux the `drm` test modules by name plus the `clipboard` package with `unix-file-copy-paste`. On macOS and Windows, a platform-gated test in another workspace crate runs only if that platform's job names the crate with `-p`. Gate a test module on a feature or `target_os` only when the code under test is gated; a pure helper that only a gated path calls gets `#[cfg(any(feature = "...", test))]`, so its tests run everywhere. -* A test behind a feature that no CI build enables needs a `cargo test` line in `.github/workflows/flutter-build.yml` that names it. In the Linux drm job, wrap it in `run_drm_tests` so a filter that matches nothing fails instead of passing. +* Rust unit tests go in a `#[cfg(test)]` module beside the code. CI runs `cargo test --workspace` with the default features on x86_64 Linux, `cargo test --lib` on the root package with the release feature set on macOS and Windows plus `-p clipboard` there, and on x86_64 Linux also the root package with `drm,drm-wake`, `scrap` with `drm` and `clipboard` with `unix-file-copy-paste`. On macOS and Windows, a platform-gated test in another workspace crate runs only if that platform's job names the crate with `-p`. Gate a test module on a feature or `target_os` only when the code under test is gated; a pure helper that only a gated path calls gets `#[cfg(any(feature = "...", test))]`, so its tests run everywhere. +* A test behind a feature that no CI build enables needs a `cargo test` line that names it in a CI workflow, such as the Linux one in `.github/workflows/ci.yml`. * Web core tests are `flutter/web/js/src/*.test.ts`, run by jest in that repository's own CI. ## Reviewing a PR diff --git a/build.py b/build.py index 1270b739f..e2bb14406 100755 --- a/build.py +++ b/build.py @@ -140,10 +140,10 @@ def make_parser(): help='Build with unix file copy paste feature' ) parser.add_argument( - '--drm', + '--no-drm', action='store_true', - help='Linux only: build the DRM/KMS capture backend (bundles libdrmtap.so, ' - 'dlopen-ed in-process by the root service). Off by default.' + help='Linux only: build without the DRM/KMS capture backend (on by default for Flutter ' + 'builds; it bundles libdrmtap.so, dlopen-ed in-process by the root service)' ) parser.add_argument( '--print-features', @@ -297,11 +297,10 @@ def external_resources(flutter, args, res_dir): def linux_packaging_branch(): """Which packaging path `main()` will take on THIS host. - MUST mirror the elif chain in main() (pacman / yum / zypper / else), and exists so `--drm` can - refuse a branch that is not drm-aware instead of silently producing a stock-named package with - the capture backend compiled in. Only the final `deb` branch reaches `build_flutter_deb`, which - is what bundles libdrmtap, renames the package, adds Conflicts/Provides and asserts the staged - binary really is a drm build. + MUST mirror the elif chain in main() (pacman / yum / zypper / else), and exists so the drm + backend is compiled in only where the package can carry libdrmtap: the `deb` branch + (`build_flutter_deb`) and the pacman Flutter branch (PKGBUILD). The yum and zypper branches + build Sciter rpms from res/rpm.spec and res/rpm-suse.spec, which do not. """ if os.path.isfile('/usr/bin/pacman'): return 'pacman' @@ -322,29 +321,14 @@ def get_features(args): features.append('flutter') if args.unix_file_copy_paste: features.append('unix-file-copy-paste') - if args.drm: - # Say so rather than quietly handing back a stock build: the backend is Linux-only, so on - # any other host the flag cannot be honoured and the resulting binary would look like a - # DRM build without being one. - if windows or osx: - raise Exception('--drm is Linux only') - # And only on the deb branch. The other three Linux paths (pacman/yum/zypper) package - # straight from `target/release` without bundling libdrmtap, without the rename, without - # Conflicts/Provides and without assert_staged_binary_is_drm() -- so they would emit a - # package NAMED `rustdesk` carrying the consent-bypass backend and the root-side uinput - # injection. The separate package name is the informed consent this feature rests on, so - # refuse rather than ship a stock-named build of it. - branch = linux_packaging_branch() - if branch != 'deb': - raise Exception( - f'--drm is only supported on the deb packaging path; this host would package via ' - f'{branch}, which cannot bundle libdrmtap or name the package distinctly') + # The backend is off at runtime until the user turns on allow-drm-capture, so every Linux + # Flutter package carries it. + if (args.flutter and not (windows or osx) and not args.no_drm + and linux_packaging_branch() in ('deb', 'pacman')): features.append('drm') - # The display wake is its own compile gate on top of `drm`, and the unattended package is - # exactly where it belongs: that variant exists to reach a machine nobody is sitting at, - # and a machine whose screen went dark is the case it is for. Dropping `drm-wake` from - # this line builds the same capture backend with no wake code in the binary at all. - # It is ALSO switchable at runtime; see OPTION_ENABLE_DRM_DISPLAY_WAKE. + # The display wake is its own compile gate on top of `drm`: it reaches a machine whose + # screen went dark, which is the unattended case DRM capture is for. It is also switchable + # at runtime; see OPTION_ENABLE_DRM_DISPLAY_WAKE. features.append('drm-wake') if osx: if args.screencapturekit: @@ -365,7 +349,9 @@ Architecture: %s Maintainer: rustdesk Homepage: https://rustdesk.com Depends: libgtk-3-0t64 | libgtk-3-0, libxcb-randr0, libxdo3 | libxdo4, libxfixes3, libxcb-shape0, libxcb-xfixes0, libasound2t64 | libasound2, libsystemd0, curl, libva2, libva-drm2, libva-x11-2, libgstreamer-plugins-base1.0-0, gstreamer1.0-pipewire%s -Recommends: libayatana-appindicator3-1 +Recommends: libayatana-appindicator3-1, libdrm2 (>= 2.4.101), libegl1, libgles2 +Conflicts: rustdesk-unattended-wayland +Replaces: rustdesk-unattended-wayland Description: A remote control software. """ % (version, get_deb_arch(), get_deb_extra_depends()) @@ -423,7 +409,7 @@ def _prebuilt_dir_is_the_pinned_checkout(prebuilt_dir): def _validate_libdrmtap_pin(): - # Called from build_libdrmtap_so(), NOT at import: a stock (non --drm) build must stay + # Called from build_libdrmtap_so(), NOT at import: a build without drm (--no-drm) must stay # byte-identical to upstream in behaviour too, and leftover DRMTAP_* variables in the # environment (or a malformed sha) must not be able to fail a build that never touches # libdrmtap. @@ -604,9 +590,6 @@ def _assert_so_has_egl(so_path): 'libgles2-mesa-dev; Arch: mesa libglvnd).') -DRM_PACKAGE_NAME = 'rustdesk-unattended-wayland' - - def assert_so_satisfies_the_runtime_abi_gate(so_path): """The .so we are about to ship must be one the RUNTIME will actually accept. @@ -672,68 +655,6 @@ def stage_libdrmtap_into_deb(so_path): system2(f'ln -sf "{so_basename}" tmpdeb/usr/lib/rustdesk/libdrmtap.so.0') -def _max_glibc_minor(path): - # Read from .dynstr rather than via objdump so packaging needs no binutils; chunked because - # librustdesk.so is ~45 MB. - best = 0 - with open(path, 'rb') as f: - tail = b'' - while True: - chunk = f.read(1 << 20) - if not chunk: - return best - for m in re.finditer(rb'GLIBC_2\.(\d+)', tail + chunk): - best = max(best, int(m.group(1))) - tail = chunk[-16:] - - -def measured_glibc_floor(): - # libdrmtap is built on a newer base than the rest of the deb, so the floor is whichever staged - # object is higher -- and it moves whenever either base does. - paths = [p for p in glob.glob('tmpdeb/usr/lib/rustdesk/libdrmtap.so.0.*') - + glob.glob('tmpdeb/usr/share/rustdesk/lib/librustdesk.so') - + glob.glob('tmpdeb/usr/share/rustdesk/rustdesk') - if os.path.isfile(p) and not os.path.islink(p)] - minor = max((_max_glibc_minor(p) for p in paths), default=0) - if not minor: - raise Exception( - f'could not measure a GLIBC_2.x floor from any staged object ({paths or "none found"}); ' - 'refusing to ship the unattended-wayland variant with an undeclared libc6 floor, which ' - 'is what lets it install on a host where libdrmtap can never load') - return f'2.{minor}' - - -def retarget_control_to_drm_variant(): - # Rewrite the control file that generate_control_file just produced, instead of parameterizing that - # function: the stock packaging path stays exactly as upstream wrote it, and everything specific to - # this variant lives here. The variant installs the same files as the stock package, so it must - # conflict with and replace it: you install one or the other, never both. It also needs libdrmtap's - # own runtime deps, which the stock package has no reason to carry. - path = '../res/DEBIAN/control' - floor = measured_glibc_floor() - print(f'[drm] {DRM_PACKAGE_NAME} libc6 floor measured at {floor}') - with open(path) as f: - lines = f.readlines() - out = [] - for line in lines: - if line.startswith('Package: rustdesk'): - out.append(f'Package: {DRM_PACKAGE_NAME}\n') - out.append('Conflicts: rustdesk\nReplaces: rustdesk\nProvides: rustdesk\n') - elif line.startswith('Depends:'): - # 2.4.101 is where drmModeGetFB2 landed; below it libdrmtap loads and can never capture. - out.append(line.rstrip('\n') + ', libdrm2 (>= 2.4.101), libegl1, libgles2, ' - f'libc6 (>= {floor})\n') - else: - out.append(line) - body = ''.join(out) - # Fail loudly rather than silently shipping a package that says `rustdesk`: a stock control file - # that stopped matching either anchor would otherwise produce a variant deb wearing the stock name. - if f'Package: {DRM_PACKAGE_NAME}\n' not in body or 'libegl1' not in body: - raise Exception(f'could not retarget {path} to the drm variant; upstream control layout changed') - with open(path, 'w') as f: - f.write(body) - - def build_flutter_deb(version, features): if not skip_cargo: system2(f'cargo build --locked --features {features} --lib --release') @@ -762,11 +683,10 @@ def build_flutter_deb(version, features): 'cp ../res/rustdesk-link.desktop tmpdeb/usr/share/applications/rustdesk-link.desktop') system2( "echo \"#!/bin/sh\" >> tmpdeb/usr/share/rustdesk/files/polkit && chmod a+x tmpdeb/usr/share/rustdesk/files/polkit") - # Bundle libdrmtap.so only when this build actually enabled the `drm` feature, so stock packages - # stay exactly what they were. The root service dlopens it in-process by absolute path. + # Bundle libdrmtap.so only when this build actually enabled the `drm` feature (not with + # --no-drm). The root service dlopens it in-process by absolute path. # `features` is the comma-joined string, so split it: a bare substring test would also match any - # future feature merely containing "drm" (drm-lease, vaapi-drm) and rename the deb to the - # consent-bypass variant without --drm ever being passed. + # future feature merely containing "drm" (drm-lease, vaapi-drm). ships_so = 'drm' in features.split(',') if ships_so: # Same artifact assertion as the --package path. Under --skip-cargo nothing here rebuilt the @@ -776,8 +696,6 @@ def build_flutter_deb(version, features): system2('mkdir -p tmpdeb/DEBIAN') generate_control_file(version) - if ships_so: - retarget_control_to_drm_variant() system2('cp -a ../res/DEBIAN/* tmpdeb/DEBIAN/') md5_file_folder("tmpdeb/") system2('dpkg-deb -b tmpdeb rustdesk.deb;') @@ -785,9 +703,6 @@ def build_flutter_deb(version, features): system2('/bin/rm -rf tmpdeb/') system2('/bin/rm -rf ../res/DEBIAN/control') os.rename('rustdesk.deb', '../rustdesk-%s.deb' % version) - if ships_so: - # Named apart from the stock package so installing the consent-free variant is a deliberate act. - os.rename('../rustdesk-%s.deb' % version, f'../{DRM_PACKAGE_NAME}-{version}.deb') os.chdir("..") @@ -815,38 +730,30 @@ def _carries_drmtap_marker(path, marker=DRMTAP_DLOPEN_MARKER): def assert_staged_binary_is_drm(): - """The staged BINARY must really be a drm build before it is named the unattended-wayland - variant. That package conflicts with and replaces the stock one, so shipping a stock binary - under that name produces something that can never capture and cannot be installed alongside - what it replaced. The marker is the absolute dlopen path from drmtap_dl.rs, present only when - the feature is compiled in -- assert what was produced, not what was asked for. - - Called from BOTH packaging paths. It used to guard only one of them, and `--skip-cargo` (which - is how CI packages) reaches the other, where nothing had rebuilt the binary at all. + """The staged BINARY must really be a drm build before libdrmtap is packaged with it. Under + `--skip-cargo` (how CI packages) nothing here rebuilt the binary, so `features` says what was + asked for while the staged bundle can be anything. The marker is the absolute dlopen path from + drmtap_dl.rs, present only when the feature is compiled in -- assert what was produced, not + what was asked for. """ binaries = [p for p in glob.glob('tmpdeb/usr/share/rustdesk/lib/librustdesk.so') + glob.glob('tmpdeb/usr/share/rustdesk/rustdesk') if os.path.isfile(p)] if not any(_carries_drmtap_marker(p) for p in binaries): raise Exception( - f'--drm was requested but the staged bundle does not look like a drm build (no ' + f'the build enabled drm but the staged bundle does not look like a drm build (no ' f'{DRMTAP_DLOPEN_MARKER.decode()} dlopen path in {binaries or "any staged binary"}); ' - 'refusing to package it as the unattended-wayland variant, which conflicts with and ' - 'replaces the stock package but could never capture') - # And the WAKE half. `--drm` enables `drm-wake` too (see get_features), and the deb is named and - # documented as the variant that can reach a machine whose screen has gone dark. The dlopen - # marker above does not distinguish them: `--features drm` alone carries it and has no wake code - # at all. Asserting only the first half is how a deb can be named for a feature it does not have. + 'the cargo line that produced it is missing the feature: --features ...,drm,drm-wake ' + '(or pass --no-drm)') + # And the WAKE half: get_features enables `drm-wake` with `drm`, and the dlopen marker above + # does not tell them apart -- `--features drm` alone carries it and has no wake code at all. if not any(_carries_drmtap_marker(p, DRMTAP_WAKE_MARKER) for p in binaries): raise Exception( - f'--drm was requested but the staged binary has no {DRMTAP_WAKE_MARKER.decode()} ' + f'the build enabled drm but the staged binary has no {DRMTAP_WAKE_MARKER.decode()} ' f'marker in {binaries or "any staged binary"}, so it was built without `drm-wake`; ' - 'refusing to package it as the unattended-wayland variant, which is named and ' - 'documented as the build that can wake an idle-disabled display. If this fired under ' - '--skip-cargo, the cargo line that produced the bundle is missing the feature: ' - '--features ...,drm,drm-wake') + 'the cargo line that produced it is missing the feature: --features ...,drm,drm-wake') -def build_deb_from_folder(version, binary_folder, want_drm=False): +def build_deb_from_folder(version, binary_folder): os.chdir('flutter') system2('mkdir -p tmpdeb/usr/bin/') system2('mkdir -p tmpdeb/usr/share/rustdesk') @@ -870,33 +777,26 @@ def build_deb_from_folder(version, binary_folder, want_drm=False): 'cp ../res/rustdesk-link.desktop tmpdeb/usr/share/applications/rustdesk-link.desktop') system2( "echo \"#!/bin/sh\" >> tmpdeb/usr/share/rustdesk/files/polkit && chmod a+x tmpdeb/usr/share/rustdesk/files/polkit") - # Where the capture library comes from for a `--package --drm` build. Two shapes are + # Where the capture library comes from for a `--package ` drm build. Two shapes are # supported, because two exist in practice: a bundle that already carries libdrmtap.so.0.* # (someone staged it, e.g. a CI artifact), and a plain bundle, which is what every build path # here actually produces -- the flutter deb builds the library straight into the staged deb, so - # nothing ever puts it inside the bundle folder. Demanding it in the bundle made this flag - # combination impossible to satisfy. + # nothing ever puts it inside the bundle folder. bundled_glob = glob.glob('tmpdeb/usr/share/rustdesk/libdrmtap.so.0.*') bundle_carries_so = any(os.path.isfile(p) and not os.path.islink(p) for p in bundled_glob) - # The variant must be decided by the EXPLICIT --drm request, not merely by what happens to be - # staged: a bundle that carries the .so must NOT be shipped as the consent-bypass variant when - # --drm was never passed. + # `--package` compiles nothing, so only the staged binary knows whether it is a drm build; a + # Sciter or --no-drm bundle must not get libdrmtap. + want_drm = any(_carries_drmtap_marker(p) + for p in glob.glob('tmpdeb/usr/share/rustdesk/lib/librustdesk.so') + + glob.glob('tmpdeb/usr/share/rustdesk/rustdesk') if os.path.isfile(p)) if bundle_carries_so and not want_drm: raise Exception( - 'the staged bundle carries libdrmtap.so.0.* but --drm was not passed; refusing ' - 'to silently ship the consent-bypass unattended-wayland variant (pass --drm to ' - 'build it deliberately)') + 'the staged bundle carries libdrmtap.so.0.* but the binary is not a drm build') if want_drm: - # Whichever shape we are in, the staged BINARY must really be a drm build. This is the - # property the old presence-of-the-.so test stood in for, badly: a stock binary packaged as - # the unattended-wayland variant would carry the consent-bypass name, conflict with and - # replace the stock package, and never be able to capture. The marker is the absolute - # dlopen path from drmtap_dl.rs, present only when the feature is compiled in -- the same - # kind of artifact assertion as _assert_so_has_egl, and for the same reason: assert what - # was produced, not what was asked for. + # The dlopen marker decided want_drm; this also asserts the drm-wake half. assert_staged_binary_is_drm() if bundle_carries_so: - so = _single_real_so(bundled_glob, 'the staged --drm bundle') + so = _single_real_so(bundled_glob, 'the staged drm bundle') # The THIRD artifact source, and the last one that was missing the check: --package # takes the .so straight out of a bundle somebody else produced, so it has the same # exposure as DRMTAP_PREBUILT_DIR (see the comment on that branch). A CPU-only stub @@ -915,10 +815,6 @@ def build_deb_from_folder(version, binary_folder, want_drm=False): system2('mkdir -p tmpdeb/DEBIAN') generate_control_file(version) - # Keyed on the EXPLICIT request, not on what happened to be staged: by here a --drm build has - # its library in tmpdeb whichever of the two shapes it came from. - if want_drm: - retarget_control_to_drm_variant() system2('cp -a ../res/DEBIAN/* tmpdeb/DEBIAN/') md5_file_folder("tmpdeb/") system2('dpkg-deb -b tmpdeb rustdesk.deb;') @@ -926,8 +822,6 @@ def build_deb_from_folder(version, binary_folder, want_drm=False): system2('/bin/rm -rf tmpdeb/') system2('/bin/rm -rf ../res/DEBIAN/control') os.rename('rustdesk.deb', '../rustdesk-%s.deb' % version) - if want_drm: - os.rename('../rustdesk-%s.deb' % version, f'../{DRM_PACKAGE_NAME}-{version}.deb') os.chdir("..") @@ -962,6 +856,9 @@ def build_flutter_arch_manjaro(version, features): os.chdir('flutter') system2('flutter build linux --release') system2(f'strip {flutter_build_dir}/lib/librustdesk.so') + # PKGBUILD installs the library from third_party/libdrmtap/build-pkg. + if 'drm' in features.split(','): + build_libdrmtap_so() os.chdir('../res') system2('HBB=`pwd`/.. FLUTTER=1 makepkg -f') @@ -1030,7 +927,7 @@ def main(): portable = args.portable package = args.package if package: - build_deb_from_folder(version, package, args.drm) + build_deb_from_folder(version, package) return res_dir = 'resources' external_resources(flutter, args, res_dir) diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 2b0d2c7d1..d81b904c5 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -105,6 +105,7 @@ const String kOptionAutoDisconnectTimeout = "auto-disconnect-timeout"; const String kOptionEnableHwcodec = "enable-hwcodec"; const String kOptionAllowAutoRecordIncoming = "allow-auto-record-incoming"; const String kOptionAllowAutoRecordOutgoing = "allow-auto-record-outgoing"; +const String kOptionAllowDrmCapture = "allow-drm-capture"; const String kOptionHideRecordingButton = "hide-recording-button"; const String kOptionVideoSaveDirectory = "video-save-directory"; const String kOptionAccessMode = "access-mode"; diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index e6f5a41aa..eff9d3179 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -549,7 +549,29 @@ class _DesktopHomePageState extends State )); } } - if (bind.mainCurrentIsWayland()) { + final drmSupported = bind.mainIsInstalled() && + bind.mainGetCommonSync(key: 'is-drm-capture-supported') == 'true'; + if (drmSupported && mainGetBoolOptionSync(kOptionAllowDrmCapture)) { + // DRM capture reaches the session and the login screen: no warning. + } else if (drmSupported && + !isOptionFixed(kOptionAllowDrmCapture) && + !bind.isDisableSettings()) { + final currentIsWayland = bind.mainCurrentIsWayland(); + if (currentIsWayland || bind.mainIsLoginWayland()) { + LinuxCards.add(buildInstallCard( + "Warning", + currentIsWayland ? "wayland-drm-tip" : "login-wayland-drm-tip", + "Enable", () async { + await mainSetBoolOption(kOptionAllowDrmCapture, true); + setState(() {}); + }, + marginTop: LinuxCards.isEmpty ? 20.0 : 5.0, + help: 'Help', + link: currentIsWayland + ? 'https://rustdesk.com/docs/en/client/linux/#x11-required' + : 'https://rustdesk.com/docs/en/client/linux/#login-screen')); + } + } else if (bind.mainCurrentIsWayland()) { LinuxCards.add(buildInstallCard( "Warning", "wayland_experiment_tip", "", () async {}, marginTop: LinuxCards.isEmpty ? 20.0 : 5.0, diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 730d75827..07b982164 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -2890,6 +2890,19 @@ class _WaylandCardState extends State { "true"; final children = [ + if (isLinux && + bind.mainIsInstalled() && + !bind.isOutgoingOnly() && + !bind.isDisableSettings() && + bind.mainGetCommonSync(key: 'is-drm-capture-supported') == + 'true') ...[ + _OptionCheckBox( + context, 'Use DRM screen capture', kOptionAllowDrmCapture), + Align( + alignment: Alignment.topLeft, + child: Text(translate('drm-capture-tip')), + ).marginOnly(left: _kCardLeftMargin), + ], if (restoreToken.isNotEmpty) _buildClearScreenSelection(context, restoreToken), if (hasShortcutsPermission) diff --git a/libs/base/src/config/keys.rs b/libs/base/src/config/keys.rs index 952ad89c8..a0ea1aa93 100644 --- a/libs/base/src/config/keys.rs +++ b/libs/base/src/config/keys.rs @@ -89,6 +89,7 @@ pub const OPTION_ENABLE_ANDROID_SOFTWARE_ENCODING_HALF_SCALE: &str = "enable-android-software-encoding-half-scale"; pub const OPTION_ENABLE_TRUSTED_DEVICES: &str = "enable-trusted-devices"; pub const OPTION_TRUSTED_DEVICE_EXPIRATION: &str = "trusted-device-expiration-days"; +pub const OPTION_ALLOW_DRM_CAPTURE: &str = "allow-drm-capture"; pub const OPTION_AV1_TEST: &str = "av1-test"; /// Maximum number of files allowed during a single file transfer request. /// @@ -335,6 +336,7 @@ pub const KEYS_SETTINGS: &[&str] = &[ OPTION_ALLOW_AUTO_UPDATE, OPTION_ALLOW_KCP_CC, OPTION_ALLOW_WEBRTC_CC, + OPTION_ALLOW_DRM_CAPTURE, ]; // BUILDIN_SETTINGS diff --git a/res/PKGBUILD b/res/PKGBUILD index 1dddb30f8..4a8d92d01 100644 --- a/res/PKGBUILD +++ b/res/PKGBUILD @@ -10,7 +10,7 @@ groups=() depends=('gtk3' 'xdotool' 'libxcb' 'libxfixes' 'alsa-lib' 'libva' 'libappindicator-gtk3' 'gst-plugins-base' 'gst-plugin-pipewire') makedepends=() checkdepends=() -optdepends=() +optdepends=('libdrm: DRM screen capture' 'libglvnd: DRM screen capture') provides=() conflicts=() replaces=() @@ -24,6 +24,11 @@ md5sums=() #generate with 'makepkg -g' package() { if [[ ${FLUTTER} ]]; then mkdir -p "${pkgdir}/usr/share/rustdesk" && cp -r ${HBB}/flutter/build/linux/x64/release/bundle/* -t "${pkgdir}/usr/share/rustdesk" + so=$(find "${DRMTAP_PREBUILT_DIR:-${HBB}/third_party/libdrmtap/build-pkg}" -maxdepth 1 -type f -name 'libdrmtap.so.0.*' 2>/dev/null || true) + if [[ -n "$so" ]]; then + install -Dm 755 "$so" -t "${pkgdir}/usr/lib/rustdesk" + ln -s "$(basename "$so")" "${pkgdir}/usr/lib/rustdesk/libdrmtap.so.0" + fi fi mkdir -p "${pkgdir}/usr/bin" pushd ${pkgdir} && ln -s /usr/share/rustdesk/rustdesk usr/bin/rustdesk && popd diff --git a/res/rpm-flutter-suse.spec b/res/rpm-flutter-suse.spec index c8e268d0b..0bb94c323 100644 --- a/res/rpm-flutter-suse.spec +++ b/res/rpm-flutter-suse.spec @@ -6,8 +6,12 @@ License: GPL-3.0 URL: https://rustdesk.com Vendor: rustdesk Requires: gtk3 libxcb1 libXfixes3 alsa-utils libXtst6 libva2 gstreamer-plugins-base gstreamer-plugin-pipewire -Recommends: libayatana-appindicator3-1 xdotool +Recommends: libayatana-appindicator3-1 xdotool libdrm.so.2()(64bit) libEGL.so.1()(64bit) libGLESv2.so.2()(64bit) Provides: libdesktop_drop_plugin.so()(64bit), libdesktop_multi_window_plugin.so()(64bit), libfile_selector_linux_plugin.so()(64bit), libflutter_custom_cursor_plugin.so()(64bit), libflutter_linux_gtk.so()(64bit), libscreen_retriever_plugin.so()(64bit), libtray_manager_plugin.so()(64bit), liburl_launcher_linux_plugin.so()(64bit), libwindow_manager_plugin.so()(64bit), libwindow_size_plugin.so()(64bit), libtexture_rgba_renderer_plugin.so()(64bit) +# libdrmtap is dlopen-ed by the root service only when DRM capture is on, and falls back if it cannot +# load, so its own dependencies (newer glibc, EGL, libdrm) must not become requirements of the package. +%global __requires_exclude_from ^/usr/lib/rustdesk/.*$ +%global __provides_exclude_from ^/usr/lib/rustdesk/.*$ # https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/ @@ -31,9 +35,13 @@ install -Dm 644 $HBB/res/rustdesk.desktop -t "%{buildroot}/usr/share/rustdesk/fi install -Dm 644 $HBB/res/rustdesk-link.desktop -t "%{buildroot}/usr/share/rustdesk/files" install -Dm 644 $HBB/res/128x128@2x.png "%{buildroot}/usr/share/icons/hicolor/256x256/apps/rustdesk.png" install -Dm 644 $HBB/res/scalable.svg "%{buildroot}/usr/share/icons/hicolor/scalable/apps/rustdesk.svg" +mkdir -p "%{buildroot}/usr/lib/rustdesk" +so=$(find "${DRMTAP_PREBUILT_DIR:-${HBB}/third_party/libdrmtap/build-pkg}" -maxdepth 1 -type f -name 'libdrmtap.so.0.*' 2>/dev/null || true) +if [ -n "$so" ]; then install -Dm 755 "$so" -t "%{buildroot}/usr/lib/rustdesk"; ln -s "$(basename "$so")" "%{buildroot}/usr/lib/rustdesk/libdrmtap.so.0"; fi %files /usr/share/rustdesk/* +/usr/lib/rustdesk /usr/share/rustdesk/files/rustdesk.service /usr/share/icons/hicolor/256x256/apps/rustdesk.png /usr/share/icons/hicolor/scalable/apps/rustdesk.svg diff --git a/res/rpm-flutter.spec b/res/rpm-flutter.spec index 5f05ba6a9..781a1c685 100644 --- a/res/rpm-flutter.spec +++ b/res/rpm-flutter.spec @@ -6,8 +6,12 @@ License: GPL-3.0 URL: https://rustdesk.com Vendor: rustdesk Requires: gtk3 libxcb libXfixes alsa-lib libva gstreamer1-plugins-base -Recommends: libayatana-appindicator-gtk3 libxdo +Recommends: libayatana-appindicator-gtk3 libxdo libdrm.so.2()(64bit) libEGL.so.1()(64bit) libGLESv2.so.2()(64bit) Provides: libdesktop_drop_plugin.so()(64bit), libdesktop_multi_window_plugin.so()(64bit), libfile_selector_linux_plugin.so()(64bit), libflutter_custom_cursor_plugin.so()(64bit), libflutter_linux_gtk.so()(64bit), libscreen_retriever_plugin.so()(64bit), libtray_manager_plugin.so()(64bit), liburl_launcher_linux_plugin.so()(64bit), libwindow_manager_plugin.so()(64bit), libwindow_size_plugin.so()(64bit), libtexture_rgba_renderer_plugin.so()(64bit) +# libdrmtap is dlopen-ed by the root service only when DRM capture is on, and falls back if it cannot +# load, so its own dependencies (newer glibc, EGL, libdrm) must not become requirements of the package. +%global __requires_exclude_from ^/usr/lib/rustdesk/.*$ +%global __provides_exclude_from ^/usr/lib/rustdesk/.*$ # https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/ @@ -31,9 +35,13 @@ install -Dm 644 $HBB/res/rustdesk.desktop -t "%{buildroot}/usr/share/rustdesk/fi install -Dm 644 $HBB/res/rustdesk-link.desktop -t "%{buildroot}/usr/share/rustdesk/files" install -Dm 644 $HBB/res/128x128@2x.png "%{buildroot}/usr/share/icons/hicolor/256x256/apps/rustdesk.png" install -Dm 644 $HBB/res/scalable.svg "%{buildroot}/usr/share/icons/hicolor/scalable/apps/rustdesk.svg" +mkdir -p "%{buildroot}/usr/lib/rustdesk" +so=$(find "${DRMTAP_PREBUILT_DIR:-${HBB}/third_party/libdrmtap/build-pkg}" -maxdepth 1 -type f -name 'libdrmtap.so.0.*' 2>/dev/null || true) +if [ -n "$so" ]; then install -Dm 755 "$so" -t "%{buildroot}/usr/lib/rustdesk"; ln -s "$(basename "$so")" "%{buildroot}/usr/lib/rustdesk/libdrmtap.so.0"; fi %files /usr/share/rustdesk/* +/usr/lib/rustdesk /usr/share/rustdesk/files/rustdesk.service /usr/share/icons/hicolor/256x256/apps/rustdesk.png /usr/share/icons/hicolor/scalable/apps/rustdesk.svg diff --git a/src/core_main.rs b/src/core_main.rs index 0f62d1e59..b919b52a4 100644 --- a/src/core_main.rs +++ b/src/core_main.rs @@ -43,9 +43,20 @@ fn finish_macos_update(result: hbb_common::ResultType<()>) -> Option Option { + // Before global_init: with drm its is_x11() can read Config (allow-drm-capture), and Config + // loads from a path named after the custom client's app name. global_init's first two steps + // run first, for the custom client: its signature check uses libsodium, and the probe child + // must not get past its dispatch. global_init repeats both. + #[cfg(all(target_os = "linux", feature = "drm"))] + { + crate::common::init_sodium(); + crate::platform::linux::dispatch_wayland_display_probe(); + crate::load_custom_client(); + } if !crate::common::global_init() { return None; } + #[cfg(not(all(target_os = "linux", feature = "drm")))] crate::load_custom_client(); #[cfg(windows)] if !crate::platform::windows::bootstrap() { @@ -521,7 +532,11 @@ pub fn core_main() -> Option { let options = crate::ipc::get_options(); println!("{}", options.get(&args[1]).unwrap_or(&"".to_owned())); } else if args.len() == 3 { + #[cfg(all(target_os = "linux", feature = "drm"))] + let drm_capture_was_on = crate::platform::linux::drm_capture_enabled(); crate::ipc::set_option(&args[1], &args[2]); + #[cfg(all(target_os = "linux", feature = "drm"))] + crate::ipc::sync_drm_capture_to_service_blocking(drm_capture_was_on); } } else { println!("Installation and administrative privileges required!"); diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index d366d39e1..ccbeb22e5 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -2780,6 +2780,12 @@ pub fn main_get_common(key: String) -> String { return crate::platform::is_win_10_or_greater().to_string(); #[cfg(not(target_os = "windows"))] return false.to_string(); + } else if key == "is-drm-capture-supported" { + // The bundled libdrmtap may not load (a glibc older than its build): then DRM cannot work. + #[cfg(all(target_os = "linux", feature = "drm"))] + return scrap::drmtap_dl::get().is_some().to_string(); + #[cfg(not(all(target_os = "linux", feature = "drm")))] + return false.to_string(); } else if key == "transfer-job-id" { return base::fs::get_next_job_id().to_string(); } else if key == "is-remote-modify-enabled-by-control-permissions" { diff --git a/src/hbbs_http/sync.rs b/src/hbbs_http/sync.rs index d39087c59..2c13eca49 100644 --- a/src/hbbs_http/sync.rs +++ b/src/hbbs_http/sync.rs @@ -256,7 +256,13 @@ async fn start_hbbs_sync_async() { } if let Some(strategy) = rsp.remove("strategy") { if let Ok(strategy) = serde_json::from_value::(strategy) { - if let Err(error) = handle_config_options(strategy.config_options).await { + #[cfg(all(target_os = "linux", feature = "drm"))] + let drm_capture_was_on = crate::platform::linux::drm_capture_enabled(); + let result = handle_config_options(strategy.config_options).await; + // Also after a rejected update: the options outside authentication are applied. + #[cfg(all(target_os = "linux", feature = "drm"))] + crate::platform::linux::sync_drm_capture_to_service(drm_capture_was_on).await; + if let Err(error) = result { hbb_common::throttled_log!(API_LOG_INTERVAL, error, "Strategy update rejected: {error}"); continue; } diff --git a/src/ipc.rs b/src/ipc.rs index cf60c1d61..7e2ad0a5e 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -1089,15 +1089,29 @@ async fn handle(data: Data, stream: &mut Connection) { if let Some(v) = value.get("privacy-mode-impl-key") { crate::privacy_mode::switch(v); } + #[cfg(all(target_os = "linux", feature = "drm"))] + let drm_capture_was_on = crate::platform::linux::drm_capture_enabled(); if let Err(error) = crate::trusted_devices::config::update_options(value).await { allow_err!( stream .send(&Data::SecurityConfigError(error.to_string())) .await ); + // Also after a rejected update: the options can be applied by then. + #[cfg(all(target_os = "linux", feature = "drm"))] + if crate::is_server() { + crate::platform::linux::sync_drm_capture_to_service(drm_capture_was_on) + .await; + } return; } allow_err!(stream.send(&Data::Options(None)).await); + // Not from a UI that hosts this IPC itself: its copy of the config can be older + // than the service's, and the sync sends all of it. + #[cfg(all(target_os = "linux", feature = "drm"))] + if crate::is_server() { + crate::platform::linux::sync_drm_capture_to_service(drm_capture_was_on).await; + } } }, Data::NatType(_) => { @@ -2071,6 +2085,14 @@ pub async fn set_options(value: HashMap) -> ResultType<()> { Ok(()) } +/// For the CLI, a process that just loaded the config. With no `--server` up to apply the change, +/// as right after an install, nothing else tells the service. +#[cfg(all(target_os = "linux", feature = "drm"))] +#[tokio::main(flavor = "current_thread")] +pub async fn sync_drm_capture_to_service_blocking(was_on: bool) { + crate::platform::linux::sync_drm_capture_to_service(was_on).await +} + #[inline] async fn get_nat_type_(ms_timeout: u64) -> ResultType { let mut c = connect(ms_timeout, "").await?; diff --git a/src/ipc/drm.rs b/src/ipc/drm.rs index 7565f8f9e..a63586d3c 100644 --- a/src/ipc/drm.rs +++ b/src/ipc/drm.rs @@ -887,6 +887,12 @@ async fn handle_drm_conn(stream: Connection) -> ResultType<()> { use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::Arc; + // The producer stays up once started, so with allow-drm-capture off it takes no new consumer. A + // stream already running ends when the service loop restarts every --server on the change. + if !crate::platform::linux::drm_capture_enabled() { + log::trace!("drm: allow-drm-capture is off; dropping this connection"); + return Ok(()); + } // World-connectable socket, so the peer MUST be authorized here (this listener bypasses the // generic `start()` accept loop). On the blocking pool: a cache miss forks `loginctl`. static DRM_AUTH_IN_FLIGHT: AtomicUsize = AtomicUsize::new(0); diff --git a/src/lang/ar.rs b/src/lang/ar.rs index 9d063298c..8e7887ddb 100644 --- a/src/lang/ar.rs +++ b/src/lang/ar.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "طلب الموافقة"), ("Forever", "إلى الأبد"), ("username-login-disabled-oidc-unavailable", "تم تعطيل تسجيل الدخول باسم المستخدم وكلمة المرور، ولا توجد طرق متاحة لتسجيل الدخول عبر OIDC."), + ("Use DRM screen capture", "استخدام التقاط الشاشة عبر DRM"), + ("drm-capture-tip", "يلتقط الشاشة مباشرة من بطاقة الرسومات عبر خدمة RustDesk، دون طلب مشاركة الشاشة في Wayland، بما في ذلك شاشة تسجيل الدخول. قد لا يعمل على كل الأجهزة؛ إذا استمرت الاتصالات في طلب مشاركة الشاشة، فأوقف هذا الخيار أو استخدم X11. تغيير هذا الخيار يقطع الجلسات الحالية."), + ("wayland-drm-tip", "للوصول غير المراقب على Wayland، جرّب التقاط الشاشة عبر DRM، أو استخدم X11 إذا لم يعمل."), + ("login-wayland-drm-tip", "للوصول إلى شاشة تسجيل الدخول في Wayland، جرّب التقاط الشاشة عبر DRM أو حوّلها إلى X11."), ].iter().cloned().collect(); } diff --git a/src/lang/az.rs b/src/lang/az.rs index dc5cc49c9..0b912263f 100644 --- a/src/lang/az.rs +++ b/src/lang/az.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Təsdiq istə"), ("Forever", "Həmişəlik"), ("username-login-disabled-oidc-unavailable", "İstifadəçi adı və parol ilə giriş deaktiv edilib və heç bir OIDC giriş üsulu mövcud deyil."), + ("Use DRM screen capture", "DRM ekran çəkilişindən istifadə et"), + ("drm-capture-tip", "Ekranı RustDesk xidməti vasitəsilə birbaşa qrafik kartdan çəkir, Wayland ekran paylaşımı sorğusu olmadan, giriş ekranı da daxil olmaqla. Hər cihazda işləməyə bilər; bağlantılar hələ də ekranı paylaşmağı tələb edirsə, bunu söndürün və ya X11 işlədin. Bunu dəyişmək cari sessiyaları kəsir."), + ("wayland-drm-tip", "Wayland-da nəzarətsiz giriş üçün DRM ekran çəkilişini sınayın, işləməzsə X11 işlədin."), + ("login-wayland-drm-tip", "Wayland giriş ekranına daxil olmaq üçün DRM ekran çəkilişini sınayın və ya onu X11-ə keçirin."), ].iter().cloned().collect(); } diff --git a/src/lang/be.rs b/src/lang/be.rs index 1e9bb8cc8..8798c94f1 100644 --- a/src/lang/be.rs +++ b/src/lang/be.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Запытаць дазвол"), ("Forever", "Назаўсёды"), ("username-login-disabled-oidc-unavailable", "Уваход з імем карыстальніка і паролем адключаны, і няма даступных спосабаў уваходу праз OIDC."), + ("Use DRM screen capture", "Выкарыстоўваць захоп экрана праз DRM"), + ("drm-capture-tip", "Захоплівае экран непасрэдна з відэакарты праз службу RustDesk, без запыту Wayland на дэманстрацыю экрана, у тым ліку на экране ўваходу. Можа працаваць не на ўсіх прыладах; калі падключэнні ўсё яшчэ патрабуюць дазволу на дэманстрацыю экрана, адключыце гэта або выкарыстоўвайце X11. Змяненне гэтага параметра разрывае бягучыя сеансы."), + ("wayland-drm-tip", "Для аўтаматычнага доступу ў Wayland паспрабуйце захоп экрана праз DRM, а калі не працуе — X11."), + ("login-wayland-drm-tip", "Для доступу да экрана ўваходу Wayland паспрабуйце захоп экрана праз DRM або пераключыце яго на X11."), ].iter().cloned().collect(); } diff --git a/src/lang/bg.rs b/src/lang/bg.rs index b3df269a9..acc06114a 100644 --- a/src/lang/bg.rs +++ b/src/lang/bg.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Поискай одобрение"), ("Forever", "Завинаги"), ("username-login-disabled-oidc-unavailable", "Входът с потребителско име и парола е изключен и няма налични методи за вход чрез OIDC."), + ("Use DRM screen capture", "Използване на заснемане на екрана чрез DRM"), + ("drm-capture-tip", "Заснема екрана директно от видеокартата чрез услугата на RustDesk, без подканата на Wayland за споделяне на екрана, включително на екрана за влизане. Може да не работи на всяко устройство; ако връзките все още искат споделяне на екрана, изключете това или използвайте X11. Промяната прекъсва текущите сесии."), + ("wayland-drm-tip", "За безконтролен достъп в Wayland опитайте заснемане чрез DRM или използвайте X11, ако не работи."), + ("login-wayland-drm-tip", "За достъп до екрана за влизане с Wayland опитайте заснемане чрез DRM или го превключете на X11."), ].iter().cloned().collect(); } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 797c95185..ac888a230 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Sol·licita aprovació"), ("Forever", "Per sempre"), ("username-login-disabled-oidc-unavailable", "L'inici de sessió amb nom d'usuari i contrasenya està desactivat i no hi ha cap mètode d'inici de sessió OIDC disponible."), + ("Use DRM screen capture", "Usa la captura de pantalla DRM"), + ("drm-capture-tip", "Captura la pantalla directament de la targeta gràfica a través del servei de RustDesk, sense la sol·licitud de compartir pantalla de Wayland, també a la pantalla d'inici de sessió. Pot no funcionar en tots els dispositius; si les connexions encara demanen compartir la pantalla, desactiveu-ho o useu X11. Canviar-ho desconnecta les sessions actuals."), + ("wayland-drm-tip", "Per a l'accés desatès a Wayland, proveu la captura de pantalla DRM, o useu X11 si no funciona."), + ("login-wayland-drm-tip", "Per accedir a la pantalla d'inici de sessió de Wayland, proveu la captura DRM o canvieu-la a X11."), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 1e652cb33..ae42078ca 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "请求批准"), ("Forever", "永久"), ("username-login-disabled-oidc-unavailable", "用户名和密码登录已禁用,且没有可用的 OIDC 登录方式。"), + ("Use DRM screen capture", "使用 DRM 捕获屏幕"), + ("drm-capture-tip", "通过 RustDesk 服务直接从显卡捕获屏幕,不再弹出 Wayland 的屏幕共享确认,登录界面也可以使用。并非所有设备都支持;如果连接时仍然要求确认屏幕共享,请关闭此选项或改用 X11。更改此选项会断开当前会话。"), + ("wayland-drm-tip", "如需在 Wayland 上无人值守访问,请尝试 DRM 捕获屏幕;如果不起作用,请使用 X11。"), + ("login-wayland-drm-tip", "如需访问 Wayland 登录界面,请尝试 DRM 捕获屏幕,或将其切换到 X11。"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 58d1b1ce1..fb994d78c 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Požádat o schválení"), ("Forever", "Navždy"), ("username-login-disabled-oidc-unavailable", "Přihlášení uživatelským jménem a heslem je zakázáno a nejsou k dispozici žádné metody přihlášení přes OIDC."), + ("Use DRM screen capture", "Použít snímání obrazovky přes DRM"), + ("drm-capture-tip", "Snímá obrazovku přímo z grafické karty prostřednictvím služby RustDesk, bez výzvy Waylandu ke sdílení obrazovky, a to i na přihlašovací obrazovce. Nemusí fungovat na všech zařízeních; pokud připojení stále žádají o sdílení obrazovky, vypněte tuto volbu nebo použijte X11. Změna této volby odpojí aktuální relace."), + ("wayland-drm-tip", "Pro bezobslužný přístup ve Waylandu zkuste snímání obrazovky přes DRM, nebo použijte X11, pokud nefunguje."), + ("login-wayland-drm-tip", "Pro přístup k přihlašovací obrazovce Waylandu zkuste snímání přes DRM nebo ji přepněte na X11."), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 2b012fbde..761f7d3c8 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Anmod om godkendelse"), ("Forever", "For evigt"), ("username-login-disabled-oidc-unavailable", "Login med brugernavn og adgangskode er deaktiveret, og ingen OIDC-loginmetoder er tilgængelige."), + ("Use DRM screen capture", "Brug DRM-skærmoptagelse"), + ("drm-capture-tip", "Optager skærmen direkte fra grafikkortet via RustDesk-tjenesten uden Waylands forespørgsel om skærmdeling, også på login-skærmen. Virker muligvis ikke på alle enheder; hvis forbindelser stadig beder om skærmdeling, så slå dette fra eller brug X11. Ændring afbryder de aktuelle sessioner."), + ("wayland-drm-tip", "Prøv DRM-skærmoptagelse for ubemandet adgang under Wayland, eller brug X11, hvis det ikke virker."), + ("login-wayland-drm-tip", "Prøv DRM-skærmoptagelse for at få adgang til Waylands login-skærm, eller skift den til X11."), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 4200c4c25..abb070d8a 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Genehmigung anfordern"), ("Forever", "Für immer"), ("username-login-disabled-oidc-unavailable", "Die Anmeldung mit Benutzername und Passwort ist deaktiviert, und es sind keine OIDC-Anmeldemethoden verfügbar."), + ("Use DRM screen capture", "DRM-Bildschirmaufnahme verwenden"), + ("drm-capture-tip", "Nimmt den Bildschirm über den RustDesk-Dienst direkt von der Grafikkarte auf, ohne die Wayland-Abfrage zur Bildschirmfreigabe, auch auf dem Anmeldebildschirm. Funktioniert möglicherweise nicht auf jedem Gerät. Wenn Verbindungen weiterhin eine Bildschirmfreigabe verlangen, deaktivieren Sie dies oder verwenden Sie X11. Eine Änderung trennt die aktuellen Sitzungen."), + ("wayland-drm-tip", "Für unbeaufsichtigten Zugriff unter Wayland DRM-Bildschirmaufnahme versuchen, sonst X11 verwenden."), + ("login-wayland-drm-tip", "Für den Wayland-Anmeldebildschirm DRM-Bildschirmaufnahme versuchen oder auf X11 umstellen."), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 272edf7c4..5de90e4ca 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Αίτημα έγκρισης"), ("Forever", "Για πάντα"), ("username-login-disabled-oidc-unavailable", "Η σύνδεση με όνομα χρήστη και κωδικό πρόσβασης είναι απενεργοποιημένη και δεν υπάρχουν διαθέσιμες μέθοδοι σύνδεσης OIDC."), + ("Use DRM screen capture", "Χρήση καταγραφής οθόνης μέσω DRM"), + ("drm-capture-tip", "Καταγράφει την οθόνη απευθείας από την κάρτα γραφικών μέσω της υπηρεσίας RustDesk, χωρίς το αίτημα κοινής χρήσης οθόνης του Wayland, ακόμη και στην οθόνη εισόδου. Ενδέχεται να μη λειτουργεί σε όλες τις συσκευές· αν οι συνδέσεις εξακολουθούν να ζητούν κοινή χρήση οθόνης, απενεργοποιήστε το ή χρησιμοποιήστε X11. Η αλλαγή του αποσυνδέει τις τρέχουσες συνεδρίες."), + ("wayland-drm-tip", "Για πρόσβαση χωρίς επίβλεψη στο Wayland, δοκιμάστε την καταγραφή μέσω DRM ή χρησιμοποιήστε X11 αν δεν λειτουργεί."), + ("login-wayland-drm-tip", "Για πρόσβαση στην οθόνη εισόδου του Wayland, δοκιμάστε την καταγραφή μέσω DRM ή αλλάξτε την σε X11."), ].iter().cloned().collect(); } diff --git a/src/lang/en.rs b/src/lang/en.rs index d8e3202d1..3d8ddd8bf 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -293,5 +293,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("android-logs-folder-tip", "Choose Android → media to store log files."), ("install-directory-not-empty-tip", "The selected folder is not empty. Installation may delete existing data. Consider choosing a different folder."), ("username-login-disabled-oidc-unavailable", "Username and password login is disabled, and no OIDC login methods are available."), + ("drm-capture-tip", "Captures the screen directly from the graphics card through the RustDesk service, without the Wayland screen sharing prompt, including at the login screen. It may not work on every device; if connections still ask to share the screen, turn this off or use X11. Changing this disconnects current sessions."), + ("wayland-drm-tip", "For unattended access on Wayland, try DRM screen capture, or use X11 if it does not work."), + ("login-wayland-drm-tip", "To access the Wayland login screen, try DRM screen capture or switch it to X11."), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 34596c80a..99859166a 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Peti aprobon"), ("Forever", "Por ĉiam"), ("username-login-disabled-oidc-unavailable", "Ensaluto per uzantnomo kaj pasvorto estas malŝaltita, kaj neniuj OIDC-ensalutmetodoj estas disponeblaj."), + ("Use DRM screen capture", "Uzi DRM-ekrankapton"), + ("drm-capture-tip", "Kaptas la ekranon rekte de la grafika karto per la servo de RustDesk, sen la peto de Wayland pri ekrankundivido, ankaŭ ĉe la ensaluta ekrano. Eble ne funkcias sur ĉiu aparato; se konektoj ankoraŭ petas kundividi la ekranon, malŝaltu ĉi tion aŭ uzu X11. Ŝanĝo malkonektas la nunajn seancojn."), + ("wayland-drm-tip", "Por senĉeesta aliro ĉe Wayland, provu DRM-ekrankapton, aŭ uzu X11 se ĝi ne funkcias."), + ("login-wayland-drm-tip", "Por aliri la ensalutan ekranon de Wayland, provu DRM-ekrankapton aŭ ŝanĝu ĝin al X11."), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 095caa68c..b59b02477 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Solicitar aprobación"), ("Forever", "Para siempre"), ("username-login-disabled-oidc-unavailable", "El inicio de sesión con nombre de usuario y contraseña está deshabilitado y no hay métodos de inicio de sesión OIDC disponibles."), + ("Use DRM screen capture", "Usar captura de pantalla DRM"), + ("drm-capture-tip", "Captura la pantalla directamente desde la tarjeta gráfica a través del servicio de RustDesk, sin la solicitud de compartir pantalla de Wayland, incluso en la pantalla de inicio de sesión. Puede no funcionar en todos los dispositivos; si las conexiones siguen pidiendo compartir la pantalla, desactívelo o use X11. Cambiarlo desconecta las sesiones actuales."), + ("wayland-drm-tip", "Para acceso desatendido en Wayland, pruebe la captura de pantalla DRM o use X11 si no funciona."), + ("login-wayland-drm-tip", "Para acceder a la pantalla de inicio de sesión de Wayland, pruebe la captura DRM o cámbiela a X11."), ].iter().cloned().collect(); } diff --git a/src/lang/et.rs b/src/lang/et.rs index 4aa463348..b4642325a 100644 --- a/src/lang/et.rs +++ b/src/lang/et.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Küsi heakskiitu"), ("Forever", "Igavesti"), ("username-login-disabled-oidc-unavailable", "Kasutajanime ja parooliga sisselogimine on keelatud ja ühtegi OIDC sisselogimisviisi pole saadaval."), + ("Use DRM screen capture", "Kasuta DRM-ekraanihõivet"), + ("drm-capture-tip", "Hõivab ekraani RustDeski teenuse kaudu otse graafikakaardilt, ilma Waylandi ekraani jagamise päringuta, ka sisselogimisekraanil. Ei pruugi töötada igas seadmes; kui ühendused küsivad endiselt ekraani jagamist, lülita see välja või kasuta X11. Muutmine katkestab praegused seansid."), + ("wayland-drm-tip", "Järelvalveta juurdepääsuks Waylandis proovi DRM-ekraanihõivet või kasuta X11, kui see ei tööta."), + ("login-wayland-drm-tip", "Waylandi sisselogimisekraanile juurdepääsuks proovi DRM-ekraanihõivet või lülita see X11 peale."), ].iter().cloned().collect(); } diff --git a/src/lang/eu.rs b/src/lang/eu.rs index a3b360801..b081634cd 100644 --- a/src/lang/eu.rs +++ b/src/lang/eu.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Eskatu onespena"), ("Forever", "Betiko"), ("username-login-disabled-oidc-unavailable", "Erabiltzaile-izenarekin eta pasahitzarekin saioa hastea desgaituta dago, eta ez dago OIDC saioa hasteko metodorik erabilgarri."), + ("Use DRM screen capture", "Erabili DRM pantaila-kaptura"), + ("drm-capture-tip", "Pantaila zuzenean txartel grafikotik kapturatzen du RustDesk zerbitzuaren bidez, Wayland-en pantaila partekatzeko eskaerarik gabe, saio-hasierako pantailan ere bai. Baliteke gailu guztietan ez ibiltzea; konexioek pantaila partekatzeko eskatzen jarraitzen badute, desaktibatu hau edo erabili X11. Aldatzeak uneko saioak deskonektatzen ditu."), + ("wayland-drm-tip", "Wayland-en arretarik gabeko sarrerarako, probatu DRM pantaila-kaptura, edo erabili X11 ez badabil."), + ("login-wayland-drm-tip", "Wayland-en saio-hasierako pantailara sartzeko, probatu DRM pantaila-kaptura edo aldatu X11-ra."), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 444201fa4..40a880309 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "درخواست تأیید"), ("Forever", "برای همیشه"), ("username-login-disabled-oidc-unavailable", "ورود با نام کاربری و گذرواژه غیرفعال است و هیچ روش ورود OIDC در دسترس نیست."), + ("Use DRM screen capture", "استفاده از ضبط صفحه با DRM"), + ("drm-capture-tip", "صفحه را از طریق سرویس RustDesk مستقیماً از کارت گرافیک ضبط می‌کند، بدون درخواست اشتراک‌گذاری صفحه Wayland، حتی در صفحه ورود. ممکن است روی همه دستگاه‌ها کار نکند؛ اگر اتصال‌ها هنوز اجازه اشتراک‌گذاری صفحه می‌خواهند، این گزینه را خاموش کنید یا از X11 استفاده کنید. تغییر این گزینه نشست‌های فعلی را قطع می‌کند."), + ("wayland-drm-tip", "برای دسترسی بدون مراقبت در Wayland، ضبط صفحه با DRM را امتحان کنید و اگر کار نکرد از X11 استفاده کنید."), + ("login-wayland-drm-tip", "برای دسترسی به صفحه ورود Wayland، ضبط صفحه با DRM را امتحان کنید یا آن را به X11 تغییر دهید."), ].iter().cloned().collect(); } diff --git a/src/lang/fi.rs b/src/lang/fi.rs index 6ad4f8886..4c8fe801e 100644 --- a/src/lang/fi.rs +++ b/src/lang/fi.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Pyydä hyväksyntää"), ("Forever", "Ikuisesti"), ("username-login-disabled-oidc-unavailable", "Kirjautuminen käyttäjätunnuksella ja salasanalla on poistettu käytöstä, eikä OIDC-kirjautumistapoja ole saatavilla."), + ("Use DRM screen capture", "Käytä DRM-näytönkaappausta"), + ("drm-capture-tip", "Kaappaa näytön suoraan näytönohjaimelta RustDesk-palvelun kautta ilman Waylandin näytön jakamisen kehotetta, myös kirjautumisnäytössä. Ei välttämättä toimi kaikilla laitteilla; jos yhteydet pyytävät yhä näytön jakamista, poista tämä käytöstä tai käytä X11:tä. Muutos katkaisee nykyiset istunnot."), + ("wayland-drm-tip", "Kokeile valvomattomaan käyttöön Waylandissa DRM-näytönkaappausta, tai käytä X11:tä, jos se ei toimi."), + ("login-wayland-drm-tip", "Kokeile Waylandin kirjautumisnäyttöön DRM-näytönkaappausta tai vaihda se X11:een."), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 74f865c44..d6d8215dc 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Demander l'approbation"), ("Forever", "Pour toujours"), ("username-login-disabled-oidc-unavailable", "La connexion par nom d’utilisateur et mot de passe est désactivée et aucune méthode de connexion OIDC n’est disponible."), + ("Use DRM screen capture", "Utiliser la capture d’écran DRM"), + ("drm-capture-tip", "Capture l’écran directement depuis la carte graphique via le service RustDesk, sans la demande de partage d’écran de Wayland, y compris sur l’écran de connexion. Peut ne pas fonctionner sur tous les appareils ; si les connexions demandent toujours de partager l’écran, désactivez cette option ou utilisez X11. La modifier déconnecte les sessions en cours."), + ("wayland-drm-tip", "Pour un accès non assisté sous Wayland, essayez la capture d’écran DRM, ou utilisez X11 si elle ne fonctionne pas."), + ("login-wayland-drm-tip", "Pour accéder à l’écran de connexion Wayland, essayez la capture d’écran DRM ou passez-le sous X11."), ].iter().cloned().collect(); } diff --git a/src/lang/ge.rs b/src/lang/ge.rs index 730c3562a..83f69f60a 100644 --- a/src/lang/ge.rs +++ b/src/lang/ge.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "დამტკიცების მოთხოვნა"), ("Forever", "სამუდამოდ"), ("username-login-disabled-oidc-unavailable", "მომხმარებლის სახელითა და პაროლით შესვლა გამორთულია და OIDC-ით შესვლის მეთოდები ხელმისაწვდომი არ არის."), + ("Use DRM screen capture", "DRM-ით ეკრანის გადაღების გამოყენება"), + ("drm-capture-tip", "ეკრანს RustDesk სერვისის მეშვეობით პირდაპირ ვიდეობარათიდან იღებს, Wayland-ის ეკრანის გაზიარების მოთხოვნის გარეშე, შესვლის ეკრანზეც. შეიძლება ყველა მოწყობილობაზე არ იმუშაოს; თუ კავშირები კვლავ ითხოვენ ეკრანის გაზიარებას, გამორთეთ ეს ან გამოიყენეთ X11. ცვლილება მიმდინარე სესიებს წყვეტს."), + ("wayland-drm-tip", "Wayland-ზე ავტომატური წვდომისთვის სცადეთ DRM-ით ეკრანის გადაღება, ან გამოიყენეთ X11, თუ არ მუშაობს."), + ("login-wayland-drm-tip", "Wayland-ის შესვლის ეკრანზე წვდომისთვის სცადეთ DRM-ით გადაღება ან გადართეთ X11-ზე."), ].iter().cloned().collect(); } diff --git a/src/lang/gl.rs b/src/lang/gl.rs index ae6455083..a5d869836 100644 --- a/src/lang/gl.rs +++ b/src/lang/gl.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Solicitar aprobación"), ("Forever", "Para sempre"), ("username-login-disabled-oidc-unavailable", "O inicio de sesión con nome de usuario e contrasinal está desactivado e non hai métodos de inicio de sesión OIDC dispoñibles."), + ("Use DRM screen capture", "Usar a captura de pantalla DRM"), + ("drm-capture-tip", "Captura a pantalla directamente da tarxeta gráfica a través do servizo de RustDesk, sen a solicitude de compartir pantalla de Wayland, tamén na pantalla de inicio de sesión. Pode non funcionar en todos os dispositivos; se as conexións seguen pedindo compartir a pantalla, desactívao ou usa X11. Cambialo desconecta as sesións actuais."), + ("wayland-drm-tip", "Para acceso desatendido en Wayland, proba a captura de pantalla DRM ou usa X11 se non funciona."), + ("login-wayland-drm-tip", "Para acceder á pantalla de inicio de sesión de Wayland, proba a captura DRM ou cámbiaa a X11."), ].iter().cloned().collect(); } diff --git a/src/lang/gu.rs b/src/lang/gu.rs index 578477787..184800155 100644 --- a/src/lang/gu.rs +++ b/src/lang/gu.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "મંજૂરીની વિનંતી કરો"), ("Forever", "કાયમ માટે"), ("username-login-disabled-oidc-unavailable", "વપરાશકર્તાનામ અને પાસવર્ડ વડે લૉગિન અક્ષમ છે અને કોઈ OIDC લૉગિન પદ્ધતિ ઉપલબ્ધ નથી."), + ("Use DRM screen capture", "DRM સ્ક્રીન કેપ્ચરનો ઉપયોગ કરો"), + ("drm-capture-tip", "RustDesk સેવા દ્વારા સીધા ગ્રાફિક્સ કાર્ડમાંથી સ્ક્રીન કેપ્ચર કરે છે, Wayland ની સ્ક્રીન શેરિંગ પુષ્ટિ વિના, લોગિન સ્ક્રીન પર પણ. દરેક ઉપકરણ પર કામ ન પણ કરે; જો કનેક્શન હજુ પણ સ્ક્રીન શેર કરવાનું કહે, તો આ બંધ કરો અથવા X11 નો ઉપયોગ કરો. આ બદલવાથી વર્તમાન સત્રો ડિસ્કનેક્ટ થાય છે."), + ("wayland-drm-tip", "Wayland પર અનટેન્ડેડ ઍક્સેસ માટે DRM સ્ક્રીન કેપ્ચર અજમાવો, કામ ન કરે તો X11 નો ઉપયોગ કરો."), + ("login-wayland-drm-tip", "Wayland લોગિન સ્ક્રીન ઍક્સેસ કરવા DRM સ્ક્રીન કેપ્ચર અજમાવો અથવા તેને X11 પર બદલો."), ].iter().cloned().collect(); } diff --git a/src/lang/he.rs b/src/lang/he.rs index 3a05faf9c..ff13e918c 100644 --- a/src/lang/he.rs +++ b/src/lang/he.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "בקש אישור"), ("Forever", "לתמיד"), ("username-login-disabled-oidc-unavailable", "כניסה באמצעות שם משתמש וסיסמה מושבתת, ואין שיטות כניסה זמינות באמצעות OIDC."), + ("Use DRM screen capture", "שימוש בלכידת מסך באמצעות DRM"), + ("drm-capture-tip", "לוכד את המסך ישירות מכרטיס המסך דרך שירות RustDesk, ללא בקשת שיתוף המסך של Wayland, גם במסך ההתחברות. ייתכן שלא יעבוד בכל מכשיר; אם חיבורים עדיין מבקשים לשתף את המסך, כבה אפשרות זו או השתמש ב-X11. שינוי ההגדרה מנתק את ההפעלות הנוכחיות."), + ("wayland-drm-tip", "לגישה ללא ליווי ב-Wayland, נסה לכידת מסך באמצעות DRM, או השתמש ב-X11 אם זה לא עובד."), + ("login-wayland-drm-tip", "לגישה למסך ההתחברות של Wayland, נסה לכידת מסך באמצעות DRM או העבר אותו ל-X11."), ].iter().cloned().collect(); } diff --git a/src/lang/hi.rs b/src/lang/hi.rs index 64a07603a..a1cefaa11 100644 --- a/src/lang/hi.rs +++ b/src/lang/hi.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "स्वीकृति का अनुरोध करें"), ("Forever", "हमेशा के लिए"), ("username-login-disabled-oidc-unavailable", "उपयोगकर्ता नाम और पासवर्ड से लॉगिन अक्षम है और कोई OIDC लॉगिन विधि उपलब्ध नहीं है।"), + ("Use DRM screen capture", "DRM स्क्रीन कैप्चर का उपयोग करें"), + ("drm-capture-tip", "RustDesk सेवा के माध्यम से सीधे ग्राफ़िक्स कार्ड से स्क्रीन कैप्चर करता है, Wayland के स्क्रीन शेयरिंग पुष्टि संकेत के बिना, लॉगिन स्क्रीन पर भी। यह हर डिवाइस पर काम न करे; यदि कनेक्शन अब भी स्क्रीन साझा करने को कहें, तो इसे बंद करें या X11 का उपयोग करें। इसे बदलने से वर्तमान सत्र डिस्कनेक्ट हो जाते हैं।"), + ("wayland-drm-tip", "Wayland पर अनअटेंडेड एक्सेस के लिए DRM स्क्रीन कैप्चर आज़माएँ, काम न करे तो X11 का उपयोग करें।"), + ("login-wayland-drm-tip", "Wayland लॉगिन स्क्रीन एक्सेस करने के लिए DRM स्क्रीन कैप्चर आज़माएँ या इसे X11 पर बदलें।"), ].iter().cloned().collect(); } diff --git a/src/lang/hr.rs b/src/lang/hr.rs index 61315ab22..3aae7c660 100644 --- a/src/lang/hr.rs +++ b/src/lang/hr.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Zatraži odobrenje"), ("Forever", "Zauvijek"), ("username-login-disabled-oidc-unavailable", "Prijava korisničkim imenom i lozinkom je onemogućena i nema dostupnih načina prijave putem OIDC-a."), + ("Use DRM screen capture", "Koristi DRM snimanje zaslona"), + ("drm-capture-tip", "Snima zaslon izravno s grafičke kartice putem usluge RustDesk, bez Waylandova upita za dijeljenje zaslona, uključujući zaslon za prijavu. Možda neće raditi na svakom uređaju; ako veze i dalje traže dijeljenje zaslona, isključite ovo ili koristite X11. Promjena prekida trenutne sesije."), + ("wayland-drm-tip", "Za pristup bez nadzora na Waylandu isprobajte DRM snimanje zaslona ili koristite X11 ako ne radi."), + ("login-wayland-drm-tip", "Za pristup Waylandovu zaslonu za prijavu isprobajte DRM snimanje zaslona ili ga prebacite na X11."), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index fbb443231..b4faf442e 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Jóváhagyás kérése"), ("Forever", "Örökre"), ("username-login-disabled-oidc-unavailable", "A felhasználónévvel és jelszóval történő bejelentkezés le van tiltva, és nem érhető el OIDC bejelentkezési mód."), + ("Use DRM screen capture", "DRM-képernyőrögzítés használata"), + ("drm-capture-tip", "A RustDesk szolgáltatáson keresztül közvetlenül a videokártyáról rögzíti a képernyőt, a Wayland képernyőmegosztási kérése nélkül, a bejelentkezési képernyőn is. Nem biztos, hogy minden eszközön működik; ha a kapcsolatok továbbra is képernyőmegosztást kérnek, kapcsolja ki ezt, vagy használja az X11-et. A módosítás bontja az aktuális munkameneteket."), + ("wayland-drm-tip", "Felügyelet nélküli hozzáféréshez Waylanden próbálja ki a DRM-képernyőrögzítést, vagy használja az X11-et."), + ("login-wayland-drm-tip", "A Wayland bejelentkezési képernyőjéhez próbálja ki a DRM-képernyőrögzítést, vagy váltson X11-re."), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index dbd8060c9..b470aa512 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Minta persetujuan"), ("Forever", "Selamanya"), ("username-login-disabled-oidc-unavailable", "Login dengan nama pengguna dan kata sandi dinonaktifkan dan tidak ada metode login OIDC yang tersedia."), + ("Use DRM screen capture", "Gunakan tangkapan layar DRM"), + ("drm-capture-tip", "Menangkap layar langsung dari kartu grafis melalui layanan RustDesk, tanpa permintaan berbagi layar Wayland, termasuk di layar login. Mungkin tidak berfungsi di semua perangkat; jika koneksi masih meminta berbagi layar, matikan opsi ini atau gunakan X11. Mengubahnya akan memutus sesi saat ini."), + ("wayland-drm-tip", "Untuk akses tanpa pengawasan di Wayland, coba tangkapan layar DRM, atau gunakan X11 jika tidak berfungsi."), + ("login-wayland-drm-tip", "Untuk mengakses layar login Wayland, coba tangkapan layar DRM atau ubah ke X11."), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index bbdacb8d8..e71437d21 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Richiedi approvazione"), ("Forever", "Per sempre"), ("username-login-disabled-oidc-unavailable", "L'accesso con utente e password è disabilitato e non sono disponibili metodi di accesso OIDC."), + ("Use DRM screen capture", ""), + ("drm-capture-tip", ""), + ("wayland-drm-tip", ""), + ("login-wayland-drm-tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index e968c3acc..2f1ea9c2c 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "承認を要求"), ("Forever", "無期限"), ("username-login-disabled-oidc-unavailable", "ユーザー名とパスワードによるログインは無効になっており、利用可能な OIDC ログイン方法がありません。"), + ("Use DRM screen capture", "DRM による画面キャプチャを使用する"), + ("drm-capture-tip", "RustDesk サービスを通じてグラフィックカードから直接画面をキャプチャし、ログイン画面も含めて Wayland の画面共有の確認を表示しません。すべてのデバイスで動作するとは限りません。接続時に引き続き画面共有の確認が求められる場合は、これをオフにするか X11 を使用してください。この設定を変更すると現在のセッションは切断されます。"), + ("wayland-drm-tip", "Wayland で無人アクセスを行うには DRM 画面キャプチャを試し、動作しない場合は X11 を使用してください。"), + ("login-wayland-drm-tip", "Wayland のログイン画面にアクセスするには、DRM 画面キャプチャを試すか X11 に切り替えてください。"), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 38545cfd3..672cf1ff7 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "승인 요청"), ("Forever", "영구"), ("username-login-disabled-oidc-unavailable", "사용자 이름과 비밀번호를 통한 로그인이 비활성화되어 있으며 사용 가능한 OIDC 로그인 방법이 없습니다."), + ("Use DRM screen capture", "DRM 화면 캡처 사용"), + ("drm-capture-tip", "RustDesk 서비스를 통해 그래픽 카드에서 직접 화면을 캡처하므로 로그인 화면을 포함해 Wayland 화면 공유 확인이 표시되지 않습니다. 모든 장치에서 작동하지 않을 수 있습니다. 연결 시 여전히 화면 공유를 요청하면 이 옵션을 끄거나 X11을 사용하세요. 이 설정을 변경하면 현재 세션의 연결이 끊어집니다."), + ("wayland-drm-tip", "Wayland에서 무인 접근을 하려면 DRM 화면 캡처를 사용해 보고, 작동하지 않으면 X11을 사용하세요."), + ("login-wayland-drm-tip", "Wayland 로그인 화면에 접근하려면 DRM 화면 캡처를 사용해 보거나 X11로 전환하세요."), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 01657350c..9739f11ba 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Мақұлдауды сұрау"), ("Forever", "Мәңгі"), ("username-login-disabled-oidc-unavailable", "Пайдаланушы аты мен құпиясөз арқылы кіру өшірілген және қолжетімді OIDC кіру әдістері жоқ."), + ("Use DRM screen capture", "DRM арқылы экранды түсіруді пайдалану"), + ("drm-capture-tip", "Экранды RustDesk қызметі арқылы тікелей бейнекартадан түсіреді, Wayland экранды бөлісу сұрауынсыз, кіру экранында да. Барлық құрылғыда жұмыс істемеуі мүмкін; қосылымдар әлі де экранды бөлісуді сұраса, мұны өшіріңіз немесе X11 қолданыңыз. Өзгерту ағымдағы сеанстарды үзеді."), + ("wayland-drm-tip", "Wayland-та қадағалаусыз қолжетімділік үшін DRM арқылы түсіруді көріңіз, жұмыс істемесе X11 қолданыңыз."), + ("login-wayland-drm-tip", "Wayland кіру экранына қол жеткізу үшін DRM арқылы түсіруді көріңіз немесе оны X11-ге ауыстырыңыз."), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index e8fe05a3b..3b8c4737e 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Prašyti patvirtinimo"), ("Forever", "Visam laikui"), ("username-login-disabled-oidc-unavailable", "Prisijungimas naudojant naudotojo vardą ir slaptažodį išjungtas ir nėra galimų OIDC prisijungimo būdų."), + ("Use DRM screen capture", "Naudoti DRM ekrano fiksavimą"), + ("drm-capture-tip", "Fiksuoja ekraną tiesiai iš vaizdo plokštės per RustDesk paslaugą, be Wayland ekrano bendrinimo užklausos, taip pat ir prisijungimo ekrane. Gali veikti ne visuose įrenginiuose; jei ryšiai vis dar prašo bendrinti ekraną, išjunkite šią parinktį arba naudokite X11. Pakeitus nutraukiami esami seansai."), + ("wayland-drm-tip", "Neprižiūrimai prieigai Wayland aplinkoje išbandykite DRM ekrano fiksavimą arba naudokite X11, jei neveikia."), + ("login-wayland-drm-tip", "Norėdami pasiekti Wayland prisijungimo ekraną, išbandykite DRM fiksavimą arba perjunkite jį į X11."), ].iter().cloned().collect(); } diff --git a/src/lang/lv.rs b/src/lang/lv.rs index 7cb400dbd..bb37c99b3 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Pieprasīt apstiprinājumu"), ("Forever", "Uz visiem laikiem"), ("username-login-disabled-oidc-unavailable", "Pieteikšanās ar lietotājvārdu un paroli ir atspējota, un nav pieejamu OIDC pieteikšanās metožu."), + ("Use DRM screen capture", "Izmantot DRM ekrāna tveršanu"), + ("drm-capture-tip", "Tver ekrānu tieši no videokartes, izmantojot RustDesk pakalpojumu, bez Wayland ekrāna kopīgošanas pieprasījuma, arī pieteikšanās ekrānā. Var nedarboties visās ierīcēs; ja savienojumi joprojām pieprasa kopīgot ekrānu, izslēdziet šo vai izmantojiet X11. Mainot šo iestatījumu, pašreizējās sesijas tiek atvienotas."), + ("wayland-drm-tip", "Neuzraudzītai piekļuvei Wayland vidē izmēģiniet DRM ekrāna tveršanu vai izmantojiet X11, ja tā nedarbojas."), + ("login-wayland-drm-tip", "Lai piekļūtu Wayland pieteikšanās ekrānam, izmēģiniet DRM ekrāna tveršanu vai pārslēdziet to uz X11."), ].iter().cloned().collect(); } diff --git a/src/lang/ml.rs b/src/lang/ml.rs index 8aad8000a..0b38c0bdd 100644 --- a/src/lang/ml.rs +++ b/src/lang/ml.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "അംഗീകാരം അഭ്യർത്ഥിക്കുക"), ("Forever", "എന്നേക്കും"), ("username-login-disabled-oidc-unavailable", "ഉപയോക്തൃനാമവും പാസ്‌വേഡും ഉപയോഗിച്ചുള്ള ലോഗിൻ പ്രവർത്തനരഹിതമാക്കിയിരിക്കുന്നു, കൂടാതെ OIDC ലോഗിൻ രീതികളൊന്നും ലഭ്യമല്ല."), + ("Use DRM screen capture", "DRM സ്ക്രീൻ ക്യാപ്‌ചർ ഉപയോഗിക്കുക"), + ("drm-capture-tip", "RustDesk സേവനം വഴി ഗ്രാഫിക്സ് കാർഡിൽ നിന്ന് നേരിട്ട് സ്ക്രീൻ ക്യാപ്‌ചർ ചെയ്യുന്നു, Wayland-ന്റെ സ്ക്രീൻ പങ്കിടൽ അനുമതി ചോദിക്കാതെ, ലോഗിൻ സ്ക്രീനിലും. എല്ലാ ഉപകരണങ്ങളിലും പ്രവർത്തിച്ചേക്കില്ല; കണക്ഷനുകൾ ഇപ്പോഴും സ്ക്രീൻ പങ്കിടാൻ ആവശ്യപ്പെടുന്നുവെങ്കിൽ, ഇത് ഓഫാക്കുക അല്ലെങ്കിൽ X11 ഉപയോഗിക്കുക. ഇത് മാറ്റുന്നത് നിലവിലെ സെഷനുകൾ വിച്ഛേദിക്കും."), + ("wayland-drm-tip", "Wayland-ൽ ആളില്ലാതെയുള്ള ആക്സസിന് DRM സ്ക്രീൻ ക്യാപ്‌ചർ പരീക്ഷിക്കുക, പ്രവർത്തിച്ചില്ലെങ്കിൽ X11 ഉപയോഗിക്കുക."), + ("login-wayland-drm-tip", "Wayland ലോഗിൻ സ്ക്രീനിൽ പ്രവേശിക്കാൻ DRM സ്ക്രീൻ ക്യാപ്‌ചർ പരീക്ഷിക്കുക അല്ലെങ്കിൽ അത് X11-ലേക്ക് മാറ്റുക."), ].iter().cloned().collect(); } diff --git a/src/lang/nb.rs b/src/lang/nb.rs index 5ae3c349d..e8a717662 100644 --- a/src/lang/nb.rs +++ b/src/lang/nb.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Be om godkjenning"), ("Forever", "For alltid"), ("username-login-disabled-oidc-unavailable", "Innlogging med brukernavn og passord er deaktivert, og ingen OIDC-innloggingsmetoder er tilgjengelige."), + ("Use DRM screen capture", "Bruk DRM-skjermopptak"), + ("drm-capture-tip", "Tar opp skjermen direkte fra grafikkortet via RustDesk-tjenesten, uten Waylands forespørsel om skjermdeling, også på påloggingsskjermen. Fungerer kanskje ikke på alle enheter; hvis tilkoblinger fortsatt ber om skjermdeling, slå dette av eller bruk X11. Endring kobler fra gjeldende økter."), + ("wayland-drm-tip", "Prøv DRM-skjermopptak for uovervåket tilgang på Wayland, eller bruk X11 hvis det ikke virker."), + ("login-wayland-drm-tip", "Prøv DRM-skjermopptak for å nå Waylands påloggingsskjerm, eller bytt den til X11."), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index d3f105cda..53e97f7f5 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Goedkeuring aanvragen"), ("Forever", "Voor altijd"), ("username-login-disabled-oidc-unavailable", "Inloggen met gebruikersnaam en wachtwoord is uitgeschakeld en er zijn geen OIDC-inlogmethoden beschikbaar."), + ("Use DRM screen capture", "DRM-schermopname gebruiken"), + ("drm-capture-tip", "Neemt het scherm via de RustDesk-service rechtstreeks van de grafische kaart op, zonder de Wayland-vraag om het scherm te delen, ook op het aanmeldingsscherm. Werkt mogelijk niet op elk apparaat; als verbindingen nog steeds vragen om het scherm te delen, schakel dit dan uit of gebruik X11. Wijzigen verbreekt de huidige sessies."), + ("wayland-drm-tip", "Probeer voor onbeheerde toegang onder Wayland DRM-schermopname, of gebruik X11 als dat niet werkt."), + ("login-wayland-drm-tip", "Probeer voor het Wayland-aanmeldingsscherm DRM-schermopname of zet het om naar X11."), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 1791806c8..e8c1b4404 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Poproś o zatwierdzenie"), ("Forever", "Na zawsze"), ("username-login-disabled-oidc-unavailable", "Logowanie za pomocą nazwy użytkownika i hasła jest wyłączone i nie ma dostępnych metod logowania OIDC."), + ("Use DRM screen capture", "Użyj przechwytywania ekranu przez DRM"), + ("drm-capture-tip", "Przechwytuje ekran bezpośrednio z karty graficznej przez usługę RustDesk, bez pytania Wayland o udostępnienie ekranu, również na ekranie logowania. Może nie działać na każdym urządzeniu; jeśli połączenia nadal proszą o udostępnienie ekranu, wyłącz tę opcję lub użyj X11. Zmiana tej opcji rozłącza bieżące sesje."), + ("wayland-drm-tip", "Dla dostępu nienadzorowanego w Wayland wypróbuj przechwytywanie przez DRM lub użyj X11, jeśli nie działa."), + ("login-wayland-drm-tip", "Aby uzyskać dostęp do ekranu logowania Wayland, wypróbuj przechwytywanie przez DRM lub przełącz go na X11."), ].iter().cloned().collect(); } diff --git a/src/lang/pt_BR.rs b/src/lang/pt_BR.rs index 6cf176622..c4ca25915 100644 --- a/src/lang/pt_BR.rs +++ b/src/lang/pt_BR.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Solicitar aprovação"), ("Forever", "Permanentemente"), ("username-login-disabled-oidc-unavailable", "O login com nome de usuário e senha está desativado e não há métodos de login OIDC disponíveis."), + ("Use DRM screen capture", "Usar captura de tela DRM"), + ("drm-capture-tip", "Captura a tela diretamente da placa de vídeo pelo serviço do RustDesk, sem o pedido de compartilhamento de tela do Wayland, inclusive na tela de login. Pode não funcionar em todos os dispositivos; se as conexões continuarem pedindo para compartilhar a tela, desative isto ou use o X11. Alterar isto desconecta as sessões atuais."), + ("wayland-drm-tip", "Para acesso autônomo no Wayland, experimente a captura de tela DRM ou use o X11 se não funcionar."), + ("login-wayland-drm-tip", "Para acessar a tela de login do Wayland, experimente a captura de tela DRM ou mude-a para o X11."), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index b7401d527..0a16bc776 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Solicitar aprovação"), ("Forever", "Para sempre"), ("username-login-disabled-oidc-unavailable", "O início de sessão com nome de utilizador e palavra-passe está desativado e não existem métodos de início de sessão OIDC disponíveis."), + ("Use DRM screen capture", "Utilizar captura de ecrã DRM"), + ("drm-capture-tip", "Captura o ecrã diretamente da placa gráfica através do serviço do RustDesk, sem o pedido de partilha de ecrã do Wayland, incluindo no ecrã de início de sessão. Pode não funcionar em todos os dispositivos; se as ligações continuarem a pedir a partilha do ecrã, desative isto ou utilize o X11. Alterar isto desliga as sessões atuais."), + ("wayland-drm-tip", "Para acesso não assistido no Wayland, experimente a captura de ecrã DRM ou utilize o X11 se não funcionar."), + ("login-wayland-drm-tip", "Para aceder ao ecrã de início de sessão do Wayland, experimente a captura DRM ou mude-o para X11."), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index 95a4c34b1..b25b033a3 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Solicită aprobarea"), ("Forever", "Pentru totdeauna"), ("username-login-disabled-oidc-unavailable", "Autentificarea cu nume de utilizator și parolă este dezactivată și nu sunt disponibile metode de autentificare OIDC."), + ("Use DRM screen capture", "Folosește captura de ecran DRM"), + ("drm-capture-tip", "Capturează ecranul direct de pe placa grafică prin serviciul RustDesk, fără solicitarea Wayland de partajare a ecranului, inclusiv pe ecranul de conectare. Este posibil să nu funcționeze pe toate dispozitivele; dacă conexiunile cer în continuare partajarea ecranului, dezactivează această opțiune sau folosește X11. Modificarea ei deconectează sesiunile curente."), + ("wayland-drm-tip", "Pentru acces nesupravegheat pe Wayland, încearcă captura de ecran DRM sau folosește X11 dacă nu funcționează."), + ("login-wayland-drm-tip", "Pentru a accesa ecranul de conectare Wayland, încearcă captura DRM sau comută-l pe X11."), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 6fd6dc872..4b32f9cae 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Запросить одобрение"), ("Forever", "Навсегда"), ("username-login-disabled-oidc-unavailable", "Вход по имени пользователя и паролю отключён, и нет доступных способов входа через OIDC."), + ("Use DRM screen capture", "Использовать захват экрана через DRM"), + ("drm-capture-tip", "Захватывает экран напрямую с видеокарты через службу RustDesk, без запроса Wayland на демонстрацию экрана, в том числе на экране входа. Может работать не на всех устройствах; если подключения по-прежнему запрашивают демонстрацию экрана, отключите этот параметр или используйте X11. Изменение параметра разрывает текущие сеансы."), + ("wayland-drm-tip", "Для автоматического доступа в Wayland попробуйте захват экрана через DRM, а если не работает — X11."), + ("login-wayland-drm-tip", "Для доступа к экрану входа Wayland попробуйте захват экрана через DRM или переключите его на X11."), ].iter().cloned().collect(); } diff --git a/src/lang/sc.rs b/src/lang/sc.rs index f4b8a6b83..442892a07 100644 --- a/src/lang/sc.rs +++ b/src/lang/sc.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Pedi s'aprovatzione"), ("Forever", "Pro semper"), ("username-login-disabled-oidc-unavailable", "S'atzessu cun su nùmene utente e sa crae est disabilitadu, e non b'at perunu mètodu de atzessu OIDC a disponimentu."), + ("Use DRM screen capture", ""), + ("drm-capture-tip", ""), + ("wayland-drm-tip", ""), + ("login-wayland-drm-tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 93ef29d66..4f7a8fb6e 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Požiadať o schválenie"), ("Forever", "Navždy"), ("username-login-disabled-oidc-unavailable", "Prihlásenie používateľským menom a heslom je zakázané a nie sú k dispozícii žiadne spôsoby prihlásenia cez OIDC."), + ("Use DRM screen capture", "Použiť snímanie obrazovky cez DRM"), + ("drm-capture-tip", "Sníma obrazovku priamo z grafickej karty prostredníctvom služby RustDesk, bez výzvy Waylandu na zdieľanie obrazovky, a to aj na prihlasovacej obrazovke. Nemusí fungovať na všetkých zariadeniach; ak pripojenia stále žiadajú o zdieľanie obrazovky, vypnite túto voľbu alebo použite X11. Zmena tejto voľby odpojí aktuálne relácie."), + ("wayland-drm-tip", "Pre bezobslužný prístup vo Waylande skúste snímanie obrazovky cez DRM, alebo použite X11, ak nefunguje."), + ("login-wayland-drm-tip", "Pre prístup k prihlasovacej obrazovke Waylandu skúste snímanie cez DRM alebo ju prepnite na X11."), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index b51bba6c7..35c004ab4 100644 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Zahtevaj odobritev"), ("Forever", "Za vedno"), ("username-login-disabled-oidc-unavailable", "Prijava z uporabniškim imenom in geslom je onemogočena in na voljo ni nobenega načina prijave prek OIDC."), + ("Use DRM screen capture", "Uporabi zajem zaslona prek DRM"), + ("drm-capture-tip", "Zajema zaslon neposredno z grafične kartice prek storitve RustDesk, brez Waylandove zahteve za deljenje zaslona, tudi na zaslonu za prijavo. Morda ne bo delovalo na vseh napravah; če povezave še vedno zahtevajo deljenje zaslona, to izklopite ali uporabite X11. Sprememba prekine trenutne seje."), + ("wayland-drm-tip", "Za nespremljan dostop v Waylandu poskusite zajem zaslona prek DRM ali uporabite X11, če ne deluje."), + ("login-wayland-drm-tip", "Za dostop do Waylandovega zaslona za prijavo poskusite zajem prek DRM ali ga preklopite na X11."), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 2a0625fd8..d229dcbd6 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Kërko miratim"), ("Forever", "Përgjithmonë"), ("username-login-disabled-oidc-unavailable", "Hyrja me emër përdoruesi dhe fjalëkalim është çaktivizuar dhe nuk ka metoda hyrjeje OIDC të disponueshme."), + ("Use DRM screen capture", "Përdor kapjen e ekranit me DRM"), + ("drm-capture-tip", "Kap ekranin drejtpërdrejt nga karta grafike përmes shërbimit RustDesk, pa kërkesën e Wayland për ndarjen e ekranit, edhe në ekranin e hyrjes. Mund të mos funksionojë në çdo pajisje; nëse lidhjet ende kërkojnë ndarjen e ekranit, çaktivizojeni këtë ose përdorni X11. Ndryshimi i tij shkëput seancat aktuale."), + ("wayland-drm-tip", "Për akses pa mbikëqyrje në Wayland, provoni kapjen e ekranit me DRM ose përdorni X11 nëse nuk funksionon."), + ("login-wayland-drm-tip", "Për të hyrë në ekranin e hyrjes së Wayland, provoni kapjen me DRM ose kalojeni në X11."), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 6cadf6af2..c8e163425 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Zatraži odobrenje"), ("Forever", "Zauvek"), ("username-login-disabled-oidc-unavailable", "Prijava korisničkim imenom i lozinkom je onemogućena i nema dostupnih načina prijave putem OIDC-a."), + ("Use DRM screen capture", "Koristi DRM snimanje ekrana"), + ("drm-capture-tip", "Snima ekran direktno sa grafičke kartice preko RustDesk servisa, bez Wayland upita za deljenje ekrana, uključujući ekran za prijavu. Možda neće raditi na svakom uređaju; ako veze i dalje traže deljenje ekrana, isključite ovo ili koristite X11. Promena prekida trenutne sesije."), + ("wayland-drm-tip", "Za pristup bez nadzora na Waylandu probajte DRM snimanje ekrana ili koristite X11 ako ne radi."), + ("login-wayland-drm-tip", "Za pristup Wayland ekranu za prijavu probajte DRM snimanje ekrana ili ga prebacite na X11."), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index a83261be1..93d65edb5 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Begär godkännande"), ("Forever", "För alltid"), ("username-login-disabled-oidc-unavailable", "Inloggning med användarnamn och lösenord är inaktiverad, och inga OIDC-inloggningsmetoder är tillgängliga."), + ("Use DRM screen capture", "Använd DRM-skärminspelning"), + ("drm-capture-tip", "Fångar skärmen direkt från grafikkortet via RustDesk-tjänsten, utan Waylands fråga om skärmdelning, även på inloggningsskärmen. Fungerar kanske inte på alla enheter; om anslutningar fortfarande ber om skärmdelning, stäng av detta eller använd X11. Att ändra detta kopplar från aktuella sessioner."), + ("wayland-drm-tip", "Prova DRM-skärminspelning för obevakad åtkomst på Wayland, eller använd X11 om det inte fungerar."), + ("login-wayland-drm-tip", "Prova DRM-skärminspelning för att nå Waylands inloggningsskärm, eller byt den till X11."), ].iter().cloned().collect(); } diff --git a/src/lang/ta.rs b/src/lang/ta.rs index 2433df617..ebf554df0 100644 --- a/src/lang/ta.rs +++ b/src/lang/ta.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "ஒப்புதல் கோரவும்"), ("Forever", "என்றென்றும்"), ("username-login-disabled-oidc-unavailable", "பயனர்பெயர் மற்றும் கடவுச்சொல் மூலம் உள்நுழைவது முடக்கப்பட்டுள்ளது, மேலும் OIDC உள்நுழைவு முறைகள் எதுவும் கிடைக்கவில்லை."), + ("Use DRM screen capture", "DRM திரைப் பிடிப்பைப் பயன்படுத்து"), + ("drm-capture-tip", "RustDesk சேவை மூலம் கிராஃபிக்ஸ் அட்டையிலிருந்து நேரடியாகத் திரையைப் பிடிக்கிறது; உள்நுழைவுத் திரை உட்பட Wayland திரைப் பகிர்வு உறுதிப்படுத்தல் கேட்கப்படாது. எல்லா சாதனங்களிலும் வேலை செய்யாமல் போகலாம்; இணைப்புகள் இன்னும் திரையைப் பகிரக் கேட்டால், இதை முடக்கவும் அல்லது X11 ஐப் பயன்படுத்தவும். இதை மாற்றினால் தற்போதைய அமர்வுகள் துண்டிக்கப்படும்."), + ("wayland-drm-tip", "Wayland இல் கவனிப்பற்ற அணுகலுக்கு DRM திரைப் பிடிப்பை முயற்சிக்கவும், வேலை செய்யாவிட்டால் X11 ஐப் பயன்படுத்தவும்."), + ("login-wayland-drm-tip", "Wayland உள்நுழைவுத் திரையை அணுக DRM திரைப் பிடிப்பை முயற்சிக்கவும் அல்லது அதை X11 க்கு மாற்றவும்."), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 51aab588e..987105eba 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", ""), ("Forever", ""), ("username-login-disabled-oidc-unavailable", ""), + ("Use DRM screen capture", ""), + ("drm-capture-tip", ""), + ("wayland-drm-tip", ""), + ("login-wayland-drm-tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 0986f0893..2c5a15922 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "ขออนุมัติ"), ("Forever", "ตลอดไป"), ("username-login-disabled-oidc-unavailable", "การเข้าสู่ระบบด้วยชื่อผู้ใช้และรหัสผ่านถูกปิดใช้งาน และไม่มีวิธีเข้าสู่ระบบผ่าน OIDC ที่พร้อมใช้งาน"), + ("Use DRM screen capture", "ใช้การจับภาพหน้าจอผ่าน DRM"), + ("drm-capture-tip", "จับภาพหน้าจอโดยตรงจากการ์ดจอผ่านบริการ RustDesk โดยไม่มีคำขอแชร์หน้าจอของ Wayland รวมถึงที่หน้าจอเข้าสู่ระบบ อาจใช้ไม่ได้กับทุกอุปกรณ์ หากการเชื่อมต่อยังขอให้แชร์หน้าจออยู่ ให้ปิดตัวเลือกนี้หรือใช้ X11 การเปลี่ยนตัวเลือกนี้จะตัดการเชื่อมต่อเซสชันปัจจุบัน"), + ("wayland-drm-tip", "สำหรับการเข้าถึงแบบไม่มีผู้ดูแลบน Wayland ให้ลองจับภาพหน้าจอผ่าน DRM หรือใช้ X11 หากใช้ไม่ได้"), + ("login-wayland-drm-tip", "หากต้องการเข้าถึงหน้าจอเข้าสู่ระบบของ Wayland ให้ลองจับภาพผ่าน DRM หรือเปลี่ยนเป็น X11"), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index f756a1f3c..fbf047d86 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Onay iste"), ("Forever", "Sonsuza dek"), ("username-login-disabled-oidc-unavailable", "Kullanıcı adı ve parola ile giriş devre dışı bırakılmış ve kullanılabilir OIDC giriş yöntemi yok."), + ("Use DRM screen capture", "DRM ekran yakalamayı kullan"), + ("drm-capture-tip", "Ekranı RustDesk hizmeti aracılığıyla doğrudan ekran kartından yakalar; giriş ekranı dahil Wayland ekran paylaşımı onayı istenmez. Her cihazda çalışmayabilir; bağlantılar hâlâ ekran paylaşımı istiyorsa bunu kapatın veya X11 kullanın. Bunu değiştirmek mevcut oturumların bağlantısını keser."), + ("wayland-drm-tip", "Wayland'de gözetimsiz erişim için DRM ekran yakalamayı deneyin, çalışmazsa X11 kullanın."), + ("login-wayland-drm-tip", "Wayland giriş ekranına erişmek için DRM ekran yakalamayı deneyin veya ekranı X11'e geçirin."), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index bc43d4583..fae623f6c 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "請求批准"), ("Forever", "永久"), ("username-login-disabled-oidc-unavailable", "使用者名稱和密碼登入已停用,且沒有可用的 OIDC 登入方式。"), + ("Use DRM screen capture", "使用 DRM 擷取螢幕"), + ("drm-capture-tip", "透過 RustDesk 服務直接從顯示卡擷取螢幕,不會再跳出 Wayland 的螢幕分享確認,登入畫面也能使用。並非所有裝置都支援;如果連線時仍要求確認螢幕分享,請關閉此選項或改用 X11。變更此選項會中斷目前的工作階段。"), + ("wayland-drm-tip", "如需在 Wayland 上無人值守存取,請嘗試 DRM 擷取螢幕;若無法運作,請使用 X11。"), + ("login-wayland-drm-tip", "如需存取 Wayland 登入畫面,請嘗試 DRM 擷取螢幕,或將其切換到 X11。"), ].iter().cloned().collect(); } diff --git a/src/lang/uk.rs b/src/lang/uk.rs index 7dedaec30..15b48ee48 100644 --- a/src/lang/uk.rs +++ b/src/lang/uk.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Запросити схвалення"), ("Forever", "Назавжди"), ("username-login-disabled-oidc-unavailable", "Вхід за іменем користувача та паролем вимкнено, і немає доступних способів входу через OIDC."), + ("Use DRM screen capture", "Використовувати захоплення екрана через DRM"), + ("drm-capture-tip", "Захоплює екран безпосередньо з відеокарти через службу RustDesk, без запиту Wayland на спільний доступ до екрана, зокрема на екрані входу. Може працювати не на всіх пристроях; якщо підключення й далі запитують спільний доступ до екрана, вимкніть це або використовуйте X11. Зміна цього параметра розриває поточні сеанси."), + ("wayland-drm-tip", "Для автоматичного доступу у Wayland спробуйте захоплення екрана через DRM, а якщо не працює — X11."), + ("login-wayland-drm-tip", "Для доступу до екрана входу Wayland спробуйте захоплення через DRM або перемкніть його на X11."), ].iter().cloned().collect(); } diff --git a/src/lang/ur.rs b/src/lang/ur.rs index 51d4abbf6..f11c7ff20 100644 --- a/src/lang/ur.rs +++ b/src/lang/ur.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "منظوری کی درخواست کریں"), ("Forever", "ہمیشہ کے لیے"), ("username-login-disabled-oidc-unavailable", "صارف نام اور پاس ورڈ کے ذریعے لاگ ان غیر فعال ہے اور OIDC کے ذریعے لاگ ان کا کوئی طریقہ دستیاب نہیں ہے۔"), + ("Use DRM screen capture", "DRM اسکرین کیپچر استعمال کریں"), + ("drm-capture-tip", "RustDesk سروس کے ذریعے براہِ راست گرافکس کارڈ سے اسکرین کیپچر کرتا ہے، Wayland کی اسکرین شیئرنگ کی تصدیق کے بغیر، لاگ ان اسکرین پر بھی۔ ہو سکتا ہے یہ ہر ڈیوائس پر کام نہ کرے؛ اگر کنکشن اب بھی اسکرین شیئر کرنے کا کہیں تو اسے بند کریں یا X11 استعمال کریں۔ اسے تبدیل کرنے سے موجودہ سیشن منقطع ہو جاتے ہیں۔"), + ("wayland-drm-tip", "Wayland پر بغیر نگرانی رسائی کے لیے DRM اسکرین کیپچر آزمائیں، کام نہ کرے تو X11 استعمال کریں۔"), + ("login-wayland-drm-tip", "Wayland لاگ ان اسکرین تک رسائی کے لیے DRM اسکرین کیپچر آزمائیں یا اسے X11 پر منتقل کریں۔"), ].iter().cloned().collect(); } diff --git a/src/lang/vi.rs b/src/lang/vi.rs index 2271e1b5e..2ef1f57cf 100644 --- a/src/lang/vi.rs +++ b/src/lang/vi.rs @@ -827,5 +827,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Request approval", "Yêu cầu phê duyệt"), ("Forever", "Vĩnh viễn"), ("username-login-disabled-oidc-unavailable", "Đăng nhập bằng tên người dùng và mật khẩu đã bị vô hiệu hóa và không có phương thức đăng nhập OIDC nào khả dụng."), + ("Use DRM screen capture", "Dùng chụp màn hình qua DRM"), + ("drm-capture-tip", "Chụp màn hình trực tiếp từ card đồ họa thông qua dịch vụ RustDesk, không cần xác nhận chia sẻ màn hình của Wayland, kể cả ở màn hình đăng nhập. Có thể không hoạt động trên mọi thiết bị; nếu kết nối vẫn yêu cầu chia sẻ màn hình, hãy tắt tùy chọn này hoặc dùng X11. Thay đổi tùy chọn này sẽ ngắt các phiên hiện tại."), + ("wayland-drm-tip", "Để truy cập không giám sát trên Wayland, hãy thử chụp màn hình qua DRM, hoặc dùng X11 nếu không hoạt động."), + ("login-wayland-drm-tip", "Để truy cập màn hình đăng nhập Wayland, hãy thử chụp màn hình qua DRM hoặc chuyển nó sang X11."), ].iter().cloned().collect(); } diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 02490e4d7..aa9672df4 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -67,7 +67,11 @@ lazy_static::lazy_static! { let x11 = base::platform::linux::is_x11_or_headless(); #[cfg(feature = "drm")] { - if x11 && !display_server_forced() && is_login_screen_wayland() { + if x11 + && drm_capture_enabled() + && !display_server_forced() + && is_login_screen_wayland() + { log::info!( "drm: seat0 is a Wayland login screen that reads as x11 upstream; \ treating it as Wayland so the DRM path is not disabled at the one \ @@ -393,7 +397,7 @@ pub struct xcb_xfixes_get_cursor_image { pub fn is_login_screen_wayland() -> bool { let values = get_values_of_seat0_with_gdm_wayland(&[0, 2, 1]); #[cfg(feature = "drm")] - if is_wayland_tty_greeter(&values[0], &values[2]) { + if drm_capture_enabled() && is_wayland_tty_greeter(&values[0], &values[2]) { return true; } is_gdm_user(&values[1]) && get_display_server_of_session(&values[0]) == DISPLAY_SERVER_WAYLAND @@ -500,6 +504,28 @@ mod tty_greeter_tests { } } +/// The root service sets this for a greeter `--server`: that process reads the greeter account's +/// config, which has not synced from root yet when `IS_X11` is computed. +#[cfg(feature = "drm")] +pub(crate) const ENV_DRM_CAPTURE: &str = "RUSTDESK_DRM_CAPTURE"; + +/// DRM capture is compiled in and `allow-drm-capture` is on. While it is off, the drm paths in +/// this crate run as a build without it. The Wayland enumeration in `base` and `scrap` does not +/// read it: with no compositor named in the environment it probes the seat's socket and backs +/// off after a failure, and it logs an enumeration failure once until the next success. +pub fn drm_capture_enabled() -> bool { + #[cfg(feature = "drm")] + { + use base::config::keys::OPTION_ALLOW_DRM_CAPTURE; + std::env::var(ENV_DRM_CAPTURE).as_deref() == Ok("Y") + || Config::get_bool_option(OPTION_ALLOW_DRM_CAPTURE) + } + #[cfg(not(feature = "drm"))] + { + false + } +} + /// An explicit `RUSTDESK_FORCED_DISPLAY_SERVER` is an operator override, and the root service /// forwards it to the per-user server on purpose: the greeter correction may only fix an /// AUTO-detected answer, never argue with the operator — a half-applied override would leave @@ -1095,6 +1121,10 @@ fn try_start_server_(desktop: Option<&Desktop>) -> ResultType> { } append_audio_latency_envs(&mut envs, |key| std::env::var(key).ok()); + #[cfg(feature = "drm")] + if desktop.is_login_wayland() && drm_capture_enabled() { + envs.push((ENV_DRM_CAPTURE, "Y".to_owned())); + } envs.push(( "TERM", @@ -1265,29 +1295,6 @@ pub fn start_os_service() { allow_err!(crate::ipc::start(crate::POSTFIX_SERVICE)); }); - // DRM/KMS capture producer (opt-in `drm` feature): a dedicated thread + runtime that streams - // scanout frames to the user `--server` over the `_drm` service-scoped channel. Runs here - // because this process is the root service that already holds CAP_SYS_ADMIN for the in-process - // (direct-mode) libdrmtap read. - // - // Builder, like every other thread this feature starts: `thread::spawn` PANICS if the thread - // cannot be created (EAGAIN under a thread-count or memory limit), and here that panic would - // unwind out of `start_os_service` -- taking down the root service itself, for a feature whose - // failure should only cost DRM capture. Losing the producer leaves the consumer to fall back to - // PipeWire/X11, which is the same path a host without the feature takes. - #[cfg(feature = "drm")] - if let Err(err) = std::thread::Builder::new() - .name("drm-producer".into()) - .spawn(|| { - crate::ipc::start_drm(); - }) - { - log::warn!( - "failed to spawn the drm capture producer thread: {err}; DRM capture is off for \ - this boot and the consumer falls back to PipeWire/X11" - ); - } - let running = Arc::new(AtomicBool::new(true)); let r = running.clone(); let (mut display, mut xauth): (String, String) = ("".to_owned(), "".to_owned()); @@ -1304,7 +1311,20 @@ pub fn start_os_service() { let mut cm0 = false; let mut last_restart = Instant::now(); + #[cfg(feature = "drm")] + let mut drm_capture = DrmCaptureSwitch::new(); while running.load(Ordering::SeqCst) { + #[cfg(feature = "drm")] + if drm_capture.poll() { + log::info!( + "drm capture switched {}; restarting --server", + if drm_capture.on { "on" } else { "off" } + ); + desktop = Desktop::default(); + stop_server(&mut server); + stop_server(&mut user_server); + force_stop_server(); + } desktop.refresh(); update_active_user_lookup_cache(&desktop); @@ -1332,11 +1352,12 @@ pub fn start_os_service() { // A greeter neither recognizes (e.g. LightDM) never reaches this branch -- it takes // the unprivileged else-branch below already. A genuine root graphical session (username=="root") // has no lower uid to drop to, so it stays root. The whole branch is gated on the drm - // feature, so the drm-off build is upstream's single `start_server(None, ..)` line. + // feature and on allow-drm-capture; otherwise it is upstream's single + // `start_server(None, ..)` line. #[cfg(not(feature = "drm"))] start_server(None, &mut server); #[cfg(feature = "drm")] - if desktop.username != "root" && !desktop.uid.is_empty() { + if drm_capture_enabled() && desktop.username != "root" && !desktop.uid.is_empty() { start_server(Some(&desktop), &mut server); // If dropping to the greeter uid did not produce a RUNNING server, fall back to a // root --server so the login screen stays remotable instead of looping on a @@ -1403,6 +1424,88 @@ pub fn start_os_service() { log::info!("Exit"); } +/// Follows `allow-drm-capture` from the service loop. The `_drm` producer starts the first time it +/// is on and then stays up; while the option is off `handle_drm_conn` refuses every peer. +#[cfg(feature = "drm")] +struct DrmCaptureSwitch { + on: bool, + producer_started: bool, +} + +#[cfg(feature = "drm")] +impl DrmCaptureSwitch { + fn new() -> Self { + Self { + on: drm_capture_enabled(), + producer_started: false, + } + } + + /// Whether the option changed since the last call: every `--server` decided its paths at start. + fn poll(&mut self) -> bool { + let on = drm_capture_enabled(); + let changed = on != self.on; + self.on = on; + if self.on && !self.producer_started { + self.producer_started = true; + // DRM/KMS capture producer (opt-in `drm` feature): a dedicated thread + runtime that + // streams scanout frames to the user `--server` over the `_drm` service-scoped channel. + // Runs here because this process is the root service that already holds CAP_SYS_ADMIN + // for the in-process (direct-mode) libdrmtap read. + // + // Builder, like every other thread this feature starts: `thread::spawn` PANICS if the + // thread cannot be created (EAGAIN under a thread-count or memory limit), and here that + // panic would unwind out of `start_os_service` -- taking down the root service itself, + // for a feature whose failure should only cost DRM capture. Losing the producer leaves + // the consumer to fall back to PipeWire/X11, which is the same path a host without the + // feature takes. + if let Err(err) = std::thread::Builder::new() + .name("drm-producer".into()) + .spawn(|| { + crate::ipc::start_drm(); + }) + { + log::warn!( + "failed to spawn the drm capture producer thread: {err}; DRM capture is off \ + for this boot and the consumer falls back to PipeWire/X11" + ); + } + } + changed + } +} + +/// The service acts on `allow-drm-capture` from its own copy of the config, which only a non-root +/// `--server` syncs. A root `--server` that applied a change to the option hands its config over +/// itself, and so does the CLI, or the change never takes effect. The UI does not: `SyncConfig` +/// carries the whole config, and a long-lived process may hold an older copy of the rest. +#[cfg(feature = "drm")] +pub async fn sync_drm_capture_to_service(was_on: bool) { + use crate::ipc::{connect_trusted_device_service, Data}; + use hbb_common::config::Config2; + if !is_root() || drm_capture_enabled() == was_on { + return; + } + let result = async { + let mut conn = connect_trusted_device_service(1000).await?; + let config2 = crate::trusted_devices::config::update(Config2::get_for_sync).await?; + let configs = Box::new((Config::get(), config2)); + conn.send(&Data::SyncConfig(Some(configs))).await?; + conn.next_timeout(1000).await + } + .await; + match result { + Ok(Some(Data::SyncConfig(None))) => { + log::info!("allow-drm-capture changed as root, config synced to the service") + } + Ok(Some(Data::SecurityConfigError(err))) => { + log::warn!("the service rejected the allow-drm-capture sync: {err}") + } + Ok(_) => log::warn!("the service did not confirm the allow-drm-capture sync"), + Err(err) => log::warn!("failed to sync allow-drm-capture to the service: {err}"), + } +} + #[inline] /// Returns the cached active `(uid, username)` snapshot when available. /// Callers that require a fresh seat0 lookup should call `get_values_of_seat0` directly. @@ -1430,8 +1533,9 @@ pub fn get_active_userid_fresh() -> String { // A Wayland greeter owns seat0 while it is up and the DRM backend serves it, so a uid gate that // cannot see it rejects the greeter's own `--server`. `Desktop::refresh` reads it the same way. #[cfg(feature = "drm")] - return get_values_of_seat0_with_gdm_wayland(&[1])[0].clone(); - #[cfg(not(feature = "drm"))] + if drm_capture_enabled() { + return get_values_of_seat0_with_gdm_wayland(&[1])[0].clone(); + } get_values_of_seat0(&[1])[0].clone() } @@ -2737,7 +2841,7 @@ mod desktop { self.username = seat0_values[2].clone(); self.protocol = get_display_server_of_session(&self.sid).into(); #[cfg(feature = "drm")] - { + if super::drm_capture_enabled() { self.tty_greeter = super::is_tty_greeter_session(&self.sid); if self.tty_greeter { // `Type=tty` names no display server, and the fallback above read this @@ -2764,7 +2868,9 @@ mod desktop { // fully populated environment. This is for the display managers whose greeter user // does match, and for greetd's Wayland greeters (`adopt_wayland_tty_greeter`). #[cfg(feature = "drm")] - self.get_home(); + if super::drm_capture_enabled() { + self.get_home(); + } return; } diff --git a/src/server/connection.rs b/src/server/connection.rs index 4fe8111f0..3e25d08ad 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -2087,7 +2087,9 @@ impl Connection { if self.is_remote() { let mut msg = "".to_string(); #[cfg(feature = "drm")] - if !crate::platform::linux::is_x11_for_drm() { + if crate::platform::linux::drm_capture_enabled() + && !crate::platform::linux::is_x11_for_drm() + { super::drm_capturer::settle_unknown_availability().await; } // Refuse only while nothing can capture a Wayland greeter: the DRM path can. diff --git a/src/server/display_service.rs b/src/server/display_service.rs index fc8ed83d8..2f6d26773 100644 --- a/src/server/display_service.rs +++ b/src/server/display_service.rs @@ -385,6 +385,7 @@ fn refresh_wayland_uinput_rect_if_changed() { } #[cfg(not(feature = "drm"))] let _ = live_changed; + let drm_capture = crate::platform::linux::drm_capture_enabled(); // The remap corrects for per-display origin shifts; the uinput ABS range corrects for // the overall bounding box. Only enable the remap once the range matches the live // layout, otherwise moves would be remapped into a range the device is not yet using. @@ -392,7 +393,7 @@ fn refresh_wayland_uinput_rect_if_changed() { // The check, the apply, what they record and the flag below run on the uinput apply thread, // in turn with the other paths; this loop waits for its answer. #[cfg(feature = "drm")] - if run_uinput_apply(move |rt| { + if drm_capture && run_uinput_apply(move |rt| { let mut range_ok = WAYLAND_UINPUT_RECT.lock().unwrap().rect == Some(rect); // The device already runs a range that fits this layout: the DRM calibration may measure. if range_ok { @@ -445,8 +446,7 @@ fn refresh_wayland_uinput_rect_if_changed() { "Failed to check the uinput range: the uinput apply thread is gone" ); } - #[cfg(not(feature = "drm"))] - { + if !drm_capture { let mut range_ok = WAYLAND_UINPUT_RECT.lock().unwrap().rect == Some(rect); if !range_ok { let (minx, maxx, miny, maxy) = rect; @@ -829,7 +829,8 @@ pub(super) fn check_update_displays(all: &Vec) { fn wayland_has_compositor() -> bool { #[cfg(feature = "drm")] { - !crate::platform::linux::is_login_screen_wayland_cached() + !crate::platform::linux::drm_capture_enabled() + || !crate::platform::linux::is_login_screen_wayland_cached() } #[cfg(not(feature = "drm"))] { diff --git a/src/server/drm_capturer.rs b/src/server/drm_capturer.rs index fd7296bca..d3870132c 100644 --- a/src/server/drm_capturer.rs +++ b/src/server/drm_capturer.rs @@ -1769,6 +1769,9 @@ pub(crate) enum Availability { /// blocking pool). This blocking form serves the capture-side callers through /// `is_available`, where waiting out a settle is acceptable. fn availability() -> Availability { + if !crate::platform::linux::drm_capture_enabled() { + return Availability::Unavailable; + } let (verdict, stale_no) = { let st = DRM_STATE.lock().unwrap(); // Keep a settled "no" while an off-thread probe re-verifies it, avoiding a transient @@ -1808,6 +1811,9 @@ fn availability() -> Availability { /// Non-blocking login-path assessment. /// Unknown starts a probe off-thread; callers require `Available` before admitting a session. pub(crate) fn availability_cached() -> Availability { + if !crate::platform::linux::drm_capture_enabled() { + return Availability::Unavailable; + } let (verdict, stale_no) = { let st = DRM_STATE.lock().unwrap(); let stale_no = @@ -2013,11 +2019,15 @@ fn refresh_available_async() { } pub(super) fn warm_availability() { + // The option is read INSIDE the loop too: this starts before the initial config sync from + // root, so an account whose own config does not hold it yet reads it as off at first. + let mut enabled = false; // The gate is INSIDE the loop because `get_display_server()` answers "x11" whenever loginctl // cannot yet name the seat0 session. `is_x11_for_drm()` is that form minus the greeter // blind spot, where plain `is_x11()` is permanently true. for _ in 0..10 { - if crate::platform::linux::is_x11_for_drm() { + enabled = crate::platform::linux::drm_capture_enabled(); + if !enabled || crate::platform::linux::is_x11_for_drm() { std::thread::sleep(Duration::from_millis(300)); continue; } @@ -2045,7 +2055,9 @@ pub(super) fn warm_availability() { Err(_) => std::thread::sleep(Duration::from_millis(300)), } } - log::info!("drm: consumer cache warm found no producer at startup (will probe lazily)"); + if enabled { + log::info!("drm: consumer cache warm found no producer at startup (will probe lazily)"); + } } /// With no verdict yet, a login probes now instead of answering "not yet"; that may wake displays. @@ -3592,4 +3604,14 @@ mod drm_capturer_tests { sum_now / n ); } + + #[test] + fn drm_capture_off_reports_unavailable_without_probing() { + // Reads the real config and environment, which may have it on where the test runs. + if crate::platform::linux::drm_capture_enabled() { + return; + } + assert!(availability() == Availability::Unavailable); + assert!(availability_cached() == Availability::Unavailable); + } } diff --git a/src/server/input_service.rs b/src/server/input_service.rs index 602f2d394..1608ecc44 100644 --- a/src/server/input_service.rs +++ b/src/server/input_service.rs @@ -434,7 +434,9 @@ fn run_cursor(sp: MouseCursorService, state: &mut StateCursor) -> ResultType<()> #[cfg(all(target_os = "linux", feature = "drm"))] { const CURSOR_CACHE_MAX: usize = 64; - if state.cached_cursor_data.len() >= CURSOR_CACHE_MAX { + if state.cached_cursor_data.len() >= CURSOR_CACHE_MAX + && super::drm_capturer::is_available_cached() + { state.cached_cursor_data.clear(); CURSOR_SHAPES.lock().unwrap().clear(); // The shape being sent was kept above; keep it past the clear. diff --git a/src/server/wayland.rs b/src/server/wayland.rs index c9bbad94c..424e8a9ea 100644 --- a/src/server/wayland.rs +++ b/src/server/wayland.rs @@ -459,7 +459,7 @@ pub(super) async fn check_init() -> ResultType<()> { // A display that falls back to PipeWire in a DRM session runs this apply // too: it goes through the uinput apply thread, in turn with the DRM paths. #[cfg(feature = "drm")] - { + if crate::platform::linux::drm_capture_enabled() { let job = move |rt: &tokio::runtime::Runtime| { super::display_service::note_input_map_unknown(); match rt.block_on(async { @@ -494,6 +494,27 @@ pub(super) async fn check_init() -> ResultType<()> { "Failed to update mouse resolution: the uinput apply thread is gone" ); } + } else { + // allow-drm-capture off: the not(drm) apply below, kept in step with it. + match timeout( + 3_000, + input_service::update_mouse_resolution(minx, maxx, miny, maxy), + ) + .await + { + Ok(Ok(())) => { + super::display_service::set_wayland_uinput_rect(( + minx, maxx, miny, maxy, + )); + super::display_service::set_wayland_layout_baseline( + scrap::wayland::display::get_display_rects_for_uinput(), + ); + } + Ok(Err(err)) => { + log::error!("Failed to update mouse resolution: {}", err) + } + Err(err) => log::error!("Failed to update mouse resolution: {}", err), + } } // Bound the IPC wait like the periodic refresh does, so a hung // response can't stall session init.