Skip to content

Commit 5f447e4

Browse files
authored
fix: do not render inactive titlebar as active on Windows (electron#24847)
1 parent 4523c90 commit 5f447e4

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

shell/browser/ui/win/electron_desktop_window_tree_host_win.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ bool ElectronDesktopWindowTreeHostWin::PreHandleMSG(UINT message,
2424
return native_window_view_->PreHandleMSG(message, w_param, l_param, result);
2525
}
2626

27+
bool ElectronDesktopWindowTreeHostWin::ShouldPaintAsActive() const {
28+
// Tell Chromium to use system default behavior when rendering inactive
29+
// titlebar, otherwise it would render inactive titlebar as active under
30+
// some cases.
31+
// See also https://github.com/electron/electron/issues/24647.
32+
return false;
33+
}
34+
2735
bool ElectronDesktopWindowTreeHostWin::HasNativeFrame() const {
2836
// Since we never use chromium's titlebar implementation, we can just say
2937
// that we use a native titlebar. This will disable the repaint locking when

shell/browser/ui/win/electron_desktop_window_tree_host_win.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ElectronDesktopWindowTreeHostWin
2525
WPARAM w_param,
2626
LPARAM l_param,
2727
LRESULT* result) override;
28+
bool ShouldPaintAsActive() const override;
2829
bool HasNativeFrame() const override;
2930
bool GetClientAreaInsets(gfx::Insets* insets,
3031
HMONITOR monitor) const override;

0 commit comments

Comments
 (0)