Hyprland下窗口失去焦点不能自动关闭 & 文档中关于`Wayland 支持`部分有点错误
问题描述
在hyprland下,使用翻译窗口并不能实现窗口失去焦点时自动关闭,但是ocr识别窗口可以,我查到之前有这个 issue
我看了一下源代码,发现 src/window/Recognize /index.jsx 里面的这个部分代码已经被删去了
void listen('tauri://move', () => {
info('Move');
if (blurTimeout) {
info('Cancel Close');
clearTimeout(blurTimeout);
}
});
但是在 src/window/Translate/index.jsx 中,这部分代码仍然存在
我自己删去后本地编译了一下是可以正常使用的 这两个窗口在这部分的代码应该是差不多的吧,是漏处理了吗
另外就是文档中关于Wayland 支持 部分错误
划词翻译窗口跟随鼠标位置
由于目前 pot 在 Wayland 下还无法获取到正确的鼠标坐标,所以内部的实现无法工作。 对于某些桌面环境/窗口管理器,可以通过设置窗口规则来实现窗口跟随鼠标位置,这里以 Hyprland 为例:
windowrulev2 = float, class:(pot), title:(Translator|OCR|PopClip|Screenshot Translate) # Translation window floating windowrulev2 = move cursor 0 0, class:(pot), title:(Translator|PopClip|Screenshot Translate) # Translation window follows the mouse position.
这部分代码实际title部分好像不大行
我用 hyprctl 查到实际 pot 的翻译窗口还有 ocr 识别窗口的 title 分别是 Translate 和 Recognize
因此我用了这个规则,就能识别到了
windowrulev2 = float, class:(pot),title:(Translate|Recognize) # Translation window floating
windowrulev2 = move cursor 0 0, class:(pot),title:(Translate|Recognize) # Translation window follows the mouse position.
操作系统 Arch linux
窗口系统(Linux Only) Hyprland
软件版本
pot: 3.0.6
补充信息
No response
窗口失去焦点不能自动关闭
KDE Plasma 6 Wayland 下有同样的问题