SpinButton used to derive from Entry in GTK3, and consequently inherited the very useful activate signal and activates-default property.
Using either one of these, you could make it so that pressing enter in a spinbutton activates the default widget.
Now in GTK4 both of these are gone, because Entry was removed as a base class of SpinButton, but there doesn’t seem to be any replacement to make up for it.
The migration guide suggests things have moved to Editable, but there’s nothing in there that can be used as an activate signal or an activates-default property.
The “activate” signal was not added mainly because nobody ever noticed, or thought that people would use it as a way to activate the default widget of a top level; that usually happens for actual buttons.
The SpinButton widget already listens to the “activate” signal on its child GtkText widget, and updates its value.
If you need the “activate” signal, please file an issue against GTK with a proper use case, so we can add it for the next release.
Don’t use get_first_child() or any other method for traversing the children of a widget: those are for widget implementations.