aboutsummaryrefslogtreecommitdiff
path: root/src/raw_input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/raw_input.rs')
-rw-r--r--src/raw_input.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/raw_input.rs b/src/raw_input.rs
index fc6ff52e..147d6e39 100644
--- a/src/raw_input.rs
+++ b/src/raw_input.rs
@@ -543,6 +543,13 @@ pub(crate) fn events_require_host_surface_redraw(
.any(|event| matches!(event, RawInputEvent::OuterFocusGained))
}
+#[cfg(any(unix, test))]
+pub(crate) fn events_require_host_mode_refresh(events: &[RawInputEvent]) -> bool {
+ events
+ .iter()
+ .any(|event| matches!(event, RawInputEvent::OuterFocusGained))
+}
+
#[cfg(any(not(windows), test))]
pub(crate) fn events_require_host_terminal_appearance_query(events: &[RawInputEvent]) -> bool {
events
@@ -1356,6 +1363,16 @@ mod tests {
}
#[test]
+ fn outer_focus_gained_requests_host_mode_refresh() {
+ assert!(events_require_host_mode_refresh(
+ &parse_raw_input_bytes_sync(b"\x1b[I")
+ ));
+ assert!(!events_require_host_mode_refresh(
+ &parse_raw_input_bytes_sync(b"\x1b[O")
+ ));
+ }
+
+ #[test]
fn outer_focus_gained_requests_host_appearance_query() {
let gained = parse_raw_input_bytes_sync(b"\x1b[I");
let lost = parse_raw_input_bytes_sync(b"\x1b[O");