Open GoogleCodeExporter opened 9 years ago
I applied what might be a solution to the repository. Could you try it out and
tell me if it is working now? I don't have a multiple monitor setup to do any
direct testing.
Original comment by evil.phillip@gmail.com
on 17 Mar 2012 at 6:08
I could test it on my 2 monitor setup and got the same problem: both windows
appear superimposed on the main screen.
It is perhaps a 'feature' of MacOS X Lion (I'm running latest 10.7.3)?
more info :
$ cat infos_ecrans.py
import pyglet
pyglet.options['darwin_cocoa'] = True
platform = pyglet.window.get_platform()
print "platform" , platform
display = platform.get_default_display()
print "display" , display
screens = display.get_screens()
print "screens" , screens
for i,screen in enumerate(screens):
print 'Screen %d: %dx%d at (%d,%d)' % (i,screen.width, screen.height, screen.x, screen.y)
config = pyglet.gl.Config(major_version=3, minor_version=2,
forward_compatible = True)
window = pyglet.window.Window(config=config, visible=False)
print('OpenGL version:', window.context.get_info().get_version())
print('OpenGL 3.2 support:', window.context.get_info().have_version(3,
2))
gives :
$ python infos_ecrans.py
platform <pyglet.window.Platform object at 0x2ca830>
display <pyglet.canvas.cocoa.CocoaDisplay object at 0x407e110>
screens [CocoaScreen(x=0, y=0, width=1920, height=1200), CocoaScreen(x=0,
y=-1200, width=1920, height=1200)]
Screen 0: 1920x1200 at (0,0)
Screen 1: 1920x1200 at (0,-1200)
('OpenGL version:', '2.1 NVIDIA-7.18.11')
('OpenGL 3.2 support:', False)
(my main monitor is an external monitor placed above the screen of my laptop,
hence the y = -1200 for the second screen I guess; changing the disposition of
monitors did not help)
cheers
Original comment by laurent.perrinet
on 21 Mar 2012 at 8:56
Ok, according to this thread:
http://www.cocoabuilder.com/archive/cocoa/280356-centering-window-on-the-current
-screen-not-the-main-screen.html
I think that the problem is that I'm sending the "center" message to the
NSWindows immediately after they're created, but apparently "center" always
positions the window on the main screen rather than the screen that the window
is in. So I think it can be fixed by just using some manual centering code.
I'll look at it some more later today.
Original comment by evil.phillip@gmail.com
on 21 Mar 2012 at 12:22
Pushed a new change so that windows should be centered on their screen, rather
than on the main display.
This still may not totally fix your problem, because multiple windows are set
to cascade upon open, but please let me know if you are at least able to get a
single window to open on your desired screen.
Original comment by evil.phillip@gmail.com
on 21 Mar 2012 at 10:19
Thanks for your efforts. I indeed had a change. Before, the screens were:
$ python particle.py
platform <pyglet.window.Platform object at 0x4956f30>
display <pyglet.canvas.cocoa.CocoaDisplay object at 0x4c14270>
screens [CocoaScreen(x=0, y=0, width=1920, height=1200), CocoaScreen(x=0,
y=1200, width=1920, height=1200)]
Screen 0: 1920x1200 at (0,0)
Screen 1: 1920x1200 at (0,1200)
and now they show:
$ python particle.py
platform <pyglet.window.Platform object at 0x49501b0>
display <pyglet.canvas.cocoa.CocoaDisplay object at 0x7955970>
screens [CocoaScreen(x=0, y=0, width=1920, height=1200), CocoaScreen(x=0,
y=-1200, width=1920, height=1200)]
Screen 0: 1920x1200 at (0,0)
Screen 1: 1920x1200 at (0,-1200)
however, both windows appear overlaid on one screen... perhaps someone with a
similar configuration (Mac OSX Lion + Enthought Python Distribution -- Version:
7.2-2 (32-bit) + 2 displays) could try out?
cheers,
Laurent
Original comment by laurent.perrinet
on 26 Mar 2012 at 8:54
Original issue reported on code.google.com by
laurent.perrinet
on 2 Mar 2012 at 12:27Attachments: