mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-02-24 00:37:43 +11:00
x11: Windows are Sync again (#474)
* x11: Windows are Sync again Fixes #472 * Add test ensuring that Window is Sync Window must be Sync for Vulkano's Arc<FramebufferAbstract> to be usable.
This commit is contained in:
parent
eae7cb247c
commit
42f0671531
2 changed files with 15 additions and 3 deletions
|
@ -1004,7 +1004,7 @@ pub struct Window {
|
||||||
pub window: Arc<Window2>,
|
pub window: Arc<Window2>,
|
||||||
display: Weak<XConnection>,
|
display: Weak<XConnection>,
|
||||||
windows: Weak<Mutex<HashMap<WindowId, WindowData>>>,
|
windows: Weak<Mutex<HashMap<WindowId, WindowData>>>,
|
||||||
ime_sender: ImeSender,
|
ime_sender: Mutex<ImeSender>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::std::ops::Deref for Window {
|
impl ::std::ops::Deref for Window {
|
||||||
|
@ -1038,7 +1038,7 @@ impl Window {
|
||||||
window: win,
|
window: win,
|
||||||
windows: Arc::downgrade(&x_events_loop.windows),
|
windows: Arc::downgrade(&x_events_loop.windows),
|
||||||
display: Arc::downgrade(&x_events_loop.display),
|
display: Arc::downgrade(&x_events_loop.display),
|
||||||
ime_sender: x_events_loop.ime_sender.clone(),
|
ime_sender: Mutex::new(x_events_loop.ime_sender.clone()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1049,7 +1049,10 @@ impl Window {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn send_xim_spot(&self, x: i16, y: i16) {
|
pub fn send_xim_spot(&self, x: i16, y: i16) {
|
||||||
let _ = self.ime_sender.send((self.window.id().0, x, y));
|
let _ = self.ime_sender
|
||||||
|
.lock()
|
||||||
|
.unwrap()
|
||||||
|
.send((self.window.id().0, x, y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
9
tests/sync_object.rs
Normal file
9
tests/sync_object.rs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
extern crate winit;
|
||||||
|
|
||||||
|
fn needs_sync<T:Sync>() {}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn window_sync() {
|
||||||
|
// ensures that `winit::Window` implements `Sync`
|
||||||
|
needs_sync::<winit::Window>();
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue