summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2015-11-09 15:02:09 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2016-05-10 10:56:16 +0200
commit1921897651ee6e3106a5dfc770b65ca4d6520929 (patch)
tree7fc8a4827996700a1d104f214af7a7f7dcc57f05 /src
parent5a4693db591e97eaa52f9e4cd0adef658aed7f40 (diff)
spicy: add toggle mouse mode menu
This is just for testing, the UI could be different in better clients. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/spicy.c22
1 files changed, 22 insertions, 0 deletions
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"