On Wayland, reduce amount of spurious wakeups

Mark it as breaking, since some clients relied on that behavior, simply
because dispatching clients queue always woke up a winit, meaning that
they won't be able to use user events for this sake.
This commit is contained in:
Kirill Chibisov 2023-08-06 01:09:59 +04:00 committed by GitHub
parent 3c3a863cc9
commit cad3277550
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 155 additions and 95 deletions

View file

@ -287,10 +287,14 @@ impl Window {
#[inline]
pub fn request_redraw(&self) {
self.window_requests
if self
.window_requests
.redraw_requested
.store(true, Ordering::Relaxed);
self.event_loop_awakener.ping();
.compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
.is_ok()
{
self.event_loop_awakener.ping();
}
}
#[inline]