Skip to content

Commit

Permalink
fix: macOS windows order (#242)
Browse files Browse the repository at this point in the history
* Make sure window is always on top on webview creation
  • Loading branch information
lemarier authored May 7, 2021
1 parent 1b70303 commit 229275f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/macos-window-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

Fix macOS windows order for tray (statusbar) applications.
4 changes: 4 additions & 0 deletions src/webview/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ impl InnerWebView {
let _: () = msg_send![webview, setWantsLayer: YES];
// Inject the web view into the window as main content
let _: () = msg_send![ns_window, setContentView: webview];
// make sure the window is always on top when we create a new webview
let app_class = class!(NSApplication);
let app: id = msg_send![app_class, sharedApplication];
let _: () = msg_send![app, activateIgnoringOtherApps: YES];

Ok(w)
}
Expand Down

0 comments on commit 229275f

Please sign in to comment.