fix: parallels windows wouldn't switch sometimes (closes #1213)

This commit is contained in:
Zachary Wander
2021-11-13 01:39:28 +09:00
committed by lwouis
parent e2d26f2abc
commit 21133ce118
+1 -3
View File
@@ -158,10 +158,8 @@ class Window {
// You can reproduce this buggy behaviour by clicking on the dock icon, proving it's an OS bug
BackgroundWork.accessibilityCommandsQueue.asyncWithCap { [weak self] in
guard let self = self else { return }
var elementConnection = UInt32(0)
CGSGetWindowOwner(cgsMainConnectionId, self.cgWindowId, &elementConnection)
var psn = ProcessSerialNumber()
CGSGetConnectionPSN(elementConnection, &psn)
GetProcessForPID(self.application.pid, &psn)
_SLPSSetFrontProcessWithOptions(&psn, self.cgWindowId, .userGenerated)
self.makeKeyWindow(psn)
self.axUiElement.focusWindow()