({
app,
persistent,
initialAllocation,
msWorkspace,
lifecycleState,
createdAt,
}: MsWindowConstructProps)
| 180 | updateMetaWindowPositionAndSizeThrottled: () => void; |
| 181 | |
| 182 | constructor({ |
| 183 | app, |
| 184 | persistent, |
| 185 | initialAllocation, |
| 186 | msWorkspace, |
| 187 | lifecycleState, |
| 188 | createdAt, |
| 189 | }: MsWindowConstructProps) { |
| 190 | super({ |
| 191 | reactive: true, |
| 192 | x: initialAllocation ? initialAllocation.x || 0 : 0, |
| 193 | y: initialAllocation ? initialAllocation.y || 0 : 0, |
| 194 | width: initialAllocation ? initialAllocation.width || 0 : 0, |
| 195 | height: initialAllocation ? initialAllocation.height || 0 : 0, |
| 196 | }); |
| 197 | |
| 198 | this.lifecycleState = lifecycleState; |
| 199 | this.app = app; |
| 200 | this.createdAt = createdAt; |
| 201 | this.trackAppChanges(); |
| 202 | this._persistent = persistent; |
| 203 | this.msWorkspace = msWorkspace; |
| 204 | this.updateMetaWindowPositionAndSizeThrottled = throttle( |
| 205 | () => this.updateMetaWindowPositionAndSizeInternal(), |
| 206 | 16 |
| 207 | ); |
| 208 | |
| 209 | this.windowClone = new Clutter.Clone(); |
| 210 | this.placeholder = new AppPlaceholder( |
| 211 | this.app.create_icon_texture(PLACEHOLDER_ICON_SIZE), |
| 212 | this.app.get_name() ?? '' |
| 213 | ); |
| 214 | this.placeholder.connect('activated', (_) => { |
| 215 | this.emit('request-new-meta-window'); |
| 216 | }); |
| 217 | this.destroyId = this.connect('destroy', this._onDestroy.bind(this)); |
| 218 | this.connect('parent-set', () => { |
| 219 | this.msContent.style_changed(); |
| 220 | this.updateMetaWindowVisibility(); |
| 221 | }); |
| 222 | this.connect('notify::visible', () => { |
| 223 | this.updateMetaWindowVisibility(); |
| 224 | }); |
| 225 | this.msContent = new MsWindowContent({ |
| 226 | placeholder: this.placeholder, |
| 227 | clone: this.windowClone, |
| 228 | }); |
| 229 | this.add_child(this.msContent); |
| 230 | this.setMsWorkspace(msWorkspace); |
| 231 | } |
| 232 | |
| 233 | get state(): MsWindowState { |
| 234 | const metaWindow = this.metaWindow; |
nothing calls this directly
no test coverage detected