mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: safer check for WCO button updates (#34833)
This commit is contained in:
@@ -876,7 +876,7 @@ bool NativeWindowViews::IsMovable() {
|
||||
void NativeWindowViews::SetMinimizable(bool minimizable) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
FlipWindowStyle(GetAcceleratedWidget(), minimizable, WS_MINIMIZEBOX);
|
||||
if (titlebar_overlay_enabled()) {
|
||||
if (IsWindowControlsOverlayEnabled()) {
|
||||
auto* frame_view =
|
||||
static_cast<WinFrameView*>(widget()->non_client_view()->frame_view());
|
||||
frame_view->caption_button_container()->UpdateButtons();
|
||||
@@ -896,7 +896,7 @@ bool NativeWindowViews::IsMinimizable() {
|
||||
void NativeWindowViews::SetMaximizable(bool maximizable) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
FlipWindowStyle(GetAcceleratedWidget(), maximizable, WS_MAXIMIZEBOX);
|
||||
if (titlebar_overlay_enabled()) {
|
||||
if (IsWindowControlsOverlayEnabled()) {
|
||||
auto* frame_view =
|
||||
static_cast<WinFrameView*>(widget()->non_client_view()->frame_view());
|
||||
frame_view->caption_button_container()->UpdateButtons();
|
||||
@@ -936,7 +936,7 @@ void NativeWindowViews::SetClosable(bool closable) {
|
||||
} else {
|
||||
EnableMenuItem(menu, SC_CLOSE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
|
||||
}
|
||||
if (titlebar_overlay_enabled()) {
|
||||
if (IsWindowControlsOverlayEnabled()) {
|
||||
auto* frame_view =
|
||||
static_cast<WinFrameView*>(widget()->non_client_view()->frame_view());
|
||||
frame_view->caption_button_container()->UpdateButtons();
|
||||
|
||||
Reference in New Issue
Block a user