Make "Activate previous app" action take desktops into account

Imagine you have windows A and B on desktop 1, and C and D on desktop 2. It would be great if "Activate previous app" could take desktops in account, and while you are on desktop 1, it would switch between A and B, and on desktop 2, it will switch between C and D.

Currently, if you did some work in window A, then switched to desktop 2 and focused window C, "Activate previous app" action would focus window A – but since desktop does not get switched automatically (you remain on desktop 2), the only change you get is unfocused window C. This is not particularly useful.

I think this action should keep separate app sequences for each desktop, or at least provide an option for this. Thanks