diff --git a/src/windows/Translator/components/TopBar/index.jsx b/src/windows/Translator/components/TopBar/index.jsx index 2bd6978c2e..28034c202a 100644 --- a/src/windows/Translator/components/TopBar/index.jsx +++ b/src/windows/Translator/components/TopBar/index.jsx @@ -19,12 +19,14 @@ let unlisten = listen('tauri://blur', () => { } }); -listen('tauri://resize', async (e) => { +listen('tauri://resize', async () => { if (get('remember_window_size') ?? false) { if (appWindow.label == 'translator' || appWindow.label == 'popclip' || appWindow.label == 'persistent') { - const size = e.payload; - await set('window_height', size.height); - await set('window_width', size.width); + const psize = await appWindow.innerSize(); + const factor = await appWindow.scaleFactor(); + const lsize = psize.toLogical(factor); + await set('window_height', parseInt(lsize.height)); + await set('window_width', parseInt(lsize.width)); } } });