From: Dietmar Maurer Date: Fri, 13 Sep 2013 05:38:07 +0000 (+0200) Subject: code cleanup X-Git-Url: https://git.proxmox.com/?p=spiceterm.git;a=commitdiff_plain;h=5cba5790721fcd0258c5bc39e1f610ea58c800be code cleanup --- diff --git a/spiceterm.c b/spiceterm.c index 49e1574..e0eb1cf 100644 --- a/spiceterm.c +++ b/spiceterm.c @@ -1263,6 +1263,20 @@ spiceterm_set_xcut_text (char* str, int len, struct _rfbClientRec* cl) } */ +static void +spiceterm_update_watch_mask(spiceTerm *vt, gboolean writable) +{ + g_assert(vt != NULL); + + int mask = SPICE_WATCH_EVENT_READ; + + if (writable) { + mask |= SPICE_WATCH_EVENT_WRITE; + } + + vt->screen->core->watch_update_mask(vt->screen->mwatch, mask); +} + static void mouse_report(spiceTerm *vt, int butt, int mrx, int mry) { @@ -1273,10 +1287,7 @@ mouse_report(spiceTerm *vt, int butt, int mrx, int mry) spiceterm_respond_esc(vt, buf); - // fixme - vt->screen->core->watch_update_mask(vt->screen->mwatch, - SPICE_WATCH_EVENT_READ|SPICE_WATCH_EVENT_WRITE); - + spiceterm_update_watch_mask(vt, TRUE); } void @@ -1623,8 +1634,7 @@ ret: } } - vt->screen->core->watch_update_mask(vt->screen->mwatch, - SPICE_WATCH_EVENT_READ|SPICE_WATCH_EVENT_WRITE); + spiceterm_update_watch_mask(vt, TRUE); } static uint8_t @@ -1800,7 +1810,7 @@ master_watch(int master, int event, void *opaque) write (master, vt->ibuf, vt->ibuf_count); vt->ibuf_count = 0; // fixme: what if not all data written } - vt->screen->core->watch_update_mask(vt->screen->mwatch, SPICE_WATCH_EVENT_READ); + spiceterm_update_watch_mask(vt, FALSE); } }