Skip to content

Commit

Permalink
fix(macos): set_focus should be triggered even if the window isn't …
Browse files Browse the repository at this point in the history
…visible (#128)
  • Loading branch information
lemarier authored Jul 14, 2021
1 parent 578dd23 commit 3da167a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/macos-set-focus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": minor
---

On macOS, make sure the `set_focus` is triggered even if the window is not visible.
4 changes: 1 addition & 3 deletions src/platform_impl/macos/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,7 @@ impl UnownedWindow {
pub fn set_focus(&self) {
unsafe {
let is_minimized: BOOL = msg_send![*self.ns_window, isMiniaturized];
let is_visible: BOOL = msg_send![*self.ns_window, isVisible];

if is_minimized == NO && is_visible == YES {
if is_minimized == NO {
util::set_focus(*self.ns_window);
}
}
Expand Down

0 comments on commit 3da167a

Please sign in to comment.