mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
On Windows and MacOS, add Window::has_focus
This commit is contained in:
@@ -773,6 +773,11 @@ impl Window {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn has_focus(&self) -> bool {
|
||||
let window_state = self.window_state.lock().unwrap();
|
||||
window_state.has_active_focus()
|
||||
}
|
||||
|
||||
pub fn title(&self) -> String {
|
||||
let len = unsafe { GetWindowTextLengthW(self.window.0) } + 1;
|
||||
let mut buf = vec![0; len as usize];
|
||||
|
||||
Reference in New Issue
Block a user