mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04:00
Merge branch 'master' into scroll-damage-performance
This commit is contained in:
commit
6bc9fd4ba1
2 changed files with 18 additions and 13 deletions
5
render.c
5
render.c
|
|
@ -1606,7 +1606,10 @@ frame_callback(void *data, struct wl_callback *wl_callback, uint32_t callback_da
|
||||||
|
|
||||||
if (term->render.pending.grid) {
|
if (term->render.pending.grid) {
|
||||||
term->render.pending.grid = false;
|
term->render.pending.grid = false;
|
||||||
grid_render(term);
|
|
||||||
|
/* TODO: need to check if this breaks GNOME/weston */
|
||||||
|
if (!term->delayed_render_timer.is_armed)
|
||||||
|
grid_render(term);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
26
terminal.c
26
terminal.c
|
|
@ -32,6 +32,8 @@
|
||||||
#define min(x, y) ((x) < (y) ? (x) : (y))
|
#define min(x, y) ((x) < (y) ? (x) : (y))
|
||||||
#define max(x, y) ((x) > (y) ? (x) : (y))
|
#define max(x, y) ((x) > (y) ? (x) : (y))
|
||||||
|
|
||||||
|
#define PTMX_TIMING 0
|
||||||
|
|
||||||
static const char *const XCURSOR_LEFT_PTR = "left_ptr";
|
static const char *const XCURSOR_LEFT_PTR = "left_ptr";
|
||||||
static const char *const XCURSOR_TEXT = "text";
|
static const char *const XCURSOR_TEXT = "text";
|
||||||
static const char *const XCURSOR_HAND2 = "hand2";
|
static const char *const XCURSOR_HAND2 = "hand2";
|
||||||
|
|
@ -125,8 +127,6 @@ fdm_ptmx_out(struct fdm *fdm, int fd, int events, void *data)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PTMX_TIMING 0
|
|
||||||
|
|
||||||
#if PTMX_TIMING
|
#if PTMX_TIMING
|
||||||
static struct timespec last = {0};
|
static struct timespec last = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -197,9 +197,10 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
|
||||||
* compositor anyway. The delay we introduce here only
|
* compositor anyway. The delay we introduce here only
|
||||||
* has any effect when the renderer is idle.
|
* has any effect when the renderer is idle.
|
||||||
*/
|
*/
|
||||||
if (term->window->frame_callback == NULL) {
|
uint64_t lower_ns = term->conf->tweak.delayed_render_lower_ns;
|
||||||
/* First timeout - reset each time we receive input. */
|
uint64_t upper_ns = term->conf->tweak.delayed_render_upper_ns;
|
||||||
|
|
||||||
|
if (lower_ns > 0 && upper_ns > 0) {
|
||||||
#if PTMX_TIMING
|
#if PTMX_TIMING
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
|
|
||||||
|
|
@ -215,8 +216,6 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
|
||||||
last = now;
|
last = now;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint64_t lower_ns = term->conf->tweak.delayed_render_lower_ns;
|
|
||||||
uint64_t upper_ns = term->conf->tweak.delayed_render_upper_ns;
|
|
||||||
assert(lower_ns < 1000000000);
|
assert(lower_ns < 1000000000);
|
||||||
assert(upper_ns < 1000000000);
|
assert(upper_ns < 1000000000);
|
||||||
assert(upper_ns > lower_ns);
|
assert(upper_ns > lower_ns);
|
||||||
|
|
@ -236,7 +235,7 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data)
|
||||||
term->delayed_render_timer.is_armed = true;
|
term->delayed_render_timer.is_armed = true;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
term->render.pending.grid = true;
|
render_refresh(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hup) {
|
if (hup) {
|
||||||
|
|
@ -396,8 +395,6 @@ fdm_delayed_render(struct fdm *fdm, int fd, int events, void *data)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
struct terminal *term = data;
|
struct terminal *term = data;
|
||||||
if (!term->delayed_render_timer.is_armed)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
uint64_t unused;
|
uint64_t unused;
|
||||||
ssize_t ret1 = 0;
|
ssize_t ret1 = 0;
|
||||||
|
|
@ -412,6 +409,9 @@ fdm_delayed_render(struct fdm *fdm, int fd, int events, void *data)
|
||||||
if (errno == EAGAIN)
|
if (errno == EAGAIN)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (!term->delayed_render_timer.is_armed)
|
||||||
|
return true;
|
||||||
|
|
||||||
LOG_ERRNO("failed to read timeout timer");
|
LOG_ERRNO("failed to read timeout timer");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -425,13 +425,15 @@ fdm_delayed_render(struct fdm *fdm, int fd, int events, void *data)
|
||||||
last = (struct timespec){0};
|
last = (struct timespec){0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
render_refresh(term);
|
|
||||||
|
|
||||||
/* Reset timers */
|
/* Reset timers */
|
||||||
struct itimerspec reset = {{0}};
|
struct itimerspec reset = {{0}};
|
||||||
timerfd_settime(term->delayed_render_timer.lower_fd, 0, &reset, NULL);
|
timerfd_settime(term->delayed_render_timer.lower_fd, 0, &reset, NULL);
|
||||||
timerfd_settime(term->delayed_render_timer.upper_fd, 0, &reset, NULL);
|
timerfd_settime(term->delayed_render_timer.upper_fd, 0, &reset, NULL);
|
||||||
term->delayed_render_timer.is_armed = false;
|
|
||||||
|
if (term->delayed_render_timer.is_armed) {
|
||||||
|
term->delayed_render_timer.is_armed = false;
|
||||||
|
render_refresh(term);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue