aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd-queue.c6
-rw-r--r--notify.c27
-rw-r--r--server.c1
-rw-r--r--tmux.h3
4 files changed, 4 insertions, 33 deletions
diff --git a/cmd-queue.c b/cmd-queue.c
index bafff1d6..2012e871 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -248,10 +248,8 @@ cmdq_continue(struct cmd_q *cmdq)
enum cmd_retval retval;
int empty;
- cmdq->references++;
- notify_disable();
-
log_debug("continuing cmdq %p: flags %#x (%p)", cmdq, cmdq->flags, c);
+ cmdq->references++;
empty = TAILQ_EMPTY(&cmdq->queue);
if (empty)
@@ -296,9 +294,7 @@ empty:
empty = 1;
out:
- notify_enable();
cmdq_free(cmdq);
-
return (empty);
}
diff --git a/notify.c b/notify.c
index a1f69240..3ec41e99 100644
--- a/notify.c
+++ b/notify.c
@@ -45,25 +45,10 @@ struct notify_entry {
};
TAILQ_HEAD(notify_queue, notify_entry);
static struct notify_queue notify_queue = TAILQ_HEAD_INITIALIZER(notify_queue);
-static int notify_enabled = 1;
-static void notify_drain(void);
static void notify_add(enum notify_type, struct client *, struct session *,
struct window *);
-void
-notify_enable(void)
-{
- notify_enabled = 1;
- notify_drain();
-}
-
-void
-notify_disable(void)
-{
- notify_enabled = 0;
-}
-
static void
notify_add(enum notify_type type, struct client *c, struct session *s,
struct window *w)
@@ -85,14 +70,11 @@ notify_add(enum notify_type type, struct client *c, struct session *s,
w->references++;
}
-static void
+void
notify_drain(void)
{
struct notify_entry *ne, *ne1;
- if (!notify_enabled)
- return;
-
TAILQ_FOREACH_SAFE(ne, &notify_queue, entry, ne1) {
switch (ne->type) {
case NOTIFY_WINDOW_LAYOUT_CHANGED:
@@ -138,13 +120,6 @@ notify_input(struct window_pane *wp, struct evbuffer *input)
{
struct client *c;
- /*
- * notify_input() is not queued and only does anything when
- * notifications are enabled.
- */
- if (!notify_enabled)
- return;
-
TAILQ_FOREACH(c, &clients, entry) {
if (c->flags & CLIENT_CONTROL)
control_notify_input(c, wp, input);
diff --git a/server.c b/server.c
index bcb596b8..e6d1c09f 100644
--- a/server.c
+++ b/server.c
@@ -192,6 +192,7 @@ server_loop(void)
struct client *c;
server_client_loop();
+ notify_drain();
if (!options_get_number(global_options, "exit-unattached")) {
if (!RB_EMPTY(&sessions))
diff --git a/tmux.h b/tmux.h
index 3f29f07f..a57ac5b0 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1577,8 +1577,7 @@ void mode_key_init(struct mode_key_data *, struct mode_key_tree *);
enum mode_key_cmd mode_key_lookup(struct mode_key_data *, key_code);
/* notify.c */
-void notify_enable(void);
-void notify_disable(void);
+void notify_drain(void);
void notify_input(struct window_pane *, struct evbuffer *);
void notify_window_layout_changed(struct window *);
void notify_window_unlinked(struct session *, struct window *);