Skip to content

Commit

Permalink
feat: sync focus at end of window destroyed, hidden, and minimized
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Sep 13, 2023
1 parent 7b1886b commit 5bc3f68
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GlazeWM.Domain/Containers/ContainerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class ContainerService
public Container FocusedContainer => ContainerTree.LastFocusedDescendant;

/// <summary>
/// Whether native focus will need to be reassigned to the WM's focused container.
/// Whether native focus needs to be reassigned to `FocusedContainer`.
/// </summary>
public bool HasPendingFocusSync { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void Handle(WindowDestroyedEvent @event)
// If window is in tree, detach the removed window from its parent.
_bus.Invoke(new UnmanageWindowCommand(window));
_bus.Invoke(new RedrawContainersCommand());
_bus.Invoke(new SyncNativeFocusCommand());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void Handle(WindowHiddenEvent @event)
// Detach the hidden window from its parent.
_bus.Invoke(new UnmanageWindowCommand(window));
_bus.Invoke(new RedrawContainersCommand());
_bus.Invoke(new SyncNativeFocusCommand());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void Handle(WindowMinimizedEvent @event)

_containerService.ContainersToRedraw.Add(workspace);
_bus.Invoke(new RedrawContainersCommand());
_bus.Invoke(new SyncNativeFocusCommand());
}
}
}

0 comments on commit 5bc3f68

Please sign in to comment.