MCPcopy
hub / github.com/paperwm/PaperWM / window_created

Method window_created

tiling.js:3314–3336  ·  view source on GitHub ↗

* @param display * @param metaWindow {import("@gi-types/meta").Window}

(metaWindow)

Source from the content-addressed store, hash-verified

3312 * @param metaWindow {import("@gi-types/meta").Window}
3313 */
3314 window_created(metaWindow) {
3315 if (!registerWindow(metaWindow)) {
3316 return;
3317 }
3318
3319 metaWindow.unmapped = true;
3320
3321 console.debug('window-created', metaWindow?.title);
3322 let actor = metaWindow.get_compositor_private();
3323 animateWindow(metaWindow);
3324
3325 /*
3326 We need reliable `window_type`, `wm_class` et. all to handle window insertion correctly.
3327
3328 On wayland this is completely broken before `first-frame`. It's
3329 somewhat more stable on X11, but there's at minimum some racing with
3330 `wm_class` which can break the users winprop rules.
3331 */
3332 signals.connectOneShot(actor, 'first-frame', () => {
3333 allocateClone(metaWindow);
3334 insertWindow(metaWindow, { existing: false });
3335 });
3336 }
3337};
3338Signals.addSignalMethods(Spaces.prototype);
3339

Callers 1

initMethod · 0.95

Calls 5

registerWindowFunction · 0.85
animateWindowFunction · 0.85
allocateCloneFunction · 0.85
insertWindowFunction · 0.85
connectOneShotMethod · 0.80

Tested by

no test coverage detected