[gnome-builder] buildui: notify pipeline of PTY size changes



commit 3f60dd10c496cf86e77458a0a1ef220c3ecb4961
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jan 23 00:55:29 2018 -0800

    buildui: notify pipeline of PTY size changes

 src/libide/buildui/ide-build-log-panel.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
---
diff --git a/src/libide/buildui/ide-build-log-panel.c b/src/libide/buildui/ide-build-log-panel.c
index 0bb36fdc6..5b75aa007 100644
--- a/src/libide/buildui/ide-build-log-panel.c
+++ b/src/libide/buildui/ide-build-log-panel.c
@@ -298,6 +298,28 @@ ide_build_log_panel_save_in_file (GSimpleAction *action,
   IDE_EXIT;
 }
 
+static void
+terminal_size_allocate (IdeBuildLogPanel *self,
+                        GtkAllocation    *allocation,
+                        IdeTerminal      *terminal)
+{
+  VtePty *pty;
+  guint rows = 0;
+  guint columns = 0;
+
+  g_assert (IDE_IS_BUILD_LOG_PANEL (self));
+  g_assert (allocation != NULL);
+  g_assert (IDE_IS_TERMINAL (terminal));
+
+  pty = vte_terminal_get_pty (VTE_TERMINAL (self->terminal));
+
+  if (self->pipeline != NULL && pty != NULL)
+    {
+      if (vte_pty_get_size (pty, &rows, &columns, NULL))
+        _ide_build_pipeline_set_pty_size (self->pipeline, rows, columns);
+    }
+}
+
 static void
 ide_build_log_panel_init (IdeBuildLogPanel *self)
 {
@@ -309,6 +331,12 @@ ide_build_log_panel_init (IdeBuildLogPanel *self)
 
   gtk_widget_init_template (GTK_WIDGET (self));
 
+  g_signal_connect_object (self->terminal,
+                           "size-allocate",
+                           G_CALLBACK (terminal_size_allocate),
+                           self,
+                           G_CONNECT_SWAPPED | G_CONNECT_AFTER);
+
   g_signal_connect_object (self->terminal,
                            "window-title-changed",
                            G_CALLBACK (ide_build_log_panel_window_title_changed),


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