Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window position reported incorrectly in multi-monitor scenarios #1625

Closed
CharlieHess opened this issue May 8, 2015 · 5 comments · Fixed by #1636
Closed

Window position reported incorrectly in multi-monitor scenarios #1625

CharlieHess opened this issue May 8, 2015 · 5 comments · Fixed by #1636

Comments

@CharlieHess
Copy link
Contributor

Starting in v0.25.2, I'm seeing an inconsistency in what window.getPosition returns. The bug seems to be exclusive to OS X. I have two monitors set up, with the primary display set as the rightmost (thus placing the secondary display in a negative coordinate space). Here's what the screen API returns for their bounds:

[0,0,1280,800]
[-2560,0,0,1440]

On Windows, when I position the window at the top of the secondary display, the bounds of the window (i.e., p[0], p[1], p[0]+s[0], p[1]+s[1]) seem reasonable:

[-1799,0,-712,746]

But on OS X, the y-coordinate has an offset applied:

[-1652,925,-742,1629]

That throws off all of our bounds checks. 😢

@anaisbetts
Copy link
Contributor

I think @tommoor was mentioning he was seeing similar strangeness

@tommoor
Copy link
Contributor

tommoor commented May 8, 2015

@paulcbetts Indeed - I have an issue that I think might be related. Using either setPosition or the new setBounds API the position is set on the currently focused screen rather than being fixed. Ie:

  • Click to focus some other application on screen 1
  • setPosition(100,100)
  • Click to focus some other application on screen 2
  • setPosition(100,100)

The window will move to two different locations. I can split this out into a separate issue if needed.

@deepak1556
Copy link
Member

@tommoor @CharlieHess i know wats causing your issue mainScreen . @zcbenz setPosition and getPosition relying on setBounds and getBounds now, on OSX are using the current focused screen values. Should move it to primary screen instead ? I dont have a multi monitor setup to patch and test , can anyone here try a PR ?

@tommoor
Copy link
Contributor

tommoor commented May 9, 2015

I can test an osx binary 😉 but not set up to build the code locally. I think that's almost definitely the issue though @deepak1556

@zcbenz
Copy link
Member

zcbenz commented May 10, 2015

@tommoor @CharlieHess i know wats causing your issue mainScreen . @zcbenz setPosition and getPosition relying on setBounds and getBounds now, on OSX are using the current focused screen values. Should move it to primary screen instead ? I dont have a multi monitor setup to patch and test , can anyone here try a PR ?

Yeah we should use the primary screen, sorry that's my fault.

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

Successfully merging a pull request may close this issue.

5 participants