This patch ensures that menu items are disabled when they should be,
i.e. when there is no applicable visible and non-iconified frame.
In a lot of cases, one could do "insert file" or choose stuff from
the "search" menu even if there were only iconified or hidden frames.
Instead of disabling some menu items one by one, wouldn't it be better
to disable all menu items if the frame attached to the menu is not
visible.
Operating on non-visible frames from the visible menu is not only
confusing,
but might be dangerous.