mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 03:45:42 +01:00
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:
parent
225a9afbc3
commit
706a64c7a0
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue