mirror of https://github.com/mpv-player/mpv
osdep/terminal-win: native VT: report exact width
The narrower-by-1 width is not required with a native VT console because the wrapping behavior is the same as on *nix on such case.
This commit is contained in:
parent
ca531b1cb2
commit
b5b266c38c
|
@ -99,8 +99,9 @@ static struct input_ctx *input_ctx;
|
||||||
void terminal_get_size(int *w, int *h)
|
void terminal_get_size(int *w, int *h)
|
||||||
{
|
{
|
||||||
CONSOLE_SCREEN_BUFFER_INFO cinfo;
|
CONSOLE_SCREEN_BUFFER_INFO cinfo;
|
||||||
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cinfo)) {
|
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
*w = cinfo.dwMaximumWindowSize.X - 1;
|
if (GetConsoleScreenBufferInfo(hOut, &cinfo)) {
|
||||||
|
*w = cinfo.dwMaximumWindowSize.X - (is_native_out_vt(hOut) ? 0 : 1);
|
||||||
*h = cinfo.dwMaximumWindowSize.Y;
|
*h = cinfo.dwMaximumWindowSize.Y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue