-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Environment: macOS 15.6.1 (likely affects other systems as well)
When using an external display, the zoom does not follow the mouse correctly along the Y axis. The X axis behaves correctly, while zoom is fixed vertically to the top of the display.
Steps to reproduce:
- Arrange an external display above the main display.
- Move the mouse across the external display while using zoom.
Observed behavior
- The zoomed area does not track the mouse properly along Y.
Root cause
Look at the two following screenshots, and note the final value of the display name.
When the external display is arranged above the main display, the Y value is positive…
When the external display is arranged below the main display, the Y value is negative…
The get_monitor_info function extracts the monitor’s top-left coordinates from the display name using this regex:
x, y = found:match("(-?%d+),(-?%d+)")
OBS reports mouse positions relative to the main display's origin (top left):
- When the mouse is above the main display, the Y coordinate is negative.
- When the mouse is below the main display, the Y coordinate is positive.
This is the inverse behavior of how the monitor position is reported.
Later, the mouse position is calculated relative to the monitor using:
if monitor_info then
mouse.x = mouse.x - monitor_info.x
mouse.y = mouse.y - monitor_info.y
end
This subtraction assumes the monitor Y coordinate is positive relative to the main display, which is not true when the monitor is above the primary display.
Solution
Invert the Y value when parsing in get_monitor_info:
info.y = -tonumber(y, 10)
This aligns the monitor offset with OBS’s global mouse coordinates, fixing the vertical tracking on external displays.

