-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Window border width does not respect system theme #1859
Comments
Is there a way to change the width of the window borders without installing a third-party theme installer? I'm going to guess that this is a subset of #1625, assuming that the border width is in fact a system theme property we can query |
That’s the wrong question to ask. The right question is, if every other app seems able to honor the third-party theme, why won’t Windows Terminal? |
Unfortunately, it is the right question to ask. There's a lot of history here for us to unravel, the earliest part of which is "why is it so hard to draw in the titlebar" and the latest part of which is "now that we're drawing in the titlebar, why was it decided by the win32 kernel driver and desktop window compositor that we absolutely must handle all of this ourselves? it's like this system was never actually designed but instead organically grown." We're a fairly simple UI with fairly simple requirements, but one of those requirements is "have a custom color in our title bar." Unfortunately, that means:
I spent almost my entire sunday trying to answer all of the questions that arise from this list. It's not due to ignorance that we're asking the questions that we are. |
Incidentally, the work merged in #929 does bring back theme-sized drag handles, they just look like a black hole opened up and consumed the contents of your display. ;) Under all of the theming slapped down by the desktop compositor is actually just the Windows Vista Aero Basic theme with all of its rounded corners and weird thick window borders. |
And from that "requirement" stems the plethora of other problems. Instead, revisit that requirement -- why is it a requirement? Why does this app think it needs to be "more special" than other Windows applications and thus inconsistent with them (and likely less compatible with other system-wide UI changes that may come in future major Windows revisions)? Can the problem that "requirement" is trying to solve be better solved instead via some other design choice that avoids all the myriad technical issues created by the current approach? |
This might be better with recent dev builds. We're giving DWM a lot more control over the window frame than we were prior. |
That sounds like a wise approach to me. 👍 |
Border width issue becomes worse the higher resolution is used, at 4K (even with 200% dpi scaling) you still have 2 pixel area to place mouse over to catch the resizer. |
Probably because the Windows Console is a hot mess of legacy spaghetti code (it used to be a whole lot worse before 2014) and the Windows Terminal has to interface with it, so it needs to be a Win32 executable, as UWP apps are sandboxed, and therefore don’t have access to system internals (e.g. the Windows Console). |
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.
🎉This issue was addressed in #3394, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Expected behavior
Windows Terminal should also respect the theme's window border width.
Actual behavior
Windows Terminal has a zero-width window border in defiance of the system theme, making it nearly impossible to resize.
The text was updated successfully, but these errors were encountered: