This is something Emacs can't handle. It is because how the lisp and event
loop interracts.
When you do (x-popup-dialog t '("Test" ("yes" . 1))), a Lisp return value is
expected back to the Lisp code.
So Emacs does not execute any more Lisp, until the dialog is popped down.
The popup is shown by a loop that just processes X events
(x_menu_wait_for_event).
When you switch frame and do C-g C-g, the "normal" stuff does not happen,
because Lisp is not executed.
This would be solvable if we had an independent Lisp loop per terminal, but it
is not so.
There is only one Lisp loop, shared by all frames/terminals, and if one
frame/terminal suspends the loop,
it is suspended for all frames/terminals.