Skip to content

Fullscreen mouse y-direction offset on Mac OS devices with camera notch #457

Description

@Sethur

On Mac OS devices with camera notch (e.g. Apple Silicon Macbooks), when rendering in full screen, the OS moves the drawable screen area below the camera notch but reports the wrong y-resolution when calling SDL_GetDesktopDisplayMode(...).

This lead to an improper calculation of m_flMouseYScale, which then leads to mouse clicks targeting the wrong area, i.e. users have to aim below the buttons in the menu to hit them.

To fix this, we have to call SDL_GL_GetDrawableSize(...) which should return the proper resolution for all system.

I have created a PR #456 that solves this issue. It should also work on Windows and Linux, but I have only tested it on Mac OS with a camera-notch device using all offered resolutions in windowed and fullscreen mode.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions