aboutsummaryrefslogtreecommitdiff
path: root/ui.h
diff options
context:
space:
mode:
authorRandy Palamar <randy@rnpnr.xyz>2025-01-08 20:13:53 -0700
committerRandy Palamar <randy@rnpnr.xyz>2025-01-08 20:23:51 -0700
commit72c26fc09af79ce217575a9b0f0d5058c336d5d7 (patch)
tree8979c4c5188174b71ef7ef57e93670dee0244cf4 /ui.h
parentd5db964a4cd5ed2bce5e8724b800f6cb425df258 (diff)
downloadvis-72c26fc09af79ce217575a9b0f0d5058c336d5d7.tar.gz
vis-72c26fc09af79ce217575a9b0f0d5058c336d5d7.tar.xz
ui: pass window id when setting style
There are a couple times when we want to set a style without an active window. In those cases we just want to use base UI_STYLE_*s and (Win *) is not needed. This fixes a crash when trying to do a vis:info() from lua during an initial file open event. Note that this code is due for a serious refactor, ui styles should be stored in Ui and window specific styles should be stored in Win. Then we won't need any of this difficult to follow indexing into the styles array based on window id and we will never have to realloc when a new window opens. Just another thing to add to my list.
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui.h b/ui.h
index 5680400..4558724 100644
--- a/ui.h
+++ b/ui.h
@@ -129,7 +129,7 @@ bool ui_getkey(Ui *, TermKeyKey *);
bool ui_style_define(Win *win, int id, const char *style);
bool ui_window_style_set_pos(Win *win, int x, int y, enum UiStyle id);
-void ui_window_style_set(Win *win, Cell *cell, enum UiStyle id);
+void ui_window_style_set(Ui *ui, int win_id, Cell *cell, enum UiStyle id);
void ui_window_options_set(Win *win, enum UiOption options);
void ui_window_status(Win *win, const char *status);