Windows Terminal failed to restore the position in the 2nd or 3rd monitor with maximized window mode.
Windows Terminal version (or Windows build number)
1.12.2922.0
Other Software
No response
Steps to reproduce
Given two or three monitors installed.
- Primary monitor: 3840x2160
- Second monitor: 1920x1080
- Third monitor: 1920x1080
Steps:
- Move Windows Terminal to secondary monitor with normal size (not maximized), close it and reopen it. Windows Terminal got restored in secondary monitor which is as expected.
- Move Windows Terminal to secondary monitor with maximized size, close it and reopen it. This time, Windows Terminal windows is restored in the primary monitor instead, with the size of the secondary monitor.
Expected Behavior
Persist window layout on window close even with maximized window mode.
Actual Behavior
Windows Terminal windows is restored in the primary monitor instead, with the size of the secondary monitor.
After you close the Terminal on the secondary monitor, can you copy the contents of state.json and share them here?
initialPosition was saved on closing. state.closeWindow.json.txt "initialPosition" : "3840,1066",
However, Windows Terminal window got restored in primary monitor.
After some time, initialPosition was changed into "0,0" state.reopen.json.txt
Hmmmmmmm I wonder if the session restore in this scenario is running abreast of the "make sure the window fits on the monitor" logic. If the window was maximized, then I bet it's "too big" for the monitor, and so it gets splatted back to the origin. That's my theory, cause the state looks totally reasonable
"persistedWindowLayouts" :
[
{
"initialPosition" : "3840,1066",
"initialSize" :
{
"height" : 1048.0,
"width" : 1920.0
},
"tabLayout" :
[
{
"action" : "newTab",
"commandline" : "%SystemRoot%\\System32\\cmd.exe",
"profile" : "Command Prompt",
"startingDirectory" : "C:\\Users\\XXX",
"suppressApplicationTitle" : false,
"tabTitle" : "Command Prompt"
}
]
}
]
Might be related to #11426
I'm geting this exact behavior even on non-maximized Windows.
~Hmm. I can't seem to repro this anymore on a 1.21 canary build (with #17066 merged in). Maybe this got fixed by our most recent session restore changes? The only other theory I have is that my display topography won't repro this ever.~
Okay I actually did find that if I maximize on my third, vertical monitor, then we session restore onto the second, middle, ultrawide one. So at least I've got a repro