mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-04-06 07:15:53 -04:00
fadeout border也设置透明
This commit is contained in:
parent
425a7ef6fe
commit
895c879f98
1 changed files with 20 additions and 0 deletions
20
maomao.c
20
maomao.c
|
|
@ -721,6 +721,24 @@ double find_animation_curve_at(double t) {
|
||||||
return baked_points[up].y;
|
return baked_points[up].y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void apply_opacity_to_rect_nodes(struct wlr_scene_node *node, double opacity) {
|
||||||
|
if (node->type == WLR_SCENE_NODE_RECT) {
|
||||||
|
struct wlr_scene_rect *rect = wlr_scene_rect_from_node(node);
|
||||||
|
// Assuming the rect has a color field and we can modify it
|
||||||
|
rect->color[3] = opacity; // Set the alpha channel of the color
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the node is a tree, recursively traverse its children
|
||||||
|
if (node->type == WLR_SCENE_NODE_TREE) {
|
||||||
|
struct wlr_scene_tree *scene_tree = wlr_scene_tree_from_node(node);
|
||||||
|
struct wlr_scene_node *child;
|
||||||
|
wl_list_for_each(child, &scene_tree->children, link) {
|
||||||
|
apply_opacity_to_rect_nodes(child, opacity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void fadeout_client_animation_next_tick(Client *c) {
|
void fadeout_client_animation_next_tick(Client *c) {
|
||||||
if (!c)
|
if (!c)
|
||||||
return;
|
return;
|
||||||
|
|
@ -751,6 +769,8 @@ void fadeout_client_animation_next_tick(Client *c) {
|
||||||
wlr_scene_node_for_each_buffer(&c->snapshot_scene->node,
|
wlr_scene_node_for_each_buffer(&c->snapshot_scene->node,
|
||||||
scene_buffer_apply_opacity, &opacity);
|
scene_buffer_apply_opacity, &opacity);
|
||||||
|
|
||||||
|
apply_opacity_to_rect_nodes(&c->snapshot_scene->node, opacity);
|
||||||
|
|
||||||
if (animation_passed == 1.0) {
|
if (animation_passed == 1.0) {
|
||||||
wl_list_remove(&c->fadeout_link);
|
wl_list_remove(&c->fadeout_link);
|
||||||
wlr_scene_node_destroy(&c->snapshot_scene->node);
|
wlr_scene_node_destroy(&c->snapshot_scene->node);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue