mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-31 22:25:29 -04:00
fix: error args for effect set when no animaiton
This commit is contained in:
parent
7ded90021b
commit
e1368e1121
1 changed files with 15 additions and 9 deletions
24
src/maomao.c
24
src/maomao.c
|
|
@ -1269,6 +1269,14 @@ void client_apply_clip(Client *c) {
|
||||||
enum corner_location current_corner_location =
|
enum corner_location current_corner_location =
|
||||||
set_client_corner_location(c);
|
set_client_corner_location(c);
|
||||||
|
|
||||||
|
float percent =
|
||||||
|
c->animation.action == OPEN && animation_fade_in && !c->nofadein
|
||||||
|
? (double)c->animation.passed_frames / c->animation.total_frames
|
||||||
|
: 1.0;
|
||||||
|
float opacity = c->isfullscreen ? 1
|
||||||
|
: c == selmon->sel ? c->focused_opacity
|
||||||
|
: c->unfocused_opacity;
|
||||||
|
|
||||||
if (!animations) {
|
if (!animations) {
|
||||||
c->animation.running = false;
|
c->animation.running = false;
|
||||||
c->need_output_flush = false;
|
c->need_output_flush = false;
|
||||||
|
|
@ -1285,6 +1293,9 @@ void client_apply_clip(Client *c) {
|
||||||
surface_clip = clip_box;
|
surface_clip = clip_box;
|
||||||
surface_clip.width = surface_clip.width - c->bw;
|
surface_clip.width = surface_clip.width - c->bw;
|
||||||
surface_clip.height = surface_clip.height - c->bw;
|
surface_clip.height = surface_clip.height - c->bw;
|
||||||
|
scale_data.opacity = c->isfullscreen ? 1
|
||||||
|
: c == selmon->sel ? c->focused_opacity
|
||||||
|
: c->unfocused_opacity;
|
||||||
|
|
||||||
if (surface_clip.width <= 0 || surface_clip.height <= 0) {
|
if (surface_clip.width <= 0 || surface_clip.height <= 0) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -1292,8 +1303,8 @@ void client_apply_clip(Client *c) {
|
||||||
|
|
||||||
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node,
|
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node,
|
||||||
&surface_clip);
|
&surface_clip);
|
||||||
buffer_set_effect(
|
buffer_set_effect(c, (animationScale){0, 0, 0, 0, opacity, opacity,
|
||||||
c, (animationScale){0, 0, 0, 0, current_corner_location, false});
|
current_corner_location, false});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1347,13 +1358,8 @@ void client_apply_clip(Client *c) {
|
||||||
scale_data.height_scale =
|
scale_data.height_scale =
|
||||||
(float)scale_data.height / (geometry.height - offset.y);
|
(float)scale_data.height / (geometry.height - offset.y);
|
||||||
scale_data.corner_location = current_corner_location;
|
scale_data.corner_location = current_corner_location;
|
||||||
scale_data.percent =
|
scale_data.percent = percent;
|
||||||
c->animation.action == OPEN && animation_fade_in && !c->nofadein
|
scale_data.opacity = opacity;
|
||||||
? (double)c->animation.passed_frames / c->animation.total_frames
|
|
||||||
: 1.0;
|
|
||||||
scale_data.opacity = c->isfullscreen ? 1
|
|
||||||
: c == selmon->sel ? c->focused_opacity
|
|
||||||
: c->unfocused_opacity;
|
|
||||||
buffer_set_effect(c, scale_data);
|
buffer_set_effect(c, scale_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue