-
Notifications
You must be signed in to change notification settings - Fork 691
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
Initial window size incorrect with respect to window padding #2664
Comments
I'm almost certain this is the case. |
I'm not seeing this on my macOS build with high DPI screen. I'm seeing exactly the pixels it's noting. Is there a configuration I'm missing? I tried both a Pro Display XDR and MacBook Pro built-in display. |
I moved my config aside and tried again and I'm seeing the same issue, an extra 8px. Completely out-of-the-box settings:
My main screen is an external LG UltraFine with a base resolution of 5120 × 2880, running at 2x DPI for a UI resolution of 2560 × 1440. If I convince Ghostty to open a window on the built-in screen it has the same metrics though. I also double-checked on my other laptop with no external screen and same problem there. This is macOS Sequoia 15.1 on Apple Silicon MBPs. Footnotes
|
I run into something similar on a MacBook Pro with the built-in 16-inch (3456 × 2234) display. The screen is on the default "looks like" setting of 1728 × 1117. I narrowed my problem down to just this config:
Ghostty opens by default in 99c x 33r and has more padding at the bottom than what I'd expect. When I resize the window with the mouse from the bottom, the following happens:
After that, the padding starts to slowly increase again. |
A brand new Ghostty window calculates the initial window size wrong with respect to window padding, at least on macOS. The result is a new window has extra padding.
My configuration going into this:
window-step-resize = true
, decoration and other settings at defaults though I turned off the macos shadow for debuggingWhat I'm seeing:
If I set
window-padding-x = 0
, the viewport is sized perfectly such that there is no horizontal padding.Surface Info:
Screen width of 1280px matches cell grid, so no extra padding.
Screenshot
If I set
window-padding-x = 1
, the viewport has 2pt/4px extra padding on the right.Expected screen width was 1284px (2px + 1280px + 2px), so at 1288px there's an extra 4px on the right (interesting that Surface Info doesn't report this anywhere)
Screenshot
If I set
window-padding-x = 2
, the viewport has 4pt/8px extra padding on the right.Expected screen width was 1288px (4px + 1280px + 4px), so at 1296px there's an extra 8px on the right.
Screenshot
Additional info
I used the Pixie app (from Apple's additional tools for Xcode download) to verify the pixel layout of the window, so I can confirm that what Surface Info reported for the screen size is accurate.
Subsequent resizes of the window preserve this additional padding (thanks to
window-step-resize = true
). If I turn that off then I can manually resize the window to remove the additional padding, so it's just an error in the initial viewport sizing.I do note that this is effectively adding twice as much padding as it should. With
window-padding-x = 1
it should have a total of 2pt of padding but it has 4pt. Withwindow-padding-x = 2
it should have a total of 4pt of padding but it has 8pt. I am wondering if this is an issue with high-DPI screens where it does an extra pixel density multiplication somewhere (e.g. it calculates 4pt, converts to 8px, then interprets that as 8pt) but I don't have a low-DPI screen available to test with.The text was updated successfully, but these errors were encountered: