mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 16:50:41 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebdd362452 | ||
|
|
26811018e0 | ||
|
|
c3959c01e9 | ||
|
|
ef14f76422 |
No files matched your search
Generated
+1
-1
@@ -2772,7 +2772,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uu-remote-linux"
|
name = "uu-remote-linux"
|
||||||
version = "0.2.44"
|
version = "0.2.46"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ab_glyph",
|
"ab_glyph",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "uu-remote-linux"
|
name = "uu-remote-linux"
|
||||||
version = "0.2.44"
|
version = "0.2.46"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "uuremote-server"
|
default-run = "uuremote-server"
|
||||||
authors = ["uu-remote-linux contributors"]
|
authors = ["uu-remote-linux contributors"]
|
||||||
|
|||||||
@@ -640,6 +640,8 @@ GNOME-to-official-Mac bidirectional clipboard synchronization is still unverifie
|
|||||||
- Frames are decoded at the host's native resolution and scaled to the window with linear filtering; a host resolution
|
- Frames are decoded at the host's native resolution and scaled to the window with linear filtering; a host resolution
|
||||||
change restarts the decoder. `UU_VIEWER_SIZE=WxH` forces a fixed letterboxed canvas instead.
|
change restarts the decoder. `UU_VIEWER_SIZE=WxH` forces a fixed letterboxed canvas instead.
|
||||||
|
|
||||||
|
The SDL remote desktop window disables local IME text composition and forwards physical keys; use the remote host’s input method and its language toggle (for example, Shift) to enter Chinese.
|
||||||
|
|
||||||
Mac targets use native macOS keycodes; Windows / Linux targets retain Windows VK. Keys follow physical positions, without
|
Mac targets use native macOS keycodes; Windows / Linux targets retain Windows VK. Keys follow physical positions, without
|
||||||
automatically translating Ctrl to Command; on a Mac target the PC Super / Windows key acts as Command. Only verified target
|
automatically translating Ctrl to Command; on a Mac target the PC Super / Windows key acts as Command. Only verified target
|
||||||
platform values 1 (Windows / this project's Linux host) and 4 (Mac) are accepted; unknown values fail explicitly. Account
|
platform values 1 (Windows / this project's Linux host) and 4 (Mac) are accepted; unknown values fail explicitly. Account
|
||||||
|
|||||||
@@ -563,6 +563,8 @@ GNOME 与官方 Mac 被控端的双向剪贴板尚未验证通过;此修改不
|
|||||||
以 CaptureSettingSync 回报为准。两种色度均由 FFmpeg 转为 RGB24 显示。
|
以 CaptureSettingSync 回报为准。两种色度均由 FFmpeg 转为 RGB24 显示。
|
||||||
- 按被控端原始分辨率解码,窗口缩放使用线性过滤;被控端分辨率变化时自动重启解码器。`UU_VIEWER_SIZE=WxH` 可改为固定的留黑边画布。
|
- 按被控端原始分辨率解码,窗口缩放使用线性过滤;被控端分辨率变化时自动重启解码器。`UU_VIEWER_SIZE=WxH` 可改为固定的留黑边画布。
|
||||||
|
|
||||||
|
SDL 远程画面窗口关闭本地输入法的文本组合,按物理键转发;输入中文时请使用被控端的输入法及其中英切换键(例如 Shift)。
|
||||||
|
|
||||||
Mac 目标使用 macOS 原生键码,Windows / Linux 目标保留 Windows VK。键盘按物理键位置转发,不自动把 Ctrl 改成 Command;
|
Mac 目标使用 macOS 原生键码,Windows / Linux 目标保留 Windows VK。键盘按物理键位置转发,不自动把 Ctrl 改成 Command;
|
||||||
控制 Mac 时,PC 键盘的 Super / Win 键对应 Command。仅接受已验证的目标平台值 1(Windows / 本项目 Linux 主机)和 4(Mac),
|
控制 Mac 时,PC 键盘的 Super / Win 键对应 Command。仅接受已验证的目标平台值 1(Windows / 本项目 Linux 主机)和 4(Mac),
|
||||||
未知值会报错,不猜测键码。账号连接缺少平台字段时查询目标设备;远程协助必须由连接响应提供平台。只看模式不需要此识别。
|
未知值会报错,不猜测键码。账号连接缺少平台字段时查询目标设备;远程协助必须由连接响应提供平台。只看模式不需要此识别。
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
控制端远程窗口不再被本地输入法截获按键。/ The viewer's remote window no longer lets the local IME swallow keys.
|
||||||
|
|
||||||
|
### 修复 / Fixed
|
||||||
|
- **控制端本地输入法截获按键(#149、#150,感谢 @xfjm136)**:SDL 远程桌面窗口创建后关闭本地文本输入,按键只按物理键转发,由被控端输入法处理;修复本地与远端都用 Shift 切换中英文时,Shift 等按键被本地输入法吞掉的问题。不修改系统输入法设置,GTK 启动器不受影响。
|
||||||
|
The SDL remote desktop window now disables local text input after creation, so keys are forwarded as physical keys and the remote IME handles composition; Shift and similar keys are no longer swallowed by the local IME. System IME settings and the GTK launcher are unchanged.
|
||||||
|
|
||||||
|
### 验证范围 / Validation
|
||||||
|
单元测试(含 SDL dummy 子进程测试)与 CI。贡献者在 KDE Wayland + Fcitx5 连接 Windows 实机验证;其他桌面/输入法后端未复测。
|
||||||
|
|
||||||
|
### 下载 / Download
|
||||||
|
`uu-remote-linux_0.2.45_<amd64|arm64>.deb`,或 `uu-remote-linux-v0.2.45-<x86_64|aarch64>-linux.tar.gz`(解压后运行 `./install.sh`),或 `docker pull ghcr.io/vallierdev/uu-remote-linux:v0.2.45`(x86_64)。
|
||||||
|
|
||||||
|
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
Linux 复制的文本可直接粘贴到 Windows 控制端。/ Text copied on Linux now pastes in the Windows viewer.
|
||||||
|
|
||||||
|
### 修复 / Fixed
|
||||||
|
- **Linux → Windows 文本剪贴板无法粘贴(#151,感谢 @afwer1231 的定位)**:主机提供 Unicode 文本格式时,格式名改用官方 Windows 端的 `predefined_13`(id 仍为 13)。此前的 `CF_UNICODETEXT` 名字会让 Windows 控制端注册一个同名的自定义格式,文本虽已到达但普通粘贴读不到。Mac 控制端按 id 13 识别,不受影响。
|
||||||
|
The host now names its Unicode text offer `predefined_13` (id 13), as official Windows peers do. The previous `CF_UNICODETEXT` name made the Windows viewer register a custom format of that name, so the text arrived but normal paste could not read it. The Mac viewer matches by id 13 and is unaffected.
|
||||||
|
|
||||||
|
### 验证范围 / Validation
|
||||||
|
单元测试与 CI;格式名依据官方 Windows/Mac 程序中的字符串对照(推断)。尚未在 Windows 控制端实机验证。
|
||||||
|
|
||||||
|
### 下载 / Download
|
||||||
|
`uu-remote-linux_0.2.46_<amd64|arm64>.deb`,或 `uu-remote-linux-v0.2.46-<x86_64|aarch64>-linux.tar.gz`(解压后运行 `./install.sh`),或 `docker pull ghcr.io/vallierdev/uu-remote-linux:v0.2.46`(x86_64)。
|
||||||
|
|
||||||
|
**非官方项目,与网易无关。** / **Unofficial, not affiliated with NetEase.**
|
||||||
+10
-2
@@ -17,6 +17,9 @@ impl TextFormat {
|
|||||||
}
|
}
|
||||||
fn id(self)->u64{match self{Self::Windows=>UNICODE_TEXT,Self::Mac=>0}}
|
fn id(self)->u64{match self{Self::Windows=>UNICODE_TEXT,Self::Mac=>0}}
|
||||||
fn name(self)->&'static str{match self{Self::Windows=>"CF_UNICODETEXT",Self::Mac=>MAC_TEXT}}
|
fn name(self)->&'static str{match self{Self::Windows=>"CF_UNICODETEXT",Self::Mac=>MAC_TEXT}}
|
||||||
|
/// Name in a format-list offer. Official Windows peers name predefined formats `predefined_<id>`; a plain
|
||||||
|
/// `CF_UNICODETEXT` makes the Windows viewer register a custom format instead of id 13 (issue #151).
|
||||||
|
fn offer_name(self)->&'static str{match self{Self::Windows=>WINDOWS_OFFER_NAME,Self::Mac=>MAC_TEXT}}
|
||||||
fn encode(self,text:&str)->Vec<u8>{match self{Self::Windows=>encode_windows(text),Self::Mac=>text.as_bytes().to_vec()}}
|
fn encode(self,text:&str)->Vec<u8>{match self{Self::Windows=>encode_windows(text),Self::Mac=>text.as_bytes().to_vec()}}
|
||||||
fn decode(self,data:&[u8])->Result<String,&'static str>{
|
fn decode(self,data:&[u8])->Result<String,&'static str>{
|
||||||
match self{
|
match self{
|
||||||
@@ -31,6 +34,7 @@ impl TextFormat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const WINDOWS_OFFER_NAME:&str="predefined_13";
|
||||||
const BLOCK_BYTES:usize=0x20000;
|
const BLOCK_BYTES:usize=0x20000;
|
||||||
const MAX_BYTES:usize=MAX_TEXT*2+2;
|
const MAX_BYTES:usize=MAX_TEXT*2+2;
|
||||||
pub struct ResultMessages {pub messages:Vec<(u32,Vec<u8>)>,pub text:Option<String>}
|
pub struct ResultMessages {pub messages:Vec<(u32,Vec<u8>)>,pub text:Option<String>}
|
||||||
@@ -96,7 +100,7 @@ impl State{
|
|||||||
if text.contains('\0')||encode_windows(&text).len()>MAX_BYTES{return Err("clipboard encoded text exceeds limit");}
|
if text.contains('\0')||encode_windows(&text).len()>MAX_BYTES{return Err("clipboard encoded text exceeds limit");}
|
||||||
self.local=Some(text);
|
self.local=Some(text);
|
||||||
let mut list=Vec::new();
|
let mut list=Vec::new();
|
||||||
for kind in formats {let mut format=Vec::new();int(1,kind.id(),&mut format);string(2,kind.name(),&mut format);nested(1,&format,&mut list);}
|
for kind in formats {let mut format=Vec::new();int(1,kind.id(),&mut format);string(2,kind.offer_name(),&mut format);nested(1,&format,&mut list);}
|
||||||
Ok(request(id,1,&list))
|
Ok(request(id,1,&list))
|
||||||
}
|
}
|
||||||
pub fn request(&mut self,rpc:&[u8],next:&mut impl FnMut()->u64)->Result<ResultMessages,&'static str>{
|
pub fn request(&mut self,rpc:&[u8],next:&mut impl FnMut()->u64)->Result<ResultMessages,&'static str>{
|
||||||
@@ -210,7 +214,11 @@ mod tests{
|
|||||||
let data=bytes(bytes(bytes(&out.messages[1].1,9).unwrap().unwrap(),3).unwrap().unwrap(),3).unwrap().unwrap();
|
let data=bytes(bytes(bytes(&out.messages[1].1,9).unwrap().unwrap(),3).unwrap().unwrap(),3).unwrap().unwrap();
|
||||||
assert_eq!(data,b"hi");
|
assert_eq!(data,b"hi");
|
||||||
// Host-side offers are unchanged: CF_UNICODETEXT only.
|
// Host-side offers are unchanged: CF_UNICODETEXT only.
|
||||||
assert_eq!(format_ids(&State::default().offer(1,"hi".into()).unwrap()),vec![13]);
|
let host_offer=State::default().offer(1,"hi".into()).unwrap();
|
||||||
|
assert_eq!(format_ids(&host_offer),vec![13]);
|
||||||
|
let list=bytes(bytes(&host_offer,9).unwrap().unwrap(),1).unwrap().unwrap();
|
||||||
|
let format=bytes(list,1).unwrap().unwrap();
|
||||||
|
assert_eq!(text_field(format,2),Ok(WINDOWS_OFFER_NAME));
|
||||||
}
|
}
|
||||||
#[test]
|
#[test]
|
||||||
fn desktop_clipboard_negotiates_and_buffers_unicode_until_confirmation(){
|
fn desktop_clipboard_negotiates_and_buffers_unicode_until_confirmation(){
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ impl Window {
|
|||||||
let name=super::device_label(std::env::var("UU_VIEWER_DEVICE_NAME").ok().as_deref()).to_owned();
|
let name=super::device_label(std::env::var("UU_VIEWER_DEVICE_NAME").ok().as_deref()).to_owned();
|
||||||
let window=video.window(&format!("{name} · {}",crate::i18n::s("UU 远程 Linux 控制端","UU Remote Linux viewer")),1280,720).position_centered().resizable().build().map_err(|_|"Window creation failed")?;
|
let window=video.window(&format!("{name} · {}",crate::i18n::s("UU 远程 Linux 控制端","UU Remote Linux viewer")),1280,720).position_centered().resizable().build().map_err(|_|"Window creation failed")?;
|
||||||
let mut canvas=window.into_canvas().build().map_err(|_|"Renderer creation failed")?;
|
let mut canvas=window.into_canvas().build().map_err(|_|"Renderer creation failed")?;
|
||||||
|
// This window forwards scancodes, not SDL_TEXTINPUT. SDL enables text input by
|
||||||
|
// default; its X11 IME path can consume keys before KeyDown/KeyUp (#149).
|
||||||
|
video.text_input().stop();
|
||||||
// Wayland maps a toplevel only after its first buffer; without this the window stays
|
// Wayland maps a toplevel only after its first buffer; without this the window stays
|
||||||
// invisible until the first decoded frame, which a stalled stream never delivers.
|
// invisible until the first decoded frame, which a stalled stream never delivers.
|
||||||
canvas.set_draw_color(LOADING_BG);canvas.clear();canvas.present();
|
canvas.set_draw_color(LOADING_BG);canvas.clear();canvas.present();
|
||||||
@@ -708,6 +711,33 @@ async fn pump_type_job(job: &mut TypeJob, session: &mut Session, window: &mut Wi
|
|||||||
|
|
||||||
#[cfg(test)] mod tests {
|
#[cfg(test)] mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
#[cfg_attr(target_os="macos",ignore)]
|
||||||
|
#[test] fn remote_window_disables_local_text_input_and_forwards_shift(){
|
||||||
|
if std::env::var_os("UU_VIEWER_IME_TEST_CHILD").is_none(){
|
||||||
|
let output=std::process::Command::new(std::env::current_exe().unwrap())
|
||||||
|
.args(["--exact","viewer::sdl::tests::remote_window_disables_local_text_input_and_forwards_shift","--test-threads=1"])
|
||||||
|
.env("SDL_VIDEODRIVER","dummy").env("UU_VIEWER_IME_TEST_CHILD","1").output().unwrap();
|
||||||
|
assert!(output.status.success(),"{}{}",String::from_utf8_lossy(&output.stdout),String::from_utf8_lossy(&output.stderr));return
|
||||||
|
}
|
||||||
|
let mut window=Window::new().unwrap();
|
||||||
|
assert!(!window.canvas.window().subsystem().text_input().is_active());
|
||||||
|
let id=window.canvas.window().id();
|
||||||
|
let key=|down,scan|if down {
|
||||||
|
Event::KeyDown{timestamp:0,window_id:id,keycode:None,scancode:Some(scan),keymod:sdl2::keyboard::Mod::NOMOD,repeat:false}
|
||||||
|
}else{
|
||||||
|
Event::KeyUp{timestamp:0,window_id:id,keycode:None,scancode:Some(scan),keymod:sdl2::keyboard::Mod::NOMOD,repeat:false}
|
||||||
|
};
|
||||||
|
let push=|event|window._sdl.event().unwrap().push_event(event).unwrap();
|
||||||
|
use sdl2::keyboard::Scancode as S;
|
||||||
|
for event in [key(true,S::LShift),key(false,S::LShift),key(true,S::A),key(false,S::A),
|
||||||
|
key(true,S::RShift),Event::Window{timestamp:0,window_id:id,win_event:WindowEvent::FocusLost},
|
||||||
|
Event::Window{timestamp:0,window_id:id,win_event:WindowEvent::FocusGained}] {push(event);}
|
||||||
|
let (_,messages)=window.poll(&mut Input::new(false));
|
||||||
|
let keys:Vec<_>=messages.iter().filter_map(|m|Some((m.get("action")?.as_str()?,m.get("key")?.as_i64()?))).collect();
|
||||||
|
assert_eq!(keys,vec![("kbd_press",0xa0),("kbd_release",0xa0),("kbd_press",0x41),("kbd_release",0x41),
|
||||||
|
("kbd_press",0xa1),("kbd_release",0xa1)]);
|
||||||
|
assert!(!window.canvas.window().subsystem().text_input().is_active());
|
||||||
|
}
|
||||||
// macOS: SDL video must start on the main thread, which the test harness does not use; CI runs it on Linux.
|
// macOS: SDL video must start on the main thread, which the test harness does not use; CI runs it on Linux.
|
||||||
#[cfg_attr(target_os="macos",ignore)]
|
#[cfg_attr(target_os="macos",ignore)]
|
||||||
#[tokio::test] async fn clipboard_requests_use_existing_window(){
|
#[tokio::test] async fn clipboard_requests_use_existing_window(){
|
||||||
|
|||||||
Reference in new issue
Block a user