summaryrefslogtreecommitdiffstats
path: root/window-clock.c
diff options
context:
space:
mode:
authornicm <nicm>2019-03-12 11:16:49 +0000
committernicm <nicm>2019-03-12 11:16:49 +0000
commit3f6bfbaf2babcc7f08f628a82ff31b0b52014e58 (patch)
treece4bf0c954cdfede0c2e86905bd85a9f565ed370 /window-clock.c
parentff4c80d53df96bb46eaa64107673e42d402f0d49 (diff)
Allow multiple modes to be open in a pane. A stack of open modes is kept
and the previous restored when the top is exited. If a mode that is already on the stack is entered, the existing instance is moved to the top as the active mode rather than being opened new.
Diffstat (limited to 'window-clock.c')
-rw-r--r--window-clock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/window-clock.c b/window-clock.c
index c7074c0d..f98d7923 100644
--- a/window-clock.c
+++ b/window-clock.c
@@ -136,6 +136,9 @@ window_clock_timer_callback(__unused int fd, __unused short events, void *arg)
evtimer_del(&data->timer);
evtimer_add(&data->timer, &tv);
+ if (TAILQ_FIRST(&wp->modes) != wme)
+ return;
+
t = time(NULL);
gmtime_r(&t, &now);
gmtime_r(&data->tim, &then);
@@ -144,7 +147,7 @@ window_clock_timer_callback(__unused int fd, __unused short events, void *arg)
data->tim = t;
window_clock_draw_screen(wme);
- server_redraw_window(wp->window);
+ wp->flags |= PANE_REDRAW;
}
static struct screen *