Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/WindowsMegaProxy/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ private void SetConnected(bool value)
}
}

private bool CanPollConnections() => IsActive && IsVisible && WindowState != WindowState.Minimized &&
private bool CanPollConnections() => IsVisible && WindowState != WindowState.Minimized &&
((TabItem)Sections.Items[0]).IsSelected && connection.State == ConnectionState.Connected && engine?.Running == true;

private DateTimeOffset nextConnectionsPoll;
Expand Down
8 changes: 7 additions & 1 deletion tests/WindowsMegaProxy.UiChecks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,15 @@ private static void Main(string[] args)
var otherWindow = new Window { Width = 200, Height = 100, Owner = window };
otherWindow.Show(); otherWindow.Activate(); Layout(otherWindow);
Wait(window, (Task)refresh.Invoke(window, [false])!);
Assert(!window.IsActive && fixtureEngine.Polls == polls, "A visible unfocused window does not poll connections.");
Assert(!window.IsActive && fixtureEngine.Polls == polls + 1, "A visible unfocused window continues polling connections.");
polls = fixtureEngine.Polls;
otherWindow.Close(); window.Activate(); Layout(window);

window.WindowState = WindowState.Minimized;
Wait(window, (Task)refresh.Invoke(window, [false])!);
Assert(fixtureEngine.Polls == polls, "A minimized window does not poll connections.");
window.WindowState = WindowState.Normal; Layout(window);

((TabControl)window.FindName("Sections")).SelectedIndex = 3;
Wait(window, (Task)refresh.Invoke(window, [false])!);
Assert(fixtureEngine.Polls == polls, "An inactive connections page does not poll the core.");
Expand Down
Loading