diff --git a/config/src/config.rs b/config/src/config.rs index 91a59aa50..b1ac5574b 100644 --- a/config/src/config.rs +++ b/config/src/config.rs @@ -651,7 +651,7 @@ pub struct Config { pub quote_dropped_files: DroppedFileQuoting, #[dynamic(default = "default_focus_change_repaint_delay")] - pub focus_change_repaint_delay: u64, + pub x11_focus_change_repaint_delay_ms: u64, } impl_lua_conversion_dynamic!(Config); diff --git a/docs/changelog.md b/docs/changelog.md index 0bdb8fce2..75cd2ff6c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -84,6 +84,7 @@ As features stabilize some brief notes about them will accumulate here. * Added [freetype_pcf_long_family_names](config/lua/config/freetype_pcf_long_family_names.md) option to workaround PCF font naming issues on certain Linux distributions. [#2100](https://github.com/wez/wezterm/issues/2100) * X11/Wayland: wezterm.desktop now specifies `StartupWMClass`. Thanks to [@uncomfyhalomacro](https://github.com/uncomfyhalomacro)! [#2052](https://github.com/wez/wezterm/issues/2052) [#2125](https://github.com/wez/wezterm/pull/2125) * `sudo -i` in a pane would cause subsequent pane/tab creation to fail until the cwd was changed to an accessible directory [#2120](https://github.com/wez/wezterm/issues/2120) +* X11: Add [x11_focus_change_repaint_delay_ms](config/lua/config/x11_focus_change_repaint_delay_ms.md) option to workaround NVIDIA specific window resize quirks. Thanks to [@pjones123](https://github.com/pjones123)! [#2111](https://github.com/wez/wezterm/pull/2111) ### 20220408-101518-b908e2dd diff --git a/docs/config/lua/config/focus_change_repaint_delay.md b/docs/config/lua/config/focus_change_repaint_delay.md deleted file mode 100644 index 3bb554662..000000000 --- a/docs/config/lua/config/focus_change_repaint_delay.md +++ /dev/null @@ -1,8 +0,0 @@ -## `focus_change_repaint_delay = 100` - -*Since: nightly builds only* - -When not set to `0`, WezTerm will wait the specified delay (in milliseconds) before invalidating the geometry and repainting the window after losing or gaining focus. - -Using the proprietry NVIDIA drivers and EGL rendering on X11, the `CONFIGURE_NOTIFY` event is sometimes missed. This workaround ensures that the window correctly resizes in these cases. - diff --git a/docs/config/lua/config/x11_focus_change_repaint_delay_ms.md b/docs/config/lua/config/x11_focus_change_repaint_delay_ms.md new file mode 100644 index 000000000..28d3ba7df --- /dev/null +++ b/docs/config/lua/config/x11_focus_change_repaint_delay_ms.md @@ -0,0 +1,13 @@ +## `x11_focus_change_repaint_delay_ms = 100` + +*Since: nightly builds only* + +When set to a non-zero value, WezTerm will wait the specified delay (in +milliseconds) after losing or gaining focus. It will then invalidate the +geometry and focus state and repaint the window. + +The purpose of this option is to workaround a quirk when using proprietry +NVIDIA drivers together with EGL under X11: the quirk causes `CONFIGURE_NOTIFY` +to sometimes be suppressed, and `FOCUS_IN` and `FOCUS_OUT` events to sometimes +contain erroneous focus state. + diff --git a/window/src/os/x11/window.rs b/window/src/os/x11/window.rs index aeb779a32..d3d5a7afb 100644 --- a/window/src/os/x11/window.rs +++ b/window/src/os/x11/window.rs @@ -557,7 +557,7 @@ impl XWindowInner { // the window a short time after the focus event is processed in the // hope that it can observe the changed window properties and update // without the human needing to interact with the window. - let delay = self.config.focus_change_repaint_delay; + let delay = self.config.x11_focus_change_repaint_delay_ms; if delay != 0 { let window_id = self.window_id; promise::spawn::spawn(async move {