Implemented focus_window (#1944)
This commit is contained in:
parent
91591c4e94
commit
b371b406d5
10 changed files with 107 additions and 0 deletions
|
|
@ -731,6 +731,21 @@ impl Window {
|
|||
self.window.set_ime_position(position.into())
|
||||
}
|
||||
|
||||
/// Brings the window to the front and sets input focus. Has no effect if the window is
|
||||
/// already in focus, minimized, or not visible.
|
||||
///
|
||||
/// This method steals input focus from other applications. Do not use this method unless
|
||||
/// you are certain that's what the user wants. Focus stealing can cause an extremely disruptive
|
||||
/// user experience.
|
||||
///
|
||||
/// ## Platform-specific
|
||||
///
|
||||
/// - **iOS / Android / Web / Wayland:** Unsupported.
|
||||
#[inline]
|
||||
pub fn focus_window(&self) {
|
||||
self.window.focus_window()
|
||||
}
|
||||
|
||||
/// Requests user attention to the window, this has no effect if the application
|
||||
/// is already focused. How requesting for user attention manifests is platform dependent,
|
||||
/// see `UserAttentionType` for details.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue