Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

windows: Revert "Fix `hide`, `activate` method on Windows to hide/show application" (#18571)

Junkui Zhang6336248c1a90
diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rs
index 7f6677973b2..e90b2c6ef1b 100644
--- a/crates/gpui/src/platform/windows/platform.rs
+++ b/crates/gpui/src/platform/windows/platform.rs
@@ -33,8 +33,6 @@ use crate::*;
pub(crate) struct WindowsPlatform {
state: RefCell<WindowsPlatformState>,
raw_window_handles: RwLock<SmallVec<[HWND; 4]>>,
- // The window handles that are hided by `hide` method.
- hidden_windows: RwLock<SmallVec<[HWND; 4]>>,
// The below members will never change throughout the entire lifecycle of the app.
icon: HICON,
main_receiver: flume::Receiver<Runnable>,
@@ -102,7 +100,6 @@ impl WindowsPlatform {
Self {
state,
raw_window_handles,
- hidden_windows: RwLock::new(SmallVec::new()),
icon,
main_receiver,
dispatch_event,
@@ -298,26 +295,9 @@ impl Platform for WindowsPlatform {
}
}
- fn activate(&self, _ignoring_other_apps: bool) {
- let mut state = self.hidden_windows.write();
- state.iter().for_each(|handle| unsafe {
- ShowWindow(*handle, SW_SHOW).ok().log_err();
- });
- state.clear();
- }
+ fn activate(&self, _ignoring_other_apps: bool) {}
- fn hide(&self) {
- let mut state = self.hidden_windows.write();
- self.raw_window_handles
- .read()
- .iter()
- .for_each(|handle| unsafe {
- if IsWindowVisible(*handle).as_bool() {
- state.push(*handle);
- ShowWindow(*handle, SW_HIDE).ok().log_err();
- }
- });
- }
+ fn hide(&self) {}
// todo(windows)
fn hide_other_apps(&self) {