summaryrefslogtreecommitdiffstats
path: root/notify.c
diff options
context:
space:
mode:
authornicm <nicm>2016-10-15 00:01:01 +0000
committernicm <nicm>2016-10-15 00:01:01 +0000
commit9b3ae84993d2493ff0761efbcda0b9d188ed6d9e (patch)
tree1bc73ae686ffab79340340746955900c843fc3a8 /notify.c
parented971268be7cfd5a4a8223211401654b30a57cbd (diff)
Drain notifys once at the end of the server loop instead of doing it
from the end of every command queue (which could be nested).
Diffstat (limited to 'notify.c')
-rw-r--r--notify.c27
1 files changed, 1 insertions, 26 deletions
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);