Un-minimize and focus the window when a document is opened

This commit is contained in:
Keavon Chambers
2026-05-06 07:47:41 -07:00
parent 5d69b5e80b
commit c9d02e1aa9
2 changed files with 8 additions and 0 deletions

View File

@@ -481,6 +481,9 @@ impl App {
if let Some(launch_documents) = &mut self.launch_documents {
launch_documents.extend(paths);
} else {
if let Some(window) = &self.window {
window.restore_and_focus();
}
self.open_files(paths);
}
}

View File

@@ -110,6 +110,11 @@ impl Window {
self.winit_window.set_minimized(true);
}
pub(crate) fn restore_and_focus(&self) {
self.winit_window.set_minimized(false);
self.winit_window.focus_window();
}
pub(crate) fn toggle_maximize(&self) {
if self.is_fullscreen() {
return;