Skip to content

platform: Don't use queued signals for batching change signals in PlatformTheme

Arjen Hiemstra requested to merge work/ahiemstra/platformthemechanges into master
  • platform: Don't use queued signals for batching change signals in PlatformTheme

While queued signals allow us to fairly easily batch things, they introduce latency to when the changes are emitted, which can cause things to be rendered in an intermediate state where not everything has changed properly.

To avoid this, we need to emit signals directly when properties change. However, this leads to performance issues because we potentially emit the same signal multiple times, which is what we were trying to avoid with the batching.

This introduces a new class, PlatformThemeChangeTracker, that keeps track of changes and will emit the right signals when destroyed. It allows nesting, so that we can liberally sprinkle this throughout code where we are changing PlatformTheme properties and get a more immediate form of batching.

Merge request reports

Loading