alsamixer: Fix window_size_changed()

Obtaining the new window size using TIOCGWINSZ and setting it using
resize_term(), so getmaxyx() reports the actual terminal size.

Signed-off-by: Benjamin Abendroth <braph93@gmx.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
braph 2019-09-26 21:01:50 +02:00 committed by Jaroslav Kysela
parent 225a9afbc3
commit 706a64c7a0

View file

@ -19,6 +19,8 @@
#include "aconfig.h"
#include <stdlib.h>
#include <term.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include "die.h"
#include "widget.h"
@ -127,6 +129,10 @@ void window_size_changed(void)
{
PANEL *panel, *below;
const struct widget *widget;
struct winsize size;
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) == 0)
resize_term(size.ws_row, size.ws_col);
getmaxyx(stdscr, screen_lines, screen_cols);
if (tigetflag("xenl") != 1 && tigetflag("am") != 1)