[gnome-builder] terminal: emit ::needs-attention when text is inserted
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] terminal: emit ::needs-attention when text is inserted
- Date: Mon, 6 May 2019 20:23:01 +0000 (UTC)
commit 76c88f0fa12986d5332ef93c997cfcc38e32ed62
Author: Christian Hergert <chergert redhat com>
Date: Mon May 6 13:20:54 2019 -0700
terminal: emit ::needs-attention when text is inserted
This can be monitored by the tab infrastructure to show
information about page such as it has new content.
.../terminal/gbp-terminal-workspace-addin.c | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)
---
diff --git a/src/plugins/terminal/gbp-terminal-workspace-addin.c
b/src/plugins/terminal/gbp-terminal-workspace-addin.c
index a932bbc38..abe4c058f 100644
--- a/src/plugins/terminal/gbp-terminal-workspace-addin.c
+++ b/src/plugins/terminal/gbp-terminal-workspace-addin.c
@@ -45,6 +45,30 @@ struct _GbpTerminalWorkspaceAddin
IdeTerminalPopover *popover;
};
+static void
+terminal_text_inserted_cb (IdeTerminalPage *page,
+ DzlDockItem *item)
+{
+ g_assert (IDE_IS_TERMINAL_PAGE (page));
+ g_assert (DZL_IS_DOCK_ITEM (item));
+
+ dzl_dock_item_needs_attention (item);
+}
+
+static void
+bind_needs_attention (DzlDockItem *item,
+ IdeTerminalPage *page)
+{
+ g_assert (DZL_IS_DOCK_ITEM (item));
+ g_assert (IDE_IS_TERMINAL_PAGE (page));
+
+ g_signal_connect_object (page,
+ "text-inserted",
+ G_CALLBACK (terminal_text_inserted_cb),
+ item,
+ 0);
+}
+
static void
new_terminal_workspace (GSimpleAction *action,
GVariant *param,
@@ -265,6 +289,7 @@ on_run_manager_run (GbpTerminalWorkspaceAddin *self,
"title", _("Application Output"),
"visible", TRUE,
NULL);
+ bind_needs_attention (DZL_DOCK_ITEM (self->run_panel), self->run_terminal);
g_signal_connect (self->run_panel,
"destroy",
G_CALLBACK (gtk_widget_destroyed),
@@ -425,6 +450,7 @@ gbp_terminal_workspace_addin_load (IdeWorkspaceAddin *addin,
"respawn-on-exit", TRUE,
"visible", TRUE,
NULL);
+ bind_needs_attention (DZL_DOCK_ITEM (self->bottom_dock), self->bottom);
g_signal_connect (self->bottom,
"destroy",
G_CALLBACK (gtk_widget_destroyed),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]