aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2026-07-28 19:16:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2026-07-30 12:18:58 +0000
commit8db88cceb758b5be23e7db1fe74a48102ab07dc0 (patch)
tree2741b009de1520e2203d4b6695073422c77df738 /terminal.h
parentchangelog: add missing bug reference (diff)
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 <amp@ampcode.com>
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h3
1 files changed, 3 insertions, 0 deletions
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(