Skip to content

fix: mac: fix coordinate conversion for secondary display in fullscreen - #55159

Open
VishalBhat07 wants to merge 1 commit into
electron:mainfrom
VishalBhat07:fix-secondary-display-fullscreen-coordinates-v2
Open

VishalBhat07 wants to merge 1 commit into
electron:mainfrom
VishalBhat07:fix-secondary-display-fullscreen-coordinates-v2

Conversation

@VishalBhat07

Copy link
Copy Markdown

Description of Change

Fix coordinate conversion for secondary displays in fullscreen mode on macOS.

Three methods in native_window_mac.mm (SetBounds, GetBounds, GetNormalBounds) used the primary screen ([[NSScreen screens] firstObject]) for coordinate conversion instead of the window's actual screen ([window_ screen]). This caused incorrect coordinates when the window was on a secondary display in fullscreen mode.

Checklist

  • I have read the Contributing Guidelines
  • I have signed my commits
  • JS lint passes (npm run lint:js)
  • Build passes on CI
  • Tests pass on CI

Release Notes

Fixes #40599: Clicking a -webkit-app-region: no-drag element inside a drag region on a secondary display in fullscreen mode now works correctly. Previously, stray pointermove events with incorrect coordinates were generated, causing clicks to be lost and drags to start incorrectly.

Fix SetBounds, GetBounds, and GetNormalBounds to use the window's screen
([window_ screen]) instead of always using the primary screen
([[NSScreen screens] firstObject]) for coordinate conversion.

This fixes a bug where clicking a -webkit-app-region: no-drag element
inside a drag region on a secondary display in fullscreen mode would
generate stray pointermove events with incorrect coordinates (offset by
the secondary display's position relative to the primary), causing
clicks to be lost and drags to start incorrectly.

Fixes electron#40599
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR contains unsigned commits. This repository enforces commit signatures
for all incoming PRs. To get your PR merged, please sign those commits
(git rebase --exec 'git commit -S --amend --no-edit -n' @{upstream}) and force push them to this branch
(git push --force-with-lease)

For more information on signing commits, see GitHub's documentation on Telling Git about your signing key.

@github-actions github-actions Bot added the needs-signed-commits Currently some or all of the commits in this PR are not signed label Oct 21, 2026

This branch has not been deployed

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

Labels

needs-signed-commits Currently some or all of the commits in this PR are not signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: First mousemove event after click returns greater than expected values on Sonoma with specific display configuration

1 participant