tauri
tauri copied to clipboard
[bug] ui shrinks approx 60% in size after wake from sleep in windows 11
Describe the bug
was directed here by @FabianLars to report this from discord support.
after waking from sleep, the ui of my app is approximately 60% in size as shown in pic. interacting with the window by moving it or minimizing it doesn't fix it, but as soon as you resize the window, the app "snaps" back to normal size.
the issue happens often, but not every time.
Reproduction
i have a project setup with create react app and tauri. i developed a basic ui for it, a layout with a navbar, and a sidebar. the css reset used is the one from tailwindcss.
repro steps:
- start the project with
npm run tauri dev - after the app is running, put the computer to sleep.
- wait a few minutes, and wake the computer
it may take a few times, but happens for me nearly every time, but not always, and it doesn't seem to be related to how long the computer was left in the sleep state. eg, i have come back after the computer slept hours and its fine, or come back after only a minute or 2 and its shrank in size as shown in the screen.
Expected behavior
the ui is not shrank in size after wake from sleep
Platform and versions
[✔] Environment
- OS: Windows 10.0.22621 X64
✔ WebView2: 114.0.1823.37
✔ MSVC: Visual Studio Community 2019
✔ rustc: 1.69.0 (84c898d65 2023-04-16)
✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
- node: 18.16.0
- npm: 9.5.1
[-] Packages
- tauri [RUST]: 1.3.0
- tauri-build [RUST]: 1.3.0
- wry [RUST]: 0.24.3
- tao [RUST]: 0.16.2
- @tauri-apps/api [NPM]: 1.3.0
- @tauri-apps/cli [NPM]: 1.3.1
[-] App
- build-type: bundle
- CSP: unset
- distDir: ../build
- devPath: http://localhost:3000/
- framework: React
Stack trace
No response
Additional context
- issue occurs intermittently (not every time)
Could you share exact steps to reproduce?
I had the exact same thing happen to my sample app once but I have not been able to reproduce. I was using Tauri v1.2x at the time and I dismissed from investigating further once I upgraded to v1.3 as I thought it was a latent bug with 1.2, but seeing that OP has 1.3 I'll try to reproduce it as well.
@amrbashir i added repro steps, but i didn't include a sample app project to run. are you wanting me to prepare a minimalist example to repro?
A minimal example is not needed for this I guess, however I left an app running and put the laptop into sleep mode overnight and when I came back it was working fine, I also tried doing a one or two minute sleep and still worked fine. I haven't been able to reproduce or figure out the cause.
@amrbashir ok, i suppose i can try and debug it, i just don't really know where to start so was hoping you might be able to provide me some suggestions. I am brand new with rust and have difficulty understanding the code at times. i would also be willing to do a screenshare on discord or something and we could try debugging it that way. thanks
upstream issue https://github.com/MicrosoftEdge/WebView2Feedback/issues/3429
@amrbashir thanks!
Looks like upstream issue was closed, so gonna close this as well.