From 671f456761fc66649260e831ceee36ec3d4ba9ca Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 05:34:56 +0200 Subject: Merging upstream version 3.4. Signed-off-by: Daniel Baumann --- popup.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'popup.c') diff --git a/popup.c b/popup.c index 2e57153..4742733 100644 --- a/popup.c +++ b/popup.c @@ -252,6 +252,7 @@ popup_draw_cb(struct client *c, void *data, struct screen_redraw_ctx *rctx) tty_draw_line(tty, &s, 0, i, pd->sx, px, py + i, &defaults, palette); } + screen_free(&s); if (pd->md != NULL) { c->overlay_check = NULL; c->overlay_data = NULL; @@ -573,8 +574,8 @@ menu: x = m->x - (pd->menu->width + 4) / 2; else x = 0; - pd->md = menu_prepare(pd->menu, 0, NULL, x, m->y, c, NULL, - popup_menu_done, pd); + pd->md = menu_prepare(pd->menu, 0, 0, NULL, x, m->y, c, + BOX_LINES_DEFAULT, NULL, NULL, NULL, NULL, popup_menu_done, pd); c->flags |= CLIENT_REDRAWOVERLAY; out: @@ -635,7 +636,7 @@ int popup_display(int flags, enum box_lines lines, struct cmdq_item *item, u_int px, u_int py, u_int sx, u_int sy, struct environ *env, const char *shellcmd, int argc, char **argv, const char *cwd, const char *title, struct client *c, - struct session *s, const char* style, const char* border_style, + struct session *s, const char *style, const char *border_style, popup_close_cb cb, void *arg) { struct popup_data *pd; @@ -786,6 +787,8 @@ popup_editor(struct client *c, const char *buf, size_t len, if (fd == -1) return (-1); f = fdopen(fd, "w"); + if (f == NULL) + return (-1); if (fwrite(buf, len, 1, f) != 1) { fclose(f); return (-1); -- cgit v1.2.3