(to, from, animate = true, callback)
| 3115 | } |
| 3116 | |
| 3117 | animateToSpace(to, from, animate = true, callback) { |
| 3118 | let currentPreviewMode = inPreview; |
| 3119 | inPreview = PreviewMode.NONE; |
| 3120 | |
| 3121 | Topbar.updateWorkspaceIndicator(to.index); |
| 3122 | if (to.hasTopBar) { |
| 3123 | if (to.showPositionBar) { |
| 3124 | Topbar.setNoBackgroundStyle(); |
| 3125 | } else { |
| 3126 | Topbar.setTransparentStyle(); |
| 3127 | } |
| 3128 | } |
| 3129 | |
| 3130 | this.selectedSpace = to; |
| 3131 | to.show(); |
| 3132 | let selected = to.selectedWindow; |
| 3133 | if (selected) |
| 3134 | ensureViewport(selected, to); |
| 3135 | |
| 3136 | if (from) { |
| 3137 | from.startAnimate(); |
| 3138 | } |
| 3139 | |
| 3140 | let visible = new Map(); |
| 3141 | for (let [, space] of this.monitors) { |
| 3142 | visible.set(space, true); |
| 3143 | } |
| 3144 | |
| 3145 | let time = animate ? Settings.prefs.animation_time : 0; |
| 3146 | let onComplete = () => { |
| 3147 | // Hide any spaces that aren't visible This |
| 3148 | // avoids a nasty preformance degregration in some |
| 3149 | // cases |
| 3150 | for (const space of spaces.values()) { |
| 3151 | if (!visible.get(space)) { |
| 3152 | space.hide(); |
| 3153 | } |
| 3154 | } |
| 3155 | |
| 3156 | to.border.hide(); |
| 3157 | to.border.opacity = 255; |
| 3158 | Utils.actor_raise(to.clip); |
| 3159 | |
| 3160 | // Ensures window clones are clickable after switching monitors. |
| 3161 | // Originally X11-only but also needed on Wayland for proper |
| 3162 | // input handling after space switches. |
| 3163 | to.startAnimate(); |
| 3164 | |
| 3165 | to.moveDone(); |
| 3166 | if (callback) { |
| 3167 | callback(); |
| 3168 | } |
| 3169 | }; |
| 3170 | |
| 3171 | if (currentPreviewMode === PreviewMode.SEQUENTIAL) { |
| 3172 | this._animateToSpaceOrdered(to, animate); |
| 3173 | let t = to.actor.get_transition('y'); |
| 3174 | if (t) { |
no test coverage detected