How to block mouse-hover passthrough from UI into game-view?

Does anyone happen to know how to make UI elements to be fully “opaque” in the sense that they don’t pass the mouse-hover through to the underlying game view?

I have an issue that in some of my mods where I want to display tooltips upon hovering over custom UI elements does not work correctly if there’s a game element (tree,unit,building, etc.) behind it in the game-view because the game then prioritizes displaying the tooltip for the in-game item over the UI item’s tooltip.