windows: Remove unnecessary code in #25412 (#25805)

Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
张小白 2025-02-28 19:05:39 +08:00 committed by GitHub
parent 7440833ff1
commit 22220ed32e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -171,19 +171,14 @@ fn fail_to_open_window(e: anyhow::Error, _cx: &mut App) {
fn main() { fn main() {
let args = Args::parse(); let args = Args::parse();
#[cfg(target_os = "windows")]
let run_foreground = args.foreground;
#[cfg(all(not(debug_assertions), target_os = "windows"))] #[cfg(all(not(debug_assertions), target_os = "windows"))]
if run_foreground {
unsafe { unsafe {
use windows::Win32::System::Console::{AttachConsole, ATTACH_PARENT_PROCESS}; use windows::Win32::System::Console::{AttachConsole, ATTACH_PARENT_PROCESS};
if run_foreground { if args.foreground {
let _ = AttachConsole(ATTACH_PARENT_PROCESS); let _ = AttachConsole(ATTACH_PARENT_PROCESS);
} }
} }
}
menu::init(); menu::init();
zed_actions::init(); zed_actions::init();
@ -235,7 +230,7 @@ fn main() {
{ {
!crate::zed::windows_only_instance::check_single_instance( !crate::zed::windows_only_instance::check_single_instance(
open_listener.clone(), open_listener.clone(),
run_foreground, args.foreground,
) )
} }