MCPcopy Create free account
hub / github.com/bea4dev/ShojiWM / invokeHandler

Function invokeHandler

tools/decoration-runtime.ts:3162–3230  ·  view source on GitHub ↗
(
  effectConfig: RuntimeEffectConfig,
  windowId: string,
  handlerId: string,
)

Source from the content-addressed store, hash-verified

3160}
3161
3162function evaluateWindowDecorationPolicy(
3163 _composition: WindowCompositionFunction,
3164 _events: CompositorEventController,
3165 snapshot: WaylandWindowSnapshot,
3166 context: WindowDecorationContext,
3167): WindowDecorationDecision {
3168 let policyEntry = decorationPolicyWindowById.get(snapshot.id);
3169 if (!policyEntry) {
3170 const snapshotRef = { current: snapshot };
3171 const unsupportedAction = () => {
3172 throw new Error(
3173 "window actions cannot be called from COMPOSITOR.window.decoration.configure",
3174 );
3175 };
3176 const handle = createReactiveWindow(snapshot, {
3177 close: unsupportedAction,
3178 maximize: unsupportedAction,
3179 unmaximize: unsupportedAction,
3180 minimize: unsupportedAction,
3181 fullscreen: unsupportedAction,
3182 unfullscreen: unsupportedAction,
3183 focus: unsupportedAction,
3184 scheduleAnimation: unsupportedAction,
3185 cancelAnimation: unsupportedAction,
3186 setCloseAnimationDuration: unsupportedAction,
3187 isXWayland: () => snapshotRef.current.isXwayland,
3188 });
3189 policyEntry = { snapshotRef, handle };
3190 decorationPolicyWindowById.set(snapshot.id, policyEntry);
3191 } else {
3192 policyEntry.snapshotRef.current = snapshot;
3193 policyEntry.handle.update(snapshot);
3194 }
3195
3196 return resolveWindowDecorationDecision(policyEntry.handle.window, context);
3197}
3198
3199function evaluateWindowEffects(
3200 effectConfig: RuntimeEffectConfig,
3201 windowId: string,
3202 entry: RuntimeCacheEntry,
3203): WindowEffectAssignment | null {
3204 const evaluate = effectConfig.window;
3205 if (!evaluate) {
3206 return null;
3207 }
3208
3209 enterWindowEffectDependencyScope(windowId);
3210 try {
3211 return resolveSignals(
3212 evaluate(entry.cache.window),
3213 ) as WindowEffectAssignment | null;
3214 } finally {
3215 leaveWindowEffectDependencyScope();
3216 }
3217}
3218
3219function reanchorAnimationEntries(

Callers 1

mainFunction · 0.70

Calls 11

hasActiveAnimationsFunction · 0.90
isManagedWindowOnlyDirtyFunction · 0.90
takeDirtyWindowNodeIdsFunction · 0.90
peekNextPollDelayFunction · 0.85
evaluateWindowEffectsFunction · 0.85
countSerializedNodesFunction · 0.85
invokeHandlerMethod · 0.80
reevaluateMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected