mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
render: xcursor_is_valid(): don't crash when there's no theme loaded
When trying to set a custom cursor shape, we first validate it. This is done by checking against known server-side names, and then trying to load the cursor from the client side cursor theme. But, if we're using server side names, there is no theme loaded, and foot crashed. Fix by checking if we have a theme loaded, and if not, fail the cursor shape name validation.
This commit is contained in:
parent
297cb370aa
commit
e2aeb7f336
2 changed files with 4 additions and 0 deletions
|
|
@ -98,6 +98,8 @@
|
|||
* "Too large" values for `scrollback.lines` causing an integer
|
||||
overflow, resulting in either visual glitches, crashes, or both
|
||||
([#1828][1828]).
|
||||
* Crash when trying to set an invalid cursor shape with OSC-22, when
|
||||
foot uses server-side cursor shapes.
|
||||
|
||||
[1828]: https://codeberg.org/dnkl/foot/issues/1828
|
||||
|
||||
|
|
|
|||
2
render.c
2
render.c
|
|
@ -4722,6 +4722,8 @@ render_xcursor_is_valid(const struct seat *seat, const char *cursor)
|
|||
{
|
||||
if (cursor == NULL)
|
||||
return false;
|
||||
if (seat->pointer.theme == NULL)
|
||||
return false;
|
||||
return wl_cursor_theme_get_cursor(seat->pointer.theme, cursor) != NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue