Skip to content

Notification toasts are unclickable on macOS Retina (HiDPI) displays #850

Description

@lunaynx

Original reporter & ticket id

No response

Category

HUD

Bug description

On macOS with a Retina display, notification toasts are not clickable because click coordinates are calculated incorrectly. Installing Sodium Extra and enabling the "Reduce Resolution on macOS" option fixes it. Confirmed on both 1.21.1 and 26.2.

Steps to reproduce

  1. Launch a client with OneConfig installed on a Mac with a Retina display and no Sodium Extra/retiNO/etc. suppressing Retina scaling
  2. Trigger a OneConfig toast notification
  3. Open chat/inventory and try to click it

Anything else?

Cause: ToastInput.mouseX/mouseY are the raw GLFW cursor position posted by Mixin_MouseInputEvent#mouseMoveCallback (MouseHandler.onMove), which is in window points. NotificationsRenderer.handleInput divides them by scale = guiScale * BASE_SCALE and hit-tests against a viewport of screenWidth * guiScale / scale, which is in framebuffer pixels (getGuiScaledWidth() is derived from framebufferWidth). Minecraft applies the missing correction in MouseHandler.getScaledXPos: xpos * window.getGuiScaledWidth() / window.getScreenWidth(), where getScreenWidth() is the window size and getWidth() is the framebuffer. With a 2× backing scale the hover point resolves to half the real cursor position; since toasts are anchored BottomRight, they become entirely unreachable.

Suggested fix: Scale the cursor position by the backing ratio window.getWidth() / window.getScreenWidth() before the hit test. Note NotificationsRenderer is in the platform-agnostic notifications module, so this likely needs a new Platform/Options accessor for the backing scale factor — or the correction applied at the post site. If done at the post site, MouseInputEvent.Moved's documented "SCREEN coordinates" contract changes, which may affect other consumers, so a separate corrected field may be safer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions