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

@ -339,6 +339,11 @@ impl Tiling {
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Default)]
pub(crate) struct RequestFrameOptions {
pub(crate) require_presentation: bool,
}
pub(crate) trait PlatformWindow: HasWindowHandle + HasDisplayHandle {
fn bounds(&self) -> Bounds<Pixels>;
fn is_maximized(&self) -> bool;
@ -367,7 +372,7 @@ pub(crate) trait PlatformWindow: HasWindowHandle + HasDisplayHandle {
fn zoom(&self);
fn toggle_fullscreen(&self);
fn is_fullscreen(&self) -> bool;
fn on_request_frame(&self, callback: Box<dyn FnMut()>);
fn on_request_frame(&self, callback: Box<dyn FnMut(RequestFrameOptions)>);
fn on_input(&self, callback: Box<dyn FnMut(PlatformInput) -> DispatchEventResult>);
fn on_active_status_change(&self, callback: Box<dyn FnMut(bool)>);
fn on_hover_status_change(&self, callback: Box<dyn FnMut(bool)>);