fix: abnormal behavior of windows background material#46855
fix: abnormal behavior of windows background material#46855zoy-l wants to merge 12 commits intoelectron:mainfrom zoy-l:fix_background_material
Conversation
|
😎Progress has been made on dynamically setting the background material. However, there's a 5-day holiday starting in my region, so I may need to wait until after the break to continue and complete the PR. |
20250507-232819.mp4Additional demonstration included. if (backgroundMaterial === 'auto') {
mainWindow?.setBackgroundColor('#00000000');
mainWindow?.setBackgroundMaterial('acrylic');
backgroundMaterial = 'acrylic';
} else {
mainWindow?.setBackgroundColor('#ffffff');
mainWindow?.setBackgroundMaterial('auto');
backgroundMaterial = 'auto';
} |
| + // translucent framed windows. Original code: !is_translucent_ && | ||
| + // delegate_->CanResize() See: | ||
| + // https://chromium-review.googlesource.com/c/chromium/src/+/6372329 | ||
| + const bool can_resize = delegate_->CanResize(); |
There was a problem hiding this comment.
This is to address the issue where a window with a frame and background material cannot be maximized.
|
@zoy-l could you rebase this please? |
| - if (!is_translucent_ && !custom_window_region_.is_valid() && | ||
| + // patch: fix_resolve_dynamic_background_material_update_issue_on_windows_11 | ||
| + // Our translucent windows use the native frame by default, and we should not | ||
| + // set a custom region when the window is maximized; otherwise, it will cause |
There was a problem hiding this comment.
Can all or part of this be upstreamed to Chromium?
There was a problem hiding this comment.
@codebytere I don't have much experience with this, but I can give it a try
| expose_webblob_path_to_allow_embedders_to_get_file_paths.patch | ||
| fix_move_autopipsettingshelper_behind_branding_buildflag.patch | ||
| revert_remove_the_allowaggressivethrottlingwithwebsocket_feature.patch | ||
| fix_activate_background_material_on_windows.patch |
There was a problem hiding this comment.
Did you intend to delete this? if yes, you also need to delete the patch file itself
There was a problem hiding this comment.
Ah, I might have missed this part during the rebase.😓
|
Perhaps some of the patches can be reduced by using |
|
Leave a legacy, might be of some reference value if someone wants to continue~ I don't have time to work on it right now. |
|
@zoy-l would you be willing to briefly say where you left off? What still needs to be done here? |
|
@codebytere Functionally everything is fine and working as expected — the above was only mentioned to reduce the number of patches. However, I did notice that a few tests related to |
|
@zoy-l awesome, thanks! that helps a lot! |
Description of Change
fix: #46753, #43345, #43196, #46882
PS: The description was written with the help of translation 🫡
Fixed applying background material correctly when creating windows on Windows, restored animations, and also fixed the issue where dynamically setting the background material had no effect.
20250429-220522.mp4
Checklist
npm testpassesRelease Notes
Notes: Fix inconsistent materials (Acrylic/Mica) and rounded corners in borderless browser window during maximize/restore operations on Windows 11