def handle_orphan_dropdowns(self, client: Window | Static) -> None:
        """
        Remove any windows from now non-existent scratchpad groups.
        """
        client_wid = client.wid
        if client_wid in self.orphans:
            self.orphans.remove(client_wid)
            if isinstance(client, Window):
                client.group = None
            if not self.orphans:
                hook.unsubscribe.client_new(self.handle_orphan_dropdowns)

        Remove any windows from now non-existent scratchpad groups.
        
libqtile/core/state.py