[SOLVED] How to get correct mouse coords on Macs with a notch-display?

I have a problem on macOS with SDL2 in fullscreen mode. On Macs with a notch in the display (f.ex. MacBook Air M2), the SDL render starts below the notch, and so does the mouse cursor, but the mouse Y offset (when using SDL2 to read the mouse position) starts at offset 36 instead of 0, because it takes the notch into account. This confuses my code, as it thinks the mouse is further down in the SDL render than it actually is.

How can I solve this problem? My code needs to work on Macs regardless of a notch being present in the display or not.

I write code using C (not Objective-C), so I don’t know if I can just call a macOS API function to detect the height of an eventual notch.

Apparently it was as easy as using SDL_GetMouseState() in fullscreen mode instead of SDL_GetGlobalMouseState()!