I think that the menues should be gone from the top menubar when the window is not under focus (i.e., the focus is on plasma's desktop). This should be straightforward to fix by checking if the window is active.
*** This bug has been marked as a duplicate of bug 395853 ***