meson, pw-top: use ncursesw

Some PulseAudio clients are known to use localised client and
stream names as values for the respective PulseAudio props, most
notably plain old pavucontrol.

We call setlocale before anything else for ncurses to display
localised text correctly. We also want to link with ncursesw, which
supports multibyte Unicode locales.
This commit is contained in:
Arseny Maslennikov 2021-03-25 11:39:29 +03:00 committed by Arseny
parent 5f7910fcac
commit 403f27c531
2 changed files with 3 additions and 1 deletions

View file

@ -308,7 +308,7 @@ dl_lib = cc.find_library('dl', required : false)
pthread_lib = dependency('threads')
dbus_dep = dependency('dbus-1')
sdl_dep = dependency('sdl2', required : get_option('sdl2'))
ncurses_dep = dependency('ncurses', required : false)
ncurses_dep = dependency('ncursesw', required : false)
sndfile_dep = dependency('sndfile', version : '>= 1.0.20', required : get_option('sndfile'))
gst_option = get_option('gstreamer')

View file

@ -25,6 +25,7 @@
#include <stdio.h>
#include <signal.h>
#include <getopt.h>
#include <locale.h>
#include <ncurses.h>
#include <spa/utils/result.h>
@ -495,6 +496,7 @@ int main(int argc, char *argv[])
struct timespec value, interval;
struct node *n;
setlocale(LC_ALL, "");
pw_init(&argc, &argv);
spa_list_init(&data.node_list);