summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <benjaminfranzke@googlemail.com>2010-07-20 00:29:04 +0200
committerben <benjaminfranzke@googlemail.com>2010-07-20 00:29:04 +0200
commitb1c10f85ccd12621ec4d58eb6ade9e3e41796a20 (patch)
tree032be3b8e1f08c57d55e3112626c5cbfe90200ab
parent57540d34dae0c9958068ffc2d2c6960389958aa8 (diff)
downloadpa-sink-ctl-b1c10f85ccd12621ec4d58eb6ade9e3e41796a20.tar.gz
pa-sink-ctl-b1c10f85ccd12621ec4d58eb6ade9e3e41796a20.tar.bz2
pa-sink-ctl-b1c10f85ccd12621ec4d58eb6ade9e3e41796a20.zip
add signal handler for SIGWINCH
-rw-r--r--src/interface.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/interface.c b/src/interface.c
index 589343a..fbf924a 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <signal.h>
#include <glib.h>
#include <pulse/pulseaudio.h>
#include <ncurses.h>
@@ -23,6 +24,18 @@ extern GArray *sink_list;
extern pa_context* context;
+void resize(int signal);
+
+void foo(void)
+{
+ signal(SIGWINCH, resize);
+}
+void resize(int signal)
+{
+ foo();
+ interface_resize();
+}
+
void interface_init(void)
{
chooser_sink = 0;
@@ -39,6 +52,7 @@ void interface_init(void)
keypad(menu_win, TRUE);
curs_set(0); /* hide cursor */
mvprintw(0, 0, "Use arrow keys to go up and down, Press enter to select a choice");
+ signal(SIGWINCH, resize);
refresh();
}