Fixed bug 2655 - OSX: Window position and global mouse coord spaces are different
Tim McDaniel
On OSX, with revision 8729, the coordinate space for window position and the coordinate space for global mouse position don't match. For a non-fullscreen window, the window position is global relative to the bottom of the menubar. The global mouse position is relative to the top of the screen. This affects Cocoa_WarpMouse and potentially other things as well. Further, the coordinate system for window position is now affected by what screen it is on. For example, if I have two equal size screens oriented side by side such that the tops of the screens are equal in global space, with the menubar on one screen, and a window straddles the two screens, the window's y position makes no sense. The window's y position depends on what screen "most" of the window is on. So if I move the window horizontally just a bit, the y position of my window is now different by the size of the menubar, even though the window was not moved vertically.
I'd like to reiterate that this was a fairly fundamental change (and a breaking change for us). If SDL OSX is to really support multi-display configurations, this is especially problematic.
If the real concern is preventing windows from going under the menubar, then perhaps a solution involving something like overriding [NSWindow constrainFrameRect] would be less problematic than redefining the global window coord space for the main display.
2 # mkinstalldirs --- make directory hierarchy
3 # Author: Noah Friedman <friedman@prep.ai.mit.edu>
11 Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
13 # process command line arguments
14 while test $# -gt 0 ; do
16 -h | --help | --h* ) # -h for help
17 echo "${usage}" 1>&2; exit 0 ;;
20 test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
23 -- ) shift; break ;; # stop option processing
24 -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
25 * ) break ;; # first non-opt arg
31 if test -d "$file"; then
44 if mkdir -p -- . 2>/dev/null; then
49 if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
50 echo "mkdir -m $dirmode -p -- $*"
51 exec mkdir -m "$dirmode" -p -- "$@"
57 set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
63 pathcomp="$pathcomp$d"
65 -* ) pathcomp=./$pathcomp ;;
68 if test ! -d "$pathcomp"; then
69 echo "mkdir $pathcomp"
71 mkdir "$pathcomp" || lasterr=$?
73 if test ! -d "$pathcomp"; then
76 if test ! -z "$dirmode"; then
77 echo "chmod $dirmode $pathcomp"
80 chmod "$dirmode" "$pathcomp" || lasterr=$?
82 if test ! -z "$lasterr"; then
99 # mkinstalldirs ends here