Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160913-1'…
Browse files Browse the repository at this point in the history
… 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) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"
# 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 <[email protected]>
  • Loading branch information
pm215 committed Sep 13, 2016
2 parents 8ede883 + 3e10c3e commit e1c270c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion qemu-options.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 8 additions & 12 deletions ui/curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions ui/vnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e1c270c

Please sign in to comment.