Skip to content

Commit

Permalink
Bug fix for glitch caused in table views
Browse files Browse the repository at this point in the history
This bug was most commonly seen in System Settings sound selection in macOS 13.5+
  • Loading branch information
rxhanson committed Sep 16, 2023
1 parent 9f1fd3f commit fb5e8c2
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Rectangle/AccessibilityElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ extension AccessibilityElement {

static func getWindowElementUnderCursor() -> AccessibilityElement? {
let position = NSEvent.mouseLocation.screenFlipped
if let element = AccessibilityElement(position), let windowElement = element.windowElement {
return windowElement
}
if let info = getWindowInfo(position) {
if !Defaults.dragFromStage.userDisabled {
if StageUtil.stageCapable && StageUtil.stageEnabled,
Expand All @@ -322,21 +319,20 @@ extension AccessibilityElement {
}
if let windowElements = AccessibilityElement(info.pid).windowElements {
if let windowElement = (windowElements.first { $0.windowId == info.id }) {
if Logger.logging {
let appName = NSRunningApplication(processIdentifier: info.pid)?.localizedName ?? ""
Logger.log("Window under cursor fallback matched: \(appName) \(info)")
}
return windowElement
}
if let windowElement = (windowElements.first { $0.frame == info.frame }) {
if Logger.logging {
let appName = NSRunningApplication(processIdentifier: info.pid)?.localizedName ?? ""
Logger.log("Window under cursor fallback matched: \(appName) \(info)")
}
return windowElement
}
}
}
if let element = AccessibilityElement(position), let windowElement = element.windowElement {
if Logger.logging, let pid = windowElement.pid {
let appName = NSRunningApplication(processIdentifier: pid)?.localizedName ?? ""
Logger.log("Window under cursor fallback matched: \(appName)")
}
return windowElement
}
Logger.log("Unable to obtain the accessibility element with the specified attribute at mouse location")
return nil
}
Expand Down

0 comments on commit fb5e8c2

Please sign in to comment.