I am making an application that can set a running application window to float above other apps so that if you click outside of the app's window, its window will still remain on the screen.
I have tried to use app.activate(options: NSApplication.ActivationOptions.activateIgnoringOtherApps)
where app
is the frontmost running application set by app = NSWorkspace.shared.frontmostApplication
, but this method only shows the window and when you click outside the app it hides again.
func setAppFloating() {
let app = NSWorkspace.shared.frontmostApplication
app?.activate(options: NSApplication.ActivationOptions.activateIgnoringOtherApps)
}
I want to set the window of the running application to Floating so that when you click outside the window, the app should still remain visible above other apps.