[gnome-44] Use the mask for the flagsclass to compute valid values

Marco Trevisan requested to merge cherry-pick-f6374c83 into gnome-44

Fix Errors

(cherry picked from commit f6374c83)

Merge request reports