mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161013-1' into staging
ui: vnc cleanups, input-linux kbd fix. # gpg: Signature made Thu 13 Oct 2016 09:47:43 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-20161013-1: input-linux: initialize key state ui: rename vnc_init_state to vnc_start_protocol ui: move some initialization out of vnc_init_state ui: remove bogus call to reset_keys() in vnc_init_state ui: remove bogus call to graphic_hw_update() in vnc_listen_io ui: refactor method for setting up VncDisplay auth types ui: rename misleading 'VncDisplay' variables ui: remove 'ws_tls' field from VncState ui: remove 'enabled' and 'ws_enabled' fields from VncState ui: remove misleading comment from vnc_init_state Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+13
-2
@@ -347,7 +347,8 @@ static void input_linux_event(void *opaque)
|
||||
static void input_linux_complete(UserCreatable *uc, Error **errp)
|
||||
{
|
||||
InputLinux *il = INPUT_LINUX(uc);
|
||||
uint8_t evtmap, relmap, absmap, keymap[KEY_CNT / 8];
|
||||
uint8_t evtmap, relmap, absmap;
|
||||
uint8_t keymap[KEY_CNT / 8], keystate[KEY_CNT / 8];
|
||||
unsigned int i;
|
||||
int rc, ver;
|
||||
|
||||
@@ -394,6 +395,7 @@ static void input_linux_complete(UserCreatable *uc, Error **errp)
|
||||
if (evtmap & (1 << EV_KEY)) {
|
||||
memset(keymap, 0, sizeof(keymap));
|
||||
rc = ioctl(il->fd, EVIOCGBIT(EV_KEY, sizeof(keymap)), keymap);
|
||||
rc = ioctl(il->fd, EVIOCGKEY(sizeof(keystate)), keystate);
|
||||
for (i = 0; i < KEY_CNT; i++) {
|
||||
if (keymap[i / 8] & (1 << (i % 8))) {
|
||||
if (linux_is_button(i)) {
|
||||
@@ -401,12 +403,21 @@ static void input_linux_complete(UserCreatable *uc, Error **errp)
|
||||
} else {
|
||||
il->num_keys++;
|
||||
}
|
||||
if (keystate[i / 8] & (1 << (i % 8))) {
|
||||
il->keydown[i] = true;
|
||||
il->keycount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qemu_set_fd_handler(il->fd, input_linux_event, NULL, il);
|
||||
input_linux_toggle_grab(il);
|
||||
if (il->keycount) {
|
||||
/* delay grab until all keys are released */
|
||||
il->grab_request = true;
|
||||
} else {
|
||||
input_linux_toggle_grab(il);
|
||||
}
|
||||
QTAILQ_INSERT_TAIL(&inputs, il, next);
|
||||
il->initialized = true;
|
||||
return;
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ static void vncws_handshake_done(Object *source,
|
||||
vnc_client_error(vs);
|
||||
} else {
|
||||
VNC_DEBUG("Websock handshake complete, starting VNC protocol\n");
|
||||
vnc_init_state(vs);
|
||||
vnc_start_protocol(vs);
|
||||
vs->ioc_tag = qio_channel_add_watch(
|
||||
vs->ioc, G_IO_IN, vnc_client_io, vs, NULL);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,6 @@ struct VncDisplay
|
||||
guint lsock_tag;
|
||||
QIOChannelSocket *lwebsock;
|
||||
guint lwebsock_tag;
|
||||
bool ws_enabled;
|
||||
DisplaySurface *ds;
|
||||
DisplayChangeListener dcl;
|
||||
kbd_layout_t *kbd_layout;
|
||||
@@ -167,14 +166,13 @@ struct VncDisplay
|
||||
|
||||
const char *id;
|
||||
QTAILQ_ENTRY(VncDisplay) next;
|
||||
bool enabled;
|
||||
bool is_unix;
|
||||
char *password;
|
||||
time_t expires;
|
||||
int auth;
|
||||
int subauth; /* Used by VeNCrypt */
|
||||
int ws_auth; /* Used by websockets */
|
||||
bool ws_tls; /* Used by websockets */
|
||||
int ws_subauth; /* Used by websockets */
|
||||
bool lossy;
|
||||
bool non_adaptive;
|
||||
QCryptoTLSCreds *tlscreds;
|
||||
@@ -309,7 +307,6 @@ struct VncState
|
||||
QEMUPutLEDEntry *led;
|
||||
|
||||
bool abort;
|
||||
bool initialized;
|
||||
QemuMutex output_mutex;
|
||||
QEMUBH *bh;
|
||||
Buffer jobs_buffer;
|
||||
@@ -518,7 +515,7 @@ void vnc_write_u8(VncState *vs, uint8_t value);
|
||||
void vnc_flush(VncState *vs);
|
||||
void vnc_read_when(VncState *vs, VncReadEvent *func, size_t expecting);
|
||||
void vnc_disconnect_finish(VncState *vs);
|
||||
void vnc_init_state(VncState *vs);
|
||||
void vnc_start_protocol(VncState *vs);
|
||||
|
||||
|
||||
/* Buffer I/O functions */
|
||||
|
||||
Reference in New Issue
Block a user