On X11, Gnome and KDE Plasma supported session/state restore, but this was based on XSMP and couldn't be simply reused for Wayland.
There's an ongoing standardization effort to provide equivalent functionality for Wayland: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/m...
KDE Plasma provides a "fake session restore" for the time being: https://invent.kde.org/plasma/plasma-workspace/-/merge_reque...