This has come up a few times now during my vala development with GTK and Libadwaita, signals/methods/properties that have identical names in inheriting classes. For example:
visible property of a StackPage versus visible property of a GtkWidget.
destroy method of GtkWindow versus destroy signal of a GtkWidget.
What is the correct way to handle these collisions? E.G. window.destroy.connect does not work as it is mapped already to the method, and using UI template files I stumble upon the same issue.
These properties behave very differently and are never available simultaneous.
Setting visible for GtkWidget is more like calling show() as it will trigger a series of init signals i.e. realize → map → show. In a way, it’s part of the life-cycle of a widget.
On the other hand, setting visible for StackPage is more literal. If a StackPage is not visible, then it’s not available. Setting visible here doesn’t emit a signal, as far as I can tell. And it’s not like set_visible_child from GtkStack/AdwViewStack. If you have a AdwViewSwitcherBar/GtkStackSwitcher with multiple StackPage’s, and one is set invisible, then the selection option for that StackPage will not appear at all.