Commit d38dcb5
committed
cocoa_input: fix frame dot-syntax and NSPoint/CGPoint mismatch
GCC 4.0 (Xcode 3.1, PowerPC) reports:
cocoa_input.m:1062: error: invalid initializer
Two problems compound in this four-line sequence on 32-bit 10.5:
CGPoint window_pos = window.frame.origin;
CGSize window_size = window.frame.size;
First, NSWindow's frame is declared - (NSRect)frame; on the
10.5-10.9 SDKs, not as @Property. GCC 4.0 only supports Obj-C 2.0
dot-syntax on explicitly declared @Property, so window.frame fails
(same class of issue as the keyWindow / alphaValue fixes in
c49a525).
Second, window.frame.origin evaluates to NSPoint, but the variable
is typed CGPoint. On 32-bit Darwin, NSPoint and CGPoint are
separate, incompatible types — Apple only unified them on LP64.
Same for NSSize vs CGSize on the next line.
Rewrite to fetch the frame once via bracket syntax into an NSRect
local, then feed the float field values directly to CGPointMake.
CGWarpMouseCursorPosition gets the same CGPoint as before; no
runtime change. Modern clang compiles identically.1 parent 8e428f4 commit d38dcb5
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
1065 | 1072 | | |
1066 | 1073 | | |
1067 | 1074 | | |
| |||
0 commit comments