How to get the position of Topbar icons?

it’s a bit strange as to why they’ve elevated the context for that - I can’t see any obvious reason for that?

Thanks for your help. I’ll give your suggestions a go.