def is_window_in_area(window, area):
    """
    Checks if a window is within an area.

    To determine whether a window is within an area it checks if the x and y of
    the window are within that area. This means a window can "hang out" of an
    area but still be considered to be in the area.

    Args:
        window: A Window instance
        area: A Geometry instance

    Returns:
        True or False
    """
    return window.geometry.x >= area.x and \
        window.geometry.y >= area.y and \
        window.geometry.x < area.x + area.w and \
        window.geometry.y < area.y + area.h