diff --git a/tiling.js b/tiling.js index db3f4d1..eb44b81 100644 --- a/tiling.js +++ b/tiling.js @@ -1758,18 +1758,22 @@ class Spaces extends Map { debug('window-created', metaWindow.title); let actor = metaWindow.get_compositor_private(); - /* HACK 3.34: Hidden actors aren't allocated if hidden, use opacity instead to fix - new window animations. + if (utils.version[1] < 34) { + animateWindow(metaWindow); + } else { + /* HACK 3.34: Hidden actors aren't allocated if hidden, use opacity + instead to fix new window animations. - The first draw will reset the opacity it seems (but not visible). So - even if we set it again in `first-frame` that is too late since that - happens _after_ mutter have drawn the frame. + The first draw will reset the opacity it seems (but not visible). + So even if we set it again in `first-frame` that is too late + since that happens _after_ mutter have drawn the frame. - So we kill visibily on the first the `queue-redraw`. - */ - signals.connectOneShot(actor, 'queue-redraw', () => { - actor.opacity = 0; - }); + So we kill visibily on the first the `queue-redraw`. + */ + signals.connectOneShot(actor, 'queue-redraw', () => { + actor.opacity = 0; + }); + } /* We need reliable `window_type`, `wm_class` et. all to handle window insertion correctly. @@ -2450,7 +2454,10 @@ function showHandler(actor) { // HACK: use opacity instead of hidden on new windows if (metaWindow.unmapped) { - actor.opacity = 0; + if (utils.version[1] < 34) + animateWindow(metaWindow); + else + actor.opacity = 0; return; } diff --git a/utils.js b/utils.js index 1235573..2178ec9 100644 --- a/utils.js +++ b/utils.js @@ -14,8 +14,8 @@ var display = global.display; var GObject = imports.gi.GObject; var registerClass; +var version = imports.misc.config.PACKAGE_VERSION.split('.').map(Number); { - let version = imports.misc.config.PACKAGE_VERSION.split('.'); if (version[0] >= 3 && version[1] > 30) { registerClass = GObject.registerClass; } else {