re-apply r67149 to fix high CPU usage on Ubuntu

r67149 was removed as part of r67929, but is still needed on Ubuntu when using
their "appmenu" (global menubar), because the menubar height is always zero in
that case. The problem can be seen with Audacity.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@73363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775