Skip to content

Commit

Permalink
limit min line cursor width with respect to DPI (~#1175)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Oct 18, 2022
1 parent f4a04ee commit f3b5c31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/wintext.c
Original file line number Diff line number Diff line change
Expand Up @@ -4118,9 +4118,11 @@ draw:;
caret_width = (3 + (lattr >= LATTR_WIDE ? 2 : 0)) * cell_width / 40;
SystemParametersInfo(SPI_GETCARETWIDTH, 0, &caret_width, 0);
caret_width *= cell_width / 8;
caret_width = (caret_width == 0) ? 1 : caret_width;
// limit cursor width (previously by line_width, #1101)
if (caret_width > cell_width)
int min_caret_width = dpi / 72;
// limit cursor width (max previously by line_width, #1101)
if (caret_width < min_caret_width)
caret_width = min_caret_width;
else if (caret_width > cell_width)
caret_width = cell_width;
}
int xx = x;
Expand Down
2 changes: 1 addition & 1 deletion wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Terminal features
* Combined sub/superscript attributes render small script (#1171).
* Adjusted subscript position (~#1171).
* Alternative DEC private SGRs for sub/superscript (#1171).
* Revamp line cursor handling, size changeable by CSI ? N c (#1157).
* Revamp line cursor handling, size changeable by CSI ? N c (#1157, #1175).

Keyboard handling
* Not suppressing user-defined KeyFunctions for keypad keys in keypad modes (#1161).
Expand Down

0 comments on commit f3b5c31

Please sign in to comment.