Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Fix wrong size drawing on maximize
Browse files Browse the repository at this point in the history
On maximize (as opposed to drag resize), the new size is drawn inside
the WM_SIZE handler. The application's draw logic needs to have the
correct size, which means calling its size method before the render.

Cleanup for issue reported in #19
  • Loading branch information
raphlinus committed Apr 21, 2018
1 parent bd698bb commit f722bb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xi-win-shell/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ impl WndProc for MyWndProc {
WM_SIZE => unsafe {
let width = LOWORD(lparam as u32) as u32;
let height = HIWORD(lparam as u32) as u32;
self.handler.size(width, height);
let use_hwnd = if let Some(ref dcomp_state) =
self.state.borrow().as_ref().unwrap().dcomp_state
{
Expand Down Expand Up @@ -405,7 +406,6 @@ impl WndProc for MyWndProc {
println!("ResizeBuffers failed: 0x{:x}", res);
}
}
self.handler.size(width, height);
Some(0)
},
WM_COMMAND => {
Expand Down

0 comments on commit f722bb7

Please sign in to comment.