macOS Accessibility: don't create an unnecessary interface

We only need to compare elements to determine whether this element has
focus.

Task-number: QTBUG-34337
Pick-to: 6.5
Change-Id: Ic1388ac00381735acfbf1e5877a658f4bd534dfb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Volker Hilsheimer 2023-04-07 20:36:59 +02:00
parent 03b7e97907
commit 69a8d1293a

View File

@ -249,12 +249,9 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
- (BOOL)isAccessibilityFocused
{
if (QAccessibleInterface *iface = self.qtInterface) {
// Just check if the app thinks we're focused.
id focusedElement = NSApp.accessibilityApplicationFocusedUIElement;
return [focusedElement isEqual:self];
}
return false;
// Just check if the app thinks we're focused.
id focusedElement = NSApp.accessibilityApplicationFocusedUIElement;
return [focusedElement isEqual:self];
}
// attributes