I could move the call to make it layered before calling the driver function of course, but the function can return FALSE, and then what happens? Should I revert it back, or not sure how to fix it.
Yes, setting it then calling `paint_layered_icon` once, before trying to dock them, and removing the attribute if docking returns FALSE looks correct.