Commit Graph
11713 Commits
Author SHA1 Message Date
rustdeskandClaude Opus 5.5 08b47a50cb feat(flutter): add the DRM capture switch to the Wayland settings card and home warnings
Settings > General > Wayland gets a "Use DRM screen capture" checkbox on an
installed Linux client, with the explanation shown below it: it skips the
Wayland screen sharing prompt (the login screen too), may not work on every
device, and switching it disconnects current sessions. Flatpak and AppImage
are not installed builds, so they do not show it.

On the home page, an installed client with the option off now offers an
"Enable" button on the Wayland session and Wayland login screen warnings,
and shows neither warning once it is on. Builds that are not installed, and
clients where the option is fixed, keep the existing warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
2026-11-23 00:06:18 +08:00
rustdeskandClaude Opus 5.5 ea48575430 feat(drm): start the _drm producer and greeter paths only with allow-drm-capture, restart --server on change
The root service used to start the `_drm` producer at boot, which dlopens
libdrmtap, opens the DRM device and grabs a frame, and to treat a Wayland
greeter as a DRM login screen. Both now wait for allow-drm-capture:

- the producer starts the first time the option is seen on, and
  `handle_drm_conn` refuses peers while it is off;
- when the option changes, the service restarts `--server` and re-reads the
  seat, because every `--server` decides its paths when it starts;
- a greeter `--server` runs as the greeter uid only with the option on, and
  is passed RUSTDESK_DRM_CAPTURE=Y, since its own config has not synced from
  root when `IS_X11` is computed;
- `get_active_userid_fresh`, the greetd detection and the login-Wayland HOME
  lookup follow the option, so with it off they match a build without drm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
2026-11-23 00:06:18 +08:00
rustdeskandClaude Opus 5.5 2bbb5771d5 feat(drm): keep the stock greeter, uinput and cursor paths while allow-drm-capture is off
With drm compiled in, these paths changed even when DRM capture was never
used: a Wayland greeter read as Wayland, the uinput range was set on the
apply thread, `wayland_has_compositor` said no at a greeter, every Wayland
login ran loginctl for the settle, and the cursor cache had a ceiling.
Each now checks `drm_capture_enabled()` and, while it is off, runs the code
a build without drm runs. `check_init`'s stock `match` is only re-indented
under its new `if`; see `git diff -w`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
2026-11-23 00:06:18 +08:00
rustdeskandClaude Opus 5.5 c0f592119b feat(drm): add allow-drm-capture and stop probing _drm when it is off
DRM capture is about to be compiled into every Linux build, so it needs a
runtime switch. `drm_capture_enabled()` reads the new `allow-drm-capture`
option (default off) or `RUSTDESK_DRM_CAPTURE=Y`, which the root service will
set for a greeter `--server`. While it is off the consumer never probes `_drm`:
`availability()` and `availability_cached()` answer Unavailable and the
startup warm returns at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
2026-11-23 00:06:17 +08:00
Jericho Siahaya 90f3fb136b fix(linux): capture Wayland portals that offer only DMA-BUF (niri) (#17175)
* fix(linux): capture Wayland portals that offer only DMA-BUF (niri)

niri's screencast stream offers BGRx only as DMA-BUF (linear and tiled
modifiers), with no system-memory format. The appsink accepts only
system-memory BGRx/RGBx, so the PipeWire link fails with "no more input
formats" and the capturer fails with "Element failed to change its
state".

When the system-memory pipeline cannot start, retry with a pipeline
that accepts linear DMA-BUF (XR24/XB24). Linear buffers are CPU
readable, so the frame is read by mmap of the dmabuf fd using the
VideoMeta stride and offset, inside DMA_BUF_IOCTL_SYNC. A normal map
cannot be used: for DMA-BUF the PipeWire chunk size is a placeholder
(1 byte on niri), and always-copy copies only that chunk, so it is not
set on this pipeline.

Desktops where the current pipeline works do not change.

Refs #15911

* scrap/wayland: address review of the DMA-BUF fallback

- Leave the existing system-memory setup in PipeWireRecorder::new as it
  was. Only a fallback hook replaces its set_state(Playing)?, and the
  DMA-BUF pipeline is built by a separate build_dmabuf_pipeline().
- Check every result in read_linear_dmabuf: DMA_BUF_IOCTL_SYNC start and
  end (restarted on EINTR/EAGAIN, as the kernel requires), lseek, mmap.
  Log munmap and pipeline-stop failures.
- Map the whole dmabuf (size from lseek) and bounds-check the frame
  against it in pack_rows, so a bad or negative stride is an error.
- Unit tests for row packing, the bounds check, and the XR24/XB24
  format mapping.

* scrap/wayland: throttle the per-frame DMA-BUF unmap warning

read_linear_dmabuf runs once per frame, so a persistent munmap failure would log a line per frame. Use hbb_common::throttled_log! (one line per minute with a repeat count).

* scrap/wayland: use checked arithmetic for the DMA-BUF frame end

The stride and offset come from the compositor. On 32-bit targets, start + stride * (h - 1) + row_len can wrap to a small value that passes the bounds check, and the row copy then panics. Compute the end with checked_mul/checked_add and return an error on overflow. The existing test gets one case for it.

* scrap/wayland: keep the system-memory capture path unchanged

capture() is back to master's body. A DMA-BUF sample now branches off at
the top into capture_dmabuf(), which has its own drm-format mapping, read,
duplicate check and crop, so GNOME and KDE run the same code as before.

A DMA-BUF frame that does not fit its buffer is now dropped with a trace
log, like the system-memory size mismatch (pipewire#985), instead of
ending the capture. mmap and sync failures are still errors.

* scrap/wayland: drop a DMA-BUF frame whose crop does not fit

The crop rectangle comes from the compositor's VideoCropMeta. One left
from an old allocation could slice past the packed frame and panic, so
capture_dmabuf now drops such a frame with a trace log before reading it.

* scrap/wayland: keep only the tests that pin the reported behavior

Drop the crop_fits test and the usize overflow assertion, which covered corner cases raised in review. The crop_fits check itself stays.
2026-11-23 00:04:20 +08:00
fufesou be181a9d18 Fix/tcp websocket error propagation (#16946)
* fix(macOS): network retry 3s if os error is EHOSTUNREACH

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): detect nested network errors when retrying

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(macos): isolate network error detection

Move EHOSTUNREACH detection into the macOS platform module and share the fast retry timeout across both retry branches.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(macos): cover host-unreachable error chains

Cover direct, context-wrapped, and nested EHOSTUNREACH errors while ensuring ECONNREFUSED does not trigger the fast-retry predicate.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-22 17:14:24 +08:00
giotic 534b047525 Send navigation, Windows and Menu keys with the extended flag on Windows (#17174) 2026-11-22 15:38:59 +08:00
fufesou 8e1433d4a2 Fix/cm chat remote input (#17119)
* fix(cm): block remote typing into protected chat

Publish CM focus protection over the existing IPC connection and check queued remote keys before injection. Preserve local chat editing and remote key releases, and stop input before closing desktop sessions when an established CM transport disconnects.

Add input-gate and local chat editing regression tests. Initial CM state synchronization and already-dispatched platform input remain known timing limits.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(cm): use a common synchronous setter

Route CM input protection through main_set_common_sync using the cm-input-blocked command. Preserve synchronous state publication and return errors for unsupported commands or invalid values. Remove the redundant Flutter CM chat compatibility test.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(cm): protect keyboard input whenever CM is focused

Use keyboard-specific names throughout CM protection and its common setter command. Keep mouse permission checks and key-release handling unchanged, and name transport-loss notifications after CM IPC.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(cm): validate mouse modifiers and preserve pending tunnels

Signed-off-by: fufesou <linlong1266@gmail.com>

* simplify

Signed-off-by: fufesou <linlong1266@gmail.com>

* Limit CM keyboard filtering to activation keys

Allow remote editing and non-activation shortcuts while CM is focused, while
rejecting keyboard activation of chat controls across protocol encodings.
Preserve local keyboard input and key releases.

Handle raw keys, text injection, Windows packed payloads, and Linux Select.
Reuse the native hotkey predicate so intact Legacy Unicode remains usable.

Signed-off-by: fufesou <linlong1266@gmail.com>

* Simplify CM keyboard filtering and disconnect teardown

Consolidate activation checks and regression tests. Use normal session teardown after CM IPC loss so the configured lock-after-session-end policy still applies.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(cm): simplify remote chat send protection

Reuse checkClickTime for keyboard and send-button actions before sending
or clearing drafts. Allow remote interaction when configured.

Record keyboard activity before native dispatch and retain the mouse
modifier whitelist. Remove the focus gate and its IPC plumbing.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(cm): cancel pending chat sends after disconnect

Signed-off-by: fufesou <linlong1266@gmail.com>

* remove the low-value test file

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-21 22:15:42 +08:00
fufesou 817ba32b25 Fix/macos update dmg eject (#16921)
* fix(macos): avoid deprecated DMG detach during updates

Signed-off-by: fufesou <linlong1266@gmail.com>

* docs(macos): explain hdiutil deprecation version

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): migrate DMG attachment and test images to diskutil

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(macos): migrate privileged DMG attachment to diskutil

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(macos): verify DMG guard ejects on drop

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-21 13:02:01 +08:00
linzch3 e0f1154f74 docs: use https for DCO links and fix the NL self-host server URL (#17152)
http://developercertificate.org currently returns HTTP 500, while
https://developercertificate.org returns 200. CONTRIBUTING-DE.md
already used https.

The Dutch README still pointed "set up your own server" at the old
blog path rustdesk.com/blog/id-relay-set, which redirects to
rustdesk.com/server, the URL used in the other READMEs.
2026-11-21 10:11:12 +08:00
linzch3 eedf39e3cb docs: fix broken nightly and server-demo links in VN/DA READMEs (#17150) 2026-11-21 00:19:47 +08:00
RustDeskandClaude Opus 5.5 144a743d0a Keep the caret in dialog text fields on Flutter 3.44 desktop builds (#17146)
Flutter 3.44 makes desktop text fields select all their text whenever
they regain focus; 3.24 did that only on web. On desktop the 2FA code
dialog opens on top of the still-open login dialog, and the two
CustomAlertDialogs bounce focus on every rebuild, so each typed digit
replaced the previous one on the macOS arm64 build (#17143). Windows
arm64 is built the same way.

The 3.44 source patch now passes selectAllOnFocus: false to
DialogTextField's TextField on desktop, restoring 3.24's behavior. Web
keeps the default (select all), as before. 3.24 has no such
parameter, so the change lives in the patch script like the other
3.44-only deltas.


Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 17:15:28 +08:00
Yunus Arda Güney 4171ba4d17 Translate elevated_foreground_window_tip in Turkish (#17093)
Signed-off-by: Yunus Arda Güney <64425746+yunusarda-sudo@users.noreply.github.com>
2026-11-20 16:09:57 +08:00
rafi_ghanbari da85f7ae69 i18n(fa): overhaul Persian translations, fix RTL word ordering, and standardize terminology (#17101)
- Fix critical semantic mistranslations and untranslated strings
- Resolve RTL/LTR bidirectional word-order scrambling
- Standardize core UI terminology across the entire file
- Fix typos, broken escape sequences, and ZWNJ spacing
2026-11-20 16:09:39 +08:00
bovirus 326deef884 Update Italian language (#17126) 2026-11-20 16:09:10 +08:00
linzch3 1beb7b30c6 docs: fix the CONTRIBUTING link in README-PTBR (#17132) 2026-11-20 16:08:54 +08:00
spacemingandluoming a3b42dfb90 docs: update Chinese README file structure (#17139)
Signed-off-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: luoming <ming.luo@uwa4d.com>
2026-11-20 13:06:14 +08:00
fufesou 304e60492d fix(windows): show an installation tip for a missing service (#16948)
* fix(windows): show an installation tip for a missing service

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve service state during recovery

Restore the saved stop-service option after installation errors and initialize the Windows Flutter service state before its first render.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(sciter): prioritize Windows recovery over download prompts

Show one Windows card in this order: upgrade the installed copy, install its missing service, then download a new version.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): read service recovery state synchronously

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): prioritize service recovery over update prompts

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): prioritize local installation over online updates

Offer the running version before an online update when the installed copy is older, even if its Windows service is registered.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(flutter): keep service recovery visible with hidden help cards

Allow missing-service recovery when the installed-copy upgrade card is hidden, while preserving visible upgrade priority.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): simplify service recovery priority

Show the missing-service Install action before update or upgrade cards in Flutter and Sciter. Preserve the original card order when service recovery is not needed.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): suppress recovery prompts during service installation

Suppress the missing-service prompt while an installation is active. Close Flutter sub-windows before service recovery, remove the redundant Windows error check, and qualify the service error type.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): keep service recovery tied to registration

Remove the installation-in-progress shortcut from the service probe. Flutter does not rebuild when the flag clears, which could leave the recovery action hidden after a cancelled or failed attempt. Keep the native guard against overlapping installations.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-20 12:22:59 +08:00
21pages c50ae97512 fix: omit preset address book password from sysinfo uploads (#17130) 2026-11-19 20:35:50 +08:00
fufesou dcb6291116 Fix/windows clipboard response leak (#17113)
* fix(clipboard): reject unsolicited Windows format data responses

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(clipboard): inline format response validation

Keep the existing callback name and allocation path. Remove the wrapper while retaining request matching and lock coverage through response notification.

Validation: all 3 clipboard unit tests pass. Sequential native checks cover early responses, wrong connections, duplicates, and error-path lock release. All 64 unsolicited 1 MiB responses are rejected with no measured private-memory growth.

The desktop paste checks recorded in the PR were performed before this behavior-preserving simplification.

Signed-off-by: fufesou <linlong1266@gmail.com>

* test(clipboard): remove standalone response regression test

Keep the PR focused on the Windows C fix. The native before and after memory measurements cover the reported leak without a test that starts a second process.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-19 18:23:29 +08:00
fufesou 742e507ca6 Feat: Windows, and an option to skip firewall rules (#17107)
* feat(windows): make installer firewall rules optional

Support FIREWALLRULES=0/1 in MSI and EXE installers, preserve the saved choice across maintenance and upgrades, and retain unconditional uninstall cleanup.

Persist MSI maintenance overrides with rollback and test EXE option resolution and command generation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): keep firewall setup failures non-fatal

Restore infallible EXE script generation, warn and use the enabled default when option resolution fails, and continue after persistence errors. Use the existing non-blocking return policy for MSI firewall persistence and rollback actions.

Add regression coverage for invalid input and a failed registry command without changing valid FIREWALLRULES=0/1 behavior.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): support Y/N firewall installer options

Accept Y/y and N/n alongside 1 and 0 for FIREWALLRULES in MSI and EXE installers. Normalize MSI values before action conditions and registry writes to preserve canonical settings across upgrades.

Extend regression coverage for alias normalization and explicit overrides while retaining non-blocking failure handling.

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(windows): simplify installer firewall option

Signed-off-by: fufesou <linlong1266@gmail.com>

* refactor(windows): retain legacy firewall installer flow

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(msi): default unknown firewall values to enabled

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): accept case-insensitive firewall option names

Keep the MSI registry search consistent with existing options and document the direct machine-hive alternative.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-19 18:03:34 +08:00
fufesou 0d1cc89828 Fix/privacy mode2 initialization (#17090)
* fix(windows): stabilize privacy mode 2 initialization

First-time Amyuni setup can reset the display layout after the monitor
appears. Prepare it on a worker outside the privacy mutex and connection
loop, keeping remote input and video responsive during initialization.

Poll DXGI for five seconds without capture loss, with a 20-second deadline.
Log and retain the full wait when DXGI cannot be observed. Cancel pending
activation on disable, disconnect or permission revocation.

Validate active outputs before reporting success and detect subsequent
privacy loss in the display loop. Notify the authenticated owner directly
without depending on the connection manager.

Validation: default test build and two privacy-mode regression tests;
Flutter cargo check --tests; formatting and whitespace checks; successful
first-install hardware test with 12.1-second activation and manual exit.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve privacy monitor cleanup and allow retries

Carry the monitor created during Amyuni preparation into privacy mode's
existing cleanup list so exiting removes one monitor instead of all managed
virtual monitors.

Wait cancellably for ongoing preparation when activation is retried, keeping
the connection responsive. Add a regression test for waiting and cancellation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): skip privacy restoration when cancelling preparation

A cancelled preparation worker already owns cleanup. Acknowledge cancellation without restoring an inactive privacy layout, which could otherwise remove all managed virtual monitors before the worker finishes.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): roll back inactive privacy monitor preparation

Attempt to undo an accepted Amyuni monitor request when privacy preparation fails or is cancelled, even if active-display enumeration cannot see the requested monitor. Preserve non-forced removal for active outputs and report cleanup failures.

Signed-off-by: fufesou <linlong1266@gmail.com>

* chore(windows): trim privacy diagnostics and adjust polling

Remove temporary activation logs and move the preparation-lock test module after the other Amyuni items. Use a 300 ms polling interval for display stabilization and preparation-lock cancellation checks.

Signed-off-by: fufesou <linlong1266@gmail.com>

* perf(windows): probe privacy readiness without pixel readback

Check DXGI duplication access without copying or mapping desktop pixels during first-install privacy preparation. Reuse frame cleanup and preserve the existing stability window and normal capture path.

Log probe creation and recreation timing, and clarify which display flags are excluded from privacy validation.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): probe the prepared display during privacy initialization

Observe the newly created Amyuni output so the readiness probe does not contend with video capture for the same DXGI duplication interface.

Retry temporary DXGI unavailability within the existing initialization deadline while retaining the stability interval and explicit full-wait fallback.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): report privacy preparation cleanup failures

Preserve the single-monitor safety checks when cleaning up a prepared Amyuni display and propagate driver errors directly.

Leave ordinary monitor removal and best-effort bulk cleanup unchanged.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): retain privacy initialization wait across retries

Remember unfinished first-install observation after monitor creation or stability failures. Recheck it when reusing an existing Amyuni output, and clear it only after the existing observation policy completes.

Keep the state local to privacy preparation and serialize access with the existing preparation lock.

Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): validate privacy preparation and avoid display stalls

Keep initialization pending when its output disappears, and wait for an active output count decrease before completing preparation cleanup.

Skip privacy checks while activation or restoration holds the mutex, report poisoned locks, and log preparation errors with throttling.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-19 17:43:55 +08:00
21pages 669cb8ac62 feat: allow custom clients to hide username and password login (#17092)
* feat: add option to hide account password login

* fix: initialize OIDC-only login in loading state

* test: cover OIDC-only login loading and empty states
2026-11-18 22:38:27 +08:00
alonginwind d40e1da715 fix(mobile): align the virtual mouse handle with the peer cursor (#17108)
* fix(mobile): align the virtual mouse handle with the peer cursor

The handle origin was reported in window coordinates, while the mouse
mapping reads it as canvas-local: on mobile CanvasModel.topToEdge and
leftToEdge are 0, so nothing compensates for the safe area. The peer
cursor was therefore drawn one inset away from the handle arrow, and a
tap landed where that cursor was rather than under the arrow.

Subtract the same padding InputModel._pointerPositionForRemoteCanvas
applies, so both entry points hand over coordinates in one space.

* test(mobile): pin the virtual mouse cursor to the canvas

The handle origin has to reach the mouse mapping as a canvas coordinate,
otherwise the peer cursor draws one safe-area inset away from the handle
arrow. Reports the handle position through a nonzero inset, so a return to
window coordinates moves the point by that inset and fails here.

Signed-off-by: alonginwind <sunzl3721@gmail.com>

---------

Signed-off-by: alonginwind <sunzl3721@gmail.com>
2026-11-18 16:46:05 +08:00
Faris Basha TM 985429669a docs: point hbb_common links to its own repository (#17094)
libs/hbb_common is a git submodule, so the
https://github.com/rustdesk/rustdesk/tree/master/libs/hbb_common link in
the README and its translations returns 404. Link to
https://github.com/rustdesk/hbb_common instead.

Signed-off-by: farisbasha <farisbashatm@gmail.com>
2026-11-17 23:54:37 +08:00
54416dcaa1 fix(wayland): preserve unmatched streams and validate display offset cache (#17073)
* fix(wayland): preserve unmatched streams and validate display offset cache

- Keep unmatched streams in `sort_streams` instead of dropping them when no
  monitor sits at `(0, 0)` (e.g. vertically offset multi-monitor layouts).
- Reject stale `wayland-pipewire-display-offset` entries whose offsets do not
  match any current display origin, skip caching unresolved `(0, 0)` defaults,
  and fall back to rotated/logical display dimensions in `try_fill_positions`.
- Replace global `HAS_POSITION_ATTR` with per-stream `has_position` and
  per-session `positions_filled` tracking.
- Do not latch `PIPEWIRE_INITIALIZED` when `init_displays` yields no displays.

Fixes https://github.com/rustdesk/rustdesk/issues/17027

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(wayland): restrict fallback display matching to unique outputs

- Keep `try_fill_positions` exact physical-mode matching for multi-match
  cursor disambiguation, and apply rotated/logical-size fallback only
  when a single display matches uniquely (leaving ambiguous cases
  unchanged and uncached).
- Inline the unmatched-stream preservation directly into `sort_streams`
  without the generic `sort_by_display_order` wrapper.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(wayland): cache only resolved display offsets and drop the size fallback

- Remove `unique_fallback_origin`: a unique rotated output is already placed
  by `reconciled_origin`, and matching a stream size against `logical_size`
  could bind a region or virtual stream to a scaled output and cache it.
- Report from `fill_multi_matched_positions` whether every stream was told
  apart, and do not cache the offsets when it was not (no embedded cursor
  mode, or a probe failed).
- Require each cached offset to name a display of its own, so a cache holding
  two streams on one output is rejected; mirrored outputs still pass.
- Import `serde_json` in the test module: on Linux scrap only gets it through
  `hbb_common`.
- Leave `init_displays` as on master: once `sort_streams` keeps unmatched
  streams the display list is no longer emptied, so the empty-list check
  cannot fire, and the initialization-state change is a separate matter.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

* chore(wayland): drop edits unrelated to the fix

- Remove the comment left over from HAS_POSITION_ATTR.
- Restore Vec::new() in sort_streams.
- Drop the empty-token check in validate_display_offset_cache: the cache
  is never written without a token, and the token comparison already
  rejects an empty current token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

* fix(wayland): narrow the #17027 fix to sort_streams

Revert the offset-cache, position-flag and disambiguation changes from
the earlier commits; only sort_streams changes now.

- sort_streams keeps a stream whose position names no display (the KDE
  full-workspace stream at (0, 0) in #17027) and, as on master, still
  drops a stream at an origin another stream already took. Keeping that
  one too let a same-size stream left at another display's origin send
  pointer input to that display.
- With the stream kept, the stale [[0, 0]] offset cache and the global
  HAS_POSITION_ATTR no longer break #17027: a cached (0, 0) gives the
  position recomputing would. Both stay as on master.
- The offset cache test goes with the validation it covered.
  sort_streams takes PipeWireCapturable, which holds a D-Bus connection
  and a fd, so it has no unit test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 16:59:44 +08:00
RustDeskandClaude Opus 5.5 b633360372 Initialize libsodium before anything uses it (#16974)
* Initialize libsodium before anything uses it

The client called sodium_init() only when the update signature check
or the trusted device token first ran. That call also chooses
libsodium's implementations: where a build has both, it moves Poly1305
from the default one to the SSE2 one, whose state is laid out
differently, so a secretbox or AEAD operation another thread was in
the middle of finished under the other implementation. In one thread,
a computation straddling the call gives a wrong tag. The call now runs
once at process start: first in global_init, which core_main begins
with, and at the top of the FFI initialize, which on mobile verifies a
signature before it reaches global_init.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* Log a failed libsodium initialization and start anyway

As hbbs does: a client that does not start is worse than one that
runs with libsodium as it was before this change, and sodium_init()
fails only when it cannot lock its own mutex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

* Initialize libsodium where Android starts the server

Started at boot, MainService calls startServer with no Flutter engine,
so initialize never ran: the server worked with libsodium uninitialized
until the UI opened, and that first sodium_init() could land while
sessions were running. startServer now makes the call first, before it
verifies the custom client's signature or spawns the server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PkpVy2ufxgEjKd3SjXPnJ8

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 11:01:31 +08:00
Gabe FletcherandGabe Fletcher d1d497ff3c fix(linux/uinput): round relative mouse moves symmetrically (#17087)
`move_relative_` halved each delta with `(v as f32 / 2.).ceil()`, which
maps -1 to 0 but +1 to 1. Single-unit moves left or up were dropped while
right or down were kept, so in relative-mouse mode the pointer drifted
toward the bottom-right.

Round half away from zero instead: positive deltas give the same values
as before and negative deltas now mirror them. The /2 scaling is kept.

Co-authored-by: Gabe Fletcher <gabe@detailinggrowth.com>
2026-11-17 10:52:16 +08:00
a98450a995 fix(linux): keep the cursor visible over blank X11 cursors (#17078)
* fix(linux): keep the cursor visible over blank X11 cursors

Signed-off-by: luoming <ming.luo@uwa4d.com>

* fix(linux): test sign-extended X11 cursor pixels

- Drop the `count != 0` guard. With non-null pixels, a 0x0 image
  gives an empty slice, which the predicate already reports as hidden.
- Assert the sign-extended opaque pixel that 64-bit Xlib actually
  returns (`_XRead32` copies through `int *`), so a later signed
  comparison such as `p >= 0x0100_0000` fails the test.
- Use the file's `c_long` import in the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

* fix(linux): restore the explicit empty cursor image check

Keep `count != 0` so an empty image is visibly treated as hidden,
without relying on the zero-length `from_raw_parts` rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs

---------

Signed-off-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: rustdesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:28:25 +08:00
fufesou 3e953e886a fix: win, reg update, check (#17040)
* fix(security): prevent privilege escalation via registry recovery (ZDI-CAN-34805)

Validate all registry recovery inputs before accessing HKEY_LOCAL_MACHINE:
  - Path must start with the graphics drivers connectivity prefix
  - Key name must be exactly "Recent"
  - Subkey cannot contain path separators, dots, or null bytes
  - Old and new values must match in type and length

Validation applies unconditionally to both force=false and force=true paths,
blocking arbitrary registry writes from low-privilege IPC clients.

Maintain existing recovery lifecycle and config persistence. Add three
regression tests covering the reported attack vector and data validation.

Reported-by: BoGeun Jang <TrendAI Zero Day Initiative>
Signed-off-by: fufesou <linlong1266@gmail.com>

* fix(windows): preserve registry recovery behavior

Restore historical type conversion and force behavior while retaining registry target validation. Replace format restrictions with a regression test for variable-length recovery records.

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-16 17:30:15 +08:00
fufesou bca767fcdb fix(terminal): background opacity, 1.0 (#17075)
Signed-off-by: fufesou <linlong1266@gmail.com>
2026-11-16 16:38:35 +08:00
github-actions[bot] 5b937c3a68 chore: update webpki-roots to latest Mozilla root store (#17074)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-11-16 12:29:21 +08:00
RustDesk 7949eca16c fix(android): enforce keyboard permission for remote input (#17061) 2026-11-15 22:58:36 +08:00
RustDeskandClaude Opus 5.5 506e111460 fix(android): sync input service state to enable-keyboard without the UI (#17064)
* Sync the Android input service state to enable-keyboard from Kotlin

enable-keyboard mirrors whether InputService is running, but only the
Flutter UI updated it. When the service was turned on from system
settings while the UI was not running, the option stayed N and new
connections were denied keyboard permission until the app was opened.

InputService now reports its state directly, and MainService reports it
again once startServer has set the config directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Stop the Android UI from resetting enable-keyboard on start

ServerModel set enable-keyboard to N on every mobile UI start and relied
on the input state message to set it back. Until that message arrived,
open connections lost keyboard permission. Android now keeps the option
in step with InputService natively, so keep the reset on iOS only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:58:13 +08:00
RustDeskandClaude Opus 5.5 fcb485bb90 Ignore keyboard and clipboard switches on non-remote connections (#17062)
Android's input control and clipboard toggles call switch_permission_all,
which reaches every CM client. On a file-transfer, view-camera or
port-forward connection, the keyboard switch set keyboard = true and both
switches re-subscribed the clipboard service, so the host's clipboard
changes were sent to a peer that was not granted a remote session.


Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:49:36 +08:00
RustDeskandClaude Opus 5.5 febee50a6e fix: subscribe clipboard services from permission switches only after authorization (#17065)
* Subscribe clipboard services from permission switches only after authorization

Permission toggles in the accept window reach the connection before the
peer is authorized. The keyboard, clipboard and file switches subscribed
the clipboard services at once, so anything the host copied while the
window was open was sent to a peer that had not been accepted.

Subscribe only once authorized, as the audio switch does; on
authorization try_sub_monitor_services subscribes from the recorded
values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Say "until authorized" in the permission switch comment

The switch arrives after the login request, so "before login" was
inaccurate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:20:09 +08:00
Maison da Silva fc9713c1b8 Update Portuguese translations for address book and forever (#17038) 2026-11-14 13:05:31 +08:00
Ruslan ZaitsevandRuslan Zaitsev a89a82f911 fix(fs): recognise compressed file extensions in any letter case (#17017)
* fix(fs): recognise compressed file extensions in any letter case

* fix(fs): compare extensions without allocating and trim the test

* test(fs): keep only the uppercase extension checks

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 10:24:40 +08:00
Ruslan ZaitsevandRuslan Zaitsev d4df77e2fd fix(lang): keep the ?key= and @public syntax in the ID field tooltips (#17016)
* fix(lang): keep the ?key= and @public syntax in the ID field tooltips

es and hr translated ?key=, da translated @public, and the Catalan
id_input_tip held the text of a different string. Restore the literal
tokens and clear the Catalan entry so the English tooltip is shown.

* fix(lang): clear the Catalan web ID tooltip and require <id>@public in the test

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 09:03:41 +08:00
Ruslan ZaitsevandRuslan Zaitsev 9cb48e959c fix(remote_printer): declare the winapi features the crate uses (#17018)
Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-14 08:29:31 +08:00
Ruslan ZaitsevandRuslan Zaitsev e7bacd0358 Add Russian translation of SECURITY.md and update README-RU (#16999)
Add docs/SECURITY-RU.md. In docs/README-RU.md: add the missing languages to the language bar, fix the Docker anchor in the navigation, name the Sciter library in the download instruction, add the libs/base entry to the file structure, and fix a typo.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 17:33:35 +08:00
d785d7ba2c docs(fr): sync README-FR with the English README (#17012)
- Move the misuse disclaimer to the top and use a valid [!Caution] alert
  ([!Attention] is not a GitHub alert type and rendered as a plain quote)
- Drop the dead #serveurs-publics-libres link from the navigation bar
- Add the missing parts: FAQ and nightly build links, F-Droid and
  Flathub badges (French versions), build guide link (French doc),
  openSUSE section, Flutter/CI note, libs/base, libs/clipboard, flutter
- Update package lists, clone and submodule commands, and screenshots
  to match README.md
- Refresh the language bar and the translation call to action

Signed-off-by: vinii34 <193139747+vinii34@users.noreply.github.com>
Co-authored-by: vinii34 <193139747+vinii34@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 17:15:11 +08:00
Ruslan ZaitsevandRuslan Zaitsev 6837cb96eb fix(lang): pick the Norwegian translation for no and nn locales (#17010)
The only Norwegian table is nb (Bokmal), but systems also report Norwegian as no (the macrolanguage, e.g. no_NO) or nn (Nynorsk). resolve_lang returned no/nn, which match no table, so the UI fell back to English.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 17:10:24 +08:00
Ruslan ZaitsevandRuslan Zaitsev 987669e121 fix(lang): use existing translated keys for three UI strings (#17009)
Version: , ID already exists and End call are not keys in src/lang, so they stayed in English in every language. Use the existing Version, Already exists and Stop voice call keys instead, as the desktop settings page, the tag rename check and the controlled side already do.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 15:32:05 +08:00
Ruslan ZaitsevandRuslan Zaitsev 53a1e8aea4 fix(lang): spell the app name as RustDesk in five translations (#17008)
da, el, es, nl and uk wrote the app name as Rustdesk or RusDesk in nine entries. translate() replaces the exact string RustDesk with a custom client's name, so these spellings showed up unchanged in custom clients (for example the uk About dialog title). Adds a test that fails on master and passes with this change.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 15:28:50 +08:00
Ruslan ZaitsevandRuslan Zaitsev a7468d0df3 Add Georgian (ka) translation of README (#16997)
Add docs/README-KA.md, translated from the current README.md, and link it from the language bar in README.md.

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 14:33:28 +08:00
Ruslan ZaitsevandRuslan Zaitsev 225ff5721e fix(lang): keep the {} placeholder in three translations (#17000)
* fix(lang): keep the {} placeholder in three translations

fa and nl dropped the {} in shortcut-must-include-modifiers and shortcut-key-not-supported, so the recording dialog lost the modifier list and the rejected key name. sc had a {} and an unrelated meaning in printer-os-requirement-tip, which is shown as plain text.

* test(lang): check fa, nl and sc against the placeholders of their English text

The existing placeholder test only looks at keys that contain {}. These three tables had mismatches against the en.rs text instead (strings whose {} is filled by Dart replaceAll). The test fails on master and passes with the translation fixes.

---------

Co-authored-by: Ruslan Zaitsev <293677063+Dofam1nch1k@users.noreply.github.com>
2026-11-13 14:23:31 +08:00
spacemingandluoming b84058e076 fix(linux): forward horizontal wheel events through uinput (#16986)
Signed-off-by: luoming <ming.luo@uwa4d.com>
Co-authored-by: luoming <ming.luo@uwa4d.com>
2026-11-13 09:46:32 +08:00
RustDeskandClaude Opus 5.5 3ccb4c4b5b fix(android): move the log toggle native into ffi.FFI (#16993)
* fix(android): move the log toggle native into ffi.FFI

Custom clients move the Kotlin classes out of com.carriez.flutter_hbb.
DocumentLogs declared setEnabled as a native method, so its export
Java_com_carriez_flutter_1hbb_DocumentLogs_setEnabled did not link
there and the app crashed on start with UnsatisfiedLinkError. The
ffi package keeps its name, so declare the native in ffi.FFI like the
others and call it from DocumentLogs.

Fixes rustdesk/rustdesk-server-pro#1035

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci(android): fail when a JNI native is outside ffi.FFI

Only ffi.FFI survives the package rename custom clients do. Check in
the Android build that every Rust JNI export is Java_ffi_FFI_* and that
no Kotlin file but ffi.kt declares an external fun, and write the rule
down in AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* ci(android): report every JNI rule violation and check class lookups

Run the checks independently so one CI round lists both the Rust and
the Kotlin offenders, and also fail on a Rust lookup of an app class by
name. Note in AGENTS.md that a Kotlin method Rust calls by name needs
@Keep to survive R8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:02:45 +08:00
RustDesk 1ac53ccb1b Update flutter-build.yml to include keychain-password
Add keychain-password parameter for signing process
2026-11-12 17:18:49 +08:00