[gnome-builder] terminal: breakout runtime notification check



commit abdce97ac2e568ee003aebdcaea8063693a730ee
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 16 12:08:33 2016 -0700

    terminal: breakout runtime notification check
    
    We might want this in the future to discover failing $PROMPT_COMMAND and
    disabling that feature. We'd do this now, but its complicated by the
    matter of possibly not being set in the flatpak but being set in the
    host.

 plugins/terminal/gb-terminal-view.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/plugins/terminal/gb-terminal-view.c b/plugins/terminal/gb-terminal-view.c
index 5886668..fc6741e 100644
--- a/plugins/terminal/gb-terminal-view.c
+++ b/plugins/terminal/gb-terminal-view.c
@@ -110,6 +110,19 @@ failure:
   IDE_EXIT;
 }
 
+static gboolean
+terminal_has_notification_signal (void)
+{
+  GQuark quark;
+  guint signal_id;
+
+  return g_signal_parse_name ("notification-received",
+                              VTE_TYPE_TERMINAL,
+                              &signal_id,
+                              &quark,
+                              FALSE);
+}
+
 static void
 gb_terminal_respawn (GbTerminalView *self,
                      VteTerminal    *terminal)
@@ -550,8 +563,6 @@ gb_terminal_view_connect_terminal (GbTerminalView *self,
                                    VteTerminal    *terminal)
 {
   GtkAdjustment *vadj;
-  GQuark quark;
-  guint signal_id;
 
   vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (terminal));
 
@@ -578,11 +589,7 @@ gb_terminal_view_connect_terminal (GbTerminalView *self,
                            self,
                            0);
 
-  if (g_signal_parse_name ("notification-received",
-                           VTE_TYPE_TERMINAL,
-                           &signal_id,
-                           &quark,
-                           FALSE))
+  if (terminal_has_notification_signal ())
     {
       g_signal_connect_object (terminal,
                                "notification-received",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]