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

Window border width and padding visibly changes when moving OS window between different resolution monitors #2346

Closed
i-tub opened this issue Feb 9, 2020 · 0 comments

Comments

@i-tub
Copy link

i-tub commented Feb 9, 2020

I notice this when I drag OS windows between my laptop monitor (retina display) and a not-so-high-resolution external monitor: the thickness of the borders, and the amount of padding, visibly doubles! For example, borders are normally 1 px thick on the low-res monitor and 2 px on the retina, and look fairly similar. But drag a window from retina to low-res, and the line is still 2 px thick, which looks too thick. If I create a new tab, borders on the new tab are 1 px and look normal. (Dragging in the opposite direction results in lines becoming visibly thinner.) The same issue applies to window padding.

My conclusion is that the conversion between points and pixels for the existing tab doesn't get updated when moving between monitors, but when a new tab is created, the conversion does get recalculated using the appropriate resolution.

I've made some modifications to my local copy of tabs.py, which fixed the problem for me. I'll post a PR in case it helps.

i-tub added a commit to i-tub/kitty that referenced this issue Feb 9, 2020
Fix for kovidgoyal#2346: whenever relayout() is called, which happens when moving
between monitors (among other things), recompute the various window
padding/margin widths and border width and reset the current layout.
This ensures that these measurements look OK after moving between
monitors with different resolution.

(As an optimization perhaps we could check if the resolution actually
changed and do nothing if it didn't change, but maybe that's unnecessary
since this doesn't appear to be a a performance-critical spot.)
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

1 participant