Skip to content

Commit 22bb419

Browse files
committed
Fix that location not updated after focused element change
# Conflicts: # Core/Sources/SuggestionWidget/SuggestionWidgetController.swift
1 parent 0135850 commit 22bb419

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

Core/Sources/SuggestionWidget/SuggestionWidgetController.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,17 @@ extension SuggestionWidgetController {
325325
guard let self else { return }
326326
try Task.checkCancellation()
327327
328+
self.updateWindowLocation(animated: false)
329+
330+
if UserDefaults.shared.value(for: \.forceOrderWidgetToFront)
331+
|| notification.name == kAXWindowMovedNotification
332+
{
333+
// We need to bring them front when the app enters fullscreen.
334+
widgetWindow.orderFront(nil)
335+
tabWindow.orderFront(nil)
336+
panelWindow.orderFront(nil)
337+
}
338+
328339
if [
329340
kAXFocusedUIElementChangedNotification,
330341
kAXApplicationActivatedNotification,
@@ -346,17 +357,6 @@ extension SuggestionWidgetController {
346357
widgetViewModel.currentFileURL = currentFileURL
347358
await updateContentForActiveEditor(fileURL: fileURL)
348359
}
349-
350-
self.updateWindowLocation(animated: false)
351-
352-
if UserDefaults.shared.value(for: \.forceOrderWidgetToFront)
353-
|| notification.name == kAXWindowMovedNotification
354-
{
355-
// We need to bring them front when the app enters fullscreen.
356-
panelWindow.orderFront(nil)
357-
widgetWindow.orderFront(nil)
358-
tabWindow.orderFront(nil)
359-
}
360360
}
361361
}
362362
}

0 commit comments

Comments
 (0)