should_start_server reads the property before force_stop_server() (a
kill plus 300 ms) and, on the DRM greeter path, before the 1 s grace
that precedes the root fallback. A sleep requested in that gap still got
a --server. Check again in start_server; the skipped start is retried on
the next tick as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
Replace the sleep monitor, the delay inhibitor, the hwcodec drain and the
Wayland/seat0 debouncing with one check at the point where the service loop
is about to start --server: if logind reports PreparingForSleep, skip the
start and let the loop retry after wake. The respawn trigger in #17208 is
unknown, but the hazard is only the GPU encoder probe a new --server runs
during suspend entry, and logind holds PreparingForSleep from the sleep
request until the system has resumed.
The diff against master is now 37 added lines in linux.rs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
Late Wayland discovery restored each missing field on its own, so a retry
that picked another DISPLAY without an XAUTHORITY got the previous
display's XAUTHORITY. Restore it only when the DISPLAY is unchanged, as
get_display_xauth_xwayland takes a candidate whole. Also rustfmt the new
module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
- Remove sleep_monitor_tests. It ran a private dbus-daemon with a mock
login1 service, and SleepMonitor::with_connection and its dest field
existed only to point the monitor at it. new() now talks to
org.freedesktop.login1 directly.
- Keep three helper tests: the steady Wayland environment, the pause
across sleep, and the --check-hwcodec-config process filter.
- Desktop::refresh() can take seconds. Poll the sleep monitor again
after it, so a PrepareForSleep that arrived meanwhile stops this
iteration before it starts --server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
Stop Desktop::refresh from re-scanning /proc every 500 ms once an active Wayland user session environment is complete, preserve known non-empty session fields across late-discovery retries on the same session ID, and hold cached session state across brief (<3 s) empty seat0 windows such as VT switches.
Pause start_os_service across org.freedesktop.login1.Manager PrepareForSleep(true/false) while holding a logind delay sleep inhibitor fd, draining or terminating any in-flight --check-hwcodec-config child before releasing the inhibitor so GPU probing does not race kernel suspend entry.
Fixes#17208
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
OverlayDialogManager.show() keeps one dialog per tag. Showing a second
dialog under a tag that is already open replaces the map entry but
leaves the first overlay inserted, so neither dismissByTag() nor
dismissAll() can remove it.
The waiting-for-image dialog can be shown twice before the first frame.
On a reconnect to a Windows host with several Windows sessions, the
client already has the session selected, so handle_peer_info() reports
the wait and the automatic send_selected_session_id() reports it again.
The first overlay then stays on top of the remote view after video
starts, and after Cancel it stays over the peer list, blocking taps.
Dismiss any waiting dialog of the session before showing a new one.
Fixes#17233
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(appimage): look up host libraries in /usr/lib on aarch64
The AppImage puts host library and GStreamer plugin paths before its own
so that Wayland capture uses the host's GStreamer and PipeWire. Those
paths were /lib64 and the Debian multiarch dir only. Arch Linux ARM has
neither on aarch64 (its filesystem package adds lib64 only on x86_64),
so the AppImage ran on its bundled focal stack: GStreamer 1.16 with
libpipewire 0.2, which crashes against PipeWire 1.x when the capture
pipeline is created. x86_64 Arch is not affected because /lib64 points
to /usr/lib there.
Add /usr/lib after the multiarch dir in APPDIR_LIBRARY_PATH, and the
matching /usr/lib/gstreamer-1.0 and /usr/lib/gio/modules entries.
Fixes#17301
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
* fix(appimage): drop the no-op GIO_MODULE_DIR entry
GLib reads GIO_MODULE_DIR as a single directory, not a search path, so
a /usr/lib/gio/modules entry in it changes nothing. Keep the change to
the library and GStreamer plugin paths, and put the comment above the
library path it explains.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(linux): keep the window background transparent with Flutter >= 3.27
Since Flutter 3.27, FlView fills itself with an opaque black background
unless fl_view_set_background_color() is called (flutter/engine#54575, the
fix for flutter/flutter#152154). Newer versions also draw without a
GtkGLArea, so find_gl_area() returns nothing and the window border and
rounded corners are drawn black (e.g. with Flutter 3.44, which
apply_flutter_3.44_source_patches.sh supports and distributions use).
Make the view transparent with fl_view_set_background_color(), the API
Flutter provides for this. Flutter >= 3.27 also sets up its GtkGLArea for
transparency itself, so this replaces the GtkGLArea workaround there. The
function is declared weak so that Flutter 3.24, which does not have it,
still builds and keeps using the workaround.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yichao Yu <yyc1992@gmail.com>
* chore(flutter): bump desktop_multi_window for transparent Linux sub-windows
Pulls in rustdesk-org/rustdesk_desktop_multi_window#41, the sub-window
counterpart of this fix: with Flutter >= 3.27 the sub-window FlView needs
fl_view_set_background_color() to stay transparent, otherwise
remote-session windows get black borders and corners. It is a weak symbol,
so the Flutter 3.24.5 builds are unchanged.
The Flutter 3.44 and 3.22 bridge lock diffs do not touch this entry and
still apply unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
---------
Signed-off-by: Yichao Yu <yyc1992@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Pulls in rustdesk-org/rustdesk_desktop_multi_window#41: with Flutter >= 3.27
the sub-window FlView needs fl_view_set_background_color() to stay
transparent, otherwise remote-session windows get black borders and corners
(e.g. the Flutter 3.44 riscv64 build). It is a weak symbol, so the Flutter
3.24.5 builds are unchanged. The main window counterpart is #17347.
The Flutter 3.44 and 3.22 bridge lock diffs do not touch this entry and
still apply unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
* Feature: Make the address book & accessible devices side panels resizable
The Address book panel and the Accessible devices panel can now
be resized by dragging a divider on their right edge. The width is clamped
(150–300px) and persisted per panel as a local option, so it survives restarts.
* Fix side panel overflow in narrow windows
A saved panel width can push the divider and the peer list off the
screen. The panel now uses the row width to limit its visible width.
When there is space, the peer list shows one full peer card.
* ci: add linux riscv64 build
Cross-builds the Flutter deb for riscv64 on x86_64 against Ubuntu
24.04's riscv64 ports, with Flutter 3.44.9 (the release the arm64
builds and the 3.44 bridge use, with the shared 3.44 source patches
and lock diff) and rustdesk-org/flutter-engine's riscv64 engine.
Like the other Linux debs since #17089 it carries the drm backend and
libdrmtap, cross-built here and handed to build.py through
DRMTAP_PREBUILT_DIR. libvpx and libaom are built from the res/vcpkg
overlay ports' sources and linked statically, as vcpkg links them on
x86_64 and aarch64, so the deb does not depend on a distribution's
codec sonames. The job runs only when uploading (nightly, tags), as
build-rustdesk-linux builds aarch64.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build.py: require Ubuntu 24.04's glibc and libstdc++ in the riscv64 deb
The riscv64 deb is cross-built on Ubuntu 24.04: librustdesk.so needs
GLIBC_2.38 and the Flutter runner needs GLIBCXX_3.4.32. Every package in
its Depends also exists on Ubuntu 22.04, so apt installed it there and
the service then failed to start. Declare the build base's libc6 and
gcc 13's libstdc++6 so apt refuses the install instead.
Checked with apt-get install -s on a package with this Depends: Ubuntu
22.04 refuses it (libc6 2.35, libstdc++6 12); Ubuntu 24.04, Ubuntu
26.04 and Debian 13 install it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
---------
Co-authored-by: Dani Sarfati <danifunkervogt@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
The builds that use bridge-artifact-flutter-3.44 (Windows and macOS
arm64) are on Flutter 3.44.9, while the bridge was still generated with
3.44.8. Generate it with the same release. Both releases pin the same
SDK packages, so flutter_3.44_pubspec.lock.diff still applies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
* fix(windows): forward Unicode Auto-Type input
Decode VK_PACKET text before physical-key mapping, preserve surrogate pairs, and route it to the focused session through the existing text-input message.
Track Windows focus for Input Source 2 and document its mixed-event ordering limitation.
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix(unix): forward KeePassXC Auto-Type text
Decode native macOS and Linux text events before physical-key processing, preserve UTF-16 surrogate pairs across key releases, and route text to the focused writable session.
Select the existing Input Source 1 path from the actual GTK display backend so XWayland works on Wayland desktops. Native Wayland remains on Input Source 2.
Signed-off-by: fufesou <linlong1266@gmail.com>
* refact: simple refactor
Signed-off-by: fufesou <linlong1266@gmail.com>
* test(windows): cover Unicode packet text decoding
Verify BMP characters and consecutive surrogate pairs produce the expected text through the Windows packet decoder.
Signed-off-by: fufesou <linlong1266@gmail.com>
* feat(windows): make Unicode input opt-in from general settings
Keep legacy input as the default and apply the saved Windows option at startup and when changed. Add the setting under General > Other and remove the branch's Linux and macOS Unicode input handling.
Signed-off-by: fufesou <linlong1266@gmail.com>
* refactor(windows): simplify Unicode packet forwarding
Preserve input-source gating and callback results while reducing the branch diff.
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix(keyboard): unicode input, translations
Signed-off-by: fufesou <linlong1266@gmail.com>
* Route Windows Unicode packets to the current session
Check permissions on the same session that receives packet text and physical keys. Preserve valid text after an unpaired high surrogate and run the decoder tests on all platforms.
Signed-off-by: fufesou <linlong1266@gmail.com>
* Pin rdev to the merged Unicode packet change
The lockfile bump to rustdesk-org/rdev#27 was made while resolving a
merge commit, which the rebase onto master dropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
---------
Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix: verify Unix IPC endpoint and configuration sync peers
Check kernel peer credentials before dispatching main IPC messages. Verify the root service, the active user's main endpoint for management commands, and the process submitting service synchronization.
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix: stop stale Linux GUIs and confirm Unix codec reports
Close the installed GUI before a package upgrade replaces its executable. Keep the codec probe alive until the installed Unix host reads back its report on the same IPC connection.
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix: keep existing Linux package upgrade behavior
An Ubuntu upgrade from 1.5.0 to 1.5.3 on master already closed the main window. Drop the extra GUI termination from the Debian, RPM and Arch upgrade scripts to keep package lifecycle changes out of the IPC fix.
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix: wait for Unix IPC peer verification before takeover
Keep an installed non-root server alive for a status round trip on the same main IPC connection before requesting the previous listener to close. This gives the listener time to verify the executable of the process requesting takeover.
Signed-off-by: fufesou <linlong1266@gmail.com>
* test: cover Unix service sync sender identity
Signed-off-by: fufesou <linlong1266@gmail.com>
* refact: function rename
Signed-off-by: fufesou <linlong1266@gmail.com>
* Refact: Remove unrachable branch
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix: wait for macOS main IPC verification before one-way sends
Keep the socket open until the listener replies to OnlineStatus. This lets the installed host resolve the sender PID before the GUI sends a password refresh or another one-way request.
Signed-off-by: fufesou <linlong1266@gmail.com>
---------
Signed-off-by: fufesou <linlong1266@gmail.com>
On a Wayland host that injects input through the RemoteDesktop portal,
wheel steps went to NotifyPointerAxis, which carries smooth-scroll
pixels, so a wheel click scrolled about one pixel: on mutter (46 and 51
tested), libei-based portals (KDE master, COSMIC) and the wlr
RemoteDesktop implementation. Released KDE portals (Plasma 6.8 and
older) pass the value to KWin fake input with y negated, so vertical
scrolling there also went backwards.
Send the steps with NotifyPointerAxisDiscrete. On GNOME a click now
arrives as a wheel step (value120 = 120). The KDE portals that still use
KWin fake input turn each step into one axis unit without a wheel step,
so multiply the steps by 10 when KWin is older than 6.8.80; in Qt, GTK3,
Firefox and Chromium that scrolls as far as a local wheel click. The
KWin version is read once from org.kde.KWin.supportInformation; if that
fails, the steps are not scaled.
Fixes#17264
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
Co-authored-by: x7edo1x-glitch <285020844+x7edo1x-glitch@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
With a restore token saved, the portal answers without showing its
picker, yet every first-viewer login still told the peer "Please Select
the screen to be shared(Operate on the peer side)". CAP_DISPLAY_INFO is
cleared when the last viewer leaves, so is_inited() reports "not
inited" on each new connection.
When the server process has a token saved, the login now holds the
message back for 3 s and drops it if the display refresh (portal request
and capturer setup) finishes first. If the portal turns the token down
and shows its picker, the message goes out after 3 s. Without a token
the message is sent at once, as before.
Fixes#17317
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(linux): wait for xrandr in change_resolution_directly to prevent zombie processes
* test(linux): add xrandr end-to-end and zombie-reaping tests
* fix(linux): run change_resolution via spawn_blocking and simplify xrandr test
* fix(linux): reap xrandr on a separate thread
Wait for xrandr on a dedicated thread in change_resolution_directly, and log a failed exit with throttled_log. Callers no longer wait for xrandr, so the async worker and restore_resolutions do not block.
Restore src/server/connection.rs to its state on master. The Windows and macOS paths do not change.
Replace the regression test with one that needs no X server.
* fix(linux): create xrandr reaper thread fallibly before spawning xrandr
* fix(linux): reap xrandr through the existing CHILD_PROCESS list
Push the xrandr child to CHILD_PROCESS, which check_zombie() already polls in the server process. This removes the waiter thread, the channel, and the second wait path that earlier commits added.
* test(linux): drop the xrandr reaping test
The test skips itself when xrandr is missing, and the CI Linux job does
not install it, so it gives no reliable coverage there. The real-session
results are the evidence for this fix.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
---------
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* feat: support a configurable default keyboard mode
* fix(web): preserve the selected keyboard mode for input source 2
* Point hbb_common back to upstream after PR #646
* ci: run web keyboard mode tests in Chrome
* test: remove browser-only keyboard mode tests and CI step
* Hide the keyboard mode setting on controllers with a single input source
* Keep the keyboard mode setting when only Input source 1 is available
* Update libs/hbb_common to latest main
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(ipc): preserve the host privacy recovery record during settings updates
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix(ipc): keep Windows config mirrors from overwriting host recovery
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix(ipc): keep display recovery in the Windows host profile
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix(ipc): preserve Windows recovery across sync and offline edits
Keep the original options for a round trip to an older host and filter the separate profile during persistence. Read and write single-option edits over the same authenticated connection. Use locked profile updates when the host pipe is absent.
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix(ipc): keep Windows offline option edits and GUI acknowledgements consistent
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix(ipc): limit recovery protection to configuration updates
Signed-off-by: fufesou <linlong1266@gmail.com>
* fix(ipc): preserve host recovery for LocalSystem clients
Signed-off-by: fufesou <linlong1266@gmail.com>
* test(ipc): cover LocalSystem host profile selection
Signed-off-by: fufesou <linlong1266@gmail.com>
* test(ipc): simplify recovery configuration checks
Signed-off-by: fufesou <linlong1266@gmail.com>
* chore: update hbb_common for configuration setter layout
Signed-off-by: fufesou <linlong1266@gmail.com>
* refactor(ipc): share the list of preserved configuration keys
Signed-off-by: fufesou <linlong1266@gmail.com>
* update hbb_common
Signed-off-by: fufesou <linlong1266@gmail.com>
---------
Signed-off-by: fufesou <linlong1266@gmail.com>
* drm: capture multi-plane scanouts with the libdrmtap packet API
KWin 6.8 on Intel can scan a window out of its own plane, above the
desktop (overlay) or below a desktop with a hole (underlay). One dma-buf
descriptor cannot describe that frame: the window was missing, or during
an underlay the window alone was streamed as the whole screen (#17187).
libdrmtap 0.6 grabs every lit plane as an opaque packet plus its fds and
composes them on the unprivileged side. When the loaded libdrmtap has the
packet API, the service sends the packet in the existing dma-buf message
(new field, all fds of the message belong to it) and the consumer converts
it with drmtap_convert_packet. With an older libdrmtap nothing changes.
The fd transport now carries up to 16 fds per message instead of one.
The ABI gate accepts minor 6 next to 5.
* drm: gate the packet path on the libdrmtap ABI level
The loader accepts libdrmtap 0.5.0 up to 0.6.x. When the library exports
drmtap_abi, the level range it serves must include 2 (the 0.6.0 header);
without the symbol it is a 0.5 library, level 1. The packet path is on
only at level 2 or above with its three symbols resolved.
The consumer reads the rotation of a packet frame from its converting
context after drmtap_convert_packet: libdrmtap knows there whether the
frame was composed (rotate-0) or one plane converted as its buffer.
drmtap_convert_packet errors and output checks now match convert():
EAGAIN, EBUSY and EINTR skip the frame instead of demoting the display.
The frame arm sends through drm_send_frame and send_msg keeps its one fd
signature. Comments and two log lines updated for the packet path.
* drm: let build.py package any accepted libdrmtap minor, keep the last frame on E2BIG
build.py required the pinned libdrmtap minor to equal DRMTAP_ABI_MINOR, so raising the
runtime gate to 0.6 made it refuse the 0.5.12 pin. It now accepts the same range as the
runtime loader. grab_packet maps E2BIG (more than four lit planes, none covering the CRTC)
to WouldBlock so the last frame stays, like grab_desc on an underlay.
* build: pin libdrmtap v0.6.0
rustdesk-org/libdrmtap is synced with upstream, so the package can ship
0.6.0 and the packet path runs. Before this, a packaged build carried
0.5.12 and has_packet() was always false.
* drm: turn a composed frame by the primary plane rotation
A frame libdrmtap composed from several planes is the CRTC raster and
answers rotate-0, so it was turned by the wl_output transform. That
transform does not carry the panel orientation: on a panel whose primary
plane rotated in hardware the composed frame came out upside down (180)
or transposed against the session size (90/270), which rebuilt the
session on every frame while an overlay was lit. The CPU path does the
same once it composes.
Enumeration now records the primary plane rotation next to
plane_transposed, read from the same query. A frame answering rotate-0
is turned by that rotation when the plane rotated, else by the output
transform as before. One-layer frames still answer their plane rotation
and are left alone.
* drm: a failed packet convert drops to one descriptor first
A convert error on a packet set prefer_cpu, which kept that monitor on
the CPU path for the rest of the process run. It now sets no_packet: the
next session asks the service for one descriptor (grab_desc) through a
new DrmStart field, and only a failed descriptor convert sets
prefer_cpu. The field defaults to false, so a consumer that does not
send it keeps the packet path.
The ABI gate test checks again that a library below the floor (0.4.x)
is refused.
* build: pin libdrmtap v0.6.1
rustdesk-org/libdrmtap is synced with v0.6.1. It fixes the frame size
of a single plane that is scaled to the screen or smaller than it: that
plane came out at its buffer size and the session was rebuilt.
---------
Co-authored-by: Mariano Abad <weimaraner@gmail.com>
* ci: give CI runs a vcpkg binary cache that works, saved from master only
vcpkg removed its x-gha backend, so every run builds the vcpkg ports from
source, 6 to 22 minutes per job. CI runs that publish nothing now restore the
vcpkg binary packages that the last master push saved for the same job,
through vcpkg's files backend and actions/cache, and a run saves only when it
built a package the cache lacked. Builds that publish (nightly, tags) set
VCPKG_BINARY_SOURCES to `clear` and never touch the cache.
rust-cache entries are 1.3 to 2.2 GB each and every PR saved its own, so
within the 10 GB limit they evicted master's and most runs missed. They are
now saved from master only; PRs still restore master's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
* DO NOT MERGE: let this PR's runs save the vcpkg cache, to test restoring it
* ci: drop rust-cache from the Flutter builds; save ci.yml's from master only
In the last two PR CI runs all 20 rust-cache restores in flutter-build.yml
and bridge.yml found nothing, and so did every job of the 2026-11-28 nightly.
Saving the ~2 GB entries still took up to 3.3 minutes per job and kept the
repository's cache above its 10 GB limit, which evicted most of the new vcpkg
entries within an hour of their first save. ci.yml keeps its rust-cache, but
only master saves it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
* Revert the temporary save-on-PR commit
With it, this PR's runs saved the vcpkg cache, and a rerun of the Android
x86_64 job restored all 20 packages from it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
* ci: keep only the current vcpkg packages in a saved entry; drop the iOS wiring
The save step now deletes the restored zips that no package installed by
this run uses before it saves. Otherwise each compiler, vcpkg commit or
port change carried the whole old set into every later entry, so an entry
grew by a full 32 to 104 MB set per such change, not by a few MB.
The iOS job runs only in builds that publish, where the restore and save
steps are skipped, so its wiring never ran: remove it.
Say that rust-cache rarely hit rather than never: macOS x64 had a hit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
* ci: keep the bridge's rust-cache, saved from master only; log the vcpkg pruning
Every platform job waits for generate-bridge, which without rust-cache
compiles cargo-expand and flutter_rust_bridge_codegen from source on every
run (2 to 3 minutes). Its entry is about 1 GB, one per run rather than one
per platform job, so keep it and save it from master only, as ci.yml does.
The vcpkg save step now logs how many zips it kept and removed, and warns
when the status file is missing, so the first master run shows the pruning
working on each platform.
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>
* ci: build published binaries without restoring any cache
Nightly and tag builds restored rust-cache (which also holds ~/.cargo/bin,
where the bridge's flutter_rust_bridge_codegen lives), the run-vcpkg cache, the
run-on-arch container images pushed to GHCR, and the bridge's Flutter and pub
cache. Other workflow runs can write all of these, so an entry planted by one
of them would end up in a published binary, past the lockfile and hash checks.
With upload-artifact set, those steps are now skipped or told not to cache,
and the cache token is no longer exported to every build step. CI runs without
upload-artifact keep their caches.
The cost is small today: vcpkg's x-gha binary cache backend has been removed
upstream, so every run already builds the vcpkg ports from source, and the
last nightly found no rust-cache entry for any job. What is new is that the
run-on-arch images are rebuilt in every published build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
* DO NOT MERGE: run this PR's CI the way a published build runs (no cache)
* Revert the temporary no-cache CI commit
Its CI run (46105502143) built every PR CI job the way a published build now
runs, without any cache, and passed.
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>
* ci: pin every external download in the Flutter build workflow
flutter-build.yml fetched 16 files with curl, wget or Invoke-WebRequest and
checked none of them against a hash kept in this repository: sciter from a
`master` URL, the engine and the web deps from release tags that are
re-uploaded in place, nasm over plain http, the Rust and Flutter tarballs. The
printer driver zips were checked, but against a sha256sums file from the same
release, which whoever can replace the zips can replace too.
Each download is now checked against a SHA-256 written next to it, and the
sciter files come from a fixed commit. The git sources that followed a branch
or a tag (flutter-elinux, CMake for armv7, flathub/shared-modules,
appimage-builder) are pinned by commit, and the last action referenced by tag
(download-syft@v0) by SHA. playground.yml gets the same check for rcodesign.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
* ci: fail on a printer driver mismatch and pin the Syft download
With the printer driver hashes now kept in this file, a mismatch is never a
network failure: it is either an update upstream or a replaced file. The step
logged it and built without the driver, so the next in-place update of the
`driver` release would have shipped Windows packages without remote printing
and a green run. It now fails the step. A failed download still skips the
driver, as before. It uses `exit` because the surrounding catch swallows
`throw` and, with $ErrorActionPreference = 'stop', Write-Error too.
anchore/sbom-action/download-syft, even pinned by commit, runs install.sh from
syft's `main` branch in a job with `contents: write`. The step now downloads
the syft 1.42.3 release tarball, the version the action installed, checks it
against a SHA-256 written here, and unpacks it outside the checkout that
`syft dir:.` scans.
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>
* ci: enforce the Flutter lockfile in every build
Every Flutter job now runs `flutter pub get --enforce-lockfile` before it
builds, so a package version or content hash that pubspec.lock does not
pin fails the job instead of being resolved live.
The Flutter 3.44 jobs (Windows arm64, macOS arm64, their bridge) and the
3.22.3 bridge job edit pubspec.yaml on the fly and had no lock for the
result, so the affected packages were resolved at build time. Each of the
two states now gets its lock entries from a diff against
flutter/pubspec.lock, applied where the pubspec.yaml edit is made. Every
other package keeps following the committed lock: a change there either
carries over or fails at `git apply` / `--enforce-lockfile`.
It has to be `flutter pub get`: `flutter packages pub get` only forwards
to `dart pub` and skips the plugin registrant files.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
* ci: apply the 3.44 lock diff before any source edit; say what the diffs track
A lock diff that no longer fits now stops apply_flutter_3.44_source_patches.sh
before it edits a source file. Before, common.dart and pubspec.yaml were already
patched and dialog.dart was not, so every later run refused the tree as
partially applied.
The comments said the diffs hold what the pubspec bumps change, but most of
their entries come from the pins of the Flutter SDK itself. Moving one of those
Flutter versions therefore needs the matching diff regenerated; say so next to
each version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
* ci: treat a restored 3.44 pubspec.lock as not patched
The "already applied" check looked at the Dart sources and pubspec.yaml
only, so rerunning the script after restoring just flutter/pubspec.lock
exited 0 with the bumped manifest and the old lock, and the following
`flutter pub get --enforce-lockfile` failed. The early return now also
requires the lock diff to reverse cleanly; otherwise the checkout is
reported as partially patched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* Add Arabic RustDesk Server Pro badge
* Add Arabic RustDesk Server Pro badge
* Revise Arabic README with updates and disclaimers
Updated the Arabic README to include new sections, improve translations, and add a disclaimer regarding misuse.
* docs: fix direction marks around release options
Android 11+ refuses the RTM_GETLINK dump to apps targeting API 30 or
later (SELinux nlmsg_readpriv). The getifaddrs() shim dumped links first
and failed the whole call, so webrtc-util saw no interfaces and WebRTC
offered no host candidates. Two peers behind one NAT then fell back to
the relay.
Dump addresses only, and name each with if_indextoname() and read its
flags with SIOCGIFFLAGS, as bionic's own getifaddrs() does for apps and
WebRTC's ifaddrs_android.cc does everywhere. This drops the link table.
Also report IFA_LOCAL rather than the peer for an IPv6 address that has
one, as for IPv4.
Supersedes #17293, which diagnosed the root cause.
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The 32-bit Windows terminal helper crashed with SIGSEGV right after it
started (#17296). portable-pty loaded CreatePseudoConsole,
ResizePseudoConsole and ClosePseudoConsole through function pointers
typed extern "C", but these functions are stdcall, so on i686 every call
popped its arguments twice and skewed the stack pointer.
rustdesk-org/wezterm@a181db18 declares the pointers extern "system".
filedescriptor comes from the same repository and moves with it; its
code is unchanged.
Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The PR template gets an "AI cross-review" section: contributors list the
models that reviewed the diff besides the one that wrote it, paste the
review output or a share link, and give their decision on each finding.
Findings can be wrong, so they are judged, not applied blindly.
A pull_request_target workflow reads the PR description and file list
(it never checks out PR code) and, for authors without write access,
labels the PR needs-evidence and leaves one polite comment listing what
is missing: test environment and results, reproduction for bug fixes,
AI cross-review, screenshots or video for UI changes, and the approval
link for features. Translation, docs and CI-only PRs skip the test and
review checks. PRs opened before this template are left alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkkfvhEPKVg85ZHovfs
* 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
* 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
* 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
* 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
* feat(lang): add the DRM screen capture strings
"Use DRM screen capture", its settings explanation and the two home-page
warnings that offer it. it.rs is left for its translator, and sc.rs is
left empty rather than guessed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* build(linux): bundle libdrmtap into the stock packages and drop the unattended-wayland variant
DRM capture is now a runtime option, so the package name no longer has to be
the consent. build.py compiles `drm,drm-wake` into every Linux Flutter build
on the deb and pacman paths (`--no-drm` opts out), and the stock `rustdesk`
deb carries libdrmtap. The yum and zypper paths only build Sciter rpms and
are left alone.
- The variant rename, its Conflicts/Provides on `rustdesk`, the extra
Depends and the measured libc6 floor are gone: libdrmtap is dlopen-ed and
falls back to PipeWire when it cannot load, so it must not stop the
package installing on older systems.
- The stock deb Conflicts/Replaces `rustdesk-unattended-wayland`, so
installing it takes over from that package.
- `--package` decides from the staged binary whether it is a drm build,
since it compiles nothing; a Sciter bundle stays as it was.
- The Flutter rpm specs and PKGBUILD install libdrmtap into
/usr/lib/rustdesk, and the rpms exclude it from auto-generated
Requires/Provides.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* ci(linux): build every Linux package with drm and run the drm tests in the main job
build-rustdesk-linux now builds libdrmtap on the runner (x86_64 and
aarch64), compiles `drm,drm-wake` into the release library and packages the
library into the deb and both rpms; arch gets it through PKGBUILD. The
separate build-rustdesk-linux-drm job is gone, along with the
rustdesk-unattended-wayland deb it published.
- The drm-gated unit tests (`run_drm_tests`) move into the x86_64 build
container unchanged.
- A step checks that the deb carries libdrmtap and a binary that dlopens
it, and each rpm is checked for the library and, on x86_64, for a glibc
requirement newer than the build container's.
- x86_64 uploads its deb on a PR too, as the drm job did, so a PR's build
can be installed and tested.
AGENTS.md now points the drm test rule at the x86_64 build job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* refactor(drm): keep start_os_service's diff to the producer move, check the cursor ceiling cheaply first
DrmCaptureSwitch now sits after start_os_service, so the diff there reads as
the producer spawn leaving and the poll arriving. The cursor-cache ceiling
compares the cache length before it locks DRM_STATE.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(drm): load the custom client before is_x11() can read Config, offer DRM only where it is compiled in
`IS_X11` now asks `drm_capture_enabled()`, which reads Config, and it is
computed in `global_init()`. `core_main()` ran that before
`load_custom_client()`, so on a Linux custom client the config loaded from
the stock "RustDesk" path before the app name was set and was never
reloaded; the root then synced that copy over the client's own settings.
Load the custom client first. On Windows and macOS `global_init()` does
nothing, so only the Linux startup order changes.
The DRM checkbox and the home-page "Enable" cards also showed on installed
builds without the drm feature (NixOS, source builds, --no-drm), where the
option has no effect. They now also need `is-drm-capture-supported`, a new
`main_get_common` key that reports whether drm is compiled in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(flutter): keep the DRM switch behind disable-settings, ask loginctl once per build
disable-settings hides the Security tab but not General, so the Wayland card's
checkbox and the home Enable button both stayed reachable on a locked custom
client. With settings disabled the home page falls back to the stock Wayland
warnings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(drm): offer DRM only where libdrmtap loads, keep the stock check_init apply verbatim
- is-drm-capture-supported also requires the bundled libdrmtap to load, so a
host whose glibc is older than its build is not offered a switch that does
nothing.
- Dispatch the Wayland probe before load_custom_client: the probe child must
run before any other startup work.
- check_init keeps master's not(drm) apply untouched; the drm build carries its
own copy for allow-drm-capture off.
- drm_capture_enabled's doc names the Wayland enumeration in base and scrap,
which does not read the option.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* ci(linux): catch any glibc 2.28+ requirement in the rpm drm check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(drm): initialize libsodium before the custom client's signature check
core_main now loads the custom client ahead of global_init, which since
#16974 starts with init_sodium so nothing uses libsodium before it. Run it
first there too; a second sodium_init() is a no-op.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(drm): follow allow-drm-capture in the startup warm and in running streams
- warm_availability reads the option inside its retry loop. It starts
before the initial config sync from root, so a --server whose account
config does not hold the option yet (a greeter account that gets no
RUSTDESK_DRM_CAPTURE, or an account not yet synced) skipped the warm
for its whole life and paid the cold probe on its first connection.
- handle_drm_conn checks the option per frame, next to the peer re-auth,
so turning it off ends a stream that is already running rather than
only refusing new ones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* test(drm): skip the option-off test where the option is on
drm_capture_enabled() reads the real config and RUSTDESK_DRM_CAPTURE, so
the test failed on a machine that has DRM capture turned on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(drm): leave running streams to the --server restart
Drop the per-frame allow-drm-capture check added in 3d1469255. The root
sees the option flip before its service loop restarts the --server, so
the check ended the stream up to one loop pass early and the consumer
spent that time failing to rebuild a capturer before the restart
disconnected the session anyway. It also took CONFIG2's read lock on
every frame, which Config2::set_options holds for writing across its
disk write. The comment now says what turning the option off does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* ci: run the drm and unix-file-copy-paste tests in the CI workflow
Move them out of the Linux package build into ci.yml's x86_64 Linux job,
which already has vcpkg and the build dependencies. The drm feature only
dlopens libdrmtap, so the tests need neither the bionic container nor
the library. A failing test no longer stops the deb, rpm and Arch
packages or skips appimage and flatpak.
The step runs every test of each package with the feature on instead of
selecting modules by name, so run_drm_tests and its guard against a
filter that matches nothing are gone, and so is the AGENTS.md rule
about it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(drm): hand an allow-drm-capture change made as root to the service
The service decides on DRM from its own copy of the config, which only a
non-root --server syncs. A root process that changed the option -- the CLI
(`sudo rustdesk --option`), or a root --server at a login screen applying a
strategy -- left the service on the old value, so the change never took effect
there, and the next store by the service overwrote it in the file.
Such a process now sends its config to the service over the existing SyncConfig
when the option changed. Non-root processes and changes to other options do
nothing more.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* build(drm): recommend the GL libraries the old variant depended on
rustdesk-unattended-wayland depended on libdrm2, libegl1 and libgles2. The
package that replaces it now recommends them: libdrmtap opens EGL lazily, so they
stay optional, but apt still installs them by default and autoremove keeps them.
AGENTS.md keeps the rule that a test behind a feature no CI build enables needs a
cargo test line, now pointing at ci.yml.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* build(drm): recommend the GL libraries in the rpm and Arch packages too
The rpm specs recommend libdrm, libEGL and libGLESv2 by soname, since Fedora and
openSUSE name the packages that provide them differently; dnf and zypper install
weak dependencies by default. PKGBUILD lists libdrm and libglvnd as optdepends,
which pacman only reports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(drm): hand the option to the service only from a current copy of the config
SyncConfig carries the whole config, and the service stores it and takes its
trusted-device grants as authoritative. A root UI held the copy it loaded at
startup, so turning the option on or off there could restore a revoked trusted
device or an older permanent password. Its view of the option could also differ
from the service's, so a change could be skipped.
The push now runs in the root --server's handler of an options update, the
process that holds the config, also when the update is rejected after the
options were applied. `sudo rustdesk --option` still pushes by itself, since it
has just loaded the config and can run before any --server is up. A UI never
pushes, including a GUI started with sudo that hosts the IPC itself: a change
made there does not reach the service.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* ci: check the archlinux package carries libdrmtap
PKGBUILD skips libdrmtap when it finds none, so a tag or nightly build could
publish an Arch package without it while every step passed. Check its contents
as the deb and rpm steps do.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(drm): send the service the trusted-device grants on disk
SyncConfig(Some(..)) makes the service write the sender's grants as
authoritative. `sudo rustdesk --option allow-drm-capture ...` loads its
config at start and pushes only after its IPC round trips with the
--server, so a grant written in that window (a 2FA trust just granted, a
device just removed) was reverted by the push.
Read the grants from disk, as the service's own SyncConfig(None) reply
does; the service then finds them equal to what it holds and writes
nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(lang): say unattended access in the Lithuanian wayland-drm-tip
"Automatinis prisijungimas" is this file's "Auto Login", so the tip read
as advice about automatic login. "Neprižiūrima prieiga" matches the
English source and the file's "prieiga" for access.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
* fix(core_main): load the custom client early only with drm
Only a Linux drm build reads Config in global_init (the IS_X11 greeter
override reads allow-drm-capture), so only there must the custom client
load first. Every other build keeps master's order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1grQ39ByRWPUtTBdTzEBF
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Update connection.rs
Added camera support for macOS
* scrap: enable nokhwa camera deps and cfg for macOS (frame path still TODO)
* scrap: allow PixelBuffer from raw bytes on macOS for camera frames
* macOS: request camera permission via nokhwa, add NSCameraUsageDescription
* macOS: add camera entitlement
* nokhwa: fix macOS bi-planar (NV12) camera frames via vendored patch
* nokhwa: point at filipklein5/nokhwa fix branch instead of vendoring
Replaces the vendored libs/nokhwa copy (~16.5k lines) with a git
dependency override pointing at the macOS NV12 fix on
filipklein5/nokhwa#macos-nv12-fix, submitted upstream as
rustdesk-org/nokhwa PR (see Cargo.toml comment). Keeps this PR's diff
focused on the macOS camera support itself.
* nokhwa: link to upstream PR #7
* address CodeRabbit review on #17135
- connection.rs: move the macOS camera-permission wait (can block up to
30s) off the Tokio worker via spawn_blocking, so send_logon_response_
and_keep_alive stays responsive to input/heartbeats while it's pending.
- camera.rs: build the non-Linux camera list in a local Vec and swap it
into SYNC_CAMERA_DISPLAYS only after enumeration succeeds, instead of
pushing into the shared cache mid-loop. A create_camera failure
partway through no longer leaves the cache holding a stale prefix
that disagrees with the Err this function returns (pre-existing on
Windows; macOS now exercises the same path).
- Cargo.toml + res/osx_camera_info.plist: add NSCameraUsageDescription
to the legacy Sciter macOS bundle via cargo-bundle's
osx_info_plist_exts, so that build path (unlike the Flutter one)
doesn't get killed at the camera permission prompt for lacking it.
* nokhwa: bump to 8920ff8 (420v + review fixes, rustdesk-org/nokhwa#7)
* keep non-macOS camera paths unchanged
- camera.rs: drop the SYNC_CAMERA_DISPLAYS local-vector rework of the
non-Linux loop; it also changed Windows and fixes a pre-existing
issue, so it belongs in a separate PR.
- connection.rs: use spawn_blocking for Cameras::all_info() on macOS
only (the permission wait is macOS-specific); other platforms keep the
original call.
* macOS: only advertise/use View Camera when AVCaptureDeviceDiscoverySession exists
nokhwa's AVFoundation query uses AVCaptureDeviceDiscoverySession, which
exists only on macOS 10.15+; on 10.14 hosts class! panics and the
release profile aborts the server. Probe the class at runtime:
- connection.rs: advertise support_view_camera on macOS only if present
(the windows/linux line is back to its original form).
- camera.rs: all_info()/exists()/create_camera() return no cameras (or
an error) when it is missing.
Also bumps nokhwa to 0a8bf56 (recv_timeout in the macOS frame_raw).
* nokhwa: bump to 5439c78 (releases the configuration lock, rustdesk-org/nokhwa#7)
* nokhwa: bump to d390711 (hold the configuration lock only while starting the stream, rustdesk-org/nokhwa#7)
* nokhwa: bump to a509e0e (configure() closure unlocks on every path, rustdesk-org/nokhwa#7)
* nokhwa: bump to 5bd00f5 (configure() takes &Self, can't swap the unlocked device, rustdesk-org/nokhwa#7)
* nokhwa: drop the [patch] now that rustdesk-org/nokhwa#7 is merged
rustdesk-org/nokhwa#7 merged into fix_from_raw_parts at 137a327.
Cargo.toml's existing git dependency now resolves there directly, so
the temporary [patch] to filipklein5/nokhwa is no longer needed.
* quartz.rs: drop PixelBuffer::from_frame, inline the screen constructor
The screen-capture call site now constructs PixelSource::Screen
directly, as it did before this feature (just with the new field
names). The extra from_frame helper only existed to wrap that one
call, which AGENTS.md asks to avoid: the screen path shouldn't change
shape just because camera.rs needs PixelBuffer::new.
* address maintainer review round 3
- camera.rs: gate exists() and create_camera() on macOS on
nokhwa::nokhwa_check() too, not just is_camera_supported(). Without
it, a denied/timed-out permission let exists() report a camera
anyway, so the server started the camera0 video service and spammed
unthrottled errors while touching AVFoundation without permission.
all_info() always runs ensure_macos_camera_permission() first during
login, so by the time these run the permission state is settled.
- connection.rs: log the Err from Cameras::all_info() (permission
denied / timed out) before falling back to an empty Vec, instead of
dropping it silently via unwrap_or_default().
- camera.rs: remove the FIXME above the PixelBuffer::new call; it's
stale now that macOS implements it.
- quartz.rs: PixelBuffer::new computes stride from pixfmt.bytes_per_pixel()
instead of hardcoding width * 4, so non-32bpp formats get a correct
stride too.
* nokhwa: bump to f149b07 (rustdesk-org/nokhwa#8 merged, fixes macOS 10.14 launch crash)
* 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.
* 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>
* 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>