mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-08 10:06:22 -05:00
term: cursor_refresh(): don't try to dirty the grid if we don't have one
If the compositor sends a keyboard enter event before our window has been mapped, foot crashes; the enter event triggers a cursor refresh (hollow -> non-hollow block cursor), which crashes since we haven't yet allocated a grid. Fix by no-op:ing the refresh if the window hasn't been configured yet. Closes #1910
This commit is contained in:
parent
39061e0422
commit
c5529808c4
2 changed files with 7 additions and 0 deletions
|
|
@ -74,6 +74,10 @@
|
|||
* 'flash' overlay (triggered by either `tput flash`, or enabling
|
||||
`bell.visual` and then sending `BEL` to the terminal) stuck when
|
||||
`colors.flash-alpha=1.0`.
|
||||
* Crash when compositor sends a keyboard enter event before the foot
|
||||
window has been mapped ([#1910][1910]).
|
||||
|
||||
[1910]: https://codeberg.org/dnkl/foot/issues/1910
|
||||
|
||||
|
||||
### Security
|
||||
|
|
|
|||
|
|
@ -515,6 +515,9 @@ term_arm_blink_timer(struct terminal *term)
|
|||
static void
|
||||
cursor_refresh(struct terminal *term)
|
||||
{
|
||||
if (!term->window->is_configured)
|
||||
return;
|
||||
|
||||
term->grid->cur_row->cells[term->grid->cursor.point.col].attrs.clean = 0;
|
||||
term->grid->cur_row->dirty = true;
|
||||
render_refresh(term);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue