mirror of
https://github.com/tmux/tmux.git
synced 2026-05-31 06:36:18 +00:00
Cache obscure flag in screen_write_ctx.
This commit is contained in:
@@ -1989,6 +1989,14 @@ screen_write_pane_is_obscured(struct screen_write_ctx *ctx)
|
|||||||
|
|
||||||
if (ctx->wp == NULL)
|
if (ctx->wp == NULL)
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
|
if (ctx->flags & SCREEN_WRITE_CHECKED_IF_OBSCURED) {
|
||||||
|
if (ctx->flags & SCREEN_WRITE_OBSCURED)
|
||||||
|
return (1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
ctx->flags |= SCREEN_WRITE_CHECKED_IF_OBSCURED;
|
||||||
|
|
||||||
while ((wp = TAILQ_PREV(wp, window_panes, zentry)) != NULL) {
|
while ((wp = TAILQ_PREV(wp, window_panes, zentry)) != NULL) {
|
||||||
if ((wp->flags & PANE_FLOATING) &&
|
if ((wp->flags & PANE_FLOATING) &&
|
||||||
((wp->yoff >= ctx->wp->yoff &&
|
((wp->yoff >= ctx->wp->yoff &&
|
||||||
@@ -1998,8 +2006,10 @@ screen_write_pane_is_obscured(struct screen_write_ctx *ctx)
|
|||||||
((wp->xoff >= ctx->wp->xoff &&
|
((wp->xoff >= ctx->wp->xoff &&
|
||||||
wp->xoff <= ctx->wp->xoff + (int)ctx->wp->sx) ||
|
wp->xoff <= ctx->wp->xoff + (int)ctx->wp->sx) ||
|
||||||
(wp->xoff + (int)wp->sx >= ctx->wp->xoff &&
|
(wp->xoff + (int)wp->sx >= ctx->wp->xoff &&
|
||||||
wp->xoff + wp->sx <= ctx->wp->xoff + ctx->wp->sx)))
|
wp->xoff + wp->sx <= ctx->wp->xoff + ctx->wp->sx))) {
|
||||||
|
ctx->flags |= SCREEN_WRITE_OBSCURED;
|
||||||
return (1);
|
return (1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|||||||
2
tmux.h
2
tmux.h
@@ -1055,6 +1055,8 @@ struct screen_write_ctx {
|
|||||||
|
|
||||||
int flags;
|
int flags;
|
||||||
#define SCREEN_WRITE_SYNC 0x1
|
#define SCREEN_WRITE_SYNC 0x1
|
||||||
|
#define SCREEN_WRITE_OBSCURED 0x2
|
||||||
|
#define SCREEN_WRITE_CHECKED_IF_OBSCURED 0x4
|
||||||
|
|
||||||
screen_write_init_ctx_cb init_ctx_cb;
|
screen_write_init_ctx_cb init_ctx_cb;
|
||||||
void *arg;
|
void *arg;
|
||||||
|
|||||||
Reference in New Issue
Block a user