Skip to content

GObject: Ensure to call setter methods for construct-only properties

Construct-only properties on JS-defined GObject subclasses takes some shortcuts to define these JS properties as readonly ones. However, this hardcodes the given G/JSValue without giving an opportunity to any defined setter methods to be called. These setter methods could do more things than setting the value (e.g. initialize related data, ensure the given object is in an specific state, ...) and are thus not trivial to bypass.

To fix this, ensure to set these properties, before locking them as readonly.

Related: gnome-shell#3926 (closed)

Merge request reports