Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Sep 13, 2023
1 parent 742b611 commit f72ae7c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public CommandResponse Handle(SyncNativeFocusCommand command)
_bus.Emit(new NativeFocusSyncedEvent(focusedContainer));
_bus.Emit(new FocusChangedEvent(focusedContainer));

_containerService.HasPendingFocusSync = false;

return CommandResponse.Ok;
}
}
Expand Down
6 changes: 0 additions & 6 deletions GlazeWM.Domain/Containers/ContainerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ public class ContainerService
public FocusMode FocusMode => FocusedContainer is FloatingWindow ?
FocusMode.Floating : FocusMode.Tiling;

/// <summary>
/// While active, any this container overrides the target container to set focus to on the next
/// focus window event (ie. `EVENT_SYSTEM_FOREGROUND`).
/// </summary>
public Countdown FocusOverrideCountdown { get; set; } = new(TimeSpan.FromMilliseconds(100));

/// <summary>
/// Name of the currently active binding mode (if one is active).
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ internal sealed class UnmanageWindowHandler : ICommandHandler<UnmanageWindowComm
{
private readonly Bus _bus;
private readonly ContainerService _containerService;
private readonly WindowService _windowService;

public UnmanageWindowHandler(Bus bus, ContainerService containerService)
public UnmanageWindowHandler(
Bus bus,
ContainerService containerService,
WindowService windowService)
{
_bus = bus;
_containerService = containerService;
_windowService = windowService;
}

public CommandResponse Handle(UnmanageWindowCommand command)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void Handle(WindowFocusedEvent @event)

if (unmanagedStopwatch?.ElapsedMilliseconds < 100)
{
_logger.LogDebug("Overriding native focus.");
_bus.Invoke(new SyncNativeFocusCommand());
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void Handle(WindowMinimizedEvent @event)
// Focus should be reassigned to appropriate container.
if (focusTarget is not null)
{
_bus.Invoke(new SetFocusedDescendant(focusTarget));
_bus.Invoke(new SetFocusedDescendantCommand(focusTarget));
_containerService.HasPendingFocusSync = true;
_windowService.UnmanagedOrMinimizedStopwatch.Restart();
}
Expand Down
23 changes: 0 additions & 23 deletions GlazeWM.Infrastructure/Utils/Countdown.cs

This file was deleted.

0 comments on commit f72ae7c

Please sign in to comment.