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

We're not sizing the drag handle correctly all the time; it cuts off parts of the window sometimes #4166

Closed
burhan opened this issue Jan 9, 2020 · 2 comments · Fixed by #4829
Assignees
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@burhan
Copy link

burhan commented Jan 9, 2020

Environment

Windows Version: 10.0.19041.0 ("slow ring" is enabled)

image

Terminal Version (0.7.3451.0); from the Windows Store

image

Native resolution: 2560 x 1440 (14" Lenovo X1 Carbon); scaling set at 125% (changed from 150% during this issue).

Steps to reproduce

Change the scaling ratio on your screen.

Expected behavior

Terminal window scales / adjusts automatically (which happens), but the controls for minimizing / maximizing disappear.

Honestly, not sure what is the expected behavior as many apps don't adjust properly, but after opening a new window, existing window at random starts showing the controls is why I raised this issue.

Actual behavior

(two instances I had open, when I changed the scaling ratio)

image

After opening a new window, randomly, the first window starts showing the minimize/maximize controls.

image

@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 Jan 9, 2020
@DHowett-MSFT DHowett-MSFT added Area-User Interface 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. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jan 13, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jan 13, 2020
@DHowett-MSFT DHowett-MSFT added this to the Terminal v1.0 milestone Jan 13, 2020
@zadjii-msft zadjii-msft self-assigned this Feb 28, 2020
@DHowett-MSFT DHowett-MSFT changed the title maximize / restore controls disappear when changing screen scaling We're not sizing the drag handle correctly all the time; it cuts off parts of the window sometimess Mar 2, 2020
@DHowett-MSFT DHowett-MSFT changed the title We're not sizing the drag handle correctly all the time; it cuts off parts of the window sometimess We're not sizing the drag handle correctly all the time; it cuts off parts of the window sometimes Mar 2, 2020
@DHowett-MSFT
Copy link
Contributor

This is now the bug tracking the class of issues around drag bar sizing. Thanks!

@zadjii-msft zadjii-msft removed their assignment Mar 3, 2020
@zadjii-msft zadjii-msft mentioned this issue Mar 5, 2020
3 tasks
@zadjii-msft
Copy link
Member

Getting the repro working exactly for me was a little tricky, but I think I got it. For me, the trick was that the window had to be in a spot where the cursor wouldn't be on top of the window immediately after the DPI scale changes. Expect a PR soon ☺️

@zadjii-msft zadjii-msft self-assigned this Mar 6, 2020
@ghost ghost added the In-PR This issue has a related PR label Mar 6, 2020
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements and removed Help Wanted We encourage anyone to jump in on these. labels Mar 6, 2020
DHowett-MSFT pushed a commit that referenced this issue Mar 6, 2020
## Summary of the Pull Request

Pretty straightforward. When we get a `WM_DISPLAYCHANGE`, that means the
display's DPI changed. When that happens, resize the drag bar, so that
it'll reflect the new scaling.

Unblocks #4778 
Closes #4166

## Validation
Man I've changed the DPI of my displays so many times in the last 30
minutes. I dragged the window across a bunch of DPI boundaries too.
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Mar 6, 2020
ghost pushed a commit that referenced this issue Mar 7, 2020
## Summary of the Pull Request

We're deref'ing a null `_terminal`. Don't do that. This is a _okay_ fix, mostly to stem the bleeding. @DHowett-MSFT's got a mind for a real fix to #4166, but this isn't it.

## PR Checklist
* [x] related to #4166
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated
DHowett-MSFT pushed a commit that referenced this issue Mar 9, 2020
## Summary of the Pull Request

Add a `SizeChanged` handler to the titlebar content UI element. It's possible that this element's size will change after the dragbar's. When that happens, the drag bar won't send another `SizeChanged` event, because the dragbar's _size_ didn't change, only it's position.

## References

We originally duped this issue to #4166, but after #4829 fixed that issue, this one persisted. They're all related, and _look_ like dupes, but they weren't.

## PR Checklist
* [x] Closes #4288
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

## Validation Steps Performed

I had a solid 100% repro that doesn't repro anymore.

I've maximized, restored, resized, and generally played with the window a bunch.
carlos-zamora pushed a commit that referenced this issue Mar 9, 2020
## Summary of the Pull Request

Add a `SizeChanged` handler to the titlebar content UI element. It's possible that this element's size will change after the dragbar's. When that happens, the drag bar won't send another `SizeChanged` event, because the dragbar's _size_ didn't change, only it's position.

## References

We originally duped this issue to #4166, but after #4829 fixed that issue, this one persisted. They're all related, and _look_ like dupes, but they weren't.

## PR Checklist
* [x] Closes #4288
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

## Validation Steps Performed

I had a solid 100% repro that doesn't repro anymore.

I've maximized, restored, resized, and generally played with the window a bunch.
carlos-zamora pushed a commit that referenced this issue Mar 10, 2020
## Summary of the Pull Request

Add a `SizeChanged` handler to the titlebar content UI element. It's possible that this element's size will change after the dragbar's. When that happens, the drag bar won't send another `SizeChanged` event, because the dragbar's _size_ didn't change, only it's position.

## References

We originally duped this issue to #4166, but after #4829 fixed that issue, this one persisted. They're all related, and _look_ like dupes, but they weren't.

## PR Checklist
* [x] Closes #4288
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

## Validation Steps Performed

I had a solid 100% repro that doesn't repro anymore.

I've maximized, restored, resized, and generally played with the window a bunch.
carlos-zamora pushed a commit that referenced this issue Mar 10, 2020
## Summary of the Pull Request

Add a `SizeChanged` handler to the titlebar content UI element. It's possible that this element's size will change after the dragbar's. When that happens, the drag bar won't send another `SizeChanged` event, because the dragbar's _size_ didn't change, only it's position.

## References

We originally duped this issue to #4166, but after #4829 fixed that issue, this one persisted. They're all related, and _look_ like dupes, but they weren't.

## PR Checklist
* [x] Closes #4288
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

## Validation Steps Performed

I had a solid 100% repro that doesn't repro anymore.

I've maximized, restored, resized, and generally played with the window a bunch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants