Skip to content

Commit

Permalink
Merge branch 'obsd-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAdam committed Oct 18, 2016
2 parents b3ab39c + 2e5c49a commit 8576eca
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
18 changes: 15 additions & 3 deletions cmd-queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ cmdq_remove(struct cmdq_item *item)
cmd_list_free(item->cmdlist);

TAILQ_REMOVE(item->queue, item, entry);

free((void *)item->name);
free(item);
}

Expand Down Expand Up @@ -147,10 +149,15 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
struct cmdq_item *item, *first = NULL, *last = NULL;
struct cmd *cmd;
u_int group = cmdq_next_group();
char *tmp;

TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
xasprintf(&tmp, "command[%s]", cmd->entry->name);

item = xcalloc(1, sizeof *item);
item->name = tmp;
item->type = CMDQ_COMMAND;

item->group = group;
item->flags = flags;

Expand Down Expand Up @@ -220,12 +227,17 @@ cmdq_fire_command(struct cmdq_item *item)

/* Get a callback for the command queue. */
struct cmdq_item *
cmdq_get_callback(cmdq_cb cb, void *data)
cmdq_get_callback1(const char *name, cmdq_cb cb, void *data)
{
struct cmdq_item *item;
char *tmp;

xasprintf(&tmp, "callback[%s]", name);

item = xcalloc(1, sizeof *item);
item->name = tmp;
item->type = CMDQ_CALLBACK;

item->group = 0;
item->flags = 0;

Expand Down Expand Up @@ -289,8 +301,8 @@ cmdq_next(struct client *c)
item = TAILQ_FIRST(queue);
if (item == NULL)
break;
log_debug("%s %s: type %d, flags %x", __func__, name,
item->type, item->flags);
log_debug("%s %s: %s (%d), flags %x", __func__, name,
item->name, item->type, item->flags);

/*
* Any item with the waiting flag set waits until an external
Expand Down
1 change: 1 addition & 0 deletions screen-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ screen_write_flush(struct screen_write_ctx *ctx)
if (dirty == ctx->dirty)
break;
}
ctx->dirty = 0;

s->cx = cx;
s->cy = cy;
Expand Down
4 changes: 3 additions & 1 deletion tmux.h
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,7 @@ enum cmdq_type {
/* Command queue item. */
typedef enum cmd_retval (*cmdq_cb) (struct cmdq_item *, void *);
struct cmdq_item {
const char *name;
struct cmdq_list *queue;
struct cmdq_item *next;

Expand Down Expand Up @@ -1781,7 +1782,8 @@ char *cmd_list_print(struct cmd_list *);
/* cmd-queue.c */
struct cmdq_item *cmdq_get_command(struct cmd_list *, struct cmd_find_state *,
struct mouse_event *, int);
struct cmdq_item *cmdq_get_callback(cmdq_cb, void *);
#define cmdq_get_callback(cb, data) cmdq_get_callback1(#cb, cb, data)
struct cmdq_item *cmdq_get_callback1(const char *, cmdq_cb, void *);
void cmdq_insert_after(struct cmdq_item *, struct cmdq_item *);
void cmdq_append(struct client *, struct cmdq_item *);
void printflike(3, 4) cmdq_format(struct cmdq_item *, const char *,
Expand Down

0 comments on commit 8576eca

Please sign in to comment.