mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04:00
term/render: move {enable,disable}_application_synchronized_updates()
From render -> terminal
This commit is contained in:
parent
afa1dbb7cc
commit
bdf127fc7e
5 changed files with 37 additions and 38 deletions
32
terminal.c
32
terminal.c
|
|
@ -443,7 +443,7 @@ fdm_application_synchronized_updates_timeout(
|
|||
return false;
|
||||
}
|
||||
|
||||
render_disable_application_synchronized_updates(term);
|
||||
term_disable_application_synchronized_updates(term);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1812,3 +1812,33 @@ term_spawn_new(const struct terminal *term)
|
|||
waitpid(pid, &result, 0);
|
||||
return WIFEXITED(result) && WEXITSTATUS(result) == 0;
|
||||
}
|
||||
|
||||
void
|
||||
term_enable_application_synchronized_updates(struct terminal *term)
|
||||
{
|
||||
if (term->render.application_synchronized_updates.enabled)
|
||||
return;
|
||||
|
||||
term->render.application_synchronized_updates.enabled = true;
|
||||
|
||||
if (timerfd_settime(
|
||||
term->render.application_synchronized_updates.timer_fd, 0,
|
||||
&(struct itimerspec){.it_value = {.tv_sec = 1}}, NULL) < 0)
|
||||
{
|
||||
LOG_ERR("failed to arm timer for application synchronized updates");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
term_disable_application_synchronized_updates(struct terminal *term)
|
||||
{
|
||||
if (!term->render.application_synchronized_updates.enabled)
|
||||
return;
|
||||
|
||||
term->render.application_synchronized_updates.enabled = false;
|
||||
|
||||
/* Reset timers */
|
||||
timerfd_settime(
|
||||
term->render.application_synchronized_updates.timer_fd, 0,
|
||||
&(struct itimerspec){{0}}, NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue