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

Terminal startup location partially off Desktop #3187

Open
csylvain opened this issue Oct 14, 2019 · 21 comments
Open

Terminal startup location partially off Desktop #3187

csylvain opened this issue Oct 14, 2019 · 21 comments
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. 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

@csylvain
Copy link

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
 10.0.18362.418
Windows Terminal version (if applicable):
 0.5.2762.0

Any other software?

Steps to reproduce

  1. change "initialRows": 44 in Settings
  2. change "defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}" # ubuntu-18.04
  3. Start -> Windows Terminal (Preview)

Expected behavior

entire Terminal with default profile on screen in its entirety is expected to be seen on Desktop

Actual behavior

Terminal appears to open with 14 lines off the bottom of the Desktop (behind and below the Taskbar). there does not seem to be "initialXpos" nor "initialYpos" in Settings to manually place Terminal in its entirety on the Desktop.

@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 14, 2019
@DHowett-MSFT
Copy link
Contributor

Hey thanks! This is a /dupe of #1043

@ghost
Copy link

ghost commented Oct 14, 2019

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Oct 14, 2019
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed 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 14, 2019
@csylvain
Copy link
Author

notfixed by #2817
different than #1043 -- if i close Terminal in position where it is entirely on the Desktop, then start Terminal again and it's back to the partially off Desktop position again. i reported an issue because there does not seem to be a workaround.

@DHowett-MSFT

This comment was marked as resolved.

@DHowett-MSFT DHowett-MSFT reopened this Oct 14, 2019
@ghost

This comment was marked as resolved.

@ghost ghost closed this as completed Oct 15, 2019
@csylvain

This comment was marked as resolved.

@DHowett-MSFT

This comment was marked as resolved.

@DHowett-MSFT DHowett-MSFT reopened this Oct 15, 2019
@DHowett-MSFT DHowett-MSFT removed the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Oct 15, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Oct 15, 2019
@DHowett-MSFT DHowett-MSFT added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. labels Oct 15, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 15, 2019
@DHowett-MSFT DHowett-MSFT added this to the Terminal Backlog milestone Oct 15, 2019
@DHowett-MSFT
Copy link
Contributor

Incoming notes from #4681

Environment

Windows build number: 1903  Build 18362.657
Windows Terminal version (if applicable):  0.9.433.0

Any other software?

Steps to reproduce

  1. Change the settings to have a large number of lines, but a number that will fit on your screen, but only by an inch or so.
  2. Start Windows Terminal repeatedly, noting that,eventually, the bottom of the terminal window goes beyond the bottom of the screen. This may take several attempts before the 'default' start position is too close to the bottom of the screen.

Expected behavior

I expect (hope?) that modern programs either save/restore the previous window size & position OR that the programs ensure that their entire window is visible when started.

If the window is larger than the screen, I would expect either

  • The top,left corner of the window to be at the top,left corner of the monitor
  • Optionally, the window size adjusted to fit on the screen automatically or, in the case of a terminal window, perhaps the font size adjusted downward until the window fits on the screen.

Actual behavior

I had my terminal configured to a rather large font and 50 lines at startup. This morning when I started it, the bottom 1/4 to 1/3 (I'm guessing) of the terminal window was below the bottom of the screen. There was more than enough space on screen ABOVE the terminal and it was easy enough to move, but the code should not require me to move it in order to see the whole window when it first loads!

@DHowett-MSFT DHowett-MSFT added the Priority-3 A description (P3) label Apr 3, 2020
@dynahcatq
Copy link

I'm looking at this issue and I have some questions:

  1. the programs ensure that their entire window is visible when started <- Can a user overwrite this behavior? Suppose they set the initialPosition in settings.json and half of the window is not visible, should we adjust the window's position?
  2. If the window is too large to fit the screen, should we adjust window to fit the screen or reposition it to top-left corner?

@csylvain
Copy link
Author

csylvain commented Apr 28, 2020 via email

@dynahcatq
Copy link

@csylvain So when a user specified an initialPosition that would cause the off-screen coordinates, we should correct all 4 coordinates to be within the screen right?

@csylvain
Copy link
Author

csylvain commented Apr 28, 2020 via email

@dynahcatq
Copy link

@DHowett-MSFT Hi, after taking a look at the issue I would like to propose a fix to the issue.

  1. Check the window's 4 corners (top-left, bottom-left, top-right, bottom-right) to determine if it is out of screen and reset top-left to (monitorInfo.rcWork.top, monitorInfo.rcWork.left), which normally will be (0, 0).
  2. If the window's size should fit in the monitor, check if partial window is behind the taskbar (reset top-left coord if taskbar overlap).

What do you think?

@DHowett-MSFT
Copy link
Contributor

We'd definitely be willing to accept contributions that improve the art here 😄

@DHowett-MSFT
Copy link
Contributor

(We need to consider, of course, how folks may have multi-monitor layouts and the application could be at a negative position with regards to the primary display.)

@dynahcatq
Copy link

For the first part, I'm planning to use EnumDisplayMonitors to deal with multi-monitor layouts. So if four corners are in different monitor, it will be treated as visible and will not trigger the reset.

@csylvain
Copy link
Author

csylvain commented Apr 29, 2020 via email

@ghost ghost added the In-PR This issue has a related PR label Apr 30, 2020
@Poopooracoocoo
Copy link

I use Sizer from BrianApps and it bugs me that Terminal doesn't remember the size and position. Most apps work great with Sizer. I also cannot right click on the title bar buttons to show Sizer's context menu. Speaking of the title bar, the elements in it don't "fade" when it's inactive. I'm pretty sure Terminal has a custom title bar.

@Poopooracoocoo
Copy link

@DHowett hey are there any updates on the priority of this?

@zadjii-msft
Copy link
Member

two thoughts looking at random other code:

  • We could absolutely pass the expected width&height of the default settings for the window into the call to CreateWindow. That would at least put the default window at a sensible place.
  • We probably could adjust the window position in AppHost::_initialResizeAndRepositionWindow. At that point, the settings would be loaded. That method is gonna try and calculate the starting pos & size. So it can know both. That's a place where we could make some adjustments to the initial position if
    • it was unset in the settings
    • the current dimensions would take it outside the bounds of the monitor

I dunno if we could be more preemptive and pass _windowLogic.GetInitialPosition et al. into the call to CreateWindow. I don't think so.

@64-bitman
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. 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

Successfully merging a pull request may close this issue.

6 participants