GregVido / mica-electron

Library to add mica effect of windows 11 in electron app
Apache License 2.0
126 stars 7 forks source link

[BUG] Rendering lags badly while resizing Acrylic window #28

Open dietrich-stein opened 11 months ago

dietrich-stein commented 11 months ago

Using Windows 10 Home and compiling "electron": "26.2.2" with "mica-electron": "^1.5.1" there is so much lag while resizing an acrylic window that it feels broken.

Rather than trying to make it composite faster, the usual fix is to revert to rectangles while resizing. However, I really like what this person managed to pull off as their solution:

https://github.com/wangwenx190/Win32Acrylic/blob/main/Win32/MainWindow.cpp#L144

In a nutshell, using the main window loop, while resizing we receive WM_ENTERSIZEMOVE and it set the blur parameter to the faster ACCENT_ENABLE_BLURBEHIND. When resizing finishes we receive WM_EXITSIZEMOVE and revert it back to ACCENT_ENABLE_ACRYLICBLURBEHIND.

I didn't see anything in dwmExec.cc to suggest that this might be trivial. But, it would be super nice to have some kind of solution.

GregVido commented 11 months ago

Hi, thanks for reporting this bug, I'll take a closer look at it next weekend because I'm very busy at the moment, sorry!