mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 16:50:41 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25d8d0c915 | ||
|
|
1a3348dfe9 |
No files matched your search
@@ -18,3 +18,17 @@ jobs:
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo test --locked
|
||||
|
||||
test-wayland:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install build dependencies (X11 + Wayland + portal)
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y build-essential pkg-config \
|
||||
libx11-dev libxext-dev libxtst-dev libxfixes-dev libgtk-3-dev \
|
||||
libwayland-dev libxkbcommon-dev libglib2.0-dev libpipewire-0.3-dev
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo test --locked --features wayland,portal
|
||||
Generated
+1
-1
@@ -2487,7 +2487,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
||||
|
||||
[[package]]
|
||||
name = "uu-remote-linux"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bytes",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "uu-remote-linux"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
edition = "2021"
|
||||
authors = ["uu-remote-linux contributors"]
|
||||
description = "Unofficial Linux host for NetEase UU Remote: control a Linux desktop from the official clients"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
Wayland(GNOME / KDE portal)修复版本。X11 行为不变。
|
||||
Wayland (GNOME / KDE portal) fix release. X11 behavior is unchanged.
|
||||
|
||||
### 修复 / Fixed
|
||||
- **GNOME Wayland 首次连接黑屏,桌面重绘后才恢复**(#2):新建的 portal 会话会把第一帧有效画面当作锁屏残留清掉,
|
||||
静止的桌面又不会产生新帧,所以画面一直是黑的。现在只有真正检测到锁屏(或 portal 被关闭)时才丢弃旧画面。
|
||||
First connection on GNOME Wayland stayed black until the desktop redrew (#2): a fresh portal session discarded its
|
||||
first valid frame as if it came from the lock screen.
|
||||
|
||||
### 其他 / Other
|
||||
- CI 新增 `--features wayland,portal` 的编译和测试。/ CI now builds and tests `--features wayland,portal`.
|
||||
|
||||
### 已知问题 / Known issues
|
||||
- Wayland(portal)下 Mac 控制端输入的下划线可能丢失(#3,正在排查,与键盘布局有关)。
|
||||
- Wayland 下剪贴板只有「控制端 → Linux」方向可用;长连接约 20 分钟可能被云端释放(排查中)。
|
||||
- Wayland 支持仍为实验性,需从源码以 `--features wayland,portal` 编译。
|
||||
|
||||
### 下载 / Download
|
||||
`uu-remote-linux-v0.1.3-x86_64-linux.tar.gz`:X11 版可执行文件(x86_64,glibc ≥ 2.35)。
|
||||
|
||||
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
|
||||
+15
-4
@@ -50,13 +50,24 @@ mod native {
|
||||
}
|
||||
let pointer = unsafe { uu_portal_open_persist(token.as_ref().map_or(std::ptr::null(), |v| v.as_ptr()), save_token, &mut cache as *mut _ as *mut c_void, &mut error, &mut width, &mut height) };
|
||||
let handle = NonNull::new(pointer).ok_or_else(|| super::error(error))?;
|
||||
Ok(Self { handle: Mutex::new(Handle(handle)), locked: crate::session_lock::watch_locked(), was_locked: std::sync::atomic::AtomicBool::new(true), retry_at: Mutex::new(None), width, height })
|
||||
// A freshly opened session holds no lock-screen frame: only an observed lock (or a
|
||||
// closed stream) must discard the cached frame. Starting "locked" cleared the first
|
||||
// valid frame, and a static desktop sends no new one, so the viewer stayed black (#2).
|
||||
Ok(Self { handle: Mutex::new(Handle(handle)), locked: crate::session_lock::watch_locked(), was_locked: std::sync::atomic::AtomicBool::new(false), retry_at: Mutex::new(None), width, height })
|
||||
}
|
||||
pub fn capture(&self, frame: &mut [u8]) -> Result<(), String> {
|
||||
let mut handle = self.handle.lock().map_err(|_| "Portal session lock poisoned")?;
|
||||
let locked = *self.locked.borrow() != Some(false);
|
||||
if locked || self.was_locked.swap(locked, std::sync::atomic::Ordering::AcqRel) {
|
||||
self.was_locked.store(locked, std::sync::atomic::Ordering::Release);
|
||||
let state = *self.locked.borrow();
|
||||
if state != Some(false) {
|
||||
// Unknown state (watcher not reported yet): show nothing but keep the cached frame.
|
||||
if state == Some(true) {
|
||||
self.was_locked.store(true, std::sync::atomic::Ordering::Release);
|
||||
unsafe { uu_portal_reset_frame(handle.0.as_ptr()) };
|
||||
}
|
||||
super::blank(frame); return Ok(());
|
||||
}
|
||||
if self.was_locked.swap(false, std::sync::atomic::Ordering::AcqRel) {
|
||||
// First unlocked capture after a real lock: drop frames captured while locked.
|
||||
unsafe { uu_portal_reset_frame(handle.0.as_ptr()) };
|
||||
super::blank(frame); return Ok(());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user