You need to check if the click occured over a free space of the screen, without GUI. For that, there is the function Rect.Contains. You’ll have to check every rect, or the one that contains them all.
Or, there is the tooltip. before any GUI is drawn, draw an empty label the size of the screen with a specific tooltip (“background”, for inst). Then, check and store the tooltip in the GUI loop. And when you click, you can check if tooltip == “background”.
In both case, you’ll need a centralised GUI, inside one function with a list of stuff to draw. I hope I’m making sense …