put WindowHandle back into platform-specific code
This commit is contained in:
parent
a91a5a1126
commit
ad12985d08
10
src/lib.rs
10
src/lib.rs
|
@ -35,16 +35,6 @@ pub enum Parent {
|
|||
|
||||
unsafe impl Send for Parent {}
|
||||
|
||||
pub struct WindowHandle {
|
||||
thread: std::thread::JoinHandle<()>,
|
||||
}
|
||||
|
||||
impl WindowHandle {
|
||||
pub fn app_run_blocking(self) {
|
||||
let _ = self.thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
type WindowOpenResult = Result<WindowInfo, ()>;
|
||||
|
||||
pub trait WindowHandler {
|
||||
|
|
|
@ -12,7 +12,7 @@ use raw_window_handle::{
|
|||
use super::XcbConnection;
|
||||
use crate::{
|
||||
Event, KeyboardEvent, MouseButton, MouseCursor, MouseEvent, Parent, ScrollDelta, WindowEvent,
|
||||
WindowHandle, WindowHandler, WindowInfo, WindowOpenOptions, WindowOpenResult,
|
||||
WindowHandler, WindowInfo, WindowOpenOptions, WindowOpenResult,
|
||||
WindowScalePolicy, PhyPoint, PhySize,
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,17 @@ pub struct Window {
|
|||
new_physical_size: Option<PhySize>
|
||||
}
|
||||
|
||||
// FIXME: move to outer crate context
|
||||
pub struct WindowHandle {
|
||||
thread: std::thread::JoinHandle<()>,
|
||||
}
|
||||
|
||||
impl WindowHandle {
|
||||
pub fn app_run_blocking(self) {
|
||||
let _ = self.thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
impl Window {
|
||||
pub fn open<H: WindowHandler>(options: WindowOpenOptions) -> Result<(WindowHandle, WindowInfo), ()> {
|
||||
let (tx, rx) = mpsc::sync_channel::<WindowOpenResult>(1);
|
||||
|
|
Loading…
Reference in a new issue