mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-28 06:46:38 -04:00
eventually apply last app ID when throttling
...instead of just dropping those app IDs.
This commit is contained in:
parent
f4dd7a7878
commit
239561ffbf
4 changed files with 69 additions and 12 deletions
22
render.c
22
render.c
|
|
@ -4488,6 +4488,28 @@ render_refresh_title(struct terminal *term)
|
|||
render_refresh_csd(term);
|
||||
}
|
||||
|
||||
void
|
||||
render_refresh_app_id(struct terminal *term)
|
||||
{
|
||||
struct timespec now;
|
||||
if (clock_gettime(CLOCK_MONOTONIC, &now) < 0)
|
||||
return;
|
||||
|
||||
struct timespec diff;
|
||||
timespec_sub(&now, &term->render.app_id.last_update, &diff);
|
||||
|
||||
if (diff.tv_sec == 0 && diff.tv_nsec < 8333 * 1000) {
|
||||
const struct itimerspec timeout = {
|
||||
.it_value = {.tv_nsec = 8333 * 1000 - diff.tv_nsec},
|
||||
};
|
||||
|
||||
timerfd_settime(term->render.app_id.timer_fd, 0, &timeout, NULL);
|
||||
} else {
|
||||
term->render.app_id.last_update = now;
|
||||
xdg_toplevel_set_app_id(term->window->xdg_toplevel, term->app_id ? term->app_id : term->conf->app_id);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
render_refresh(struct terminal *term)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue