diff --git a/docs/how-to-create-new-effects.md b/docs/how-to-create-new-effects.md index 0d10d04..730c131 100644 --- a/docs/how-to-create-new-effects.md +++ b/docs/how-to-create-new-effects.md @@ -152,10 +152,11 @@ var SimpleFade = class SimpleFade { // This is also called from extension.js. It is used to tweak a window's open / close // transitions - usually windows are faded in / out and scaled up / down by GNOME Shell. - // forOpening is set to true if this is called for a window-open transition, for a - // window-close transition it is set to false. The modes can be set to any value from - // here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode. This also - // determines how the uProgress uniform value will progress in the shader. + // The parameter 'forOpening' is set to true if this is called for a window-open + // transition, for a window-close transition it is set to false. The modes can be set to + // any value from here: https://gjs-docs.gnome.org/clutter8~8_api/clutter.animationmode. + // This also determines how the uProgress uniform value will progress in the shader. + // Tweaking the actor's scale during the transition only works properly for GNOME 3.38+. // For this effect, windows should neither be scaled nor faded. static tweakTransition(actor, settings, forOpening) { return { diff --git a/extension.js b/extension.js index fd393f2..5115b3e 100644 --- a/extension.js +++ b/extension.js @@ -100,22 +100,26 @@ class Extension { realWindow = params[0].get_compositor_private(); } - const xID = realWindow.connect('notify::scale-x', () => { - if (realWindow.scale_x > 0) { - clone.scale_x = realWindow.scale_x; - } - }); + // Syncing the real window's scale with the scale of its clone only works on GNOME + // Shell 3.38+. So effects cannot scale windows in the overview of GNOME 3.36... + if (utils.shellVersionIsAtLeast(3, 38)) { + const xID = realWindow.connect('notify::scale-x', () => { + if (realWindow.scale_x > 0) { + clone.scale_x = realWindow.scale_x; + } + }); - const yID = realWindow.connect('notify::scale-y', () => { - if (realWindow.scale_y > 0) { - clone.scale_y = realWindow.scale_y; - } - }); + const yID = realWindow.connect('notify::scale-y', () => { + if (realWindow.scale_y > 0) { + clone.scale_y = realWindow.scale_y; + } + }); - clone.connect('destroy', () => { - realWindow.disconnect(xID); - realWindow.disconnect(yID); - }); + clone.connect('destroy', () => { + realWindow.disconnect(xID); + realWindow.disconnect(yID); + }); + } // On GNOME 3.36, the window clone's 'destroy' handler only calls _removeWindowClone // but not _doRemoveWindow. The latter is required to trigger the repositioning of @@ -155,9 +159,8 @@ class Extension { - // This class is only available in GNOME Shell 3.38+. So no transition tweaking in - // GNOME Shell 3.36, but this is not used by any effect available there anyways for - // now... + // This class is only available in GNOME Shell 3.38+. So no overlay-hiding on + // GNOME Shell 3.36 for now. if (WindowPreview) { this._origDeleteAll = WindowPreview.prototype._deleteAll; this._origRestack = WindowPreview.prototype._restack;