Windows: fix initial active status (#9694)
Separate from #9451 On Windows, a new window may already active immediate after creation. Release Notes: - N/A --------- Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
@@ -1389,6 +1389,10 @@ impl PlatformWindow for WindowsWindow {
|
||||
unsafe { SetForegroundWindow(self.inner.hwnd) };
|
||||
}
|
||||
|
||||
fn is_active(&self) -> bool {
|
||||
self.inner.hwnd == unsafe { GetActiveWindow() }
|
||||
}
|
||||
|
||||
// todo(windows)
|
||||
fn set_title(&mut self, title: &str) {
|
||||
unsafe { SetWindowTextW(self.inner.hwnd, &HSTRING::from(title)) }
|
||||
|
||||
Reference in New Issue
Block a user