aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c1
-rw-r--r--ui/curses.c14
-rw-r--r--ui/input-linux.c1
-rw-r--r--ui/meson.build2
-rw-r--r--ui/sdl2.c5
-rw-r--r--ui/vnc-stubs.c3
6 files changed, 18 insertions, 8 deletions
diff --git a/ui/console.c b/ui/console.c
index 54a74c0b16..820e408170 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1310,6 +1310,7 @@ static QemuConsole *new_console(DisplayState *ds, console_type_t console_type,
}
s->ds = ds;
s->console_type = console_type;
+ s->window_id = -1;
if (QTAILQ_EMPTY(&consoles)) {
s->index = 0;
diff --git a/ui/curses.c b/ui/curses.c
index a59b23a9cf..e4f9588c3e 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -30,7 +30,6 @@
#endif
#include <locale.h>
#include <wchar.h>
-#include <langinfo.h>
#include <iconv.h>
#include "qapi/error.h"
@@ -263,7 +262,7 @@ static int curses2foo(const int _curses2foo[], const int _curseskey2foo[],
static void curses_refresh(DisplayChangeListener *dcl)
{
int chr, keysym, keycode, keycode_alt;
- enum maybe_keycode maybe_keycode;
+ enum maybe_keycode maybe_keycode = CURSES_KEYCODE;
curses_winch_check();
@@ -300,7 +299,7 @@ static void curses_refresh(DisplayChangeListener *dcl)
/* alt or esc key */
if (keycode == 1) {
- enum maybe_keycode next_maybe_keycode;
+ enum maybe_keycode next_maybe_keycode = CURSES_KEYCODE;
int nextchr = console_getch(&next_maybe_keycode);
if (nextchr != -1) {
@@ -526,6 +525,7 @@ static void font_setup(void)
iconv_t nativecharset_to_ucs2;
iconv_t font_conv;
int i;
+ g_autofree gchar *local_codeset = g_get_codeset();
/*
* Control characters are normally non-printable, but VGA does have
@@ -566,14 +566,14 @@ static void font_setup(void)
0x25bc
};
- ucs2_to_nativecharset = iconv_open(nl_langinfo(CODESET), "UCS-2");
+ ucs2_to_nativecharset = iconv_open(local_codeset, "UCS-2");
if (ucs2_to_nativecharset == (iconv_t) -1) {
fprintf(stderr, "Could not convert font glyphs from UCS-2: '%s'\n",
strerror(errno));
exit(1);
}
- nativecharset_to_ucs2 = iconv_open("UCS-2", nl_langinfo(CODESET));
+ nativecharset_to_ucs2 = iconv_open("UCS-2", local_codeset);
if (nativecharset_to_ucs2 == (iconv_t) -1) {
iconv_close(ucs2_to_nativecharset);
fprintf(stderr, "Could not convert font glyphs to UCS-2: '%s'\n",
@@ -581,7 +581,7 @@ static void font_setup(void)
exit(1);
}
- font_conv = iconv_open(nl_langinfo(CODESET), font_charset);
+ font_conv = iconv_open(local_codeset, font_charset);
if (font_conv == (iconv_t) -1) {
iconv_close(ucs2_to_nativecharset);
iconv_close(nativecharset_to_ucs2);
@@ -602,7 +602,7 @@ static void font_setup(void)
/* DEL */
convert_ucs(0x7F, 0x2302, ucs2_to_nativecharset);
- if (strcmp(nl_langinfo(CODESET), "UTF-8")) {
+ if (strcmp(local_codeset, "UTF-8")) {
/* Non-Unicode capable, use termcap equivalents for those available */
for (i = 0; i <= 0xFF; i++) {
wchar_t wch[CCHARW_MAX];
diff --git a/ui/input-linux.c b/ui/input-linux.c
index ab351a4187..34cc531190 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -418,6 +418,7 @@ static void input_linux_instance_finalize(Object *obj)
if (il->initialized) {
QTAILQ_REMOVE(&inputs, il, next);
+ qemu_set_fd_handler(il->fd, NULL, NULL, NULL);
close(il->fd);
}
g_free(il->evdev);
diff --git a/ui/meson.build b/ui/meson.build
index 8a080c38e3..78ad792ffb 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -39,7 +39,7 @@ specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl)
ui_modules = {}
-if config_host.has_key('CONFIG_CURSES')
+if curses.found()
curses_ss = ss.source_set()
curses_ss.add(when: [curses, iconv], if_true: [files('curses.c'), pixman])
ui_modules += {'curses' : curses_ss}
diff --git a/ui/sdl2.c b/ui/sdl2.c
index abad7f981e..189d26e2a9 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -84,6 +84,11 @@ void sdl2_window_create(struct sdl2_console *scon)
if (scon->hidden) {
flags |= SDL_WINDOW_HIDDEN;
}
+#ifdef CONFIG_OPENGL
+ if (scon->opengl) {
+ flags |= SDL_WINDOW_OPENGL;
+ }
+#endif
scon->real_window = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
diff --git a/ui/vnc-stubs.c b/ui/vnc-stubs.c
index 06c4ac6296..c6b737dcec 100644
--- a/ui/vnc-stubs.c
+++ b/ui/vnc-stubs.c
@@ -12,6 +12,9 @@ int vnc_display_pw_expire(const char *id, time_t expires)
};
QemuOpts *vnc_parse(const char *str, Error **errp)
{
+ if (strcmp(str, "none") == 0) {
+ return NULL;
+ }
error_setg(errp, "VNC support is disabled");
return NULL;
}