Calling `wnck_set_default_icon_size` can segfault
With the new invalidate_icons() code here, self->screens might not be initialized, causing a segfault. wnck_set_default_icon_size and wnck_setmini_icon_sizegets or creates a new WnckHandle, but this does not initialize thescreens` member, as far as I can tell. It looks like the previous code1 explicitly got the default screen and then iterates over its windows.
This causes bamf/bamfdaemon to break, which uses libwnck for window tracking, and thus in turn causes other applications using bamf to break, such as Plank.