-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
possible to resize terminal to a lower width than minimum width #8026
Comments
Wow yep that's a real bug. I wonder why the shell even lets that happen. Maybe there's some other window message that's sent for "I'm about to snap you to this size", which we don't reply to. |
IMHO we need to implement a handler for either WM_GETMINMAXINFO (which can be problematic if we switch the screen to a screen with another dpi-scaling during the resize) or to enforce the minimal size upon WM_WINDOWPOSCHANGING. I did a nano POC for protection in WM_WINDOWPOSCHANGING (see below). As you can see there is still some artifact of Windows rendering the "future borders" when the mouse button is still clicked. Yet it seems to be better than now. Please let me know if you want me to productize this solution. Of course this artifact goes away if we override WM_GETMINMAXINFO (see below), but as mentioned earlier this might not work properly on the boundary of screens with different DPIs. Please let me know if you think this approach (or mix of the approaches is favorable). @zadjii-msft - FYI. |
Wow both those look better. I'm thinking the |
Cool. I am doing it 😄 |
Until now, we relied on WM_SIZING to ensure that the island is not downsized below minimal allowed dimensions. However, on some occasions WM_WINDOWPOSCHANGED, e.g. when anchoring a window to the top/bottom of the screen. This message will use dimensions obtained from WM_GETMINMAXINFO. Until now we didn't override this value, falling back to the defaults. As a result we got an inconsistent behavior (at least when attaching the anchor). I added logic very similar to the one we use in IslandWindow::_OnSizing to the MINMAXINFO handler: snap the client area, add non client exclusive are, consider DPI along the computation. ## Validation Steps Performed * Manual testing of minimizing, maximizing, resizing, attaching different anchors, etc. Closes #8026
Until now, we relied on WM_SIZING to ensure that the island is not downsized below minimal allowed dimensions. However, on some occasions WM_WINDOWPOSCHANGED, e.g. when anchoring a window to the top/bottom of the screen. This message will use dimensions obtained from WM_GETMINMAXINFO. Until now we didn't override this value, falling back to the defaults. As a result we got an inconsistent behavior (at least when attaching the anchor). I added logic very similar to the one we use in IslandWindow::_OnSizing to the MINMAXINFO handler: snap the client area, add non client exclusive are, consider DPI along the computation. * Manual testing of minimizing, maximizing, resizing, attaching different anchors, etc. Closes #8026 (cherry picked from commit e3fcfcc)
🎉This issue was addressed in #8066, which has now been successfully released as Handy links: |
🎉This issue was addressed in #8066, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
Expected behavior
minimum width is enforced properly
Actual behavior
width is resized based on mouse position
![resize](https://user-images.githubusercontent.com/43626415/97038684-8e562580-1541-11eb-806b-c73a90c7fe70.gif)
The text was updated successfully, but these errors were encountered: