Skip to content

Commit ce0b20b

Browse files
committed
Update locations immediately in some situations
1 parent d7bcfcd commit ce0b20b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Core/Sources/SuggestionWidget/WidgetWindowsController.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,10 @@ private extension WidgetWindowsController {
299299
await send(.updateFocusingDocumentURL)
300300
}
301301

302-
func updateWidgetsAndNotifyChangeOfEditor() async {
303-
await updateWindowLocation(animated: false, immediately: false)
304-
await updateWindowOpacity(immediately: false)
302+
func updateWidgetsAndNotifyChangeOfEditor(immediately: Bool) async {
305303
await send(.panel(.switchToAnotherEditorAndUpdateContent))
304+
await updateWindowLocation(animated: false, immediately: immediately)
305+
await updateWindowOpacity(immediately: immediately)
306306
}
307307

308308
func updateWidgets() async {
@@ -313,9 +313,11 @@ private extension WidgetWindowsController {
313313
switch notification.kind {
314314
case .focusedWindowChanged, .focusedUIElementChanged:
315315
await hideWidgetForTransitions()
316-
await updateWidgetsAndNotifyChangeOfEditor()
317-
case .applicationActivated, .mainWindowChanged:
318-
await updateWidgetsAndNotifyChangeOfEditor()
316+
await updateWidgetsAndNotifyChangeOfEditor(immediately: true)
317+
case .applicationActivated:
318+
await updateWidgetsAndNotifyChangeOfEditor(immediately: false)
319+
case .mainWindowChanged:
320+
await updateWidgetsAndNotifyChangeOfEditor(immediately: false)
319321
case .applicationDeactivated,
320322
.moved,
321323
.resized,

0 commit comments

Comments
 (0)