fix: simpler/better window focus

This commit is contained in:
Louis Pontoise authored and lwouis committed 2020-04-02 19:39:39 +09:00
1 parent 65816a270f
commit 574a6401b9
1 file changed
-2
-2
View File
@@ -75,8 +75,6 @@ class Window {
CGSGetWindowOwner(cgsMainConnectionId, self.cgWindowId, &elementConnection)
var psn = ProcessSerialNumber()
CGSGetConnectionPSN(elementConnection, &psn)
AXUIElementPerformAction(self.axUiElement, kAXRaiseAction as CFString)
self.makeKeyWindow(psn)
_SLPSSetFrontProcessWithOptions(&psn, self.cgWindowId, .userGenerated)
self.makeKeyWindow(psn)
AXUIElementPerformAction(self.axUiElement, kAXRaiseAction as CFString)