Merge branch 'master' into feature-floating-window-panes

This commit is contained in:
Michael Grant
2026-01-07 23:41:29 +01:00
committed by GitHub
22 changed files with 261 additions and 79 deletions

View File

@@ -1036,7 +1036,7 @@ window_pane_create(struct window *w, u_int sx, u_int sy, u_int hlimit)
wp = xcalloc(1, sizeof *wp);
wp->window = w;
wp->options = options_create(w->options);
wp->flags = (PANE_STYLECHANGED|PANE_THEMECHANGED);
wp->flags = PANE_STYLECHANGED;
wp->id = next_window_pane_id++;
RB_INSERT(window_pane_tree, &all_window_panes, wp);
@@ -2051,6 +2051,8 @@ window_pane_get_theme(struct window_pane *wp)
void
window_pane_send_theme_update(struct window_pane *wp)
{
enum client_theme theme;
if (wp == NULL || window_pane_exited(wp))
return;
if (~wp->flags & PANE_THEMECHANGED)
@@ -2058,16 +2060,23 @@ window_pane_send_theme_update(struct window_pane *wp)
if (~wp->screen->mode & MODE_THEME_UPDATES)
return;
switch (window_pane_get_theme(wp)) {
theme = window_pane_get_theme(wp);
if (theme == wp->last_theme)
return;
wp->last_theme = theme;
wp->flags &= ~PANE_THEMECHANGED;
switch (theme) {
case THEME_LIGHT:
input_key_pane(wp, KEYC_REPORT_LIGHT_THEME, NULL);
log_debug("%s: %%%u light theme", __func__, wp->id);
bufferevent_write(wp->event, "\033[?997;2n", 9);
break;
case THEME_DARK:
input_key_pane(wp, KEYC_REPORT_DARK_THEME, NULL);
log_debug("%s: %%%u dark theme", __func__, wp->id);
bufferevent_write(wp->event, "\033[?997;1n", 9);
break;
case THEME_UNKNOWN:
log_debug("%s: %%%u unknown theme", __func__, wp->id);
break;
}
wp->flags &= ~PANE_THEMECHANGED;
}