diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-10-20 14:01:15 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-10-20 14:01:15 +0100 |
commit | 1bf2f811ea8835dd24bdb773b5be4df517767d1f (patch) | |
tree | 0c9b68c65c797a0cb14fb9dbf8a34f4dfa299e2c /popup.c | |
parent | 65bb36d6bdec631cbab33ae6896e1dad29a8fffe (diff) | |
parent | acba07629ebf2dc2f0c316f110493e720b30757c (diff) | |
download | rtmux-1bf2f811ea8835dd24bdb773b5be4df517767d1f.tar.gz rtmux-1bf2f811ea8835dd24bdb773b5be4df517767d1f.tar.bz2 rtmux-1bf2f811ea8835dd24bdb773b5be4df517767d1f.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'popup.c')
-rw-r--r-- | popup.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -31,6 +31,7 @@ struct popup_data { struct cmdq_item *item; int flags; enum box_lines lines; + char *title; struct screen s; struct colour_palette palette; @@ -228,7 +229,8 @@ popup_draw_cb(struct client *c, void *data, struct screen_redraw_ctx *rctx) screen_write_cursormove(&ctx, 0, 0, 0); screen_write_fast_copy(&ctx, &pd->s, 0, 0, pd->sx, pd->sy); } else if (pd->sx > 2 && pd->sy > 2) { - screen_write_box(&ctx, pd->sx, pd->sy, pd->lines, &bgc); + screen_write_box(&ctx, pd->sx, pd->sy, pd->lines, &bgc, + pd->title); screen_write_cursormove(&ctx, 1, 1, 0); screen_write_fast_copy(&ctx, &pd->s, 0, 0, pd->sx - 2, pd->sy - 2); @@ -286,6 +288,7 @@ popup_free_cb(struct client *c, void *data) screen_free(&pd->s); colour_palette_free(&pd->palette); + free(pd->title); free(pd); } @@ -631,8 +634,8 @@ popup_job_complete_cb(struct job *job) 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, struct client *c, struct session *s, - popup_close_cb cb, void *arg) + int argc, char **argv, const char *cwd, const char *title, struct client *c, + struct session *s, popup_close_cb cb, void *arg) { struct popup_data *pd; u_int jx, jy; @@ -663,6 +666,7 @@ popup_display(int flags, enum box_lines lines, struct cmdq_item *item, u_int px, pd->item = item; pd->flags = flags; pd->lines = lines; + pd->title = xstrdup(title); pd->c = c; pd->c->references++; @@ -775,7 +779,7 @@ popup_editor(struct client *c, const char *buf, size_t len, xasprintf(&cmd, "%s %s", editor, path); if (popup_display(POPUP_INTERNAL|POPUP_CLOSEEXIT, BOX_LINES_DEFAULT, - NULL, px, py, sx, sy, NULL, cmd, 0, NULL, _PATH_TMP, c, NULL, + NULL, px, py, sx, sy, NULL, cmd, 0, NULL, _PATH_TMP, NULL, c, NULL, popup_editor_close_cb, pe) != 0) { popup_editor_free(pe); free(cmd); |