fix x11 c bool define for c++ usage ; add screen bounds check on mac osx