mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 06:05:58 +01:00
xcursor: don't store NULL xcursors
This commit is contained in:
parent
e16b0068a7
commit
c6b498528c
1 changed files with 6 additions and 6 deletions
|
@ -100,19 +100,19 @@ static void load_default_theme(struct wlr_xcursor_theme *theme) {
|
||||||
free(theme->name);
|
free(theme->name);
|
||||||
theme->name = strdup("default");
|
theme->name = strdup("default");
|
||||||
|
|
||||||
theme->cursor_count = sizeof(cursor_metadata) / sizeof(cursor_metadata[0]);
|
size_t cursor_count = sizeof(cursor_metadata) / sizeof(cursor_metadata[0]);
|
||||||
theme->cursors = malloc(theme->cursor_count * sizeof(*theme->cursors));
|
theme->cursor_count = 0;
|
||||||
|
theme->cursors = malloc(cursor_count * sizeof(*theme->cursors));
|
||||||
if (theme->cursors == NULL) {
|
if (theme->cursors == NULL) {
|
||||||
theme->cursor_count = 0;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t i = 0; i < theme->cursor_count; ++i) {
|
for (uint32_t i = 0; i < cursor_count; ++i) {
|
||||||
theme->cursors[i] =
|
theme->cursors[i] = xcursor_create_from_data(&cursor_metadata[i], theme);
|
||||||
xcursor_create_from_data(&cursor_metadata[i], theme);
|
|
||||||
if (theme->cursors[i] == NULL) {
|
if (theme->cursors[i] == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
++theme->cursor_count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue