chore: fix textured window conditional on macOS (#44728)

This commit is contained in:
Shelley Vohr
2024-11-20 17:34:46 +01:00
committed by GitHub
parent eba0edf81e
commit f95e1d8ea0

View File

@@ -167,11 +167,6 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
if (!rounded_corner && !has_frame()) if (!rounded_corner && !has_frame())
styleMask = NSWindowStyleMaskBorderless; styleMask = NSWindowStyleMaskBorderless;
// TODO: remove NSWindowStyleMaskTexturedBackground.
// https://github.com/electron/electron/issues/43125
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (minimizable) if (minimizable)
styleMask |= NSWindowStyleMaskMiniaturizable; styleMask |= NSWindowStyleMaskMiniaturizable;
if (closable) if (closable)
@@ -179,9 +174,11 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
if (resizable) if (resizable)
styleMask |= NSWindowStyleMaskResizable; styleMask |= NSWindowStyleMaskResizable;
// TODO: remove NSWindowStyleMaskTexturedBackground.
// https://github.com/electron/electron/issues/43125
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations" #pragma clang diagnostic ignored "-Wdeprecated-declarations"
if (windowType == "textured" || transparent() || !has_frame()) { if (windowType == "textured" && (transparent() || !has_frame())) {
util::EmitWarning( util::EmitWarning(
"The 'textured' window type is deprecated and will be removed", "The 'textured' window type is deprecated and will be removed",
"DeprecationWarning"); "DeprecationWarning");
@@ -189,9 +186,6 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
} }
#pragma clang diagnostic pop #pragma clang diagnostic pop
// -Wdeprecated-declarations
#pragma clang diagnostic pop
// Create views::Widget and assign window_ with it. // Create views::Widget and assign window_ with it.
// TODO(zcbenz): Get rid of the window_ in future. // TODO(zcbenz): Get rid of the window_ in future.
views::Widget::InitParams params( views::Widget::InitParams params(