From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> This is just for testing, the UI could be different in better clients. Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> --- src/spicy.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/spicy.c b/src/spicy.c index 0475530..2865678 100644 --- a/src/spicy.c +++ b/src/spicy.c @@ -354,6 +354,21 @@ static void menu_cb_remove_smartcard(GtkAction *action, void *data) } #endif +static void menu_cb_mouse_mode(GtkAction *action, void *data) +{ + SpiceWindow *win = data; + SpiceMainChannel *cmain = win->conn->main; + int mode; + + g_object_get(cmain, "mouse-mode", &mode, NULL); + if (mode == SPICE_MOUSE_MODE_CLIENT) + mode = SPICE_MOUSE_MODE_SERVER; + else + mode = SPICE_MOUSE_MODE_CLIENT; + + spice_main_request_mouse_mode(cmain, mode); +} + #ifdef USE_USBREDIR static void remove_cb(GtkContainer *container, GtkWidget *widget, void *data) { @@ -693,6 +708,12 @@ static const GtkActionEntry entries[] = { },{ #endif + .name = "MouseMode", + .label = "Toggle _mouse mode", + .callback = G_CALLBACK(menu_cb_mouse_mode), + .accelerator = "<shift>F7", + + },{ /* Help menu */ .name = "About", .stock_id = "help-about", @@ -818,6 +839,7 @@ static char ui_xml[] = " <menu action='OptionMenu'>\n" " <menuitem action='grab-keyboard'/>\n" " <menuitem action='grab-mouse'/>\n" +" <menuitem action='MouseMode'/>\n" " <menuitem action='resize-guest'/>\n" " <menuitem action='scaling'/>\n" " <menuitem action='disable-inputs'/>\n" -- 2.7.4 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel