Copyright © 2026 Unity Technologies
After investigating the root cause, the main window tracking the primary display is intended for multi-window applications. We're closing this as As Designed. We recommend this workaround, where this is an issue: If you need the main window to stay put while activating a secondary display, you can setup and configure a custom message handler from your own C# scripts, using Windows' modern subclassing API : On a MonoBehaviour's Start, capture the app's window handle (Process.GetCurrentProcess().MainWindowHandle) and install a subclass via SetWindowSubclass. Using a subclass (identified by a dedicated SubclassId) adds your callback to the window's subclass chain so it coexists cleanly with any other handler, rather than replacing the window's message handler outright. Before activating a secondary display, record the current window position (GetWindowRect) and turn on a "guard" flag. In the callback, watch for WM_WINDOWPOSCHANGING (sent just before Windows applies a move). While guarding is active, if the proposed position differs from the saved one, overwrite it back to the original coordinates, then forward the message on via DefSubclassProc. The move is silently rejected. After activation completes, clear the guard flag so the window can move freely again. Optionally, remove the subclass on application quit with RemoveWindowSubclass. This keeps the window fixed only during the display-activation window, without affecting normal behavior before or after. Full native interop sample code is available on request.
How to reproduce:
Actual result: Main screen is moved from monitor 2 to monitor 1
Expected result: Main screen remains on monitor 2
Reproducible with: 2023.1.0a3, 6000.0.73f1, 6000.3.14f1, 6000.4.5f1, 6000.5.0b6, 6000.6.0a4
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Note: Requires at least 3 displays for testing
Issues you vote on will appear here