Ok, I misunderstood the layers dialog code. selection()->unselect_all() doesn't apply to the current document selection, but to the layers dialog tree...
Ok, I misunderstood the layers dialog code. selection( )->unselect_ all() doesn't apply to the current document selection, but to the layers dialog tree...