SharpRDP 是一个面向 Ubuntu 和 Windows 高分屏的原生 RDP 客户端。它不把远程桌面先渲染成逻辑分辨率再交给桌面环境放大,而是按 Qt 窗口的真实设备像素比请求远端分辨率,并用 OpenGL 最近邻采样直接显示 BGRA 帧,避免客户端二次插值造成的文字发虚。
- Ubuntu/Wayland/X11 与 Windows 上的 Qt Quick/QML 无边框现代界面
- FreeRDP 3 会话、NLA/TLS 认证和 Windows 连接
- 逻辑尺寸 ×
devicePixelRatioF()的物理像素分辨率请求 - RDP Display Control 动态分辨率;窗口缩放后 220 ms 防抖更新
- Windows
DesktopScaleFactor/DeviceScaleFactorHiDPI 参数 - RDPGFX、H.264/AVC444 和传统位图三种模式
- Qt Quick FBO 中的 OpenGL BGRA 纹理上传、全视口显示和
GL_NEAREST锐利采样;远端尺寸切换期间不产生黑边 - 鼠标、滚轮、常用键盘扫描码和 Unicode/中文输入
- Windows 远程光标形状、热点和隐藏状态同步(文本、缩放、忙碌等指针)
- 远程光标按本地设备像素比显示,避免高分屏把光标二次放大
- Ubuntu 与 Windows 之间的 Unicode 文本剪贴板同步
rdpsnd远程音频播放重定向,可在连接前独立开关- 未知证书确认、证书变化警告;密码不写入配置文件
- 可选密码保存:Ubuntu 使用 Secret Service/GNOME Keyring,Windows 使用 Credential Manager,异步读取不阻塞界面
- 非阻塞断连与安全退出,断开期间界面不会冻结
- 断连立即清除最后一帧并退出全屏;关闭程序最多等待 5 秒后兜底退出
- 无边框全像素全屏、连接参数持久化和显示策略单元测试
- 默认全屏连接选项;连接时直接按当前显示器的完整物理像素请求桌面
- 默认全屏会等待窗口管理器完成尺寸切换后再连接,并在显示通道就绪后补发分辨率,避免首次全屏模糊
- 原始远端分辨率截图、Ctrl+Alt+Del、Windows 键和失焦防卡键
- 类 Remmina 的顶部悬浮工具岛,支持自动隐藏、固定、直接最小化、断开、组合键、截图和全屏切换
- 全屏会话可以直接最小化;恢复时保持全屏窗口状态,不触发无意义的远程分辨率切换
- 连接成功后可自动切到英文输入状态;Ubuntu 支持 IBus/Fcitx,Windows 使用系统键盘布局 API,断开后恢复连接前状态
- 原生打包:Ubuntu
.deb、Windows NSIS 安装器与免安装 ZIP - GitHub Actions 自动双平台构建;推送版本标签后自动创建 Release 并上传安装包
- QML 玻璃质感连接卡片、无边框标题栏、主题化控件、自定义背景图、GPU 背景模糊和默认渐变背景
例如 Ubuntu 中窗口逻辑尺寸为 1920×1080、缩放为 200%,SharpRDP 会向 Windows 请求 3840×2160,而不是请求 1920×1080 后放大到 4K。Windows 仍通过200%桌面缩放保持控件大小合适,字形则由Windows在4K像素网格上重新栅格化。
当远端暂时还没完成动态分辨率切换时,画面会等比例显示并使用最近邻采样,因此可能短暂出现像素块,但不会被双线性滤镜抹糊。分辨率切换完成后通常是 1:1 像素显示。
- Ubuntu 25.10 或更新版本(推荐 Ubuntu 26.04;其他发行版需自行提供 Qt 6.8+)
- CMake 3.22+
- GCC 12+ 或 Clang 15+
- Qt 6.8+(Core、Gui、Widgets、OpenGL、QML、Quick、Quick Controls 2、Quick Effects)
- FreeRDP 3 与 WinPR 3 开发包
- libsecret 1 开发包及可用的 Secret Service(Ubuntu 桌面通常由 GNOME Keyring 提供)
- OpenGL 3.2 兼容上下文
Ubuntu 仓库若提供 FreeRDP 3,可以执行:
chmod +x scripts/*.sh
./scripts/install_deps_ubuntu.sh
./scripts/build.sh
./build/sharprdp如果系统仓库只有 FreeRDP 2,请从 FreeRDP 官方发行版构建并安装 FreeRDP 3。以下三个 pkg-config 模块必须可见:
pkg-config --modversion freerdp3 freerdp-client3 winpr3手动构建:
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure生成 Ubuntu 安装包:
./scripts/install_deps_ubuntu.sh
./scripts/package_ubuntu.sh
sudo apt install ./dist/sharprdp_0.6.0_amd64.deb- Windows 10/11 x64
- Visual Studio 2022 C++ 工具链、CMake、Ninja、NSIS
- Qt 6.8.3 MSVC 2022 x64
- vcpkg 2026.06.24;清单会安装 FreeRDP 3.26、WinPR、FFmpeg 和 pkgconf
在“x64 Native Tools PowerShell for VS 2022”中运行:
./scripts/package_windows.ps1 `
-QtRoot C:\Qt\6.8.3\msvc2022_64 `
-VcpkgRoot C:\vcpkg输出目录包含:
SharpRDP-0.6.0-windows-x64.exe:Windows 安装器,带开始菜单快捷方式和卸载入口SharpRDP-0.6.0-windows-x64.zip:免安装版本,解压后运行bin\sharprdp.exe
安装包会携带 Qt、FreeRDP、WinPR 及其运行时 DLL,目标电脑无需单独安装开发环境。当前安装器没有商业代码签名证书,因此 Windows SmartScreen 可能显示“未知发布者”;发布前可在 CI 中加入你自己的证书签名步骤。
仓库已包含 .github/workflows/package.yml,无需自行上传编译产物:
- 将这个源码目录提交并推送到 GitHub。
- 在仓库的 Actions → Package SharpRDP → Run workflow 中手动测试一次;构建完成后可以在该次运行的 Artifacts 下载 Ubuntu 和 Windows 包。
- 正式发布时创建并推送与项目版本一致的标签:
git tag v0.6.0
git push origin v0.6.0标签会触发 Ubuntu 26.04 与 Windows 2022 两个独立构建。两边都通过测试后,工作流会创建 v0.6.0 GitHub Release,并上传 .deb、.exe 和 .zip。GitHub 自带的 Source code 压缩包会同时保留源码。
- 在 Windows 的“设置 → 系统 → 远程桌面”中启用远程桌面,并确认防火墙允许 TCP 3389。
- 输入 Windows 主机、用户名和密码。Microsoft 账户通常使用账户邮箱;域环境可单独填写域。
- 桌面缩放优先选择“自动”。它会跟随 Ubuntu 当前屏幕的设备像素比;若 Windows UI 太大或太小,再手动选择百分比。
- 局域网优先用 AVC444 清晰模式。若服务器或 FreeRDP 构建不支持 H.264,改用 RDPGFX 兼容模式;仍有兼容问题再使用传统位图模式。
- 只有在完全可信的隔离局域网中才勾选“忽略未知证书”。证书发生变化时仍会独立警告。
- “连接时默认全屏”和“播放远程音频”默认启用;设置会在下次启动时保留。
- 可选择 PNG/JPEG/WebP/BMP 背景,并随时恢复默认渐变背景或关闭模糊效果。
- 勾选“保存密码(系统密钥环)”后,密码会按主机、端口、用户名和域分别保存;取消勾选会删除当前连接对应的已存密码。
- “连接后切到英文”默认启用,支持 Ubuntu 常见的 IBus、Fcitx 5/Fcitx 4,以及 Windows 的 US English 键盘布局;断开连接时会尽力恢复原来的输入状态。
连接后把鼠标移到远程画面顶部边缘即可展开悬浮工具岛。工具岛会在 1.8 秒后自动收起;勾选“固定”后会持续显示。“最小化”按钮不会先退出全屏,所以不会让 Windows 桌面在全屏尺寸和窗口尺寸之间来回切换。
常用快捷键:
F11:进入或退出无边框、纯远程画面的全屏模式Ctrl+Alt+End:向远端发送Ctrl+Alt+DelCtrl+Alt+Home:向远端发送 Windows 键Ctrl+Shift+S:保存远端原始分辨率截图
“播放远程音频”会启用 FreeRDP 的 rdpsnd 输出通道,把 Windows 会话声音播放到 Ubuntu 当前默认音频设备。FreeRDP 会使用系统构建中可用的 PipeWire、PulseAudio 或 ALSA 后端。若没有声音,请先确认 Windows 的“允许音频和视频播放重定向”策略没有被禁用,并检查所安装的 FreeRDP 3 包是否包含 rdpsnd 音频后端。
flowchart TD
UI["Qt Quick / QML 界面"] --> Controller["AppController"]
Controller --> View["RdpQuickView / OpenGL FBO"]
Controller --> Session["RdpSession / 工作线程"]
Session --> FreeRDP["FreeRDP 3 协议与解码"]
FreeRDP --> Frames["线程安全 BGRA FrameStore"]
Frames --> View
View -->|"物理视口与输入"| Session
协议处理、解码和输入发送都在同一个 RDP 工作线程中串行执行;Qt GUI 线程负责 QML 状态与输入,Qt Quick 渲染线程负责 OpenGL。完整帧通过互斥保护的隐式共享 QByteArray 交接,避免渲染线程读取正在改写的 FreeRDP 主缓冲区。
- 当前为单显示器版本;多显示器布局、麦克风输入、磁盘和打印机重定向尚未实现。
- 为了保证正确性,每次
EndPaint会复制完整帧。4K/高帧率场景下一步应改成脏矩形上传和三缓冲。 - 键盘映射覆盖常用按键与 Unicode 输入。Ubuntu 英文输入状态切换依赖系统中可用的
ibus、fcitx5-remote或fcitx-remote;其他输入法框架会保持原状态。 - Wayland 下全局快捷键受桌面安全策略限制,但窗口聚焦后的远端输入不受影响。
未勾选“保存密码”时,密码只保存在当前进程内。勾选后,Ubuntu 由 libsecret 交给系统 Secret Service 保存,Windows 由 Credential Manager 保存;QSettings 只记录是否启用该功能,始终不保存密码明文。主机名、端口、用户名和域作为查找属性保存在普通配置与系统密码库元数据中。后续仍建议增加证书指纹固定和已知主机管理。
MIT
SharpRDP is a native RDP client designed for HiDPI displays on Ubuntu and Windows. Instead of rendering the remote desktop at a logical resolution and letting the desktop environment upscale it, SharpRDP requests the remote resolution from the Qt window's real device-pixel ratio. It then presents BGRA frames directly through OpenGL with nearest-neighbor sampling, avoiding the text blur caused by a second client-side interpolation pass.
- Modern, frameless Qt Quick/QML interface on Ubuntu/Wayland/X11 and Windows
- FreeRDP 3 sessions with NLA/TLS authentication and Windows connectivity
- Physical-pixel resolution requests calculated as logical size ×
devicePixelRatioF() - Dynamic resolution through RDP Display Control, with a 220 ms debounce after window resizing
- Windows
DesktopScaleFactorandDeviceScaleFactorHiDPI parameters - RDPGFX, H.264/AVC444, and legacy bitmap graphics modes
- OpenGL BGRA texture uploads in a Qt Quick FBO, full-viewport presentation, and sharp
GL_NEARESTsampling; no black bars while the remote size changes - Mouse, wheel, common keyboard scan codes, and Unicode/Chinese input
- Synchronization of Windows cursor shape, hotspot, and hidden state, including text, resize, and busy cursors
- Remote cursor rendering based on the local device-pixel ratio, preventing a second HiDPI enlargement
- Unicode text clipboard synchronization between Ubuntu and Windows
rdpsndremote-audio redirection with an independent pre-connection toggle- Unknown-certificate confirmation and certificate-change warnings; passwords are never written to the settings file
- Optional password storage through Secret Service/GNOME Keyring on Ubuntu and Credential Manager on Windows, loaded asynchronously without blocking the UI
- Non-blocking disconnect and safe shutdown, so the interface stays responsive while a session closes
- Immediate last-frame clearing and fullscreen exit on disconnect, with a five-second shutdown fallback
- Borderless, pixel-filling fullscreen mode, persistent connection settings, and display-policy unit tests
- Optional fullscreen-on-connect, requesting the complete physical resolution of the current display
- Fullscreen connection startup waits for the window manager to finish resizing, then resends the resolution after the display channel becomes ready to avoid a blurry first frame
- Native-resolution screenshots, Ctrl+Alt+Del, Windows key, and stuck-key prevention on focus loss
- Remmina-style floating top toolbar with auto-hide, pin, direct minimize, disconnect, key commands, screenshot, and fullscreen controls
- Direct minimization from a fullscreen session; restoring preserves fullscreen state and avoids unnecessary remote-resolution changes
- Optional automatic switch to English input after connection; IBus/Fcitx on Ubuntu and the system keyboard-layout API on Windows are supported, with best-effort restoration after disconnect
- Native Ubuntu
.deb, Windows NSIS installer, and portable ZIP packaging - GitHub Actions builds for both platforms, with automatic Release creation and package upload for version tags
- Glass-style QML connection cards, a frameless title bar, themed controls, custom background images, GPU blur, and a default gradient background
Suppose the Ubuntu window has a logical size of 1920×1080 at 200% scaling. SharpRDP asks Windows for 3840×2160 instead of requesting 1920×1080 and stretching it to 4K. Windows can still use 200% desktop scaling to keep controls comfortably sized, while glyphs are rasterized directly on the 4K pixel grid.
While the remote side is still applying a dynamic-resolution change, the previous frame is fitted proportionally with nearest-neighbor sampling. It may look briefly pixelated, but a bilinear filter will not blur it. Presentation normally returns to a 1:1 pixel mapping when the resolution transition completes.
- Ubuntu 25.10 or newer (Ubuntu 26.04 recommended; other distributions must provide Qt 6.8+)
- CMake 3.22+
- GCC 12+ or Clang 15+
- Qt 6.8+ with Core, Gui, Widgets, OpenGL, QML, Quick, Quick Controls 2, and Quick Effects
- FreeRDP 3 and WinPR 3 development packages
- libsecret 1 development files and a working Secret Service, normally GNOME Keyring on Ubuntu Desktop
- An OpenGL 3.2-compatible context
If the Ubuntu repositories provide FreeRDP 3, run:
chmod +x scripts/*.sh
./scripts/install_deps_ubuntu.sh
./scripts/build.sh
./build/sharprdpIf the repositories only contain FreeRDP 2, build and install FreeRDP 3 from an official FreeRDP release. These three pkg-config modules must be visible:
pkg-config --modversion freerdp3 freerdp-client3 winpr3Manual build:
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failureCreate and install the Ubuntu package:
./scripts/install_deps_ubuntu.sh
./scripts/package_ubuntu.sh
sudo apt install ./dist/sharprdp_0.6.0_amd64.deb- Windows 10/11 x64
- Visual Studio 2022 C++ toolchain, CMake, Ninja, and NSIS
- Qt 6.8.3 for MSVC 2022 x64
- vcpkg 2026.06.24; the manifest installs FreeRDP 3.26, WinPR, FFmpeg, and pkgconf
Run the following in an “x64 Native Tools PowerShell for VS 2022” terminal:
./scripts/package_windows.ps1 `
-QtRoot C:\Qt\6.8.3\msvc2022_64 `
-VcpkgRoot C:\vcpkgThe output directory contains:
SharpRDP-0.6.0-windows-x64.exe: Windows installer with Start menu shortcuts and an uninstall entrySharpRDP-0.6.0-windows-x64.zip: portable build; extract it and runbin\sharprdp.exe
The packages include the required Qt, FreeRDP, WinPR, and runtime DLLs, so no development environment is required on the target PC. The current installer is not signed with a commercial code-signing certificate, and Windows SmartScreen may therefore show “Unknown publisher.” You can add your own signing step to CI before a public release.
The repository includes .github/workflows/package.yml; compiled files do not need to be uploaded manually:
- Commit and push this source tree to GitHub.
- Open Actions → Package SharpRDP → Run workflow for a test build. When it finishes, download the Ubuntu and Windows packages from that run's Artifacts section.
- For a release, create and push a tag matching the project version:
git tag v0.6.0
git push origin v0.6.0The tag starts independent Ubuntu 26.04 and Windows 2022 builds. After both jobs pass their tests, the workflow creates the v0.6.0 GitHub Release and uploads the .deb, .exe, and .zip files. GitHub also retains its standard source archives.
- Enable Remote Desktop under Settings → System → Remote Desktop on Windows, and allow TCP port 3389 through the firewall.
- Enter the Windows host, user name, and password. A Microsoft account normally uses its email address; a domain can be entered separately when required.
- Start with Automatic desktop scaling. It follows the current Ubuntu display's device-pixel ratio. Choose a percentage manually only if the Windows UI appears too large or too small.
- Prefer AVC444 sharp mode on a LAN. If the server or FreeRDP build does not support H.264, use RDPGFX compatibility mode, then fall back to legacy bitmap mode if necessary.
- Enable Ignore unknown certificate only on a fully trusted, isolated LAN. A changed certificate still produces a separate warning.
- Start in fullscreen and Play remote audio are enabled by default, and their values persist for the next launch.
- Select a PNG, JPEG, WebP, or BMP background at any time, restore the default gradient, or turn off the blur effect.
- When Save password (system keyring) is enabled, the password is stored separately for each host, port, user name, and domain. Disabling it removes the saved password for the current connection.
- Switch to English after connecting is enabled by default. Common IBus, Fcitx 5/Fcitx 4 installations on Ubuntu and the US English keyboard layout on Windows are supported. SharpRDP attempts to restore the previous input state after disconnecting.
Move the pointer to the top edge of the remote view to reveal the floating toolbar. It hides automatically after 1.8 seconds unless Pin is enabled. The minimize control does not leave fullscreen first, so the Windows desktop does not repeatedly switch between fullscreen and windowed resolutions.
Common shortcuts:
F11: enter or leave borderless, remote-only fullscreen modeCtrl+Alt+End: sendCtrl+Alt+Delto the remote computerCtrl+Alt+Home: send the Windows key to the remote computerCtrl+Shift+S: save a screenshot at the original remote resolution
Play remote audio enables FreeRDP's rdpsnd output channel and plays Windows-session audio through the current default Ubuntu audio device. FreeRDP uses whichever PipeWire, PulseAudio, or ALSA backend is available in the system build. If audio is missing, verify that Windows policy allows audio/video playback redirection and that the installed FreeRDP 3 package contains an rdpsnd audio backend.
flowchart TD
UI["Qt Quick / QML UI"] --> Controller["AppController"]
Controller --> View["RdpQuickView / OpenGL FBO"]
Controller --> Session["RdpSession / worker thread"]
Session --> FreeRDP["FreeRDP 3 protocol and decoding"]
FreeRDP --> Frames["Thread-safe BGRA FrameStore"]
Frames --> View
View -->|"physical viewport and input"| Session
Protocol handling, decoding, and input transmission are serialized on one RDP worker thread. The Qt GUI thread owns QML state and input events, while the Qt Quick render thread owns OpenGL. Complete frames cross threads through a mutex-protected, implicitly shared QByteArray, preventing the render thread from reading a FreeRDP primary buffer while it is being modified.
- This release supports one monitor. Multi-monitor layouts, microphone input, drive redirection, and printer redirection are not implemented yet.
- For correctness, every
EndPaintcurrently copies a complete frame. A future optimization for 4K/high-frame-rate sessions should use dirty-rectangle uploads and triple buffering. - Keyboard mapping covers common keys and Unicode input. English-input switching on Ubuntu depends on an available
ibus,fcitx5-remote, orfcitx-remotecommand; other input-method frameworks keep their current state. - Global shortcuts are subject to desktop security policy on Wayland, but remote input works normally while the window has focus.
When password saving is disabled, the password exists only in the current process. When enabled, libsecret stores it through the system Secret Service on Ubuntu, and Credential Manager stores it on Windows. QSettings records only whether the feature is enabled and never stores the plaintext password. Host, port, user name, and domain are ordinary lookup attributes and may appear in application settings or password-store metadata. Certificate fingerprint pinning and known-host management remain recommended future improvements.
MIT