X11: Fix window creation hangs when another application is fullscreen (#1248)
* X11: Fix window creation hangs when another application is fullscreen Previously, the X11 backend would block until a `VisibilityNotify` event is received when creating a Window that is visible or when calling `set_visible(true)` on a Window that is not currently visible. This could cause winit to hang in situations where the WM does not quickly send this event to the application, such as another window being fullscreen at the time. This behavior existed to prevent an X protocol error caused by setting fullscreen state on an invisible window. This fix instead stores desired fullscreen state when `set_fullscreen` is called (iff the window is not visible or not yet visible) and issues X commands to set fullscreen state when a `VisibilityNotify` event is received through the normal processing of events in the event loop. * Add window_debug example to facilitate testing * Add a CHANGELOG entry * Call `XUnmapWindow` if `VisibilityNotify` is received on an invisible window
This commit is contained in:
parent
b6e8dd0d8a
commit
a70ac1531e
5 changed files with 202 additions and 56 deletions
|
|
@ -497,6 +497,13 @@ impl<T: 'static> EventProcessor<T> {
|
|||
});
|
||||
}
|
||||
|
||||
ffi::VisibilityNotify => {
|
||||
let xev: &ffi::XVisibilityEvent = xev.as_ref();
|
||||
let xwindow = xev.window;
|
||||
|
||||
self.with_window(xwindow, |window| window.visibility_notify());
|
||||
}
|
||||
|
||||
ffi::Expose => {
|
||||
let xev: &ffi::XExposeEvent = xev.as_ref();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue