WM_NCHITTEST returns HTCAPTION for client area and tabs #12071

Open
opened 2026-01-31 03:05:38 +00:00 by claunia · 4 comments
Owner

Originally created by @chaohershi on GitHub (Jan 15, 2021).

Description of the new feature/enhancement

Please consider placing the tabs into the client area instead of the title bar. Right now the tabs are in the correct place only with setting "showTabsInTitlebar": false,. This will cause problems with softwares that utilize the title bars.

Snipaste_2021-01-14_22-36-17
Default settings

Snipaste_2021-01-14_22-32-35
"showTabsInTitlebar": false,

Proposed technical implementation details (optional)

Take a look at Edge browser. Edge used to place everything in the title bar as well, but now it has been fixed.

Snipaste_2021-01-14_22-39-10

Originally created by @chaohershi on GitHub (Jan 15, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement Please consider placing the tabs into the client area instead of the title bar. Right now the tabs are in the correct place only with setting `"showTabsInTitlebar": false,`. This will cause problems with softwares that utilize the title bars. ![Snipaste_2021-01-14_22-36-17](https://user-images.githubusercontent.com/22566267/104679562-f25d3580-56bb-11eb-9901-41be78851300.png) Default settings ![Snipaste_2021-01-14_22-32-35](https://user-images.githubusercontent.com/22566267/104679573-f7ba8000-56bb-11eb-9fe5-9e96149a8d3f.png) `"showTabsInTitlebar": false,` <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) Take a look at Edge browser. Edge used to place everything in the title bar as well, but now it has been fixed. ![Snipaste_2021-01-14_22-39-10](https://user-images.githubusercontent.com/22566267/104679588-fee18e00-56bb-11eb-9e4d-5f5a4bf787c0.png) <!-- A clear and concise description of what you want to happen. -->
Author
Owner

@zadjii-msft commented on GitHub (Jan 15, 2021):

Well, that's certainly an interesting one. Thanks for finding this!

@zadjii-msft commented on GitHub (Jan 15, 2021): Well, that's certainly an interesting one. Thanks for finding this!
Author
Owner

@DHowett commented on GitHub (Jan 17, 2021):

I've updated the title to more accurately represent what is happening.

Offending code is in NonClientIslandWindow.cpp, NonClientIslandWindow::_OnNcHitTest.

@DHowett commented on GitHub (Jan 17, 2021): I've updated the title to more accurately represent what is happening. Offending code is in `NonClientIslandWindow.cpp`, `NonClientIslandWindow::_OnNcHitTest`.
Author
Owner

@RamonUnch commented on GitHub (Feb 14, 2021):

I did encounter this problem while developping the AltDrag software.
It could be nice if it could be fixed. It forces me to treat Windows Terminal as a spetial case
I will infiorm my users that setting the "showTabsInTitlebar": false, fixes the problem.

@RamonUnch commented on GitHub (Feb 14, 2021): I did encounter this [problem ](https://github.com/RamonUnch/AltDrag/issues/11) while developping the [AltDrag](https://github.com/RamonUnch/AltDrag) software. It could be nice if it could be fixed. It forces me to treat Windows Terminal as a spetial case I will infiorm my users that setting the "showTabsInTitlebar": false, fixes the problem.
Author
Owner

@zadjii-msft commented on GitHub (Sep 1, 2021):

Notes from a mail thread

What they're doing is not really supported (or at least not expected by any of this newer input magic code), and I think you only get the proper behavior if you're actual input rather than some random process calling WindowFromPoint + SendMessage(WM_NCHITTEST). I agree though you could probably make your implementation return "the right thing" even though the OS would never ask you for those regions.

So I'll probably need to roll a scratch test app to be able to investigate this fully.

@zadjii-msft commented on GitHub (Sep 1, 2021): Notes from a mail thread > What they're doing is not really supported (or at least not expected by any of this newer input magic code), and I think you only get the proper behavior if you're actual input rather than some random process calling `WindowFromPoint` + `SendMessage(WM_NCHITTEST)`. I agree though you could probably make your implementation return "the right thing" even though the OS would never ask you for those regions. So I'll probably need to roll a scratch test app to be able to investigate this fully.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12071