Fix window drawing when switching X11 workspaces by presenting when expose events occur (#20535)

Closes #18184

Release Notes:

- Fix window drawing when switching X11 workspaces, particularly for tiling window managers such as i3wm and XMonad.
This commit is contained in:
Michael Sloan 2024-11-12 01:20:25 -07:00 committed by GitHub
parent ad3171d16d
commit aad3ed7f91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 40 additions and 32 deletions

View file

@ -681,7 +681,7 @@ impl Window {
let needs_present = needs_present.clone();
let next_frame_callbacks = next_frame_callbacks.clone();
let last_input_timestamp = last_input_timestamp.clone();
move || {
move |request_frame_options| {
let next_frame_callbacks = next_frame_callbacks.take();
if !next_frame_callbacks.is_empty() {
handle
@ -695,7 +695,8 @@ impl Window {
// Keep presenting the current scene for 1 extra second since the
// last input to prevent the display from underclocking the refresh rate.
let needs_present = needs_present.get()
let needs_present = request_frame_options.require_presentation
|| needs_present.get()
|| (active.get()
&& last_input_timestamp.get().elapsed() < Duration::from_secs(1));