Skip to content

Commit

Permalink
fixed con kill issue
Browse files Browse the repository at this point in the history
  • Loading branch information
WillPower3309 committed Aug 9, 2023
1 parent 27aa948 commit 7d37b1f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sway/tree/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ static int animation_timer(void *data) {
for (int i = 0; i < con->outputs->length; ++i) {
struct sway_output *output = root->outputs->items[i];
fastest_output_refresh_ns = MAX(fastest_output_refresh_ns, output->refresh_nsec);

float alpha_step = config->animation_duration ?
(con->max_alpha * output->refresh_sec) / config->animation_duration : con->max_alpha;

con->alpha = con->alpha < con->target_alpha ? MIN(con->alpha + alpha_step, con->target_alpha)
: MAX(con->alpha - alpha_step, con->target_alpha);
}
if (con->alpha != con->target_alpha) {
wl_event_source_timer_update(con->animation_present_timer, fastest_output_refresh_ns / 1000000);
} else {
wl_event_source_remove(con->animation_present_timer);
}
container_damage_whole(con);

Expand Down Expand Up @@ -121,9 +119,7 @@ void container_destroy(struct sway_container *con) {
wlr_texture_destroy(con->marks_urgent);
wlr_texture_destroy(con->marks_focused_tab_title);

if (con->animation_present_timer) {
wl_event_source_remove(con->animation_present_timer);
}
wl_event_source_remove(con->animation_present_timer);

if (con->view && con->view->container == con) {
con->view->container = NULL;
Expand Down

0 comments on commit 7d37b1f

Please sign in to comment.