mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Remove XFlush
call in event loop (#982)
Internally, `XFlush` calls `_XSend` to write data. It then calls `XEventsQueued(display, QueuedAfterReading)`, which reads data from the X server connection. This prevents the event loop source callback from being run, as there is no longer data waiting on the socket. Ideally, we would want to call `_XSend` directly to ensure that no output is buffered by Xlib. However, this function is not exported as part of Xlib's public API. Testing with the `XFlush` call removed does not appear to adversely affect the performance of an application. If any bugs should eventually arise from this change, perhaps another function may be used in place of `XFlush`, such as `XPending`, which writes buffered output but does not so aggressively read from the X server connection. Closes #865
This commit is contained in:
parent
3555de114a
commit
29e2481597
|
@ -291,11 +291,6 @@ impl<T: 'static> EventLoop<T> {
|
|||
);
|
||||
}
|
||||
|
||||
// flush the X11 connection
|
||||
unsafe {
|
||||
(wt.xconn.xlib.XFlush)(wt.xconn.display);
|
||||
}
|
||||
|
||||
match control_flow {
|
||||
ControlFlow::Exit => break,
|
||||
ControlFlow::Poll => {
|
||||
|
|
Loading…
Reference in a new issue