[PR #16587] Avoid timer ticks on frozen windows #30946

Open
opened 2026-01-31 09:44:00 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/16587

State: closed
Merged: Yes


At the time of writing, closing the last tab of a window inexplicably
doesn't lead to the destruction of the remaining TermControl instance.
On top of that, on Win10 we don't destroy window threads due to bugs in
DesktopWindowXamlSource. In other words, we leak TermControl instances.

Additionally, the XAML timer class is "self-referential".
Releasing all references to an instance will not stop the timer.
Only calling Stop() explicitly will achieve that.

The result is that the message loop of a frozen window thread has so
far received 1-2 messages per second due to the blink timer not being
stopped. This may have filled the message queue and lead to bugs as
described in #16332 where keyboard input stopped working.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/16587 **State:** closed **Merged:** Yes --- At the time of writing, closing the last tab of a window inexplicably doesn't lead to the destruction of the remaining TermControl instance. On top of that, on Win10 we don't destroy window threads due to bugs in DesktopWindowXamlSource. In other words, we leak TermControl instances. Additionally, the XAML timer class is "self-referential". Releasing all references to an instance will not stop the timer. Only calling Stop() explicitly will achieve that. The result is that the message loop of a frozen window thread has so far received 1-2 messages per second due to the blink timer not being stopped. This may have filled the message queue and lead to bugs as described in #16332 where keyboard input stopped working.
claunia added the pull-request label 2026-01-31 09:44:00 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30946