Skip to content

Commit

Permalink
fix text area size reported in response to CSI 14 t (#899)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Aug 29, 2019
1 parent 02b51c5 commit f41954d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/winmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ mtime(void)


#ifdef debug_resize
#define SetWindowPos(wnd, after, x, y, cx, cy, flags) {printf("SWP[%s] %ld %ld\n", __FUNCTION__, (long int)cx, (long int)cy); Set##WindowPos(wnd, after, x, y, cx, cy, flags);}
#define SetWindowPos(wnd, after, x, y, cx, cy, flags) printf("SWP[%s] %ld %ld\n", __FUNCTION__, (long int)cx, (long int)cy), Set##WindowPos(wnd, after, x, y, cx, cy, flags)
static void
trace_winsize(char * tag)
{
Expand Down Expand Up @@ -1303,19 +1303,25 @@ win_has_scrollbar(void)
void
win_get_pixels(int *height_p, int *width_p, bool with_borders)
{
trace_winsize("win_get_pixels");
RECT r;
GetWindowRect(wnd, &r);
//printf("win_get_pixels: width %d win_has_scrollbar %d\n", r.right - r.left, win_has_scrollbar());
if (with_borders) {
GetWindowRect(wnd, &r);
*height_p = r.bottom - r.top;
*width_p = r.right - r.left;
}
else {
GetClientRect(wnd, &r);
int sy = win_search_visible() ? SEARCHBAR_HEIGHT : 0;
*height_p = r.bottom - r.top - extra_height - 2 * PADDING - sy;
*width_p = r.right - r.left - extra_width - 2 * PADDING
//- (cfg.scrollbar ? GetSystemMetrics(SM_CXVSCROLL) : 0);
- (win_has_scrollbar() ? GetSystemMetrics(SM_CXVSCROLL) : 0);
*height_p = r.bottom - r.top - 2 * PADDING - sy
//- extra_height
;
*width_p = r.right - r.left - 2 * PADDING
//- extra_width
//- (cfg.scrollbar ? GetSystemMetrics(SM_CXVSCROLL) : 0)
//- (win_has_scrollbar() ? GetSystemMetrics(SM_CXVSCROLL) : 0)
;
}
}

Expand Down
1 change: 1 addition & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Terminal features
* Fixed iconified window report which was reverted (#893).
* Prevent negative CSI 13 t response parameters (#899).
* Fixed interaction of OSC 12/112 "Set/Reset cursor colour" with IME (#903).
* Fixed text area size reported in response to CSI 14 t (#899).

Font rendering
* Reimplement auto-narrowing (too wide glyphs) by coordinate scaling (#892).
Expand Down

0 comments on commit f41954d

Please sign in to comment.