aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-01-10 14:52:34 +0000
committerPeter Maydell <peter.maydell@linaro.org>2017-01-10 14:52:34 +0000
commitb44486dfb9447c88e4b216e730adcc780190852c (patch)
treedc17dcf2e0ef260cb411cc90f8216fb96f7e150a /backends
parent41a0e54756a9ae6b60be34bb33302a7e085fdb07 (diff)
parente934644126f214a99bb3b3201f73fe7f0c579ef7 (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20170110-1' into staging
gtk,vnc: misc bugfixes. kbd: add jp keys, fix ps2 regressions. sdl: export window id for baum, remove sdl hooks from baum. egl: egl-helpers.c license change. # gpg: Signature made Tue 10 Jan 2017 07:16:05 GMT # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-ui-20170110-1: ps2: Fix lost scancodes by recent changes curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT) ui/vnc: Fix problem with sending too many bytes as server name gtk: avoid oob array access egl-helpers: Change file licensing to LGPLv2 sdl2: set window ID console: move window ID code from baum to sdl console: add API to get underlying gui window ID ui: use evdev keymap when running under wayland ui/gtk: fix crash at startup when no console is available Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'backends')
-rw-r--r--backends/baum.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/backends/baum.c b/backends/baum.c
index b92369d840..b045ef49c5 100644
--- a/backends/baum.c
+++ b/backends/baum.c
@@ -27,12 +27,10 @@
#include "sysemu/char.h"
#include "qemu/timer.h"
#include "hw/usb.h"
+#include "ui/console.h"
#include <brlapi.h>
#include <brlapi_constants.h>
#include <brlapi_keycodes.h>
-#ifdef CONFIG_SDL
-#include <SDL_syswm.h>
-#endif
#if 0
#define DPRINTF(fmt, ...) \
@@ -227,12 +225,8 @@ static const uint8_t nabcc_translation[2][256] = {
/* The guest OS has started discussing with us, finish initializing BrlAPI */
static int baum_deferred_init(BaumDriverState *baum)
{
-#if defined(CONFIG_SDL)
-#if SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
- SDL_SysWMinfo info;
-#endif
-#endif
- int tty;
+ int tty = BRLAPI_TTY_DEFAULT;
+ QemuConsole *con;
if (baum->deferred_init) {
return 1;
@@ -243,21 +237,12 @@ static int baum_deferred_init(BaumDriverState *baum)
return 0;
}
-#if defined(CONFIG_SDL)
-#if SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
- memset(&info, 0, sizeof(info));
- SDL_VERSION(&info.version);
- if (SDL_GetWMInfo(&info)) {
- tty = info.info.x11.wmwindow;
- } else {
-#endif
-#endif
- tty = BRLAPI_TTY_DEFAULT;
-#if defined(CONFIG_SDL)
-#if SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
+ con = qemu_console_lookup_by_index(0);
+ if (con && qemu_console_is_graphic(con)) {
+ tty = qemu_console_get_window_id(con);
+ if (tty == -1)
+ tty = BRLAPI_TTY_DEFAULT;
}
-#endif
-#endif
if (brlapi__enterTtyMode(baum->brlapi, tty, NULL) == -1) {
brlapi_perror("baum: brlapi__enterTtyMode");