|
@@ -1920,16 +1920,19 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
|
|
|
y = (window->h - point.y);
|
|
y = (window->h - point.y);
|
|
|
|
|
|
|
|
// On macOS 26 if you move away from a space and then back, mouse motion events will have incorrect
|
|
// On macOS 26 if you move away from a space and then back, mouse motion events will have incorrect
|
|
|
- // values at the top of the screen. The global mouse position query is still correct, so we'll fall
|
|
|
|
|
- // back to that until this is fixed by Apple. Mouse button events are interestingly not affected.
|
|
|
|
|
|
|
+ // values at the top of the screen. Apparently non-fullscreen windows suffer from this from time
|
|
|
|
|
+ // to time when mouse leaves/enters a window and/or focus changes, too. The global mouse position query
|
|
|
|
|
+ // is still correct, so we'll fall back to that until this is fixed by Apple. Mouse button events are
|
|
|
|
|
+ // interestingly not affected.
|
|
|
if (@available(macOS 26.0, *)) {
|
|
if (@available(macOS 26.0, *)) {
|
|
|
- if ([_data.listener isInFullscreenSpace]) {
|
|
|
|
|
|
|
+ // do for all windows for now, not just fullscreen spaces. And hopefully remove this code entirely soon.
|
|
|
|
|
+ //if ([_data.listener isInFullscreenSpace]) {
|
|
|
int posx = 0, posy = 0;
|
|
int posx = 0, posy = 0;
|
|
|
SDL_GetWindowPosition(window, &posx, &posy);
|
|
SDL_GetWindowPosition(window, &posx, &posy);
|
|
|
SDL_GetGlobalMouseState(&x, &y);
|
|
SDL_GetGlobalMouseState(&x, &y);
|
|
|
x -= posx;
|
|
x -= posx;
|
|
|
y -= posy;
|
|
y -= posy;
|
|
|
- }
|
|
|
|
|
|
|
+ //}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_13_2) {
|
|
if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_13_2) {
|