It seems to be related to a setting in KDE's window manager, "Click
Raise Active Window". The tooltip for this setting says:
When this option is enabled, the active window will be brought to
the front when you click somewhere into the window contents.
When "Click Raise Active Window" is enabled, the bug appears (clicking
on a toolbar button when the tooltip is active dismisses the tooltip,
but doesn't click the button). The bug goes away if "Click Raise
Active Window" is disabled.
This is KDE 3.4.3, the one that comes with the Ubuntu "Breezy Badger"
release.