From: Dietmar Maurer Date: Wed, 9 Oct 2013 11:09:51 +0000 (+0200) Subject: reset cursor after resize X-Git-Url: https://git.proxmox.com/?p=spiceterm.git;a=commitdiff_plain;h=6508981fdde283f201398a35e84d82fc22c8ec14 reset cursor after resize --- diff --git a/screen.c b/screen.c index 5c908c9..451d119 100644 --- a/screen.c +++ b/screen.c @@ -370,6 +370,8 @@ create_primary_surface(SpiceScreen *spice_screen, uint32_t width, spice_screen->width = width; spice_screen->height = height; + spice_screen->cursor_set = 0; + qxl_worker->create_primary_surface(qxl_worker, 0, &surface); } @@ -532,15 +534,15 @@ cursor_init() static int get_cursor_command(QXLInstance *qin, struct QXLCommandExt *ext) { - //SpiceScreen *spice_screen = SPICE_CONTAINEROF(qin, SpiceScreen, qxl_instance); - static int set = 1; + SpiceScreen *spice_screen = SPICE_CONTAINEROF(qin, SpiceScreen, qxl_instance); QXLCursorCmd *cursor_cmd; QXLCommandExt *cmd; - if (!set) return FALSE; - set = 0; - + if (spice_screen->cursor_set) + return FALSE; + + spice_screen->cursor_set = 1; cmd = calloc(sizeof(QXLCommandExt), 1); cursor_cmd = calloc(sizeof(QXLCursorCmd), 1); diff --git a/spiceterm.h b/spiceterm.h index a8d27d1..b2c764c 100644 --- a/spiceterm.h +++ b/spiceterm.h @@ -58,6 +58,8 @@ struct SpiceScreen { //cache for glyphs bitmaps GHashTable *image_cache; + + gboolean cursor_set; // callbacks void (*on_client_connected)(SpiceScreen *spice_screen);