mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04:00
term: shorten application_synchronized_updates -> app_sync_updates
This commit is contained in:
parent
02c310d241
commit
1623fc0c0a
4 changed files with 26 additions and 26 deletions
4
dcs.c
4
dcs.c
|
|
@ -13,7 +13,7 @@ bsu(struct terminal *term)
|
||||||
LOG_WARN("untested: BSU - Begin Synchronized Update (params: %.*s)",
|
LOG_WARN("untested: BSU - Begin Synchronized Update (params: %.*s)",
|
||||||
(int)term->vt.dcs.idx, term->vt.dcs.data);
|
(int)term->vt.dcs.idx, term->vt.dcs.data);
|
||||||
|
|
||||||
term_enable_application_synchronized_updates(term);
|
term_enable_app_sync_updates(term);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ esu(struct terminal *term)
|
||||||
LOG_WARN("untested: ESU - Begin Synchronized Update (params: %.*s)",
|
LOG_WARN("untested: ESU - Begin Synchronized Update (params: %.*s)",
|
||||||
(int)term->vt.dcs.idx, term->vt.dcs.data);
|
(int)term->vt.dcs.idx, term->vt.dcs.data);
|
||||||
|
|
||||||
term_disable_application_synchronized_updates(term);
|
term_disable_app_sync_updates(term);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
4
render.c
4
render.c
|
|
@ -1016,7 +1016,7 @@ render_resize(struct terminal *term, int width, int height)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Cancel an application initiated "Synchronized Update" */
|
/* Cancel an application initiated "Synchronized Update" */
|
||||||
term_disable_application_synchronized_updates(term);
|
term_disable_app_sync_updates(term);
|
||||||
|
|
||||||
term->width = width;
|
term->width = width;
|
||||||
term->height = height;
|
term->height = height;
|
||||||
|
|
@ -1193,7 +1193,7 @@ fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
|
||||||
if (!term->render.refresh_needed)
|
if (!term->render.refresh_needed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (term->render.application_synchronized_updates.enabled)
|
if (term->render.app_sync_updates.enabled)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
assert(term->window->is_configured);
|
assert(term->window->is_configured);
|
||||||
|
|
|
||||||
38
terminal.c
38
terminal.c
|
|
@ -186,7 +186,7 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
|
||||||
* has any effect when the renderer is idle.
|
* has any effect when the renderer is idle.
|
||||||
*/
|
*/
|
||||||
if (term->window->frame_callback == NULL) {
|
if (term->window->frame_callback == NULL) {
|
||||||
if (term->render.application_synchronized_updates.enabled)
|
if (term->render.app_sync_updates.enabled)
|
||||||
term->render.refresh_needed = true;
|
term->render.refresh_needed = true;
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
@ -418,7 +418,7 @@ fdm_delayed_render(struct fdm *fdm, int fd, int events, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
fdm_application_synchronized_updates_timeout(
|
fdm_app_sync_updates_timeout(
|
||||||
struct fdm *fdm, int fd, int events, void *data)
|
struct fdm *fdm, int fd, int events, void *data)
|
||||||
{
|
{
|
||||||
if (events & EPOLLHUP)
|
if (events & EPOLLHUP)
|
||||||
|
|
@ -426,7 +426,7 @@ fdm_application_synchronized_updates_timeout(
|
||||||
|
|
||||||
struct terminal *term = data;
|
struct terminal *term = data;
|
||||||
uint64_t unused;
|
uint64_t unused;
|
||||||
ssize_t ret = read(term->render.application_synchronized_updates.timer_fd,
|
ssize_t ret = read(term->render.app_sync_updates.timer_fd,
|
||||||
&unused, sizeof(unused));
|
&unused, sizeof(unused));
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
@ -436,7 +436,7 @@ fdm_application_synchronized_updates_timeout(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
term_disable_application_synchronized_updates(term);
|
term_disable_app_sync_updates(term);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -534,7 +534,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||||
int cursor_blink_fd = -1;
|
int cursor_blink_fd = -1;
|
||||||
int delay_lower_fd = -1;
|
int delay_lower_fd = -1;
|
||||||
int delay_upper_fd = -1;
|
int delay_upper_fd = -1;
|
||||||
int application_synchronized_updates_fd = -1;
|
int app_sync_updates_fd = -1;
|
||||||
|
|
||||||
struct terminal *term = malloc(sizeof(*term));
|
struct terminal *term = malloc(sizeof(*term));
|
||||||
|
|
||||||
|
|
@ -561,7 +561,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||||
goto close_fds;
|
goto close_fds;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((application_synchronized_updates_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) == -1)
|
if ((app_sync_updates_fd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK)) == -1)
|
||||||
{
|
{
|
||||||
LOG_ERRNO("failed to create application synchronized updates timer FD");
|
LOG_ERRNO("failed to create application synchronized updates timer FD");
|
||||||
goto close_fds;
|
goto close_fds;
|
||||||
|
|
@ -581,7 +581,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||||
!fdm_add(fdm, cursor_blink_fd, EPOLLIN, &fdm_cursor_blink, term) ||
|
!fdm_add(fdm, cursor_blink_fd, EPOLLIN, &fdm_cursor_blink, term) ||
|
||||||
!fdm_add(fdm, delay_lower_fd, EPOLLIN, &fdm_delayed_render, term) ||
|
!fdm_add(fdm, delay_lower_fd, EPOLLIN, &fdm_delayed_render, term) ||
|
||||||
!fdm_add(fdm, delay_upper_fd, EPOLLIN, &fdm_delayed_render, term) ||
|
!fdm_add(fdm, delay_upper_fd, EPOLLIN, &fdm_delayed_render, term) ||
|
||||||
!fdm_add(fdm, application_synchronized_updates_fd, EPOLLIN, &fdm_application_synchronized_updates_timeout, term))
|
!fdm_add(fdm, app_sync_updates_fd, EPOLLIN, &fdm_app_sync_updates_timeout, term))
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
@ -656,7 +656,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||||
.wl = wayl,
|
.wl = wayl,
|
||||||
.render = {
|
.render = {
|
||||||
.scrollback_lines = conf->scrollback_lines,
|
.scrollback_lines = conf->scrollback_lines,
|
||||||
.application_synchronized_updates.timer_fd = application_synchronized_updates_fd,
|
.app_sync_updates.timer_fd = app_sync_updates_fd,
|
||||||
.workers = {
|
.workers = {
|
||||||
.count = conf->render_worker_count,
|
.count = conf->render_worker_count,
|
||||||
.queue = tll_init(),
|
.queue = tll_init(),
|
||||||
|
|
@ -732,7 +732,7 @@ close_fds:
|
||||||
fdm_del(fdm, cursor_blink_fd);
|
fdm_del(fdm, cursor_blink_fd);
|
||||||
fdm_del(fdm, delay_lower_fd);
|
fdm_del(fdm, delay_lower_fd);
|
||||||
fdm_del(fdm, delay_upper_fd);
|
fdm_del(fdm, delay_upper_fd);
|
||||||
fdm_del(fdm, application_synchronized_updates_fd);
|
fdm_del(fdm, app_sync_updates_fd);
|
||||||
|
|
||||||
free(term);
|
free(term);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -793,7 +793,7 @@ term_shutdown(struct terminal *term)
|
||||||
|
|
||||||
term_cursor_blink_disable(term);
|
term_cursor_blink_disable(term);
|
||||||
|
|
||||||
fdm_del(term->fdm, term->render.application_synchronized_updates.timer_fd);
|
fdm_del(term->fdm, term->render.app_sync_updates.timer_fd);
|
||||||
fdm_del(term->fdm, term->delayed_render_timer.lower_fd);
|
fdm_del(term->fdm, term->delayed_render_timer.lower_fd);
|
||||||
fdm_del(term->fdm, term->delayed_render_timer.upper_fd);
|
fdm_del(term->fdm, term->delayed_render_timer.upper_fd);
|
||||||
fdm_del(term->fdm, term->cursor_blink.fd);
|
fdm_del(term->fdm, term->cursor_blink.fd);
|
||||||
|
|
@ -801,7 +801,7 @@ term_shutdown(struct terminal *term)
|
||||||
fdm_del(term->fdm, term->flash.fd);
|
fdm_del(term->fdm, term->flash.fd);
|
||||||
fdm_del(term->fdm, term->ptmx);
|
fdm_del(term->fdm, term->ptmx);
|
||||||
|
|
||||||
term->render.application_synchronized_updates.timer_fd = -1;
|
term->render.app_sync_updates.timer_fd = -1;
|
||||||
term->delayed_render_timer.lower_fd = -1;
|
term->delayed_render_timer.lower_fd = -1;
|
||||||
term->delayed_render_timer.upper_fd = -1;
|
term->delayed_render_timer.upper_fd = -1;
|
||||||
term->cursor_blink.fd = -1;
|
term->cursor_blink.fd = -1;
|
||||||
|
|
@ -851,7 +851,7 @@ term_destroy(struct terminal *term)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fdm_del(term->fdm, term->render.application_synchronized_updates.timer_fd);
|
fdm_del(term->fdm, term->render.app_sync_updates.timer_fd);
|
||||||
fdm_del(term->fdm, term->delayed_render_timer.lower_fd);
|
fdm_del(term->fdm, term->delayed_render_timer.lower_fd);
|
||||||
fdm_del(term->fdm, term->delayed_render_timer.upper_fd);
|
fdm_del(term->fdm, term->delayed_render_timer.upper_fd);
|
||||||
fdm_del(term->fdm, term->cursor_blink.fd);
|
fdm_del(term->fdm, term->cursor_blink.fd);
|
||||||
|
|
@ -1807,12 +1807,12 @@ term_spawn_new(const struct terminal *term)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
term_enable_application_synchronized_updates(struct terminal *term)
|
term_enable_app_sync_updates(struct terminal *term)
|
||||||
{
|
{
|
||||||
term->render.application_synchronized_updates.enabled = true;
|
term->render.app_sync_updates.enabled = true;
|
||||||
|
|
||||||
if (timerfd_settime(
|
if (timerfd_settime(
|
||||||
term->render.application_synchronized_updates.timer_fd, 0,
|
term->render.app_sync_updates.timer_fd, 0,
|
||||||
&(struct itimerspec){.it_value = {.tv_sec = 1}}, NULL) < 0)
|
&(struct itimerspec){.it_value = {.tv_sec = 1}}, NULL) < 0)
|
||||||
{
|
{
|
||||||
LOG_ERR("failed to arm timer for application synchronized updates");
|
LOG_ERR("failed to arm timer for application synchronized updates");
|
||||||
|
|
@ -1828,15 +1828,15 @@ term_enable_application_synchronized_updates(struct terminal *term)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
term_disable_application_synchronized_updates(struct terminal *term)
|
term_disable_app_sync_updates(struct terminal *term)
|
||||||
{
|
{
|
||||||
if (!term->render.application_synchronized_updates.enabled)
|
if (!term->render.app_sync_updates.enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
term->render.application_synchronized_updates.enabled = false;
|
term->render.app_sync_updates.enabled = false;
|
||||||
|
|
||||||
/* Reset timers */
|
/* Reset timers */
|
||||||
timerfd_settime(
|
timerfd_settime(
|
||||||
term->render.application_synchronized_updates.timer_fd, 0,
|
term->render.app_sync_updates.timer_fd, 0,
|
||||||
&(struct itimerspec){{0}}, NULL);
|
&(struct itimerspec){{0}}, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,7 @@ struct terminal {
|
||||||
struct {
|
struct {
|
||||||
bool enabled;
|
bool enabled;
|
||||||
int timer_fd;
|
int timer_fd;
|
||||||
} application_synchronized_updates;
|
} app_sync_updates;
|
||||||
|
|
||||||
/* Render threads + synchronization primitives */
|
/* Render threads + synchronization primitives */
|
||||||
struct {
|
struct {
|
||||||
|
|
@ -411,5 +411,5 @@ void term_set_window_title(struct terminal *term, const char *title);
|
||||||
void term_flash(struct terminal *term, unsigned duration_ms);
|
void term_flash(struct terminal *term, unsigned duration_ms);
|
||||||
bool term_spawn_new(const struct terminal *term);
|
bool term_spawn_new(const struct terminal *term);
|
||||||
|
|
||||||
void term_enable_application_synchronized_updates(struct terminal *term);
|
void term_enable_app_sync_updates(struct terminal *term);
|
||||||
void term_disable_application_synchronized_updates(struct terminal *term);
|
void term_disable_app_sync_updates(struct terminal *term);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue