[gnome-terminal] screen: Don't emit child-exited on closing
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] screen: Don't emit child-exited on closing
- Date: Mon, 20 Aug 2018 20:50:19 +0000 (UTC)
commit ce9b93f6d8b57872e37992984cdf12a85211d9b8
Author: Christian Persch <chpe src gnome org>
Date: Mon Aug 20 22:49:32 2018 +0200
screen: Don't emit child-exited on closing
When the TerminalScreen is already being disposed and
the child-exited arrives from within VteTerminal::dispose,
don't try to emit the "close" signal so that TerminalWindow
won't try to re-remove the screen from the window which it's
already removing.
src/terminal-screen.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 32ce2a7d..f98d0347 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -573,6 +573,11 @@ terminal_screen_dispose (GObject *object)
TerminalScreenPrivate *priv = screen->priv;
GtkSettings *settings;
+ /* Unset child PID so that when an eventual child-exited signal arrives,
+ * we don't emit "close".
+ */
+ priv->child_pid = -1;
+
settings = gtk_widget_get_settings (GTK_WIDGET (screen));
g_signal_handlers_disconnect_matched (settings, G_SIGNAL_MATCH_DATA,
0, 0, NULL, NULL,
@@ -1642,6 +1647,10 @@ terminal_screen_child_exited (VteTerminal *terminal,
TerminalScreenPrivate *priv = screen->priv;
TerminalExitAction action;
+ /* Don't do anything if we don't have a child */
+ if (priv->child_pid == -1)
+ return;
+
/* No need to chain up to VteTerminalClass::child_exited since it's NULL */
_terminal_debug_print (TERMINAL_DEBUG_PROCESSES,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]