Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/win/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ pub(super) struct WindowState {
window_class: Cell<Option<RegisteredClass>>,
current_size: Cell<PhySize>,
current_scale_factor: Cell<f64>,
_parent_handle: Option<ParentHandle>,
_parent_handle: ParentHandle,
keyboard_state: RefCell<KeyboardState>,
mouse_button_counter: Cell<usize>,
mouse_was_outside_window: RefCell<bool>,
Expand Down Expand Up @@ -632,20 +632,24 @@ impl Window<'_> {
B: FnOnce(&mut crate::Window) -> H,
B: Send + 'static,
{
let (_, hwnd) = Self::open(false, null_mut(), options, build);
let (window_handle, _) = Self::open(false, null_mut(), options, build);

unsafe {
let mut msg: MSG = std::mem::zeroed();

loop {
let status = GetMessageW(&mut msg, hwnd, 0, 0);
let status = GetMessageW(&mut msg, null_mut(), 0, 0);
Comment thread
prokopyl marked this conversation as resolved.

if status == -1 {
break;
}

TranslateMessage(&msg);
DispatchMessageW(&msg);

if !window_handle.is_open() {
break;
}
}
}
}
Expand Down Expand Up @@ -725,7 +729,6 @@ impl Window<'_> {
});

let (parent_handle, window_handle) = ParentHandle::new(hwnd);
let parent_handle = if parented { Some(parent_handle) } else { None };

let window_state = Rc::new(WindowState {
hwnd,
Expand Down
Loading