mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-04 07:15:29 -04:00
commit
70f1274171
6 changed files with 32 additions and 33 deletions
|
|
@ -25,6 +25,8 @@
|
||||||
than specified in the binding. This allows you to, for example,
|
than specified in the binding. This allows you to, for example,
|
||||||
quickly press the middle-button to paste multiple times
|
quickly press the middle-button to paste multiple times
|
||||||
(https://codeberg.org/dnkl/foot/issues/146).
|
(https://codeberg.org/dnkl/foot/issues/146).
|
||||||
|
* Color flashes when changing the color palette with OSC 4,10,11
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/141).
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
14
osc.c
14
osc.c
|
|
@ -589,7 +589,6 @@ osc_dispatch(struct terminal *term)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render_refresh(term);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -635,8 +634,7 @@ osc_dispatch(struct terminal *term)
|
||||||
}
|
}
|
||||||
|
|
||||||
term_damage_view(term);
|
term_damage_view(term);
|
||||||
render_refresh(term);
|
term_damage_margins(term);
|
||||||
render_refresh_margins(term);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -664,7 +662,8 @@ osc_dispatch(struct terminal *term)
|
||||||
term->cursor_color.cursor = 0; /* Invert fg/bg */
|
term->cursor_color.cursor = 0; /* Invert fg/bg */
|
||||||
else
|
else
|
||||||
term->cursor_color.cursor = 1u << 31 | color;
|
term->cursor_color.cursor = 1u << 31 | color;
|
||||||
render_refresh(term);
|
|
||||||
|
term_damage_cursor(term);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 30: /* Set tab title */
|
case 30: /* Set tab title */
|
||||||
|
|
@ -705,7 +704,6 @@ osc_dispatch(struct terminal *term)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render_refresh(term);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -716,22 +714,20 @@ osc_dispatch(struct terminal *term)
|
||||||
LOG_DBG("resetting foreground");
|
LOG_DBG("resetting foreground");
|
||||||
term->colors.fg = term->colors.default_fg;
|
term->colors.fg = term->colors.default_fg;
|
||||||
term_damage_view(term);
|
term_damage_view(term);
|
||||||
render_refresh(term);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 111: /* Reset default text background color */
|
case 111: /* Reset default text background color */
|
||||||
LOG_DBG("resetting background");
|
LOG_DBG("resetting background");
|
||||||
term->colors.bg = term->colors.default_bg;
|
term->colors.bg = term->colors.default_bg;
|
||||||
term_damage_view(term);
|
term_damage_view(term);
|
||||||
render_refresh(term);
|
term_damage_margins(term);
|
||||||
render_refresh_margins(term);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 112:
|
case 112:
|
||||||
LOG_DBG("resetting cursor color");
|
LOG_DBG("resetting cursor color");
|
||||||
term->cursor_color.text = term->default_cursor_color.text;
|
term->cursor_color.text = term->default_cursor_color.text;
|
||||||
term->cursor_color.cursor = term->default_cursor_color.cursor;
|
term->cursor_color.cursor = term->default_cursor_color.cursor;
|
||||||
render_refresh(term);
|
term_damage_cursor(term);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 555:
|
case 555:
|
||||||
|
|
|
||||||
28
render.c
28
render.c
|
|
@ -1568,7 +1568,7 @@ static const struct wl_callback_listener frame_listener = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
grid_render(struct terminal *term, bool redraw_margins)
|
grid_render(struct terminal *term)
|
||||||
{
|
{
|
||||||
if (term->is_shutting_down)
|
if (term->is_shutting_down)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1588,7 +1588,7 @@ grid_render(struct terminal *term, bool redraw_margins)
|
||||||
if (term->render.last_buf != buf ||
|
if (term->render.last_buf != buf ||
|
||||||
term->flash.active || term->render.was_flashing ||
|
term->flash.active || term->render.was_flashing ||
|
||||||
term->is_searching != term->render.was_searching ||
|
term->is_searching != term->render.was_searching ||
|
||||||
redraw_margins)
|
term->render.margins)
|
||||||
{
|
{
|
||||||
if (term->render.last_buf != NULL &&
|
if (term->render.last_buf != NULL &&
|
||||||
term->render.last_buf->width == buf->width &&
|
term->render.last_buf->width == buf->width &&
|
||||||
|
|
@ -1596,7 +1596,7 @@ grid_render(struct terminal *term, bool redraw_margins)
|
||||||
!term->flash.active &&
|
!term->flash.active &&
|
||||||
!term->render.was_flashing &&
|
!term->render.was_flashing &&
|
||||||
term->is_searching == term->render.was_searching &&
|
term->is_searching == term->render.was_searching &&
|
||||||
!redraw_margins)
|
!term->render.margins)
|
||||||
{
|
{
|
||||||
static bool has_warned = false;
|
static bool has_warned = false;
|
||||||
if (!has_warned) {
|
if (!has_warned) {
|
||||||
|
|
@ -1972,13 +1972,11 @@ frame_callback(void *data, struct wl_callback *wl_callback, uint32_t callback_da
|
||||||
term->window->frame_callback = NULL;
|
term->window->frame_callback = NULL;
|
||||||
|
|
||||||
bool grid = term->render.pending.grid;
|
bool grid = term->render.pending.grid;
|
||||||
bool margins = term->render.pending.margins;
|
|
||||||
bool csd = term->render.pending.csd;
|
bool csd = term->render.pending.csd;
|
||||||
bool search = term->render.pending.search;
|
bool search = term->render.pending.search;
|
||||||
bool title = term->render.pending.title;
|
bool title = term->render.pending.title;
|
||||||
|
|
||||||
term->render.pending.grid = false;
|
term->render.pending.grid = false;
|
||||||
term->render.pending.margins = false;
|
|
||||||
term->render.pending.csd = false;
|
term->render.pending.csd = false;
|
||||||
term->render.pending.search = false;
|
term->render.pending.search = false;
|
||||||
term->render.pending.title = false;
|
term->render.pending.title = false;
|
||||||
|
|
@ -1995,11 +1993,8 @@ frame_callback(void *data, struct wl_callback *wl_callback, uint32_t callback_da
|
||||||
if (search && term->is_searching)
|
if (search && term->is_searching)
|
||||||
render_search_box(term);
|
render_search_box(term);
|
||||||
|
|
||||||
if ((grid || margins) &&
|
if (grid && (!term->delayed_render_timer.is_armed || csd || search))
|
||||||
(!term->delayed_render_timer.is_armed || csd || search))
|
grid_render(term);
|
||||||
{
|
|
||||||
grid_render(term, margins);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move to terminal.c? */
|
/* Move to terminal.c? */
|
||||||
|
|
@ -2336,13 +2331,11 @@ fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
|
||||||
assert(term->window->is_configured);
|
assert(term->window->is_configured);
|
||||||
|
|
||||||
bool grid = term->render.refresh.grid;
|
bool grid = term->render.refresh.grid;
|
||||||
bool margins = term->render.refresh.margins;
|
|
||||||
bool csd = term->render.refresh.csd;
|
bool csd = term->render.refresh.csd;
|
||||||
bool search = term->render.refresh.search;
|
bool search = term->render.refresh.search;
|
||||||
bool title = term->render.refresh.title;
|
bool title = term->render.refresh.title;
|
||||||
|
|
||||||
term->render.refresh.grid = false;
|
term->render.refresh.grid = false;
|
||||||
term->render.refresh.margins = false;
|
|
||||||
term->render.refresh.csd = false;
|
term->render.refresh.csd = false;
|
||||||
term->render.refresh.search = false;
|
term->render.refresh.search = false;
|
||||||
term->render.refresh.title = false;
|
term->render.refresh.title = false;
|
||||||
|
|
@ -2357,12 +2350,11 @@ fdm_hook_refresh_pending_terminals(struct fdm *fdm, void *data)
|
||||||
render_update_title(term);
|
render_update_title(term);
|
||||||
if (search)
|
if (search)
|
||||||
render_search_box(term);
|
render_search_box(term);
|
||||||
if (grid || margins)
|
if (grid)
|
||||||
grid_render(term, margins);
|
grid_render(term);
|
||||||
} else {
|
} else {
|
||||||
/* Tells the frame callback to render again */
|
/* Tells the frame callback to render again */
|
||||||
term->render.pending.grid |= grid;
|
term->render.pending.grid |= grid;
|
||||||
term->render.pending.margins |= margins;
|
|
||||||
term->render.pending.csd |= csd;
|
term->render.pending.csd |= csd;
|
||||||
term->render.pending.search |= search;
|
term->render.pending.search |= search;
|
||||||
term->render.pending.title |= title;
|
term->render.pending.title |= title;
|
||||||
|
|
@ -2393,12 +2385,6 @@ render_refresh(struct terminal *term)
|
||||||
term->render.refresh.grid = true;
|
term->render.refresh.grid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
render_refresh_margins(struct terminal *term)
|
|
||||||
{
|
|
||||||
term->render.refresh.margins = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
render_refresh_csd(struct terminal *term)
|
render_refresh_csd(struct terminal *term)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
1
render.h
1
render.h
|
|
@ -13,7 +13,6 @@ bool render_resize(struct terminal *term, int width, int height);
|
||||||
bool render_resize_force(struct terminal *term, int width, int height);
|
bool render_resize_force(struct terminal *term, int width, int height);
|
||||||
|
|
||||||
void render_refresh(struct terminal *term);
|
void render_refresh(struct terminal *term);
|
||||||
void render_refresh_margins(struct terminal *term);
|
|
||||||
void render_refresh_csd(struct terminal *term);
|
void render_refresh_csd(struct terminal *term);
|
||||||
void render_refresh_search(struct terminal *term);
|
void render_refresh_search(struct terminal *term);
|
||||||
void render_refresh_title(struct terminal *term);
|
void render_refresh_title(struct terminal *term);
|
||||||
|
|
|
||||||
13
terminal.c
13
terminal.c
|
|
@ -1626,6 +1626,19 @@ term_damage_view(struct terminal *term)
|
||||||
term_damage_rows_in_view(term, 0, term->rows - 1);
|
term_damage_rows_in_view(term, 0, term->rows - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
term_damage_cursor(struct terminal *term)
|
||||||
|
{
|
||||||
|
term->grid->cur_row->cells[term->grid->cursor.point.col].attrs.clean = 0;
|
||||||
|
term->grid->cur_row->dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
term_damage_margins(struct terminal *term)
|
||||||
|
{
|
||||||
|
term->render.margins = true;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
term_damage_scroll(struct terminal *term, enum damage_type damage_type,
|
term_damage_scroll(struct terminal *term, enum damage_type damage_type,
|
||||||
struct scroll_region region, int lines)
|
struct scroll_region region, int lines)
|
||||||
|
|
|
||||||
|
|
@ -373,7 +373,6 @@ struct terminal {
|
||||||
/* Scheduled for rendering, as soon-as-possible */
|
/* Scheduled for rendering, as soon-as-possible */
|
||||||
struct {
|
struct {
|
||||||
bool grid;
|
bool grid;
|
||||||
bool margins;
|
|
||||||
bool csd;
|
bool csd;
|
||||||
bool search;
|
bool search;
|
||||||
bool title;
|
bool title;
|
||||||
|
|
@ -382,12 +381,13 @@ struct terminal {
|
||||||
/* Scheduled for rendering, in the next frame callback */
|
/* Scheduled for rendering, in the next frame callback */
|
||||||
struct {
|
struct {
|
||||||
bool grid;
|
bool grid;
|
||||||
bool margins;
|
|
||||||
bool csd;
|
bool csd;
|
||||||
bool search;
|
bool search;
|
||||||
bool title;
|
bool title;
|
||||||
} pending;
|
} pending;
|
||||||
|
|
||||||
|
bool margins; /* Someone explicitly requested a refresh of the margins */
|
||||||
|
|
||||||
int scrollback_lines; /* Number of scrollback lines, from conf (TODO: move out from render struct?) */
|
int scrollback_lines; /* Number of scrollback lines, from conf (TODO: move out from render struct?) */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
@ -512,6 +512,9 @@ void term_damage_rows_in_view(struct terminal *term, int start, int end);
|
||||||
void term_damage_all(struct terminal *term);
|
void term_damage_all(struct terminal *term);
|
||||||
void term_damage_view(struct terminal *term);
|
void term_damage_view(struct terminal *term);
|
||||||
|
|
||||||
|
void term_damage_cursor(struct terminal *term);
|
||||||
|
void term_damage_margins(struct terminal *term);
|
||||||
|
|
||||||
void term_reset_view(struct terminal *term);
|
void term_reset_view(struct terminal *term);
|
||||||
|
|
||||||
void term_damage_scroll(
|
void term_damage_scroll(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue