We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
从按下快捷键到显示翻译窗口通常需要等待1-2秒钟。这个问题我忍了很久了,今天看了一下代码,实现了一个秒开的 demo:
首先在windows下需要跳过窗口创建动画,可以直接使用下面这个函数:
pub fn set_skip_animation(win: &Window) { #[cfg(target_os = "windows")] { use windows::Win32::{ Foundation::{BOOL, HWND}, Graphics::Dwm::{DwmSetWindowAttribute, DWMWA_TRANSITIONS_FORCEDISABLED}, }; let hwnd = win.hwnd().unwrap(); unsafe { let _ = DwmSetWindowAttribute( HWND(hwnd.0), DWMWA_TRANSITIONS_FORCEDISABLED, &mut BOOL::from(true) as *mut _ as *mut std::ffi::c_void, std::mem::size_of::<BOOL>() as u32, ); } } }
并在 windows crate 中 添加 feature:Win32_Graphics_Dwm
Win32_Graphics_Dwm
跳过窗口动画可以加快窗口展示速度,配合翻译窗口的webview进程常驻内存可以实现瞬间打开。 两秒的启动速度实在是太慢了 跳过窗口启动动画比较简单,如果管理者认可的话我可以直接提PR 翻译窗口常驻内的存改动会比较大,可能需要进一步讨论
all
No response
The text was updated successfully, but these errors were encountered:
发现这个问题+1,窗口加载速度有点慢,而且快捷键打开后没有默认选中文本框,还需要用鼠标手动点一下。
Sorry, something went wrong.
666,快点提交 PR 吧,我已经迫不及待了
No branches or pull requests
Description
从按下快捷键到显示翻译窗口通常需要等待1-2秒钟。这个问题我忍了很久了,今天看了一下代码,实现了一个秒开的 demo:
2024-04-29.170403.mp4
首先在windows下需要跳过窗口创建动画,可以直接使用下面这个函数:
并在 windows crate 中 添加 feature:
Win32_Graphics_Dwm
跳过窗口动画可以加快窗口展示速度,配合翻译窗口的webview进程常驻内存可以实现瞬间打开。
两秒的启动速度实在是太慢了
跳过窗口启动动画比较简单,如果管理者认可的话我可以直接提PR
翻译窗口常驻内的存改动会比较大,可能需要进一步讨论
Application Scenario
all
References
No response
The text was updated successfully, but these errors were encountered: