How to get the mouse position outside of the window on Modal Operator
The following script will check if the mouse is outside the 3d_view window, not Blender's window. It's not exactly what you asked for, but I hope it'll help:

def click_outside_3d_view(event):
    area, viewport = get_3d_area_region()
    return not (0 &lt; event.mouse_region_x &lt; viewport.width and 0 &lt; event.mouse_region_y &lt; viewport.height)

def get_3d_area_region():
    for window in bpy.context.window_manager.windows:
        for area in window.screen.areas:
            if area.type == 'VIEW_3D':
                for region in area.regions:
                    if region.type == 'WINDOW':
                        return area, region


***** Edit *****

I'm not completely sure, but it seems that the mouse_region_x/y are relative to the original region that the operator was running in. 
The following code is more foolproof:

def click_inside_3d_view(event):
    for area in get_3d_areas():
        if 0 &lt; event.mouse_x-area.x &lt; area.width and 0 &lt; event.mouse_y-area.y &lt; area.height:
            return True
    return False

def get_3d_areas():
    for screen in bpy.data.screens:
        for area in screen.areas:
            if area.type == 'VIEW_3D':
                yield area