Skip to content

Commit 01e78a8

Browse files
committed
Disable widget for alerts
1 parent a0a1deb commit 01e78a8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Core/Sources/AXExtension/AXUIElement.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ public extension AXUIElement {
3131
var description: String {
3232
(try? copyValue(key: kAXDescriptionAttribute)) ?? ""
3333
}
34+
35+
var label: String {
36+
(try? copyValue(key: kAXLabelValueAttribute)) ?? ""
37+
}
3438

3539
var isSourceEditor: Bool {
3640
description == "Source Editor"

Core/Sources/SuggestionWidget/SuggestionWidgetController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,13 @@ extension SuggestionWidgetController {
478478
}
479479
} else if var window = application.focusedWindow,
480480
var frame = application.focusedWindow?.rect,
481-
frame.size.height > 200,
481+
frame.size.height > 300,
482482
let screen = NSScreen.screens.first(where: { $0.frame.origin == .zero }),
483483
let firstScreen = NSScreen.main
484484
{
485-
if ["open_quickly"].contains(window.identifier) {
485+
if ["open_quickly"].contains(window.identifier)
486+
|| ["alert"].contains(window.label)
487+
{
486488
// fallback to use workspace window
487489
guard let workspaceWindow = application.windows
488490
.first(where: { $0.identifier == "Xcode.WorkspaceWindow" }),

0 commit comments

Comments
 (0)