Skip to content

fix(linux): 持久化并校验 UInput 屏幕尺寸 - #397

Open
hiuyt wants to merge 1 commit into
MaaXYZ:mainfrom
hiuyt:codex/fix-linux-uinput-dimensions
Open

hiuyt wants to merge 1 commit into
MaaXYZ:mainfrom
hiuyt:codex/fix-linux-uinput-dimensions

Conversation

@hiuyt

@hiuyt hiuyt commented Oct 23, 2026 •

Copy link
Copy Markdown

Linux ScreenCast 的宽高输入原先只保存在连接面板的局部状态;直接开始任务会读到缺失的 UInput 尺寸,并在建立屏幕共享后因 0×0 输入范围连接失败。

  • 编辑宽高时立即更新 savedDevice,清空时移除旧值。
  • 手动连接与自动任务共用尺寸校验;缺失、非整数、非正数或超出 i32 范围时,在打开 Portal 前停止并显示提示。
  • 同步五种语言文案,添加尺寸解析与校验回归测试。

验证:12 项单元测试、TypeScript 检查、Vite 构建通过;无头浏览器验证实际连接面板的即时保存、清空,以及实际配置构建函数的拒绝路径。相同表单测试在原版上复现未保存尺寸,在修复版上通过。构建仍有原有的分包大小和静态/动态导入警告。

Fixes #335
Related: MaaXYZ/MaaFramework#1584

Sourcery 总结

在允许建立连接之前,持久化并验证 Linux UInput 屏幕尺寸。

Bug 修复:

  • 在编辑 Linux UInput 屏幕尺寸时持久化这些尺寸,并在启动屏幕共享或自动连接之前拒绝缺失或无效的尺寸。

增强功能:

  • 集中处理 UInput 尺寸的解析和验证,强制尺寸为正的 32 位有符号整数,并提供五种语言的本地化验证消息。

测试:

  • 添加回归测试,覆盖 UInput 尺寸解析、验证边界以及清除先前保存的值。
Original summary in English

Summary by Sourcery

Persist and validate Linux UInput screen dimensions before allowing connections.

Bug Fixes:

  • Persist Linux UInput screen dimensions as they are edited and reject missing or invalid dimensions before starting screen sharing or automated connections.

Enhancements:

  • Centralize UInput dimension parsing and validation, enforce positive signed 32-bit integer limits, and provide localized validation messages across five languages.

Tests:

  • Add regression coverage for UInput dimension parsing, validation boundaries, and clearing previously saved values.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嘿——我已经审查了你的更改,整体看起来很棒!


Sourcery 对开源项目免费使用——如果你喜欢我们的评审,欢迎分享 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux 控制器(screencast)下修改分辨率输入框后未持久化,直接开始任务会导致分辨率错误

1 participant