mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: abnormal behavior of windows background material (#47814)
* fix: abnormal behavior of windows background material Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: zoy <zoy-l@outlook.com> * chore: update patches Co-authored-by: patchup[bot] <73610968+patchup[bot]@users.noreply.github.com> * fix: setting background material after init Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: zoy <zoy-l@outlook.com> Co-authored-by: patchup[bot] <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -64,7 +64,16 @@ bool ElectronDesktopWindowTreeHostWin::GetDwmFrameInsetsInPixels(
|
||||
gfx::Insets* insets) const {
|
||||
// Set DWMFrameInsets to prevent maximized frameless window from bleeding
|
||||
// into other monitors.
|
||||
|
||||
if (IsMaximized() && !native_window_view_->has_frame()) {
|
||||
// We avoid doing this when the window is translucent (e.g. using
|
||||
// backgroundMaterial effects), because setting zero insets can interfere
|
||||
// with DWM rendering of blur or acrylic, potentially causing visual
|
||||
// glitches.
|
||||
const std::string& bg_material = native_window_view_->background_material();
|
||||
if (!bg_material.empty() && bg_material != "none") {
|
||||
return false;
|
||||
}
|
||||
// This would be equivalent to calling:
|
||||
// DwmExtendFrameIntoClientArea({0, 0, 0, 0});
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user