Dismiss GUI.Window by hit outside only

I want to dismiss a GUI.Window by tapping outside it. I created a GUITexture for the background, and can see it getting hit. But it sees hits right through the popup. How can I detect a hit on just the .Window?

	void OnGUI()
	{	
		settingsWindowRect = GUI.Window(0, settingsWindowRect, DoSettingsWindow, "Settings");		 			
    }
    	
	void DoSettingsWindow(int windowID) 
	{
		if (GUILayout.Button("Hello World"))
			print("Got a click"); 
	}
	
	void Update () 
	{
		if(Input.GetMouseButton(0) && splashBackgroundGUITexture.HitTest(Input.mousePosition))
		{
			Debug.Log("Background Hit");
		}
		
	}

Check out the example in the GUI.Window documentation, it has a sample script to toggle a popup on/off. For instance, you could use a boolean variable like so:

bool showSettingsWindow = true;

    void OnGUI()
    {        
        if (showSettingsWindow)
        {
            // Do your window stuff here.
        }
    }

    void Update()
    {
        if (Input.GetMouseButton(0) && splashBackgroundGUITexture.HitTest(Input.mousePosition))
        {
            showSettingsWindow = false;
        }
    }