Skip to content

notifications: Fix custom source policies

Florian Müllner requested to merge fmuellner/gnome-shell:pass-policy into main

Quoting the main commit:

notification: Pass policy in the Source contructor

Commit 932ccac1 changed Source to use a regular constructor
instead of `_init()`.

Unfortunately that results in ordering issues for subclasses
that override `_createPolicy()`, if that method needs to access
any properties that are set in the constructor (as `this` is
only available after chaining up to the parent).

We can fix that by simply setting the policy from the constructor,
instead of relying on some overriden method being called.

Also see !3166 (closed) for the original discussion.

Merge request reports