# Fail to open a Specified size window on multi-screen display

**URL:** <https://psychtoolbox.discourse.group/t/fail-to-open-a-specified-size-window-on-multi-screen-display/5105>\
**Category:** Programming Help\
**Tags:** windows\
**Created:** [September 26, 2023, 1:25pm UTC](https://psychtoolbox.discourse.group/t/fail-to-open-a-specified-size-window-on-multi-screen-display/5105 "2023-09-26T13:25:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![VickyKang](https://avatars.discourse-cdn.com/v4/letter/v/eb9ed0/32.png) [@VickyKang](https://psychtoolbox.discourse.group/u/VickyKang)\
**Post date:** [September 26, 2023, 1:25pm UTC](https://psychtoolbox.discourse.group/t/fail-to-open-a-specified-size-window-on-multi-screen-display/5105/1 "2023-09-26T13:25:07Z")

</div>

I am using a DELL Precision 5820 tower workstation with Windows 11 system. There are three screens connected to the computer, whose resolutions are 2560_1440,1920_1080,1920\*1080 respectively. I want to open windows with same size but different centers on two small screens. One of the small screen’s screenNumber is 2.  
If I type ‘Screen(‘OpenWindow’, 2, 0,[]);’ , then the small screen will open a black window as expected.  
However if I type ‘Screen(‘OpenWindow’, 2, 0, [50,50,860,720]);’, the black window will appear on the big screen.  
It is strange that after adding the [,rect], the window does not appear on the screen with screenNumber that I want. How can I create two specified window on screen2 and screen3 with different physical centers?

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [September 26, 2023, 2:00pm UTC](https://psychtoolbox.discourse.group/t/fail-to-open-a-specified-size-window-on-multi-screen-display/5105/2 "2023-09-26T14:00:06Z")

</div>

Rect positions are not relative to the monitor specified but in a global coordinate system shared across monitors. Use Screen(‘Rect’) to get the global rect of each monitor, and use CenterRect to place your window rect in it

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [September 26, 2023, 6:35pm UTC](https://psychtoolbox.discourse.group/t/fail-to-open-a-specified-size-window-on-multi-screen-display/5105/3 "2023-09-26T18:35:27Z")

</div>

@dcnieho is sort of correct. That’s how it is done on Windows and macOS. On Linux, by design of the X-Windows display system, the origin is per X-Screen aka PTB screen, as each X-Screen is its own separate universe, so on a single-X-Screen setup this is the same as on Windows, but on multi-X-Screen it isn’t.

Always remember though that opening non-fullscreen windows will ruin any reliable visual stimulus timing/timestamping on Windows and macOS. Even on Linux you could only get trustworthy timing when running under GNOME or Ubuntu desktop GUI with some special opt-in option enabled, and reduced performance and some other restrictions. So for experiments where visual timing matters, non-fullscreen is often a no-go on Linux, and always a no-go on Windows and macOS. The same is true for partially transparent fullscreen windows.

The question is what it is you want to achieve here with those windows with different centers?

---

<div class="post-metadata">

**Author:** ![VickyKang](https://avatars.discourse-cdn.com/v4/letter/v/eb9ed0/32.png) [@VickyKang](https://psychtoolbox.discourse.group/u/VickyKang)\
**Post date:** [September 27, 2023, 1:41am UTC](https://psychtoolbox.discourse.group/t/fail-to-open-a-specified-size-window-on-multi-screen-display/5105/4 "2023-09-27T01:41:01Z")

</div>

Thanks a lot!  
I just realized this problem!

---

<div class="post-metadata">

**Author:** ![VickyKang](https://avatars.discourse-cdn.com/v4/letter/v/eb9ed0/32.png) [@VickyKang](https://psychtoolbox.discourse.group/u/VickyKang)\
**Post date:** [September 27, 2023, 1:49am UTC](https://psychtoolbox.discourse.group/t/fail-to-open-a-specified-size-window-on-multi-screen-display/5105/5 "2023-09-27T01:49:43Z")

</div>

> [@mariokleiner](#):
>
> So for experiments where visual timing matters, non-fullscreen is often a no-go on Linux, and always a no-go on Windows and macOS. The same is true for partially transparent fullscreen windows.

Yes, thanks very much for your precious advice!  
I am just doing some pre-test on a windows workstation, which does not require precise time control. We have a stereoscope system with two split monitors which present stimuli through reflection of mirror. It seems the centers of monitors are unavoidably different in two eyes. So I did a calibration first to fix this, ensuring that the windows on two monitor has same center in each eye’s view.

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [September 27, 2023, 4:21pm UTC](https://psychtoolbox.discourse.group/t/fail-to-open-a-specified-size-window-on-multi-screen-display/5105/6 "2023-09-27T16:21:56Z")

</div>

Normally you’d use `PsychImaging('Openwindow', ...)` with stereomode 4 or 5 for this and the adjust specific placement, scaling etc. via `SetStereoSideBySideParameters()`, cfe. `ImagingStereoDemo(4);`.

This also allows then to use per eye view `PsychImaging` tasks to do things like flip stimuli horizontally or vertically (tasks ‘FlipHorizontal’ and ‘FlipVertical’), use display distortion correction (cfe. `help DisplayUndistortionBVL`) etc., to deal with mirrors and such, if needed.

Either you’d display to a single ptb screen 1,2,… and use some hardware display splitter to split to two monitors, or use a single wide-screen monitor for your stereoscope, or you’d assign the two stereoscope monitors to ptb screen 1 and 2, then select screen 0 for display (which combines screen 1+2) - and hope that the latest Windows OS bugs won’t cause mayhem, as they did in some Windows releases with some graphics cards, or use Linux instead.
