aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-12 11:55:19 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-12 11:55:19 +0000
commit1623fc0c0a9b7b86ae633776d84f2b56b158976a (patch)
tree8e6bb16c11e38cd8a75f32fe04ec07ef63715c8b
parentterm: enable_application_synchronized_updates: not a noop if already enabled (diff)
term: shorten application_synchronized_updates -> app_sync_updates
-rw-r--r--dcs.c4
-rw-r--r--render.c4
-rw-r--r--terminal.c38
-rw-r--r--terminal.h6
4 files changed, 26 insertions, 26 deletions
diff --git a/dcs.c b/dcs.c
index 1b33c41e..ee7e7646 100644
--- a/dcs.c
+++ b/dcs.c
@@ -13,7 +13,7 @@ bsu(struct terminal *term)
LOG_WARN("untested: BSU - Begin Synchronized Update (params: %.*s)",
(int)term->vt.dcs.idx, term->vt.dcs.data);
- term_enable_application_synchronized_updates(term);
+ term_enable_app_sync_updates(term);
abort();
}
@@ -25,7 +25,7 @@ esu(struct terminal *term)
LOG_WARN("untested: ESU - Begin Synchronized Update (params: %.*s)",
(int)term->vt.dcs.idx, term->vt.dcs.data);
- term_disable_application_synchronized_updates(term);
+ term_disable_app_sync_updates(term);
abort();
}
diff --git a/render.c b/render.c
index ae623940..f1ba330d 100644
--- a/render.c
+++ b/render.c
@@ -1016,7 +1016,7 @@ render_resize(struct terminal *term, int width, int height)
return;
/* Cancel an application initiated "Synchronized Update" */
- term_disable_application_synchronized_updates(term);
+ term_disable_app_sync_updates(term);
term->width = width;
term->height = height;
@@ -1193,7 +1193,7 @@ fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
if (!term->render.refresh_needed)
continue;
- if (term->render.application_synchronized_updates.enabled)
+ if (term->render.app_sync_updates.enabled)
continue;
assert(term->window->is_configured);
diff --git a/terminal.c b/terminal.c
index 5b79151e..ffc2dbbf 100644
--- a/terminal.c
+++ b/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.
*/
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;
else {
@@ -418,7 +418,7 @@ fdm_delayed_render(struct fdm *fdm, int fd, int events, void *data)
}
static bool
-fdm_application_synchronized_updates_timeout(
+fdm_app_sync_updates_timeout(
struct fdm *fdm, int fd, int events, void *data)
{
if (events & EPOLLHUP)
@@ -426,7 +426,7 @@ fdm_application_synchronized_updates_timeout(
struct terminal *term = data;
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));
if (ret < 0) {
@@ -436,7 +436,7 @@ fdm_application_synchronized_updates_timeout(
return false;
}
- term_disable_application_synchronized_updates(term);
+ term_disable_app_sync_updates(term);
return true;
}
@@ -534,7 +534,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
int cursor_blink_fd = -1;
int delay_lower_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));
@@ -561,7 +561,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
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");
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, delay_lower_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;
}
@@ -656,7 +656,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
.wl = wayl,
.render = {
.scrollback_lines = conf->scrollback_lines,
- .application_synchronized_updates.timer_fd = application_synchronized_updates_fd,
+ .app_sync_updates.timer_fd = app_sync_updates_fd,
.workers = {
.count = conf->render_worker_count,
.queue = tll_init(),
@@ -732,7 +732,7 @@ close_fds:
fdm_del(fdm, cursor_blink_fd);
fdm_del(fdm, delay_lower_fd);
fdm_del(fdm, delay_upper_fd);
- fdm_del(fdm, application_synchronized_updates_fd);
+ fdm_del(fdm, app_sync_updates_fd);
free(term);
return NULL;
@@ -793,7 +793,7 @@ term_shutdown(struct terminal *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.upper_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->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.upper_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.upper_fd);
fdm_del(term->fdm, term->cursor_blink.fd);
@@ -1807,12 +1807,12 @@ term_spawn_new(const struct terminal *term)
}
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(
- 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)
{
LOG_ERR("failed to arm timer for application synchronized updates");
@@ -1828,15 +1828,15 @@ term_enable_application_synchronized_updates(struct terminal *term)
}
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;
- term->render.application_synchronized_updates.enabled = false;
+ term->render.app_sync_updates.enabled = false;
/* Reset timers */
timerfd_settime(
- term->render.application_synchronized_updates.timer_fd, 0,
+ term->render.app_sync_updates.timer_fd, 0,
&(struct itimerspec){{0}}, NULL);
}
diff --git a/terminal.h b/terminal.h
index f30352ae..8c56648e 100644
--- a/terminal.h
+++ b/terminal.h
@@ -295,7 +295,7 @@ struct terminal {
struct {
bool enabled;
int timer_fd;
- } application_synchronized_updates;
+ } app_sync_updates;
/* Render threads + synchronization primitives */
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);
bool term_spawn_new(const struct terminal *term);
-void term_enable_application_synchronized_updates(struct terminal *term);
-void term_disable_application_synchronized_updates(struct terminal *term);
+void term_enable_app_sync_updates(struct terminal *term);
+void term_disable_app_sync_updates(struct terminal *term);