diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-09-13 12:59:36 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-09-13 12:59:36 +0100 |
commit | e1c270c9404efe47c94b944818fdd093e418f938 (patch) | |
tree | 739b84b4be68c2789a2a687698fcd5aa877a1a97 | |
parent | 8ede883cfaf92e99ed7527c319e62dc13ab934d8 (diff) | |
parent | 3e10c3ecfcaf604d8b400d6e463e1a186ce97d9b (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160913-1' into staging
ui: misc small fixes for vnc, spice and curses.
# gpg: Signature made Tue 13 Sep 2016 08:04:46 BST
# 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-20160913-1:
vnc: fix qemu crash because of SIGSEGV
qemu-options.hx: correct spice options streaming-video default document value to 'off'
ui/curses.c: Clean up nextchr logic
ui/curses.c: Ensure we don't read off the end of curses2qemu array
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | qemu-options.hx | 2 | ||||
-rw-r--r-- | ui/curses.c | 20 | ||||
-rw-r--r-- | ui/vnc.c | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/qemu-options.hx b/qemu-options.hx index a71aaf8ea8..70dfe986a2 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1145,7 +1145,7 @@ Configure wan image compression (lossy for slow links). Default is auto. @item streaming-video=[off|all|filter] -Configure video stream detection. Default is filter. +Configure video stream detection. Default is off. @item agent-mouse=[on|off] Enable/disable passing mouse events via vdagent. Default is on. diff --git a/ui/curses.c b/ui/curses.c index b47558956c..d06f724879 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -181,7 +181,7 @@ static kbd_layout_t *kbd_layout = NULL; static void curses_refresh(DisplayChangeListener *dcl) { - int chr, nextchr, keysym, keycode, keycode_alt; + int chr, keysym, keycode, keycode_alt; curses_winch_check(); @@ -195,15 +195,9 @@ static void curses_refresh(DisplayChangeListener *dcl) graphic_hw_text_update(NULL, screen); - nextchr = ERR; while (1) { /* while there are any pending key strokes to process */ - if (nextchr == ERR) - chr = getch(); - else { - chr = nextchr; - nextchr = ERR; - } + chr = getch(); if (chr == ERR) break; @@ -224,13 +218,12 @@ static void curses_refresh(DisplayChangeListener *dcl) /* alt key */ if (keycode == 1) { - nextchr = getch(); + int nextchr = getch(); if (nextchr != ERR) { chr = nextchr; keycode_alt = ALT; - keycode = curses2keycode[nextchr]; - nextchr = ERR; + keycode = curses2keycode[chr]; if (keycode != -1) { keycode |= ALT; @@ -317,7 +310,10 @@ static void curses_refresh(DisplayChangeListener *dcl) qemu_input_event_send_key_delay(0); } } else { - keysym = curses2qemu[chr]; + keysym = -1; + if (chr < CURSES_KEYS) { + keysym = curses2qemu[chr]; + } if (keysym == -1) keysym = chr; @@ -911,6 +911,10 @@ static void vnc_dpy_copy(DisplayChangeListener *dcl, } } + if (!vd->server) { + /* no client connected */ + return; + } /* do bitblit op on the local surface too */ pitch = vnc_server_fb_stride(vd); src_row = vnc_server_fb_ptr(vd, src_x, src_y); |