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

White border at the bottom of the window. #3064

Closed
danielniccoli opened this issue Oct 4, 2019 · 15 comments · Fixed by #3394
Closed

White border at the bottom of the window. #3064

danielniccoli opened this issue Oct 4, 2019 · 15 comments · Fixed by #3394
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 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

@danielniccoli
Copy link

danielniccoli commented Oct 4, 2019

Environment

Windows build number: 10.0.18995.0
Windows Terminal version (if applicable): 0.5.2762.0

Steps to reproduce

Open Terminal app.

Expected behavior

Should not show a white border on the bottom of the window.

Actual behavior

Shows a 1 pixel thin white border on the bottom of the window.
grafik

@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 4, 2019
@carlos-zamora
Copy link
Member

#1625? @DHowett-MSFT

@carlos-zamora carlos-zamora added 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. Product-Terminal The new Windows Terminal. labels Oct 8, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 8, 2019
@sourajitk
Copy link

sourajitk commented Oct 13, 2019

Can confirm the existence of the issue. Occurs after the update to Windows Insider Preview.

@ricardosantos9521
Copy link

It also shows a 1 pixel thin white border on the left side of the window. (build 19008)

Screen Resolution: 2256x1504, Scale: 125%:
image

Screen Resolution: 1920x1080, Scale: 100%:
image

@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Oct 23, 2019
@DHowett-MSFT
Copy link
Contributor

Chatted with the DWM team, who owns the API we're using to control our non-client drawing. They've got a solution for us, but it'll take some time to implement.
I'm tagging this into #1625.

@zadjii-msft
Copy link
Member

(We think that this is going to be closely related to a bucket of things, #3136 #1859 #3064 #1307)

@AzAgarampur
Copy link

AzAgarampur commented Nov 3, 2019

@DHowett-MSFT In some of my projects, I need to use DwmExtendFrameIntoClientArea to get a window shadow. But I make my main window layered, and make the color key for the window frame transparent. I think this will solve the issue:

SetLayeredWindowAttributes(_window.get(), RGB(255, 0, 255), 0, LWA_COLORKEY);

So it would look like this:

WINRT_VERIFY(CreateWindowEx(WS_EX_LAYERED, wc.lpszClassName, L"Windows Terminal", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, nullptr, nullptr, wc.hInstance, this)); SetLayeredWindowAttributes(_window.get(), RGB(255, 0, 255), 0, LWA_COLORKEY);

Plus, you won't see the white lines at the top and bottom when resizing the window anymore.

@DHowett-MSFT
Copy link
Contributor

@Arush-Agarampur Thanks! @greg904 actually has a comprehensive fix for this in progress in #3394.

@AzAgarampur
Copy link

Ahh OK, sorry I didn't see that. First time contributing to a huge project like this... 😅

@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements and removed In-PR This issue has a related PR labels Nov 4, 2019
DHowett-MSFT pushed a commit that referenced this issue Nov 4, 2019
We take the standard window frame except that we remove the top part
(see `NonClientIslandWindow::_OnNcCalcSize`), then we put little 1 pixel
wide top border back in the client area using
`DwmExtendFrameIntoClientArea` and then we put the XAML island and the
drag bar on top.

Most of this PR is comments to explain how the code works and also
removing complex code that was needed to handle the weird cases when the
borders were custom.

I've also refactored a little bit the `NonClientIslandWindow` class.

* Fix DwmExtendFrameIntoClientArea values
* Fix WM_NCHITTEST handling
* Position the XAML island window correctly
* Fix weird colors in drag bar and hide old title bar buttons
* Fix the window's position when maximized
* Add support for dark theme on the frame
* DRY shared code between conhost and new terminal
* Fix drag bar and remove dead code
* Remove dead code and use cached DPI
* Refactor code
* Remove impossible TODO
* Use system metrics instead of hardcoding resize border height
* Use theme from app settings instead of system theme. Improve comments. Remove unused DWM frame on maximize.
* Fix initial position DPI handling bug and apply review changes
* Fix thick borders with DPI > 96

Closes #3064.
Closes #1307.
Closes #3136.
Closes #1897.
Closes #3222.
Closes #1859.
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Nov 4, 2019
zadjii-msft added a commit that referenced this issue Nov 5, 2019
## Summary of the Pull Request

Enables the `toggleFullscreen` action to be able to enter fullscreen mode, bound by default to <kbd>alt+enter</kbd>.

The action is bubbled up to the WindowsTerminal (Win32) layer, where the window resizes itself to take the entire size of the monitor.

This largely reuses code from conhost. Conhost already had a fullscreen mode, so I figured I might as well re-use that.

## References

Unfortunately there are still very thin borders around the window when the NonClientIslandWindow is fullscreened. I think I know where the problem is. However, that area of code is about to get a massive overhaul with #3064, so I didn't want to necessarily make it worse right now.  

A follow up should be filed to add support for "Always show / reveal / never show tabs in fullscreen mode". Currently, the only mode is "never show tabs".

Additionally, some of this code (particularily re:drawing the nonclient area) could be re-used for #2238.

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


## Validation Steps Performed
* Manually tested both the NonClientIslandWindow and the IslandWindow.

* Cherry-pick commit 8e56bfe

* Don't draw the tab strip when maximized

(cherry picked from commit bac4be7)

* Fix the vista window flash for the NCIW

(cherry picked from commit 7d3a18a)

* Some code cleanup for review

(cherry picked from commit 9e22b77)

* A tad bit more notes and cleanup

* Update schema, docs

* Most of the PR comments

* I'm not sure this actually works, so I'm committing it to revert it and check

* Update some comments that were lost.

* Fix a build break?

* oh no
@ghost
Copy link

ghost commented Nov 26, 2019

🎉This issue was addressed in #3394, which has now been successfully released as Windows Terminal Preview v0.7.3291.0.:tada:

Handy links:

@danielniccoli
Copy link
Author

danielniccoli commented Nov 27, 2019

That made the issue 4 times worse as you now have 4 white borders: top left right and bottom 😂

grafik

I think this issue needs to be reopened.

@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented Nov 27, 2019

You're going to hate to hear this, but it's actually "by design" -- there's no official way for an application to opt in to match the shell's "dark theme" ☹️. If we trespass on those 1px borders, DWM will give up on us and force us to draw every pixel of our application. We've seen what lies at the end of that road.

@saschanaz
Copy link

saschanaz commented Nov 27, 2019

You're going to hate to hear this (with all your effort 🙏), but could we roll it back to affect only the bottom border? 🤔

@AzAgarampur
Copy link

I don't want to come across as pushy, but I think the best idea is to fall back to the bottom border, and use the layered window attribute I commented earlier. It hides it perfectly, also while resizing.

@DHowett-MSFT
Copy link
Contributor

I appreciate your input. On the balance, though: the border pull request fixed at least seven different issues (#3064, #1307, #3136, #1897, #3222, #1859, #2268; this list does not count all the ones we later realized were caused by the same thing).
I'm willing to take a one-or-two-release regression in how terminal looks--at least until we can get it ironed out--in the name of improving our project's health.

I know that it's possible to get this right (Firefox manages it, for example), but I'd rather move forward and look for the right solution than move backward and settle on the pretty bad solution we had.

@DHowett-MSFT
Copy link
Contributor

Continuing discussion at #3425. We've figured out how to suppress the borders without using a private API. 😁

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

8 participants