Re: [psychopy-users] Drawing on multiple screens; Screen initialization problem; Windows are all on one monitor

1,515 views
Skip to first unread message

Michael MacAskill

unread,
Sep 20, 2012, 5:20:09 PM9/20/12
to psychop...@googlegroups.com
Dear Jan,

In the lines where you create your windows, specify which screen to use, e.g.:

mainWin = visual.Window([800,800], units='norm', screen=0)
secondWin = visual.Window([800,800], units='norm', screen=1)

Your operating system will have an index which identifies each monitor. That can be found from the Windows control panel and similarly I think in OS X, but generally 0 and 1 should work if you have two displays, and trial and error will quickly show which is which.

Regards,

Michael


On 21 Sep, 2012, at 00:49, Jan Zimmermann <mal...@gmail.com> wrote:

> Dear humble group,
>
> I am encountering a problem someone might have a simple solution for.
>
> I am trying to run an experiment which requires two separate drawing windows that are supposed to be on two different screen. Using the monitor wizard in the standalone version I can define multiple screens. All works well. However, the screens are all initialized on one of my monitors and I can't figure out how to bind a window to a particular screen.
>
> Everything else works great and as expected, only that I basically have two windows that are always started on the same monitor.. which I would want to pre allocate to different screens somehow..
>
> All the best and thanks in advance
>
> Jan

Jan Zimmermann

unread,
Sep 20, 2012, 6:01:54 PM9/20/12
to psychop...@googlegroups.com
Dear Michael,

works like a charm! Thank you very much.

Best regards

Jan

Robert Muil

unread,
Mar 13, 2013, 12:40:00 PM3/13/13
to psychop...@googlegroups.com
Dear all,

I think this behaviour is somewhat broken. On my systems, the `screen` parameter is not honoured.

Sometimes, it appears to work on the first invocation of a user session (login) but then no longer. The screens, whether full-screen or not, appear on the first screen regardless of the value of `screen`.

I am running psychopy 1.76.0.

I am running with the awesome window manager but I believe it is also so under the normal gnome window manager of Ubuntu ~10.

I have tried this with pyglet directly, and it works (so it is possible)

Failing Psychopy code:
  from psychopy import visual as v
 
from psychopy import event as e
  w1
= v.Window(screen = 0)
  w2
= v.Window(screen = 1)

Working pyglet code: (pyglet requires fullscreen for the screen designation to function)
screens = pyglet.window.get_platform().get_default_display().get_screens()
w0 = pyglet.window.Window(screen=screens[0])
w1
= pyglet.window.Window(screen=screens[1])
w0
.set_fullscreeen(True)
w1.set_fullscreeen(True)

Any help much appreciated,

Cheers,
Rob.
On Thursday, September 20, 2012 11:20:47 PM UTC+2, Michael MacAskill wrote:

Jonathan Peirce

unread,
Mar 13, 2013, 12:42:51 PM3/13/13
to psychop...@googlegroups.com
If it requires fullscreen under pyglet, try using fullscreen mode under psychopy:

  from psychopy import visual as v
 
from psychopy import event as
e
  w1
= v.Window(screen = 0, fullscr=True)
  w2
= v.Window(screen = 1, fullscr=True)
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/lQfDzHHTW7YJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk



Robert Muil

unread,
Mar 13, 2013, 2:15:44 PM3/13/13
to psychop...@googlegroups.com
Thank you for your immediate response.

Unfortunately I had already tried that (and tried again now) - it does not work either.

Interestingly, it seems actually to work initially and then immediately flick to the first screen: I see the second monitor flicker when the windows are initialised, and I see the following warnings:
0.4787 WARNING Creating new monitor...
0.7565 WARNING User requested fullscreen with size [800 600], but screen is actually [1600, 900]. Using actual size
1.6697 WARNING Creating new monitor...
1.6714 WARNING User requested fullscreen with size [800 600], but screen is actually [1440, 900]. Using actual size

which, because of the different size of my screens, I can see it is at least initially trying for the correct screen. And then it appears something pulls the window to the other screen.

Also, it appears the `pos` argument is also ignored (for non-fullscreened windows). I suppose this is related. It is also worth noting that this does sometimes work, and the best I can tell you at the moment is that it seems to work on the first invocation after login, but then reverts to ignoring these arguments.

Rob.

Robert Muil

unread,
Mar 13, 2013, 2:25:43 PM3/13/13
to psychop...@googlegroups.com
FYI: I've tried this:
1. on a system with same-size dual screens and a system with different sized screens
2. on a system using the Gnome Desktop 2.32 window manager
3. on a system using the awesome window manager 
3. on Ubuntu 10.10 (Maverick) with PsychoPy 1.73.06
4. on Ubuntu 12.10 (quantal) with PsychoPy 1.76

And in all cases it fails with Psychopy and works with pyglet there.

Robert Muil

unread,
Mar 14, 2013, 6:45:40 AM3/14/13
to psychop...@googlegroups.com
Another update: in lieu of more expert advice, I've fiddled around with the PsychoPy code a little, and I think a possible fix is simply to stop the _setupPyglet() function from updating the position of the window if the window is to be fullscreen.

Here's a unified diff of what I suggest:
--- visual.orig.py 2013-03-14 11:37:02.017460288 +0100
+++ visual.py 2013-03-14 11:39:34.773462670 +0100
@@ -961,7 +961,8 @@
         if self.pos==None:
             #work out where the centre should be
             self.pos = [ (thisScreen.width-self.size[0])/2 , (thisScreen.height-self.size[1])/2 ]
-        self.winHandle.set_location(self.pos[0]+thisScreen.x, self.pos[1]+thisScreen.y)#add the necessary amount for second screen
+        if not self._isFullScr:
+            self.winHandle.set_location(self.pos[0]+thisScreen.x, self.pos[1]+thisScreen.y)#add the necessary amount for second screen
 
         try: #to load an icon for the window
             iconFile = os.path.join(psychopy.prefs.paths['resources'], 'psychopy.ico')

Rob.

Jonathan Peirce

unread,
Mar 14, 2013, 7:45:24 AM3/14/13
to psychop...@googlegroups.com

Robert Muil

unread,
Mar 14, 2013, 8:30:48 AM3/14/13
to psychop...@googlegroups.com
Wonderful, thanks very much indeed!

Rob.

Matt Pontifex

unread,
Nov 18, 2014, 5:40:44 PM11/18/14
to psychop...@googlegroups.com
I am experiencing a similar problem on an iMac running OS X Yosemite in v1.81.02 

from psychopy import visual, core
import pyglet

allScrs = pyglet.window.get_platform().get_default_display().get_screens()
print allScrs

mainWin = visual.Window([800,800], units='norm', fullscr=True, screen=0) 
secondWin = visual.Window([800,800], units='norm', fullscr=True, screen=1) 

core.wait(3.0)

On OSX, both windows are presented on the iMac monitor. One window full screen, the other as a smaller window in the upper left quadrant of the iMac monitor.  Nothing is displayed on the separate monitor
pyglet reports:
[CarbonScreen(x=0, y=0, width=2560, height=1440), CarbonScreen(x=-1280, y=0, width=1280, height=720)]

On Windows7, the code correctly runs full screen on each separate monitor.
pyglet reports:
[Win32Screen(x=1920, y=0, width=1920, height=1080), Win32Screen(x=0, y=0, width=1920, height=1080)]


Do you have any suggestions on how to display multiple monitors using OSX?

Jonathan Peirce

unread,
Nov 19, 2014, 5:02:46 AM11/19/14
to psychop...@googlegroups.com
I'm afraid that from Maveriks onwards OSX doesn't allow the second window ever to be in true full-screen mode. As I understand, this simply isn't possible using any software.

Your (not great) workaround is simply to create a window the size of the screen although the timing is then less good. This is one of the reasons that Mario Kleiner advises his users never to go mac for serious experiments! (I don't go that far but this issue is indeed annoying).

cheers,
Jon
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages