@zakim24/electron-liquid-glass 1.1.1 → 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.1",
3
+ "version": "1.1.3",
4
4
  "description": "macOS glass / vibrancy wrapper for Electron BrowserWindow",
5
5
  "repository": {
6
6
  "type": "git",
@@ -122,12 +122,31 @@ extern "C" int AddGlassEffectView(unsigned char *buffer, bool opaque) {
122
122
 
123
123
  // Ensure autoresize if we created a private glass view too
124
124
  glass.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
125
+
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;
125
132
 
126
- // 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)
127
134
  if (opaque && backgroundView) {
128
- [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
+ }
129
143
  } else {
130
- [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
+ }
131
150
  }
132
151
 
133
152
  // Associate views with the container for cleanup
Binary file