add: ActiveEventLoop::create_proxy()

Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
daxpedda 2024-06-29 17:19:09 +02:00 committed by GitHub
parent 2e93e48a3b
commit a0d69c782a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 78 additions and 71 deletions

View file

@ -247,7 +247,7 @@ impl EventLoop {
/// Creates an [`EventLoopProxy`] that can be used to dispatch user events
/// to the main event loop, possibly from another thread.
pub fn create_proxy(&self) -> EventLoopProxy {
EventLoopProxy { event_loop_proxy: self.event_loop.create_proxy() }
EventLoopProxy { event_loop_proxy: self.event_loop.window_target().p.create_proxy() }
}
/// Gets a persistent reference to the underlying platform display.
@ -345,6 +345,12 @@ impl AsRawFd for EventLoop {
}
impl ActiveEventLoop {
/// Creates an [`EventLoopProxy`] that can be used to dispatch user events
/// to the main event loop, possibly from another thread.
pub fn create_proxy(&self) -> EventLoopProxy {
EventLoopProxy { event_loop_proxy: self.p.create_proxy() }
}
/// Create the window.
///
/// Possible causes of error include denied permission, incompatible system, and lack of memory.