tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] ui shrinks approx 60% in size after wake from sleep in windows 11

Open r3wt opened this issue 2 years ago • 7 comments

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.

Screenshot 2023-06-04 180439

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:

  1. start the project with npm run tauri dev
  2. after the app is running, put the computer to sleep.
  3. 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)

r3wt avatar Jun 06 '23 13:06 r3wt

Could you share exact steps to reproduce?

amrbashir avatar Jun 06 '23 15:06 amrbashir

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.

xD0135 avatar Jun 08 '23 01:06 xD0135

@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?

r3wt avatar Jun 08 '23 01:06 r3wt

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 avatar Jun 09 '23 11:06 amrbashir

@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

r3wt avatar Jun 09 '23 15:06 r3wt

upstream issue https://github.com/MicrosoftEdge/WebView2Feedback/issues/3429

amrbashir avatar Jun 14 '23 00:06 amrbashir

@amrbashir thanks!

r3wt avatar Jun 14 '23 15:06 r3wt

Looks like upstream issue was closed, so gonna close this as well.

amrbashir avatar Mar 11 '24 16:03 amrbashir