Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize GlWindow #106

Merged
merged 2 commits into from
Feb 10, 2019
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
16 changes: 16 additions & 0 deletions azul/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,22 @@ fn render_single_window_content<T: Layout>(
frame_was_resize = true;
}

#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
{
if frame_event_info.is_resize_event {
// Resize gl window
let gl_window = window.display.gl_window();
let size = gl_window.get_inner_size().unwrap().to_physical(gl_window.get_hidpi_factor());
gl_window.resize(size);
}
}

// Update the window state that we got from the frame event (updates window dimensions and DPI)
// Sets frame_event_info.needs redraw if the event was a
window.update_from_external_window_state(&frame_event_info);
Expand Down