From ad12985d086e76bc48b39ea5656669ecddc45418 Mon Sep 17 00:00:00 2001 From: Billy Messenger Date: Tue, 20 Oct 2020 15:52:09 -0500 Subject: [PATCH] put WindowHandle back into platform-specific code --- src/lib.rs | 10 ---------- src/x11/window.rs | 13 ++++++++++++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d45e20a..2b9b126 100755 --- a/src/lib.rs +++ b/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; pub trait WindowHandler { diff --git a/src/x11/window.rs b/src/x11/window.rs index 8549255..f7df37a 100755 --- a/src/x11/window.rs +++ b/src/x11/window.rs @@ -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 } +// 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(options: WindowOpenOptions) -> Result<(WindowHandle, WindowInfo), ()> { let (tx, rx) = mpsc::sync_channel::(1);