Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2020.3
2020.3.22f1
2021.2
2022.1
Issue ID
1384876
Regression
No
Main Player window is moved to the primary display when it's launched on a 3rd monitor and the 2nd monitor is activated
Main Player window is moved to the primary display when it's launched on a 3rd monitor and a 2nd monitor is activated with Display.Activate()
How to reproduce:
1. Have 3 monitors connected
2. On the Desktop, create a new Shortcut (Right-click > New > Shortcut)
3. Click "Browse" and navigate to the location of the attached build's "monitor" executable "monitor.exe"
4. Add the argument " -monitor 3" to the end of the executable's location
5. Click "Next" and "Finish"
6. Launch the newly created Shortcut
Expected result: The Player is launched and stays on the 3rd monitor
Actual result: The Player is launched on the 3rd monitor and moves to the primary monitor
Reproducible with: 2019.4.33f1, 2020.3.24f1, 2021.2.5f1, 2022.1.0b1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
Resolution Note:
This is by design. When using multi-display API, each window gets assigned their own display and primary window will always get assigned the primary display. Otherwise, you could get into situation where the one of the displays has two windows on it and the primary display has none.
If you don't like this behaviour, you can work around it in your scripts:
1. Before calling display.Activate(), call GetWindowRect() Windows API to find window position;
2. display.Activate() displays;
3. Wait 1 frame;
4. Call SetWindowPos() Windows API with coordinates obtained from GetWindowRect() to restore the desired position.
In Unity 2021.2, you can use Screen.MoveMainWindowTo() API instead.