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

Function createWindows

src/window/windowManager.js:627–730  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

625
626
627function createWindows() {
628 const primaryDisplay = screen.getPrimaryDisplay();
629 const { y: workAreaY, width: screenWidth } = primaryDisplay.workArea;
630
631 const initialX = Math.round((screenWidth - DEFAULT_WINDOW_WIDTH) / 2);
632 const initialY = workAreaY + 21;
633 movementManager = new SmoothMovementManager(windowPool, getDisplayById, getCurrentDisplay, updateLayout);
634
635 const header = new BrowserWindow({
636 width: DEFAULT_WINDOW_WIDTH,
637 height: HEADER_HEIGHT,
638 x: initialX,
639 y: initialY,
640 frame: false,
641 transparent: true,
642 vibrancy: false,
643 hasShadow: false,
644 alwaysOnTop: true,
645 skipTaskbar: true,
646 hiddenInMissionControl: true,
647 resizable: false,
648 focusable: true,
649 acceptFirstMouse: true,
650 webPreferences: {
651 nodeIntegration: false,
652 contextIsolation: true,
653 preload: path.join(__dirname, '../preload.js'),
654 backgroundThrottling: false,
655 webSecurity: false,
656 enableRemoteModule: false,
657 // Ensure proper rendering and prevent pixelation
658 experimentalFeatures: false,
659 },
660 // Prevent pixelation and ensure proper rendering
661 useContentSize: true,
662 disableAutoHideCursor: true,
663 });
664 if (process.platform === 'darwin') {
665 header.setWindowButtonVisibility(false);
666 }
667 const headerLoadOptions = {};
668 if (!shouldUseLiquidGlass) {
669 header.loadFile(path.join(__dirname, '../ui/app/header.html'), headerLoadOptions);
670 }
671 else {
672 headerLoadOptions.query = { glass: 'true' };
673 header.loadFile(path.join(__dirname, '../ui/app/header.html'), headerLoadOptions);
674 header.webContents.once('did-finish-load', () => {
675 const viewId = liquidGlass.addView(header.getNativeWindowHandle());
676 if (viewId !== -1) {
677 liquidGlass.unstable_setVariant(viewId, liquidGlass.GlassMaterialVariant.bubbles);
678 // liquidGlass.unstable_setScrim(viewId, 1);
679 // liquidGlass.unstable_setSubdued(viewId, 1);
680 }
681 });
682 }
683 windowPool.set('header', header);
684 header.on('moved', updateLayout);

Callers 1

index.jsFile · 0.85

Calls 8

setupIpcHandlersFunction · 0.85
setupAnimationControllerFunction · 0.85
createFeatureWindowsFunction · 0.85
updateLayoutFunction · 0.85
onMethod · 0.80
registerShortcutsMethod · 0.80
setMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected