How the switch animation between light and dark style is made?

How the switch animation between light and dark style is made/implemented in Gnome? The setting value is shared by the XDG standard and isn’t Gnome spesific, but how does Gnome make the switch animation so smoothly? Someone said that Gnome takes a screenshot.

That’s pretty accurate.

gnome-shell captures the screen, overlays it over the screen and starts fading it out after a short delay.

That animation is triggered by Settings (via D-Bus) or gnome-shell itself (the quick settings button) when they are about to change the setting.

Could we implement this in Mutter?

Not impossible, but more of a hassle. gnome-shell would need to reparent the actor into its own uiGroup actor, mutter would need to deal with the unexpected parent (when raising the actor to the top before starting the transition), and gnome-shell must be allowed to control its visibility for the overview.

Ah, and we’d probably want a way to allow gnome-shell development hooks like slow-down-factor to work for the transition, even when it’s run by mutter.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.