[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 <lea.anthony@gmail.com>
This commit is contained in:
Etesam 2025-08-29 21:57:21 -04:00 committed by GitHub
commit 91f4906908
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 7 deletions

View file

@ -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

View file

@ -23,6 +23,7 @@ After processing, the content will be moved to the main changelog and this file
## Fixed
<!-- Bug fixes -->
- Fixed redefinition error for liquid glass demo in [#4542](https://github.com/wailsapp/wails/pull/4542) by @Etesam913
## Deprecated
<!-- Soon-to-be removed features -->

View file

@ -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"];
}