summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-10-21 22:22:04 +0000
committernicm <nicm@openbsd.org>2014-10-21 22:22:04 +0000
commita00af3f56619eaa2daed58a3dff55b49251ba2fd (patch)
tree94c03bbf98fafa941c57fcad66fb409a564e442f
parentSave next item after firing command in case it has added to the queue. (diff)
downloadwireguard-openbsd-a00af3f56619eaa2daed58a3dff55b49251ba2fd.tar.xz
wireguard-openbsd-a00af3f56619eaa2daed58a3dff55b49251ba2fd.zip
Only redraw pane when it has actually changed.
-rw-r--r--usr.bin/tmux/cmd-select-pane.c5
-rw-r--r--usr.bin/tmux/tmux.h4
-rw-r--r--usr.bin/tmux/window.c9
3 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c
index ab796a8dbff..f699941d322 100644
--- a/usr.bin/tmux/cmd-select-pane.c
+++ b/usr.bin/tmux/cmd-select-pane.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-select-pane.c,v 1.19 2014/10/20 22:29:25 nicm Exp $ */
+/* $OpenBSD: cmd-select-pane.c,v 1.20 2014/10/21 22:22:04 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -99,8 +99,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmd_q *cmdq)
wp->flags &= ~PANE_INPUTOFF;
else if (args_has(self->args, 'd'))
wp->flags |= PANE_INPUTOFF;
- else {
- window_set_active_pane(wl->window, wp);
+ else if (window_set_active_pane(wl->window, wp)) {
server_status_window(wl->window);
server_redraw_window_borders(wl->window);
}
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 26902a85610..092fdf84fed 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.476 2014/10/20 23:57:14 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.477 2014/10/21 22:22:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -2116,7 +2116,7 @@ void window_destroy(struct window *);
struct window_pane *window_get_active_at(struct window *, u_int, u_int);
void window_set_active_at(struct window *, u_int, u_int);
struct window_pane *window_find_string(struct window *, const char *);
-void window_set_active_pane(struct window *, struct window_pane *);
+int window_set_active_pane(struct window *, struct window_pane *);
struct window_pane *window_add_pane(struct window *, u_int);
void window_resize(struct window *, u_int, u_int);
int window_zoom(struct window_pane *);
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index bf018bddb9b..86771dd128d 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.113 2014/08/11 22:14:30 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.114 2014/10/21 22:22:04 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -386,11 +386,11 @@ window_resize(struct window *w, u_int sx, u_int sy)
w->sy = sy;
}
-void
+int
window_set_active_pane(struct window *w, struct window_pane *wp)
{
if (wp == w->active)
- return;
+ return (0);
w->last = w->active;
w->active = wp;
while (!window_pane_visible(w->active)) {
@@ -398,9 +398,10 @@ window_set_active_pane(struct window *w, struct window_pane *wp)
if (w->active == NULL)
w->active = TAILQ_LAST(&w->panes, window_panes);
if (w->active == wp)
- return;
+ return (1);
}
w->active->active_point = next_active_point++;
+ return (1);
}
struct window_pane *