Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Terminal failed to restore the position in the 2nd or 3rd monitor with maximized window mode. #11639

Open
Tracked by #9800
kwkaiwang opened this issue Oct 28, 2021 · 5 comments
Labels
Area-Windowing Window frame, quake mode, tearout Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Milestone

Comments

@kwkaiwang
Copy link

kwkaiwang commented Oct 28, 2021

Windows Terminal version (or Windows build number)

1.12.2922.0

Other Software

No response

Steps to reproduce

Given two or three monitors installed.

  1. Primary monitor: 3840x2160
  2. Second monitor: 1920x1080
  3. Third monitor: 1920x1080

Steps:

  1. 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.
  2. 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.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Oct 28, 2021
@zadjii-msft
Copy link
Member

After you close the Terminal on the secondary monitor, can you copy the contents of state.json and share them here?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Oct 28, 2021
@kwkaiwang
Copy link
Author

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

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Oct 28, 2021
@zadjii-msft
Copy link
Member

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

@zadjii-msft zadjii-msft added Area-Windowing Window frame, quake mode, tearout Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Oct 28, 2021
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Oct 28, 2021
@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 29, 2021
@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, 22H2 Jan 4, 2022
@brneor
Copy link

brneor commented Sep 5, 2022

I'm geting this exact behavior even on non-maximized Windows.

@zadjii-msft zadjii-msft modified the milestones: 22H2, Backlog Dec 5, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 5, 2022
@zadjii-msft
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Windowing Window frame, quake mode, tearout Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants