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

Text change size (becomes tiny) when window changes screen #487

Closed
mestreniko opened this issue Nov 5, 2015 · 24 comments
Closed

Text change size (becomes tiny) when window changes screen #487

mestreniko opened this issue Nov 5, 2015 · 24 comments

Comments

@mestreniko
Copy link

When a window is maximized in one screen, if it's dragged and dropped in another screen the text size changes (becomes tiny) and I need to do ctrl+0 to restore text to the normal size.
It doesn't happen if the window is first restored.

@mestreniko mestreniko reopened this Nov 5, 2015
@mintty
Copy link
Owner

mintty commented Nov 5, 2015

This happens since mintty 2.1.1 due to the new feature Shift-coupled font-with-window zooming (#204).
It should only occur if you hold Shift while dragging the window. The purpose of that feature is to zoom the font so that the terminal size stays the same.

In this issue, the zoom feature apparently interferes with the fact that full-screen mode is reverted if the window is dragged to another screen (which has always been the case and is probably some Windows feature) and this is not considered with the new feature (yet), so the font is zoomed down to match the terminal size as if the window was still full-screen.

@ghost
Copy link

ghost commented Dec 8, 2015

+1 and I'm dragging mintty window without holding shift key. DPI on both monitors are the same. Actually both monitors are same, resolution and so on. ZoomFontWithWindow=false doesn't help

@mintty
Copy link
Owner

mintty commented Dec 8, 2015

What if you move with the Windows hotkeys, Win+Shift+cursor-left/right, as a workaround?

@ghost
Copy link

ghost commented Dec 8, 2015

@mintty, yep. it works this way. thanks!

@rupor-github
Copy link
Contributor

Would like to propose fix for this one and #492 - it is a bit simpler than Takashi Kawasaki's change (espresso3389). I tested it with WIndows shortcuts and also by mouse-moving mintty window between screens with very different DPIs (96 & 192, 96 &144 - with and without DPI scaling enabled). Should I open pull request - https://github.com/rupor-github/mintty/commit/2ddd9e55ff010d9c10ac87fdfca0cfc8d76592ff?

@mintty
Copy link
Owner

mintty commented Dec 19, 2015

Great, thanks! I'll check that next week.
If you'd like a pull merged, may I ask for uniform formatting please: 2 spaces indentation, no TABs.

@rupor-github
Copy link
Contributor

Thank you, I fixed code formatting and opened pull request.

@mintty
Copy link
Owner

mintty commented Dec 21, 2015

Hmm. I see no different behaviour on Windows 7. If I maximise, then drag to another screen, the window is restored (not maximised) but the font size remains. Only if dragged with Shift, the font size becomes tiny. Same with your patch.
Maybe it's only helpful on Windows 8?
Also, we should make sure that issue #470 isn't broken by the patch; @espresso3389, do you have time to test that?

@rupor-github
Copy link
Contributor

I do not really know - do not have Windows 7 any more. Tested under Windows 10 - and I did not realize that I have to maximize window :) Will look into this some more.

@rupor-github
Copy link
Contributor

@mintty I think real reason for this problem is the fact that during WM_EXITSIZEMOVE message processing call to win_adapt_term_size(shift, false) is wrong. It should be something like win_adapt_term_size(false, shift) instead.

I also think that logic related to font scaling is a bit over-complicated in general, particularly with zoom_token. So I tried to correct this - it seems to solve other scaling issues too, in particular #492.

Please, take a look at https://github.com/rupor-github/mintty - as I may not be aware of all the details it is quite possible that I am missing something here.

@ElvenSpellmaker
Copy link

I'm not sure if this is a separate issue, but it seems related to this issue and so I'll comment on it here.

If you use the shortcut for fullscreen (Alt+Enter) with the shift key held down (Shift+Alt+Enter) then the font size first gets larger (5 times above 100%, like pressing ^+ 5 times), and gradually gets smaller and smaller on each successive press of the combination until the zoom
factor gets to the lowest possible and then it reverts back to 100% again and continues the cycle of, once large and then gradually zooming out.

Weirdly this doesn't happen if the zoom factor is over a certain amount beyond 100%, which for me seems to be 4 ^+ keyboard commands (zooming in 4 times over 100%)

@mintty
Copy link
Owner

mintty commented May 22, 2016

Alt+Enter toggles full-screen, so the second pressing should restore the window to normal size.
If you mean the third (5th, etc) Shift+Alt+Enter to change the zoom factor, I don't see it here right now, but it may happen; quoting from the manual page: (Note that due to the different height/width factors, this is not a precise operation)

@digulla
Copy link

digulla commented Jul 25, 2016

I updated to the latest cygwin 2.5.2 today. mintty --version says "2.4.0" I'm on Windows 8.1 Professional.

I have two identical monitors with the same DPI settings. Whenever I move a mintty window from one screen to another using the mouse, the font and the window gets bigger.

I'm not pressing Shift while moving windows. Using Win+CursorKey doesn't show this effect.

@mintty
Copy link
Owner

mintty commented Jul 25, 2016

That's not the issue being discussed here. It's actually #566 and was fixed in 2.4.1.

@mintty
Copy link
Owner

mintty commented Aug 2, 2016

I've tentatively revised DPI change handling to hook into WM_WINDOWPOSCHANGED rather than WM_DPICHANGED.
Please test the repository version (not making a release now before 3-week travelling).

@mintty
Copy link
Owner

mintty commented Aug 22, 2016

Revised DPI handling as described in #470 (comment); release in 2.5.0 (cygwin test version).
Please check whether that fixes this issue.

@ghost
Copy link

ghost commented Aug 24, 2016

Checked v2.5.0. Works as expected.

Good job!

OS: Windows 10
Cygwin:

$ uname -a
CYGWIN_NT-10.0 the_host_name 2.5.2(0.297/5/3) 2016-06-23 14:29 x86_64 Cygwin

@mintty
Copy link
Owner

mintty commented Aug 29, 2016

I have seen similar behaviour as a consequence of interference with Aero-Snap. Switching off Aero-Snap fixed this for me.

@mintty
Copy link
Owner

mintty commented Sep 8, 2016

Released revised DPI handling in 2.5.1; assuming this issue is resolved, too, unless Aero-Snap interferes.

@mintty mintty closed this as completed Sep 8, 2016
@apeteri
Copy link

apeteri commented Jul 20, 2020

Just a heads-up, the FancyZones feature of Windows 10 PowerToys also uses Shift to show snap regions (when the corresponding "Enable zones while dragging with the shift key" setting is enabled): https://github.com/microsoft/PowerToys/wiki/FancyZones-Overview#settings

@jpweytjens
Copy link

Just a heads-up, the FancyZones feature of Windows 10 PowerToys also uses Shift to show snap regions (when the corresponding "Enable zones while dragging with the shift key" setting is enabled): https://github.com/microsoft/PowerToys/wiki/FancyZones-Overview#settings

A workaround with .minttyrc can be found here.

@apeteri
Copy link

apeteri commented Sep 22, 2020

It did work, thanks for the link!

@mintty
Copy link
Owner

mintty commented Oct 3, 2020

mintty 3.4.1 will also override font zooming behaviour when Ctrl is pressed, too. So with Shift+Ctrl+movement you'd snap to a fancy zone without font zooming

@mintty
Copy link
Owner

mintty commented Oct 24, 2020

Released 3.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants