Added|Changed: Fill .ws_xpixel and .ws_ypixel in winsize

This allows to get terminal size in pixel using `TIOCGWINSZ` ioctl.
Set `.ws_xpixel` using `columns * cell_width` and set `.ws_ypixel` using `rows * cell_height`.
Cell width and height is font width and line spacing, respectively.
This commit is contained in:
Krunal Patel 2022-11-16 14:03:07 +05:30 committed by agnostic-apollo
parent a4437083a0
commit e11ce2a833
No known key found for this signature in database
GPG key ID: BCCC0287E9DCCAED
4 changed files with 20 additions and 16 deletions

View file

@ -975,7 +975,7 @@ public final class TerminalView extends View {
int newRows = Math.max(4, (viewHeight - mRenderer.mFontLineSpacingAndAscent) / mRenderer.mFontLineSpacing);
if (mEmulator == null || (newColumns != mEmulator.mColumns || newRows != mEmulator.mRows)) {
mTermSession.updateSize(newColumns, newRows);
mTermSession.updateSize(newColumns, newRows, (int) mRenderer.getFontWidth(), mRenderer.getFontLineSpacing());
mEmulator = mTermSession.getEmulator();
mClient.onEmulatorSet();