Desktop: Hook up native window controls (#3161)

* Implement window controls

* Fix drag target size

* Maximize with drag area double click
This commit is contained in:
Timon
2025-09-13 13:15:52 -07:00
committed by GitHub
parent e97d5520e8
commit 944a6eeea2
9 changed files with 29 additions and 4 deletions

View File

@@ -164,6 +164,11 @@ impl WinitApp {
window.set_minimized(minimized);
}
}
DesktopFrontendMessage::DragWindow => {
if let Some(window) = &self.window {
let _ = window.drag_window();
}
}
DesktopFrontendMessage::CloseWindow => {
let _ = self.event_loop_proxy.send_event(CustomEvent::CloseWindow);
}
@@ -271,7 +276,9 @@ impl ApplicationHandler<CustomEvent> for WinitApp {
let mut window = Window::default_attributes()
.with_title(APP_NAME)
.with_min_inner_size(winit::dpi::LogicalSize::new(400, 300))
.with_inner_size(winit::dpi::LogicalSize::new(1200, 800));
.with_inner_size(winit::dpi::LogicalSize::new(1200, 800))
.with_decorations(false)
.with_resizable(true);
#[cfg(target_os = "linux")]
{