When using mouse controls in XNA (MonoGame, FNA) I use methods like:
public static bool IsMouseClickedLeft()
{
// No clicks if game is not the active application
if (Game.IsActive == false) return false;
if (mouseState.LeftButton == ButtonState.Pressed) return true;
return false;
}
However, in windowed mode (if not fullscreen) mouse clicks (and mouse movement) is recognized and processed even if the game window is covered or partly covered by other windows e.g. a browser or the Windows file explorer. How can I make sure that only mouse clicks are recognized that click on visible (not covered) parts of the game window.