🔀 Merge pull request #362 from Schneegans/fix/fullscreen-effects
This commit is contained in:
@@ -15,6 +15,7 @@ SPDX-License-Identifier: CC-BY-4.0
|
|||||||
|
|
||||||
#### Bug Fixes
|
#### Bug Fixes
|
||||||
|
|
||||||
|
- Some effects (Fire, Incinerate, Energize A, Energize B) are faded towards the edges of the window. This used to look weird when the window is maximized. This has been fixed.
|
||||||
- On KDE, the animations are not applied to IntelliJ IDEs anymore. These IDEs use windows for their tooltips which do not set the WM class correctly. This caused the animations to be applied to the tooltips as well making them unusable. This is rather a workaround than a fix, but makes the effect usable again in conjunction with IntelliJ IDEs.
|
- On KDE, the animations are not applied to IntelliJ IDEs anymore. These IDEs use windows for their tooltips which do not set the WM class correctly. This caused the animations to be applied to the tooltips as well making them unusable. This is rather a workaround than a fix, but makes the effect usable again in conjunction with IntelliJ IDEs.
|
||||||
|
|
||||||
## [Burn My Windows 35](https://github.com/schneegans/Burn-My-Windows/releases/tag/v35)
|
## [Burn My Windows 35](https://github.com/schneegans/Burn-My-Windows/releases/tag/v35)
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ class %EFFECT_CLASS% {
|
|||||||
this.setupForcedRoles(window);
|
this.setupForcedRoles(window);
|
||||||
|
|
||||||
effect.setUniform(this.shader, 'uForOpening', 1.0);
|
effect.setUniform(this.shader, 'uForOpening', 1.0);
|
||||||
|
effect.setUniform(this.shader, 'uIsFullscreen', window.fullScreen ? 1.0 : 0.0);
|
||||||
|
|
||||||
%ON_ANIMATION_BEGIN%
|
%ON_ANIMATION_BEGIN%
|
||||||
|
|
||||||
@@ -167,6 +168,7 @@ class %EFFECT_CLASS% {
|
|||||||
this.setupForcedRoles(window);
|
this.setupForcedRoles(window);
|
||||||
|
|
||||||
effect.setUniform(this.shader, 'uForOpening', 0.0);
|
effect.setUniform(this.shader, 'uForOpening', 0.0);
|
||||||
|
effect.setUniform(this.shader, 'uIsFullscreen', window.fullScreen ? 1.0 : 0.0);
|
||||||
|
|
||||||
%ON_ANIMATION_BEGIN%
|
%ON_ANIMATION_BEGIN%
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
// Each shader can access these standard input values:
|
// Each shader can access these standard input values:
|
||||||
|
|
||||||
// vec2 iTexCoord: Texture coordinates for retrieving the window input color.
|
// vec2 iTexCoord: Texture coordinates for retrieving the window input color.
|
||||||
|
// bool uIsFullscreen: True if the window is maximized or in fullscreen mode.
|
||||||
// bool uForOpening: True if a window-open animation is ongoing, false otherwise.
|
// bool uForOpening: True if a window-open animation is ongoing, false otherwise.
|
||||||
// float uProgress: A value which transitions from 0 to 1 during the animation.
|
// float uProgress: A value which transitions from 0 to 1 during the animation.
|
||||||
// float uDuration: The duration of the current animation in seconds.
|
// float uDuration: The duration of the current animation in seconds.
|
||||||
@@ -35,6 +36,7 @@
|
|||||||
// void setOutputColor(vec4 outColor)
|
// void setOutputColor(vec4 outColor)
|
||||||
|
|
||||||
uniform bool uForOpening;
|
uniform bool uForOpening;
|
||||||
|
uniform bool uIsFullscreen;
|
||||||
uniform float uProgress;
|
uniform float uProgress;
|
||||||
uniform float uDuration;
|
uniform float uDuration;
|
||||||
|
|
||||||
@@ -168,14 +170,18 @@ float easeOutBack(float x, float e) {
|
|||||||
// --------------------------------------------------------------------- edge mask helpers
|
// --------------------------------------------------------------------- edge mask helpers
|
||||||
|
|
||||||
// This method returns a mask which smoothly transitions towards zero when approaching
|
// This method returns a mask which smoothly transitions towards zero when approaching
|
||||||
// the window's borders. There is a variant which takes the transition area width in
|
// the window's borders. If the window is currently maximized or in fullscreen mode, this
|
||||||
|
// will return 1.0 everywhere. There is a variant which takes the transition area width in
|
||||||
// pixels and one which takes this as a percentage.
|
// pixels and one which takes this as a percentage.
|
||||||
float getEdgeMask(vec2 uv, vec2 maxUV, float fadeWidth) {
|
float getEdgeMask(vec2 uv, vec2 maxUV, float fadeWidth) {
|
||||||
float mask = 1.0;
|
float mask = 1.0;
|
||||||
|
|
||||||
|
if (!uIsFullscreen) {
|
||||||
mask *= smoothstep(0.0, 1.0, clamp(uv.x / fadeWidth, 0.0, 1.0));
|
mask *= smoothstep(0.0, 1.0, clamp(uv.x / fadeWidth, 0.0, 1.0));
|
||||||
mask *= smoothstep(0.0, 1.0, clamp(uv.y / fadeWidth, 0.0, 1.0));
|
mask *= smoothstep(0.0, 1.0, clamp(uv.y / fadeWidth, 0.0, 1.0));
|
||||||
mask *= smoothstep(0.0, 1.0, clamp((maxUV.x - uv.x) / fadeWidth, 0.0, 1.0));
|
mask *= smoothstep(0.0, 1.0, clamp((maxUV.x - uv.x) / fadeWidth, 0.0, 1.0));
|
||||||
mask *= smoothstep(0.0, 1.0, clamp((maxUV.y - uv.y) / fadeWidth, 0.0, 1.0));
|
mask *= smoothstep(0.0, 1.0, clamp((maxUV.y - uv.y) / fadeWidth, 0.0, 1.0));
|
||||||
|
}
|
||||||
|
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ var Shader = GObject.registerClass(
|
|||||||
|
|
||||||
// Store standard uniform locations.
|
// Store standard uniform locations.
|
||||||
this._uForOpening = this.get_uniform_location('uForOpening');
|
this._uForOpening = this.get_uniform_location('uForOpening');
|
||||||
|
this._uIsFullscreen = this.get_uniform_location('uIsFullscreen');
|
||||||
this._uProgress = this.get_uniform_location('uProgress');
|
this._uProgress = this.get_uniform_location('uProgress');
|
||||||
this._uDuration = this.get_uniform_location('uDuration');
|
this._uDuration = this.get_uniform_location('uDuration');
|
||||||
this._uSize = this.get_uniform_location('uSize');
|
this._uSize = this.get_uniform_location('uSize');
|
||||||
@@ -124,9 +125,13 @@ var Shader = GObject.registerClass(
|
|||||||
// This is not necessarily symmetric, but I haven't figured out a way to
|
// This is not necessarily symmetric, but I haven't figured out a way to
|
||||||
// get the actual values...
|
// get the actual values...
|
||||||
const padding = (actor.width - actor.meta_window.get_frame_rect().width) / 2;
|
const padding = (actor.width - actor.meta_window.get_frame_rect().width) / 2;
|
||||||
|
const isFullscreen =
|
||||||
|
actor.meta_window.get_maximized() === Meta.MaximizeFlags.BOTH ||
|
||||||
|
actor.meta_window.fullscreen;
|
||||||
|
|
||||||
this.set_uniform_float(this._uPadding, 1, [padding]);
|
this.set_uniform_float(this._uPadding, 1, [padding]);
|
||||||
this.set_uniform_float(this._uForOpening, 1, [forOpening]);
|
this.set_uniform_float(this._uForOpening, 1, [forOpening]);
|
||||||
|
this.set_uniform_float(this._uIsFullscreen, 1, [isFullscreen]);
|
||||||
this.set_uniform_float(this._uDuration, 1, [duration * 0.001]);
|
this.set_uniform_float(this._uDuration, 1, [duration * 0.001]);
|
||||||
this.set_uniform_float(this._uSize, 2, [actor.width, actor.height]);
|
this.set_uniform_float(this._uSize, 2, [actor.width, actor.height]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user