diff --git a/0007-spicy-only-watch-stdin-if-testing-org.spice.spicy-po.patch b/0007-spicy-only-watch-stdin-if-testing-org.spice.spicy-po.patch new file mode 100644 index 0000000..a034e69 --- /dev/null +++ b/0007-spicy-only-watch-stdin-if-testing-org.spice.spicy-po.patch @@ -0,0 +1,51 @@ +From bde4144593197efb4fa5ac993313acc526179f56 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Thu, 6 Oct 2016 15:46:37 +0400 +Subject: [PATCH spice-gtk] spicy: only watch stdin if testing org.spice.spicy + port +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes starting spicy with a shell in the background with &, spicy +would hang in tcsetattr(). + +Signed-off-by: Marc-André Lureau +Acked-by: Victor Toso +--- + src/spicy.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/spicy.c b/src/spicy.c +index a000e09..92de251 100644 +--- a/src/spicy.c ++++ b/src/spicy.c +@@ -1409,6 +1409,8 @@ static gboolean input_cb(GIOChannel *gin, GIOCondition condition, gpointer data) + return TRUE; + } + ++static void watch_stdin(void); ++ + static void port_opened(SpiceChannel *channel, GParamSpec *pspec, + spice_connection *conn) + { +@@ -1432,6 +1434,7 @@ static void port_opened(SpiceChannel *channel, GParamSpec *pspec, + + /* handle the first spicy port and connect it to stdin/out */ + if (g_strcmp0(name, "org.spice.spicy") == 0 && stdin_port == NULL) { ++ watch_stdin(); + stdin_port = port; + } + } else { +@@ -1908,8 +1911,6 @@ int main(int argc, char *argv[]) + g_free(tls_port); + g_free(unix_path); + +- watch_stdin(); +- + connection_connect(conn); + if (connections > 0) + g_main_loop_run(mainloop); +-- +2.10.0 + diff --git a/0008-spicy-fix-reset-of-terminal-when-quit.patch b/0008-spicy-fix-reset-of-terminal-when-quit.patch new file mode 100644 index 0000000..8a2f075 --- /dev/null +++ b/0008-spicy-fix-reset-of-terminal-when-quit.patch @@ -0,0 +1,45 @@ +From 89b531ac451f83c8c446d60304f0394a11a481b3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Fri, 7 Oct 2016 15:26:49 +0400 +Subject: [PATCH spice-gtk] spicy: fix reset of terminal when quit +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Only restore the terminal if it was actually saved. + +Signed-off-by: Marc-André Lureau +Acked-by: Victor Toso +--- + src/spicy.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/spicy.c b/src/spicy.c +index 92de251..c502428 100644 +--- a/src/spicy.c ++++ b/src/spicy.c +@@ -1818,14 +1818,18 @@ static void setup_terminal(gboolean reset) + return; + + #ifdef HAVE_TERMIOS_H +- static struct termios saved_tios; + struct termios tios; ++ static struct termios saved_tios; ++ static bool saved = false; + +- if (reset) ++ if (reset) { ++ if (!saved) ++ return; + tios = saved_tios; +- else { ++ } else { + tcgetattr(stdinfd, &tios); + saved_tios = tios; ++ saved = true; + tios.c_lflag &= ~(ICANON | ECHO); + } + +-- +2.10.0 + diff --git a/spice-gtk.spec b/spice-gtk.spec index 683ee08..21d8f08 100644 --- a/spice-gtk.spec +++ b/spice-gtk.spec @@ -2,7 +2,7 @@ Name: spice-gtk Version: 0.32 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A GTK+ widget for SPICE clients Group: System Environment/Libraries @@ -16,6 +16,8 @@ Patch3: 0003-usb-channel-Really-stop-listening-for-USB-events-on-.patch Patch4: 0004-usb-device-manager-Avoid-USB-event-thread-leak.patch Patch5: 0005-util-fix-off-by-one-array-access.patch Patch6: 0006-spice-widget-init-egl-only-after-first-gl_scanout.patch +Patch7: 0007-spicy-only-watch-stdin-if-testing-org.spice.spicy-po.patch +Patch8: 0008-spicy-fix-reset-of-terminal-when-quit.patch BuildRequires: intltool BuildRequires: usbredir-devel >= 0.5.2 @@ -190,6 +192,9 @@ rm -f %{buildroot}%{_libdir}/*.la %{_bindir}/spicy-stats %changelog +* Mon Oct 10 2016 Marc-André Lureau - 0.32-4 +- Fix backgrounding spicy causes it to freeze (rhbz#1382328) + * Thu Oct 06 2016 Marc-André Lureau - 0.32-3 - Fix display refresh unless scaling is forced (rhbz#1382325)