summaryrefslogtreecommitdiff
path: root/gtk/spicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/spicy.c')
-rw-r--r--gtk/spicy.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk/spicy.c b/gtk/spicy.c
index 40e7325..9860ea6 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -44,6 +44,13 @@ static void menu_cb_fullscreen(GtkAction *action, void *data)
}
}
+static void menu_cb_ungrab(GtkAction *action, void *data)
+{
+ struct spice_window *win = data;
+
+ spice_display_mouse_ungrab(win->spice);
+}
+
static void menu_cb_bool_prop(GtkToggleAction *action, gpointer data)
{
struct spice_window *win = data;
@@ -116,6 +123,9 @@ static const GtkActionEntry entries[] = {
.name = "ViewMenu",
.label = "_View",
},{
+ .name = "InputMenu",
+ .label = "_Input",
+ },{
.name = "OptionMenu",
.label = "_Options",
},{
@@ -139,6 +149,13 @@ static const GtkActionEntry entries[] = {
.accelerator = "<shift>F11",
},{
+ /* Input menu */
+ .name = "UngrabMouse",
+ .label = "_Ungrab mouse",
+ .callback = G_CALLBACK(menu_cb_ungrab),
+ .accelerator = "<shift>F12",
+ },{
+
/* Help menu */
.name = "About",
.stock_id = GTK_STOCK_ABOUT,
@@ -153,6 +170,10 @@ static const GtkToggleActionEntry tentries[] = {
.label = "Grab keyboard",
.callback = G_CALLBACK(menu_cb_bool_prop),
},{
+ .name = "grab-mouse",
+ .label = "Grab mouse",
+ .callback = G_CALLBACK(menu_cb_bool_prop),
+ },{
.name = "resize-guest",
.label = "Resize guest",
.callback = G_CALLBACK(menu_cb_bool_prop),
@@ -168,8 +189,12 @@ static char ui_xml[] =
" <menu action='ViewMenu'>\n"
" <menuitem action='Fullscreen'/>\n"
" </menu>\n"
+" <menu action='InputMenu'>\n"
+" <menuitem action='UngrabMouse'/>\n"
+" </menu>\n"
" <menu action='OptionMenu'>\n"
" <menuitem action='grab-keyboard'/>\n"
+" <menuitem action='grab-mouse'/>\n"
" <menuitem action='resize-guest'/>\n"
" </menu>\n"
" <menu action='HelpMenu'>\n"