[PR #3347] Fix tab row doesn't grow #25324

Open
opened 2026-01-31 09:08:45 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/3347

State: closed
Merged: No


Summary of the Pull Request

Fix the bug where resizing the window to a smaller size makes the tab row shrink but it doesn't grows back to its original size when the window is resized to its original size.

References

PR Checklist

  • Closes Bug Report - PowerShell Tool not working in Azure Cloud Shell. (#3300)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

I don't really understand the bug but I managed to solve it by changing things so I don't know if this is a good PR.

Anyways, here is how I fixed the bug:

We need to make sure that both the tab row and the drag bar grow as much as they can, but we give priority to the tab row.

Before, the solution was to manually set the tab row's maximum size by taking the title bar's size and subtracting the drag bar and min-max-close buttons' size.

I think I found a better solution that for some reason fixes this bug: I decided to put the drag bar inside the tab row and let the tab row extend as much as it can.

Other changes:

  • I also removed TabRowControl::OnNewTabButtonClick because it was not used anywhere (the TerminalPage listens for the click itself)? I can add it back or make a separate PR if needed.
  • Finally, I was going to move TitleBar::DragBar_DoubleTapped into the TabRowControl but I ran the terminal and it worked without it. So I just removed it and double click to maximize still works. Maybe DefWindowProc is already implementing double click on title bar to maximize based on what WM_NCHITTEST returns? I tried returning HTNOWHERE everytime for WM_NCHITTEST and the double click on title bar to maximize no longer worked. Also, when I put a breakpoint in TitleBar::DragBar_DoubleTapped, I found that it was not even called anyways. EDIT: TitleBar::DragBar_DoubleTapped is not called because the Xaml doesn't handle the drag bar because of #929.

Validation Steps Performed

I checked if it was fixed.

Before:
bug

After:
nobug

**Original Pull Request:** https://github.com/microsoft/terminal/pull/3347 **State:** closed **Merged:** No --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Fix the bug where resizing the window to a smaller size makes the tab row shrink but it doesn't grows back to its original size when the window is resized to its original size. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #3300 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments I don't really understand the bug but I managed to solve it by changing things so I don't know if this is a good PR. Anyways, here is how I fixed the bug: We need to make sure that both the tab row and the drag bar grow as much as they can, but we give priority to the tab row. Before, the solution was to manually set the tab row's maximum size by taking the title bar's size and subtracting the drag bar and min-max-close buttons' size. I think I found a better solution that for some reason fixes this bug: I decided to put the drag bar inside the tab row and let the tab row extend as much as it can. Other changes: - I also removed `TabRowControl::OnNewTabButtonClick` because it was not used anywhere (the TerminalPage listens for the click itself)? I can add it back or make a separate PR if needed. - Finally, I was going to move `TitleBar::DragBar_DoubleTapped` into the `TabRowControl` but I ran the terminal and it worked without it. So I just removed it and double click to maximize still works. Maybe `DefWindowProc` is already implementing double click on title bar to maximize based on what `WM_NCHITTEST` returns? I tried returning `HTNOWHERE` everytime for `WM_NCHITTEST` and the double click on title bar to maximize no longer worked. Also, when I put a breakpoint in `TitleBar::DragBar_DoubleTapped`, I found that it was not even called anyways. **EDIT:** `TitleBar::DragBar_DoubleTapped` is not called because the Xaml doesn't handle the drag bar because of #929. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed I checked if it was fixed. Before: ![bug](https://user-images.githubusercontent.com/56923875/67636681-64890500-f8d3-11e9-8d11-69e9a1c26763.gif) After: ![nobug](https://user-images.githubusercontent.com/56923875/67636683-681c8c00-f8d3-11e9-9e34-7c3f5aae0486.gif)
claunia added the pull-request label 2026-01-31 09:08:45 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25324