mirror of
https://github.com/tmux/tmux.git
synced 2026-01-11 16:30:22 +00:00
Add separate z-index list. Each window has its own z-order list of panes now.
This commit is contained in:
10
window.c
10
window.c
@@ -306,6 +306,7 @@ window_create(u_int sx, u_int sy, u_int xpixel, u_int ypixel)
|
||||
w->flags = 0;
|
||||
|
||||
TAILQ_INIT(&w->panes);
|
||||
TAILQ_INIT(&w->z_index);
|
||||
TAILQ_INIT(&w->last_panes);
|
||||
w->active = NULL;
|
||||
|
||||
@@ -586,8 +587,8 @@ window_redraw_active_switch(struct window *w, struct window_pane *wp)
|
||||
if (wp == w->active)
|
||||
break;
|
||||
if (wp->layout_cell == NULL) {
|
||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||
TAILQ_INSERT_TAIL(&w->panes, wp, entry);
|
||||
TAILQ_REMOVE(&w->z_index, wp, zentry);
|
||||
TAILQ_INSERT_HEAD(&w->z_index, wp, zentry);
|
||||
wp->flags |= PANE_REDRAW;
|
||||
}
|
||||
wp = w->active;
|
||||
@@ -600,7 +601,7 @@ window_get_active_at(struct window *w, u_int x, u_int y)
|
||||
struct window_pane *wp;
|
||||
u_int xoff, yoff, sx, sy;
|
||||
|
||||
TAILQ_FOREACH_REVERSE(wp, &w->panes, window_panes, entry) {
|
||||
TAILQ_FOREACH(wp, &w->z_index, zentry) {
|
||||
if (!window_pane_visible(wp))
|
||||
continue;
|
||||
window_pane_full_size_offset(wp, &xoff, &yoff, &sx, &sy);
|
||||
@@ -765,6 +766,7 @@ window_add_pane(struct window *w, struct window_pane *other, u_int hlimit,
|
||||
else
|
||||
TAILQ_INSERT_AFTER(&w->panes, other, wp, entry);
|
||||
}
|
||||
TAILQ_INSERT_HEAD(&w->z_index, wp, zentry);
|
||||
return (wp);
|
||||
}
|
||||
|
||||
@@ -799,6 +801,7 @@ window_remove_pane(struct window *w, struct window_pane *wp)
|
||||
window_lost_pane(w, wp);
|
||||
|
||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||
TAILQ_REMOVE(&w->z_index, wp, zentry);
|
||||
window_pane_destroy(wp);
|
||||
}
|
||||
|
||||
@@ -882,6 +885,7 @@ window_destroy_panes(struct window *w)
|
||||
while (!TAILQ_EMPTY(&w->panes)) {
|
||||
wp = TAILQ_FIRST(&w->panes);
|
||||
TAILQ_REMOVE(&w->panes, wp, entry);
|
||||
TAILQ_REMOVE(&w->z_index, wp, zentry);
|
||||
window_pane_destroy(wp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user