MCPcopy
hub / github.com/pickle-com/glass / createFeatureWindows

Function createFeatureWindows

src/window/windowManager.js:350–560  ·  view source on GitHub ↗
(header, namesToCreate)

Source from the content-addressed store, hash-verified

348
349
350function createFeatureWindows(header, namesToCreate) {
351 // if (windowPool.has('listen')) return;
352
353 const commonChildOptions = {
354 parent: header,
355 show: false,
356 frame: false,
357 transparent: true,
358 vibrancy: false,
359 hasShadow: false,
360 skipTaskbar: true,
361 hiddenInMissionControl: true,
362 resizable: true,
363 webPreferences: {
364 nodeIntegration: false,
365 contextIsolation: true,
366 preload: path.join(__dirname, '../preload.js'),
367 },
368 };
369
370 const createFeatureWindow = (name) => {
371 if (windowPool.has(name)) return;
372
373 switch (name) {
374 case 'listen': {
375 const listen = new BrowserWindow({
376 ...commonChildOptions, width:400,minWidth:400,maxWidth:900,
377 maxHeight:900,
378 });
379 listen.setContentProtection(isContentProtectionOn);
380 listen.setVisibleOnAllWorkspaces(true,{visibleOnFullScreen:true});
381 if (process.platform === 'darwin') {
382 listen.setWindowButtonVisibility(false);
383 }
384 const listenLoadOptions = { query: { view: 'listen' } };
385 if (!shouldUseLiquidGlass) {
386 listen.loadFile(path.join(__dirname, '../ui/app/content.html'), listenLoadOptions);
387 }
388 else {
389 listenLoadOptions.query.glass = 'true';
390 listen.loadFile(path.join(__dirname, '../ui/app/content.html'), listenLoadOptions);
391 listen.webContents.once('did-finish-load', () => {
392 const viewId = liquidGlass.addView(listen.getNativeWindowHandle());
393 if (viewId !== -1) {
394 liquidGlass.unstable_setVariant(viewId, liquidGlass.GlassMaterialVariant.bubbles);
395 // liquidGlass.unstable_setScrim(viewId, 1);
396 // liquidGlass.unstable_setSubdued(viewId, 1);
397 }
398 });
399 }
400 if (!app.isPackaged) {
401 listen.webContents.openDevTools({ mode: 'detach' });
402 }
403 windowPool.set('listen', listen);
404 break;
405 }
406
407 // ask

Callers 3

openShortcutEditorFunction · 0.85
createWindowsFunction · 0.85
handleHeaderStateChangedFunction · 0.85

Calls 1

createFeatureWindowFunction · 0.85

Tested by

no test coverage detected