@zakim24/electron-liquid-glass 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zakim24/electron-liquid-glass",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "macOS glass / vibrancy wrapper for Electron BrowserWindow",
5
5
  "repository": {
6
6
  "type": "git",
Binary file
@@ -123,21 +123,30 @@ extern "C" int AddGlassEffectView(unsigned char *buffer, bool opaque) {
123
123
  // Ensure autoresize if we created a private glass view too
124
124
  glass.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
125
125
 
126
- // CRITICAL: Allow mouse events to pass through the glass effect to the content below
127
- // Without this, the glass view intercepts all mouse events and blocks UI interaction
128
- if ([glass respondsToSelector:@selector(setIgnoresMouseEvents:)]) {
129
- [(id)glass setIgnoresMouseEvents:YES];
130
- }
131
- // Also set on background view if present
132
- if (backgroundView && [backgroundView respondsToSelector:@selector(setIgnoresMouseEvents:)]) {
133
- [(id)backgroundView setIgnoresMouseEvents:YES];
134
- }
126
+ // Make the glass view click-through by setting it to not accept any mouse events
127
+ // NSView doesn't have setIgnoresMouseEvents, so we use layer properties
128
+ glass.wantsLayer = YES;
129
+
130
+ // Get the first existing subview to position our glass behind it
131
+ NSView *firstSubview = container.subviews.firstObject;
135
132
 
136
- // Add the glass view (positioned relative to background view if opaque, or below everything if not)
133
+ // Add the glass view (positioned BELOW all existing content to not block events)
137
134
  if (opaque && backgroundView) {
138
- [container addSubview:glass positioned:NSWindowAbove relativeTo:backgroundView];
135
+ // Background at very bottom, glass above it, content on top
136
+ if (firstSubview) {
137
+ [container addSubview:backgroundView positioned:NSWindowBelow relativeTo:firstSubview];
138
+ [container addSubview:glass positioned:NSWindowAbove relativeTo:backgroundView];
139
+ } else {
140
+ [container addSubview:backgroundView positioned:NSWindowBelow relativeTo:nil];
141
+ [container addSubview:glass positioned:NSWindowAbove relativeTo:backgroundView];
142
+ }
139
143
  } else {
140
- [container addSubview:glass positioned:NSWindowBelow relativeTo:nil];
144
+ // Glass at very bottom, content on top
145
+ if (firstSubview) {
146
+ [container addSubview:glass positioned:NSWindowBelow relativeTo:firstSubview];
147
+ } else {
148
+ [container addSubview:glass positioned:NSWindowBelow relativeTo:nil];
149
+ }
141
150
  }
142
151
 
143
152
  // Associate views with the container for cleanup