( effectConfig: RuntimeEffectConfig, windowId: string, handlerId: string, )
| 3160 | } |
| 3161 | |
| 3162 | function 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 | |
| 3199 | function 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 | |
| 3219 | function reanchorAnimationEntries( |
no test coverage detected