From 8db88cceb758b5be23e7db1fe74a48102ab07dc0 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Tue, 28 Jul 2026 14:16:05 -0500 Subject: terminal: add visibility reports Applications cannot infer whether their terminal view is observable from keyboard focus alone, so they may continue expensive rendering while the surface is hidden. Implement private mode 2033 and the one-shot visibility query. Report Wayland xdg_toplevel suspension as not visible and otherwise remain conservative by treating the terminal as potentially visible. Amp-Thread-ID: https://ampcode.com/threads/T-019fb2b7-f245-7124-a69a-1484812532bb Co-authored-by: Amp --- terminal.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 7e95697e..3e2c6904 100644 --- a/terminal.h +++ b/terminal.h @@ -439,6 +439,7 @@ struct terminal { bool reverse_wrap; bool bracketed_paste; bool focus_events; + bool visibility_reports; bool alt_scrolling; bool modify_other_keys_2; /* True when modifyOtherKeys=2 (i.e. "CSI >4;2m") */ enum cursor_origin origin; @@ -523,6 +524,7 @@ struct terminal { bool cursor_blink:1; bool bracketed_paste:1; bool focus_events:1; + bool visibility_reports:1; bool alt_scrolling:1; //bool mouse_x10:1; bool mouse_click:1; @@ -927,6 +929,7 @@ void term_restore_cursor(struct terminal *term, const struct cursor *cursor); void term_visual_focus_in(struct terminal *term); void term_visual_focus_out(struct terminal *term); +void term_send_visibility_report(struct terminal *term); void term_kbd_focus_in(struct terminal *term); void term_kbd_focus_out(struct terminal *term); void term_mouse_down( -- cgit v1.3