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

fix(wayland): fix the inaccurately applied inner_size when creating a new window. #984

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Prev Previous commit
Next Next commit
Update the window size event
  • Loading branch information
Zamoca42 committed Oct 1, 2024
commit 94ac49f609e83b4fbfd87bf7b890a9b6fdfd442e
8 changes: 7 additions & 1 deletion src/platform_impl/linux/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,13 @@ impl<T: 'static> EventLoop<T> {
log::warn!("Failed to send window moved event to event channel: {}", e);
}

let (w, h) = event.size();
let (w, h) = if let Some(child) = window.child() {
let allocation = child.allocation();
(allocation.width() as u32, allocation.height() as u32)
} else {
event.size()
};

if let Err(e) = tx_clone.send(Event::WindowEvent {
window_id: RootWindowId(id),
event: WindowEvent::Resized(
Expand Down