Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

fix(settings): leave the Windows backdrop alone and mark opacity unstable

RoversXc2f722434054
diff --git a/thinkterm-i18n/i18n/de-DE.ftl b/thinkterm-i18n/i18n/de-DE.ftl
index f4f52f83..0e0e7da3 100644
--- a/thinkterm-i18n/i18n/de-DE.ftl
+++ b/thinkterm-i18n/i18n/de-DE.ftl
@@ -87,7 +87,7 @@ settings-window-opacity = Fensterdeckkraft
settings-window-opacity-description = Zum Einstellen ziehen, ganz rechts ist deckend. Seitenleisten und Tabs bleiben etwas deckender.
settings-window-opacity-default = Standard
settings-window-opacity-reset = Zurücksetzen
-settings-window-opacity-linux = Unter Linux noch nicht verfügbar.
+settings-window-opacity-platforms = Unter Linux noch nicht verfügbar, unter Windows noch nicht stabil.
settings-badge-beta = Beta
settings-app-icon-simple = Schlicht
settings-app-icon-classic = Klassisch
diff --git a/thinkterm-i18n/i18n/en-US.ftl b/thinkterm-i18n/i18n/en-US.ftl
index e92bdaa2..9f6608d4 100644
--- a/thinkterm-i18n/i18n/en-US.ftl
+++ b/thinkterm-i18n/i18n/en-US.ftl
@@ -87,7 +87,7 @@ settings-window-opacity = Window Opacity
settings-window-opacity-description = Drag to adjust; all the way right is opaque. The sidebars and tab bar stay a little more solid.
settings-window-opacity-default = Default
settings-window-opacity-reset = Reset to Default
-settings-window-opacity-linux = Not available on Linux yet.
+settings-window-opacity-platforms = Not available on Linux yet, and not yet stable on Windows.
settings-badge-beta = Beta
settings-app-icon-simple = Simple
settings-app-icon-classic = Classic
diff --git a/thinkterm-i18n/i18n/fr-FR.ftl b/thinkterm-i18n/i18n/fr-FR.ftl
index 7122363f..6b05c24b 100644
--- a/thinkterm-i18n/i18n/fr-FR.ftl
+++ b/thinkterm-i18n/i18n/fr-FR.ftl
@@ -87,7 +87,7 @@ settings-window-opacity = Opacité de la fenêtre
settings-window-opacity-description = Faites glisser ; tout à droite est opaque. Barres latérales et onglets restent un peu plus opaques.
settings-window-opacity-default = Par défaut
settings-window-opacity-reset = Rétablir
-settings-window-opacity-linux = Pas encore disponible sous Linux.
+settings-window-opacity-platforms = Pas encore disponible sous Linux, pas encore stable sous Windows.
settings-badge-beta = Bêta
settings-app-icon-simple = Simple
settings-app-icon-classic = Classique
diff --git a/thinkterm-i18n/i18n/ja-JP.ftl b/thinkterm-i18n/i18n/ja-JP.ftl
index 9d7bbcb0..e36eddba 100644
--- a/thinkterm-i18n/i18n/ja-JP.ftl
+++ b/thinkterm-i18n/i18n/ja-JP.ftl
@@ -84,7 +84,7 @@ settings-window-opacity = ウィンドウの不透明度
settings-window-opacity-description = ドラッグで調整、右端は不透明。サイドバーとタブバーは少し濃くなります。
settings-window-opacity-default = デフォルト
settings-window-opacity-reset = デフォルトに戻す
-settings-window-opacity-linux = Linux では未対応です。
+settings-window-opacity-platforms = Linux では未対応、Windows ではまだ安定していません。
settings-badge-beta = ベータ
settings-app-icon-simple = シンプル
settings-app-icon-classic = クラシック
diff --git a/thinkterm-i18n/i18n/zh-CN.ftl b/thinkterm-i18n/i18n/zh-CN.ftl
index 93c91fe7..6db64d30 100644
--- a/thinkterm-i18n/i18n/zh-CN.ftl
+++ b/thinkterm-i18n/i18n/zh-CN.ftl
@@ -84,7 +84,7 @@ settings-window-opacity = 窗口透明度
settings-window-opacity-description = 拖动调整,最右边是不透明;侧栏和标签条会更实一些。
settings-window-opacity-default = 默认
settings-window-opacity-reset = 恢复默认
-settings-window-opacity-linux = Linux 暂时不支持。
+settings-window-opacity-platforms = Linux 暂时不支持,Windows 上还不够稳定。
settings-badge-beta = Beta
settings-app-icon-simple = 简约
settings-app-icon-classic = 经典
diff --git a/wezterm-gui/src/native_settings.rs b/wezterm-gui/src/native_settings.rs
index 594fcb03..409e0778 100644
--- a/wezterm-gui/src/native_settings.rs
+++ b/wezterm-gui/src/native_settings.rs
@@ -396,34 +396,30 @@ const WINDOW_BLUR_RADIUS: i64 = 20;
/// what. `None` removes a key, so that the configuration decides again.
pub(crate) fn window_opacity_overrides(
settings: &ThinkTermNativeSettings,
-) -> [(&'static str, Option<wezterm_dynamic::Value>); 3] {
+) -> [(&'static str, Option<wezterm_dynamic::Value>); 2] {
use wezterm_dynamic::ToDynamic;
let changes = window_opacity_changes(settings.appearance.window_opacity);
- let [opacity, blur, backdrop] = WINDOW_OPACITY_KEYS;
+ let [opacity, blur] = WINDOW_OPACITY_KEYS;
[
(opacity, changes.opacity.map(|opacity| opacity.to_dynamic())),
(blur, changes.blur.map(|blur| blur.to_dynamic())),
- (
- backdrop,
- changes.backdrop.map(|backdrop| backdrop.to_dynamic()),
- ),
]
}
/// The configuration keys Settings' window opacity overrides in a window.
-pub(crate) const WINDOW_OPACITY_KEYS: [&str; 3] = [
- "window_background_opacity",
- "macos_window_background_blur",
- "win32_system_backdrop",
-];
+pub(crate) const WINDOW_OPACITY_KEYS: [&str; 2] =
+ ["window_background_opacity", "macos_window_background_blur"];
/// What a window opacity of `percent` changes in a window's configuration:
-/// the opacity, and while it is see-through the blur or backdrop the
+/// the opacity, and while it is see-through on macOS the blur the
/// configuration file does not ask for itself. `None` changes nothing.
+///
+/// Windows is given no backdrop: with this window frame any
+/// `win32_system_backdrop` turns a see-through window opaque (see
+/// wezterm#6265), so that stays the configuration's to choose.
struct WindowOpacityChanges {
opacity: Option<f64>,
blur: Option<i64>,
- backdrop: Option<config::SystemBackdrop>,
}
fn window_opacity_changes(percent: Option<u8>) -> WindowOpacityChanges {
@@ -438,18 +434,13 @@ fn window_opacity_changes(percent: Option<u8>) -> WindowOpacityChanges {
&& cfg!(target_os = "macos")
&& config.macos_window_background_blur == 0)
.then_some(WINDOW_BLUR_RADIUS),
- // Acrylic is the backdrop Windows 10 and 11 both have.
- backdrop: (see_through
- && cfg!(windows)
- && config.win32_system_backdrop == config::SystemBackdrop::Auto)
- .then_some(config::SystemBackdrop::Acrylic),
}
}
/// What `window_opacity_overrides` for a window opacity of `percent` leaves
-/// in a window's configuration -- its opacity, blur and backdrop -- without
-/// the reload applying them takes. What the slider previews while dragged.
-pub(crate) fn window_opacity_preview(percent: u8) -> (f32, i64, config::SystemBackdrop) {
+/// in a window's configuration -- its opacity and blur -- without the reload
+/// applying them takes. What the slider previews while dragged.
+pub(crate) fn window_opacity_preview(percent: u8) -> (f32, i64) {
let changes = window_opacity_changes(Some(percent));
let file = config::configuration();
(
@@ -457,7 +448,6 @@ pub(crate) fn window_opacity_preview(percent: u8) -> (f32, i64, config::SystemBa
.opacity
.map_or(file.window_background_opacity, |opacity| opacity as f32),
changes.blur.unwrap_or(file.macos_window_background_blur),
- changes.backdrop.unwrap_or(file.win32_system_backdrop),
)
}
@@ -2130,19 +2120,17 @@ mod tests {
fn window_opacity_overrides_the_opacity_and_asks_for_a_blur() {
use wezterm_dynamic::ToDynamic;
let mut settings = ThinkTermNativeSettings::default();
- let [opacity, blur, backdrop] = window_opacity_overrides(&settings);
+ let [opacity, blur] = window_opacity_overrides(&settings);
assert_eq!(opacity, ("window_background_opacity", None));
assert_eq!(blur, ("macos_window_background_blur", None));
- assert_eq!(backdrop, ("win32_system_backdrop", None));
settings.appearance.window_opacity = Some(80);
- let [opacity, blur, backdrop] = window_opacity_overrides(&settings);
+ let [opacity, blur] = window_opacity_overrides(&settings);
if window_opacity_supported() {
assert_eq!(opacity.1, Some(0.8f64.to_dynamic()));
} else {
assert_eq!(opacity.1, None);
}
assert_eq!(blur.1.is_some(), cfg!(target_os = "macos"));
- assert_eq!(backdrop.1.is_some(), cfg!(windows));
// Below the least is the least; opaque needs no blur.
settings.appearance.window_opacity = Some(5);
let [opacity, ..] = window_opacity_overrides(&settings);
@@ -2150,9 +2138,10 @@ mod tests {
assert_eq!(opacity.1, Some(0.3f64.to_dynamic()));
}
settings.appearance.window_opacity = Some(100);
- let [_, blur, backdrop] = window_opacity_overrides(&settings);
+ let [_, blur] = window_opacity_overrides(&settings);
assert_eq!(blur.1, None);
- assert_eq!(backdrop.1, None);
+ // The Windows backdrop is never Settings' to set.
+ assert!(!WINDOW_OPACITY_KEYS.contains(&"win32_system_backdrop"));
}
use config::UiColors;
diff --git a/wezterm-gui/src/settings_window.rs b/wezterm-gui/src/settings_window.rs
index bc07acaa..11f14602 100644
--- a/wezterm-gui/src/settings_window.rs
+++ b/wezterm-gui/src/settings_window.rs
@@ -15486,7 +15486,7 @@ impl SettingsWindow {
/// The window's opacity: a slider from `WINDOW_OPACITY_LEAST` to opaque
/// and its value -- "Default" while the configuration decides, the knob
- /// then showing what that decided -- with a note that Linux has none.
+ /// then showing what that decided -- with a note on where it works.
fn paint_window_opacity_row(
&mut self,
layers: &mut TripleLayerQuadAllocator<'_>,
@@ -15637,15 +15637,15 @@ impl SettingsWindow {
control_bottom = reset_y + step;
}
- // The one place the slider is not offered, said plainly, as the app
- // icon's row says where it works.
+ // Where the slider is not offered, and where it is not yet reliable,
+ // said plainly, as the app icon's row says where it works.
let note_y = self.settings_row_description_y(y) + step + description_extra;
self.draw_text(
layers,
&body_font,
x,
note_y,
- &crate::i18n::tr("settings-window-opacity-linux"),
+ &crate::i18n::tr("settings-window-opacity-platforms"),
palette.muted_text,
text_width,
)?;
diff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rs
index 9a7a0d0d..c0253b36 100644
--- a/wezterm-gui/src/termwindow/mod.rs
+++ b/wezterm-gui/src/termwindow/mod.rs
@@ -8409,19 +8409,16 @@ impl TermWindow {
pub(crate) fn preview_window_opacity(&mut self, percent: Option<u8>) {
let config = match percent {
Some(percent) => {
- let (opacity, blur, backdrop) =
- crate::native_settings::window_opacity_preview(percent);
+ let (opacity, blur) = crate::native_settings::window_opacity_preview(percent);
// A step that shows what is shown already copies nothing.
if self.config.window_background_opacity == opacity
&& self.config.macos_window_background_blur == blur
- && self.config.win32_system_backdrop == backdrop
{
return;
}
self.configured_config.adjusted(|config| {
config.window_background_opacity = opacity;
config.macos_window_background_blur = blur;
- config.win32_system_backdrop = backdrop;
})
}
None => self.configured_config.clone(),