From 91f4906908aa274a2676ebbe6d41336d830fef10 Mon Sep 17 00:00:00 2001 From: Etesam Date: Fri, 29 Aug 2025 21:57:21 -0400 Subject: [PATCH] [v3] Liquid glass redefinition error (#4542) * Fixed issue with redefinition of NSGlassEffectViewStyle * Added entry to changelog * Updated enum names * Fix docs --------- Co-authored-by: Lea Anthony --- docs/src/content/docs/changelog.mdx | 5 +++++ v3/UNRELEASED_CHANGELOG.md | 1 + v3/pkg/application/webview_window_darwin.m | 14 +++++++------- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/src/content/docs/changelog.mdx b/docs/src/content/docs/changelog.mdx index f8a2acad3..c55f43e63 100644 --- a/docs/src/content/docs/changelog.mdx +++ b/docs/src/content/docs/changelog.mdx @@ -23,6 +23,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 */ +/* + ** PLEASE DO NOT UPDATE THIS FILE ** + Updates should be added to `v3/UNRELEASED_CHANGELOG.md` + Thank you! +*/ ## [Unreleased] ## v3.0.0-alpha.26 - 2025-08-24 diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 8e4648038..1d2027c54 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -23,6 +23,7 @@ After processing, the content will be moved to the main changelog and this file ## Fixed +- Fixed redefinition error for liquid glass demo in [#4542](https://github.com/wailsapp/wails/pull/4542) by @Etesam913 ## Deprecated diff --git a/v3/pkg/application/webview_window_darwin.m b/v3/pkg/application/webview_window_darwin.m index 199556bc6..b50eccb93 100644 --- a/v3/pkg/application/webview_window_darwin.m +++ b/v3/pkg/application/webview_window_darwin.m @@ -11,12 +11,12 @@ extern void processWindowKeyDownEvent(unsigned int, const char*); extern bool hasListeners(unsigned int); extern bool windowShouldUnconditionallyClose(unsigned int); -// Define NSGlassEffectView style constants (these match the Go constants) -typedef NS_ENUM(NSInteger, NSGlassEffectViewStyle) { - NSGlassEffectViewStyleAutomatic = 0, - NSGlassEffectViewStyleLight = 1, - NSGlassEffectViewStyleDark = 2, - NSGlassEffectViewStyleVibrant = 3 +// Define custom glass effect style constants (these match the Go constants) +typedef NS_ENUM(NSInteger, MacLiquidGlassStyle) { + LiquidGlassStyleAutomatic = 0, + LiquidGlassStyleLight = 1, + LiquidGlassStyleDark = 2, + LiquidGlassStyleVibrant = 3 }; @implementation WebviewWindow - (WebviewWindow*) initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation; @@ -907,7 +907,7 @@ void windowSetLiquidGlass(void* nsWindow, int style, int material, double corner // Set style if the property exists if ([glassView respondsToSelector:@selector(setStyle:)]) { // For vibrant style, try to use Light style for a lighter effect - int lightStyle = (style == NSGlassEffectViewStyleVibrant) ? NSGlassEffectViewStyleLight : style; + int lightStyle = (style == LiquidGlassStyleVibrant) ? LiquidGlassStyleLight : style; [glassView setValue:@(lightStyle) forKey:@"style"]; }