@Override
	public void mouseClicked(int button, int x, int y, int clickcount) {
		Client.debug("clicked in a window x:" + x + " y:" + y );
		boolean found = false;
		for (GUIObject obj : objects.values()) {
			if (!obj.isInput())
				continue;
			
			if ( x >= obj.getRealX() && x < obj.getRealX()+obj.getRealWidth() ) {
				if ( y >= obj.getRealY() && y < obj.getRealY()+obj.getRealHeight() ) {
					found = true;
					Client.debug("Clicked " + obj.getName());
					obj.mouseClicked(button, x-obj.getRealX(), y-obj.getRealY(), clickcount);
					break;
				}
			}
		}
		
		if (!found) {
			if (selected != null) {
				selected.setSelected(false);
				selected = null;
			}
		}
	}