fix: do not render inactive titlebar as active on Windows (#24847)

This commit is contained in:
Cheng Zhao 2020-08-07 01:05:23 +09:00 committed by GitHub
parent 4523c90dcd
commit 5f447e4b4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -24,6 +24,14 @@ bool ElectronDesktopWindowTreeHostWin::PreHandleMSG(UINT message,
return native_window_view_->PreHandleMSG(message, w_param, l_param, result);
}
bool ElectronDesktopWindowTreeHostWin::ShouldPaintAsActive() const {
// Tell Chromium to use system default behavior when rendering inactive
// titlebar, otherwise it would render inactive titlebar as active under
// some cases.
// See also https://github.com/electron/electron/issues/24647.
return false;
}
bool ElectronDesktopWindowTreeHostWin::HasNativeFrame() const {
// Since we never use chromium's titlebar implementation, we can just say
// that we use a native titlebar. This will disable the repaint locking when

View file

@ -25,6 +25,7 @@ class ElectronDesktopWindowTreeHostWin
WPARAM w_param,
LPARAM l_param,
LRESULT* result) override;
bool ShouldPaintAsActive() const override;
bool HasNativeFrame() const override;
bool GetClientAreaInsets(gfx::Insets* insets,
HMONITOR monitor) const override;