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

Opening windows on extended screen #196

Open
typemytype opened this issue Oct 10, 2023 · 0 comments
Open

Opening windows on extended screen #196

typemytype opened this issue Oct 10, 2023 · 0 comments

Comments

@typemytype
Copy link
Member

The window on the extended screen opens at the bottom of the screen instead of positioned at the top, honouring the vanilla posSize (the default when no left and top are given is 100 for both)

This is using the _calcFrame (which is used everywhere, and works perfect, only with screen frames it gives a wrong top value.

import vanilla
import AppKit
from vanilla.vanillaBase import _calcFrame

w = vanilla.Window((0,0, 300, 300))

screen = AppKit.NSScreen.mainScreen()
frame = screen.visibleFrame()
print(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height)
frame = _calcFrame(screen.visibleFrame(), ((100, 100), (300, 300)))
print(frame)
for other in AppKit.NSApp().orderedWindows():
    (oL, oB), (oW, oH) = other.frame()
print(oL, oB)            
# w.open()

output on the main screen:

0.0 48.0 2560.0 1367.0
((100, 967.0), (300, 300))  # top is different
0.0 1067.0

output on the extended screen:

-2560.0 0.0 2560.0 1415.0
((100, 1015.0), (300, 300)) # top is different
-2560.0 283.0

interestingly the top from the frame being calculated with _calcFrame is different from the oB from the window frame. (without cascading as the posSize has 4 values)

I have no solution for now, but it should be fixed within vanilla...

something similar #60

ryanbugden added a commit to ryanbugden/Slinky that referenced this issue Oct 10, 2023
Should be fixed in vanilla. See robotools/vanilla#196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant