From 49b9839fdb41eff4d2aae3bb91e6a4befb9cd20b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 19 Nov 2022 14:50:34 -0700 Subject: [PATCH] fix IME composition status applying to all panes refs: https://github.com/wez/wezterm/issues/2569 --- docs/changelog.md | 3 +++ wezterm-gui/src/termwindow/render.rs | 15 +++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index b729fd2283d..85c830ba1b3 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -129,6 +129,9 @@ As features stabilize some brief notes about them will accumulate here. wezterm gui was already running. Thanks to [@exactly-one-kas](https://github.com/exactly-one-kas)! [#2661](https://github.com/wez/wezterm/pull/2661) +* IME composition text and cursor color incorrectly applied to all panes rather + than just the active pane. + [#2569](https://github.com/wez/wezterm/issues/2569) #### Changed * Removed Last Resort fallback font diff --git a/wezterm-gui/src/termwindow/render.rs b/wezterm-gui/src/termwindow/render.rs index 7001be6795e..c31677d5fca 100644 --- a/wezterm-gui/src/termwindow/render.rs +++ b/wezterm-gui/src/termwindow/render.rs @@ -1715,12 +1715,11 @@ impl super::TermWindow { cursor_border_color: self.cursor_border_color, cursor_is_default_color: self.cursor_is_default_color, }), - if let DeadKeyStatus::Composing(composing) = - &self.term_window.dead_key_status - { - Some(composing.to_string()) - } else { - None + match (self.pos.is_active, &self.term_window.dead_key_status) { + (true, DeadKeyStatus::Composing(composing)) => { + Some(composing.to_string()) + } + _ => None, }, if self.term_window.config.detect_password_input { match self.pos.pane.get_metadata() { @@ -1790,7 +1789,7 @@ impl super::TermWindow { let shape_key = LineToEleShapeCacheKey { shape_hash, shape_generation: quad_key.shape_generation, - composing: if self.cursor.y == stable_row { + composing: if self.cursor.y == stable_row && self.pos.is_active { if let DeadKeyStatus::Composing(composing) = &self.term_window.dead_key_status { @@ -3392,7 +3391,7 @@ impl super::TermWindow { let dead_key_or_leader = self.dead_key_status != DeadKeyStatus::None || self.leader_is_active(); - if dead_key_or_leader { + if dead_key_or_leader && params.is_active_pane { let (fg_color, bg_color) = if self.config.force_reverse_video_cursor && params.cursor_is_default_color { (params.bg_color, params.fg_color)