Skip to content

Commit ae5f2c1

Browse files
committed
Implement fade out animation
1 parent f6e8fcf commit ae5f2c1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/BackgroundBlurEffect.vala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class Gala.BackgroundBlurEffect : Clutter.Effect {
1313
public float monitor_scale { get; construct set; }
1414

1515
private float downscale_factor;
16+
private float real_blur_radius;
1617

1718
private int texture_width;
1819
private int texture_height;
@@ -312,7 +313,7 @@ public class Gala.BackgroundBlurEffect : Clutter.Effect {
312313
var width = (int) actor_box.get_width ();
313314
var height = (int) actor_box.get_height ();
314315

315-
var downscale_factor = calculate_downscale_factor (width, height, blur_radius);
316+
var downscale_factor = calculate_downscale_factor (width, height, real_blur_radius);
316317

317318
var updated = update_actor_fbo (width, height, downscale_factor) && update_rounded_fbo (width, height, downscale_factor) && update_background_fbo (width, height);
318319

@@ -330,7 +331,7 @@ public class Gala.BackgroundBlurEffect : Clutter.Effect {
330331
var blur_node = new Clutter.BlurNode (
331332
(uint) (texture_width / downscale_factor),
332333
(uint) (texture_height / downscale_factor),
333-
blur_radius / downscale_factor
334+
real_blur_radius / downscale_factor
334335
);
335336
blur_node.add_rectangle ({
336337
0.0f,
@@ -383,6 +384,8 @@ public class Gala.BackgroundBlurEffect : Clutter.Effect {
383384
return;
384385
}
385386

387+
real_blur_radius = blur_radius * (1.0f - (float) (255 - actor.opacity) / 255.0f);
388+
386389
Clutter.ActorBox source_actor_box = {};
387390
update_actor_box (paint_context, ref source_actor_box);
388391

0 commit comments

Comments
 (0)