aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-04-01 09:50:56 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-04-01 09:50:56 -0300
commit82373cd0c432ff6043fa45120d0de846a2e306c1 (patch)
tree3c1755e8be83e82082b6a04d4c9585ae3a25c1fe
parent3887fc2ade8dc0d829929439682918c3fbbbba63 (diff)
downloadkvmx-82373cd0c432ff6043fa45120d0de846a2e306c1.tar.gz
kvmx-82373cd0c432ff6043fa45120d0de846a2e306c1.tar.bz2
Adds share/patches with spice-gtk toggle-menubar patch
-rw-r--r--share/patches/README.txt13
-rw-r--r--share/patches/spice-gtk/toggle-menubar-0.33.patch65
-rw-r--r--share/patches/spice-gtk/toggle-menubar-0.35.patch65
3 files changed, 143 insertions, 0 deletions
diff --git a/share/patches/README.txt b/share/patches/README.txt
new file mode 100644
index 0000000..08fbab0
--- /dev/null
+++ b/share/patches/README.txt
@@ -0,0 +1,13 @@
+# Support for toggling Menubar visibility on spicy
+
+This patch adds a submenu item at the Views menu item which allows to hide and
+show the Menubar.
+
+The functionality is also available using Shift+F6 keyboard combination.
+
+This feature makes possible a more seamless integration between spice guests
+and the host's window manager.
+
+The patch was rejected by upstream, so it now lives at KVMX tree.
+
+See https://lists.freedesktop.org/archives/spice-devel/2018-November/046208.html
diff --git a/share/patches/spice-gtk/toggle-menubar-0.33.patch b/share/patches/spice-gtk/toggle-menubar-0.33.patch
new file mode 100644
index 0000000..f24fdf0
--- /dev/null
+++ b/share/patches/spice-gtk/toggle-menubar-0.33.patch
@@ -0,0 +1,65 @@
+--- src/spicy.c 2018-11-15 15:40:43.092856281 -0200
++++ src/spicy.c 2018-11-16 19:35:17.377703430 -0200
+@@ -464,6 +464,15 @@
+ g_key_file_set_boolean(keyfile, "ui", "statusbar", state);
+ }
+
++static void menu_cb_menubar(GtkToggleAction *action, gpointer data)
++{
++ SpiceWindow *win = data;
++ gboolean state = gtk_toggle_action_get_active(action);
++
++ gtk_widget_set_visible(win->menubar, state);
++ g_key_file_set_boolean(keyfile, "ui", "menubar", state);
++}
++
+ static void menu_cb_about(GtkAction *action, void *data)
+ {
+ char *comments = "gtk test client app for the\n"
+@@ -513,10 +522,14 @@
+ gboolean state;
+ GtkAction *toggle;
+
+- gtk_widget_show(win->menubar);
++ toggle = gtk_action_group_get_action(win->ag, "Menubar");
++ state = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(toggle));
++ gtk_widget_set_visible(win->menubar, state);
++
+ toggle = gtk_action_group_get_action(win->ag, "Toolbar");
+ state = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(toggle));
+ gtk_widget_set_visible(win->toolbar, state);
++
+ toggle = gtk_action_group_get_action(win->ag, "Statusbar");
+ state = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(toggle));
+ gtk_widget_set_visible(win->statusbar, state);
+@@ -614,6 +627,10 @@
+ }
+ g_clear_error(&error);
+
++ state = g_key_file_get_boolean(keyfile, "ui", "menubar", &error);
++ if (error == NULL)
++ gtk_widget_set_visible(win->menubar, state);
++ g_clear_error(&error);
+
+ state = g_key_file_get_boolean(keyfile, "ui", "toolbar", &error);
+ if (error == NULL)
+@@ -779,6 +796,11 @@
+ .name = "Toolbar",
+ .label = "Toolbar",
+ .callback = G_CALLBACK(menu_cb_toolbar),
++ },{
++ .name = "Menubar",
++ .label = "Menubar",
++ .callback = G_CALLBACK(menu_cb_menubar),
++ .accelerator = "<shift>F6",
+ }
+ };
+
+@@ -833,6 +855,7 @@
+ " <menuitem action='Fullscreen'/>\n"
+ " <menuitem action='Toolbar'/>\n"
+ " <menuitem action='Statusbar'/>\n"
++" <menuitem action='Menubar'/>\n"
+ " </menu>\n"
+ " <menu action='InputMenu'>\n"
+ #ifdef USE_SMARTCARD
diff --git a/share/patches/spice-gtk/toggle-menubar-0.35.patch b/share/patches/spice-gtk/toggle-menubar-0.35.patch
new file mode 100644
index 0000000..a6d6d0c
--- /dev/null
+++ b/share/patches/spice-gtk/toggle-menubar-0.35.patch
@@ -0,0 +1,65 @@
+--- tools/spicy.c 2018-08-30 13:09:28.000000000 -0300
++++ tools/spicy.c 2018-11-16 19:17:35.566512247 -0200
+@@ -469,6 +469,15 @@
+ g_key_file_set_boolean(keyfile, "ui", "statusbar", state);
+ }
+
++static void menu_cb_menubar(GtkToggleAction *action, gpointer data)
++{
++ SpiceWindow *win = data;
++ gboolean state = gtk_toggle_action_get_active(action);
++
++ gtk_widget_set_visible(win->menubar, state);
++ g_key_file_set_boolean(keyfile, "ui", "menubar", state);
++}
++
+ static void menu_cb_about(GtkAction *action, void *data)
+ {
+ char *comments = "gtk test client app for the\n"
+@@ -518,10 +527,14 @@
+ gboolean state;
+ GtkAction *toggle;
+
+- gtk_widget_show(win->menubar);
++ toggle = gtk_action_group_get_action(win->ag, "Menubar");
++ state = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(toggle));
++ gtk_widget_set_visible(win->menubar, state);
++
+ toggle = gtk_action_group_get_action(win->ag, "Toolbar");
+ state = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(toggle));
+ gtk_widget_set_visible(win->toolbar, state);
++
+ toggle = gtk_action_group_get_action(win->ag, "Statusbar");
+ state = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(toggle));
+ gtk_widget_set_visible(win->statusbar, state);
+@@ -677,6 +690,10 @@
+ }
+ g_clear_error(&error);
+
++ state = g_key_file_get_boolean(keyfile, "ui", "menubar", &error);
++ if (error == NULL)
++ gtk_widget_set_visible(win->menubar, state);
++ g_clear_error(&error);
+
+ state = g_key_file_get_boolean(keyfile, "ui", "toolbar", &error);
+ if (error == NULL)
+@@ -850,6 +867,11 @@
+ .name = "Toolbar",
+ .label = "Toolbar",
+ .callback = G_CALLBACK(menu_cb_toolbar),
++ },{
++ .name = "Menubar",
++ .label = "Menubar",
++ .callback = G_CALLBACK(menu_cb_menubar),
++ .accelerator = "<shift>F6",
+ }
+ };
+
+@@ -924,6 +946,7 @@
+ " <menuitem action='Fullscreen'/>\n"
+ " <menuitem action='Toolbar'/>\n"
+ " <menuitem action='Statusbar'/>\n"
++" <menuitem action='Menubar'/>\n"
+ " </menu>\n"
+ " <menu action='InputMenu'>\n"
+ #ifdef USE_SMARTCARD