Merge lp:~daniellimws/gnome-terminal/command-notify into lp:~ubuntu-desktop/gnome-terminal/ubuntu
- command-notify
- Merge into ubuntu
Proposed by
Daniel Lim
Status: | Work in progress |
---|---|
Proposed branch: | lp:~daniellimws/gnome-terminal/command-notify |
Merge into: | lp:~ubuntu-desktop/gnome-terminal/ubuntu |
Diff against target: |
450 lines (+413/-1) 5 files modified
debian/changelog (+11/-0) debian/control (+1/-1) debian/patches/command-notify-debug.patch (+80/-0) debian/patches/command-notify.patch (+319/-0) debian/patches/series (+2/-0) |
To merge this branch: | bzr merge lp:~daniellimws/gnome-terminal/command-notify |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Didier Roche-Tolomelli | Needs Fixing | ||
Review via email: mp+336112@code.launchpad.net |
Commit message
Add command line notification patches from Fedora
Description of the change
Add command line notification patches from Fedora.
To post a comment you must log in.
Unmerged revisions
- 207. By Daniel Lim
-
* debian/
patches/ command- notify. patch:
Support desktop notification from OSC 777
* debian/patches/ command- notify- debug.patch:
Sprinkle debug messages for notifications
* debian/control:
Update to use libvte-2.91-dev (>= 0.48.4)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2017-07-13 15:07:53 +0000 | |||
3 | +++ debian/changelog 2018-01-15 15:00:04 +0000 | |||
4 | @@ -1,3 +1,14 @@ | |||
5 | 1 | gnome-terminal (3.24.2-0ubuntu6) UNRELEASED; urgency=medium | ||
6 | 2 | |||
7 | 3 | * debian/patches/command-notify.patch: | ||
8 | 4 | Support desktop notification from OSC 777 | ||
9 | 5 | * debian/patches/command-notify-debug.patch: | ||
10 | 6 | Sprinkle debug messages for notifications | ||
11 | 7 | * debian/control: | ||
12 | 8 | Update to use libvte-2.91-dev (>= 0.48.4) | ||
13 | 9 | |||
14 | 10 | -- daniel <daniel@daniels-ubuntu> Mon, 15 Jan 2018 18:06:38 +0800 | ||
15 | 11 | |||
16 | 1 | gnome-terminal (3.24.2-0ubuntu4) artful; urgency=medium | 12 | gnome-terminal (3.24.2-0ubuntu4) artful; urgency=medium |
17 | 2 | 13 | ||
18 | 3 | * debian/patches/0001-screen-window-Extra-padding-around-transparent-termi.patch: | 14 | * debian/patches/0001-screen-window-Extra-padding-around-transparent-termi.patch: |
19 | 4 | 15 | ||
20 | === modified file 'debian/control' | |||
21 | --- debian/control 2017-07-13 15:07:48 +0000 | |||
22 | +++ debian/control 2018-01-15 15:00:04 +0000 | |||
23 | @@ -19,7 +19,7 @@ | |||
24 | 19 | libgtk-3-dev (>= 3.20), | 19 | libgtk-3-dev (>= 3.20), |
25 | 20 | libglib2.0-dev (>= 2.42.0), | 20 | libglib2.0-dev (>= 2.42.0), |
26 | 21 | # libpcre2-dev (>= 10.00), | 21 | # libpcre2-dev (>= 10.00), |
28 | 22 | libvte-2.91-dev (>= 0.48.2), | 22 | libvte-2.91-dev (>= 0.48.4), |
29 | 23 | libsm-dev, | 23 | libsm-dev, |
30 | 24 | gnome-pkg-tools (>= 0.10), | 24 | gnome-pkg-tools (>= 0.10), |
31 | 25 | docbook-to-man, | 25 | docbook-to-man, |
32 | 26 | 26 | ||
33 | === added file 'debian/patches/command-notify-debug.patch' | |||
34 | --- debian/patches/command-notify-debug.patch 1970-01-01 00:00:00 +0000 | |||
35 | +++ debian/patches/command-notify-debug.patch 2018-01-15 15:00:04 +0000 | |||
36 | @@ -0,0 +1,80 @@ | |||
37 | 1 | From 1a3ff85b3c404f762f01808b802ffe2ed86d4074 Mon Sep 17 00:00:00 2001 | ||
38 | 2 | From: Debarshi Ray <debarshir@gnome.org> | ||
39 | 3 | Date: Thu, 29 Jan 2015 11:47:21 +0100 | ||
40 | 4 | Subject: [PATCH] Sprinkle debug messages for notifications | ||
41 | 5 | |||
42 | 6 | This can be useful for finding out whether the escape sequence wasn't | ||
43 | 7 | emitted or the filtering was faulty. | ||
44 | 8 | |||
45 | 9 | https://bugzilla.gnome.org/show_bug.cgi?id=711059 | ||
46 | 10 | --- | ||
47 | 11 | src/terminal-debug.c | 1 + | ||
48 | 12 | src/terminal-debug.h | 3 ++- | ||
49 | 13 | src/terminal-screen.c | 6 ++++++ | ||
50 | 14 | 3 files changed, 9 insertions(+), 1 deletion(-) | ||
51 | 15 | |||
52 | 16 | diff --git a/src/terminal-debug.c b/src/terminal-debug.c | ||
53 | 17 | index 0ff321f1f0e2..dac79c38d82b 100644 | ||
54 | 18 | --- a/src/terminal-debug.c | ||
55 | 19 | +++ b/src/terminal-debug.c | ||
56 | 20 | @@ -38,6 +38,7 @@ _terminal_debug_init(void) | ||
57 | 21 | { "settings-list", TERMINAL_DEBUG_SETTINGS_LIST }, | ||
58 | 22 | { "appmenu", TERMINAL_DEBUG_APPMENU }, | ||
59 | 23 | { "search", TERMINAL_DEBUG_SEARCH }, | ||
60 | 24 | + { "notifications", TERMINAL_DEBUG_NOTIFICATIONS }, | ||
61 | 25 | }; | ||
62 | 26 | |||
63 | 27 | _terminal_debug_flags = g_parse_debug_string (g_getenv ("GNOME_TERMINAL_DEBUG"), | ||
64 | 28 | diff --git a/src/terminal-debug.h b/src/terminal-debug.h | ||
65 | 29 | index 5dc3ca4f3df0..7499ebe06c88 100644 | ||
66 | 30 | --- a/src/terminal-debug.h | ||
67 | 31 | +++ b/src/terminal-debug.h | ||
68 | 32 | @@ -34,7 +34,8 @@ typedef enum { | ||
69 | 33 | TERMINAL_DEBUG_PROFILE = 1 << 6, | ||
70 | 34 | TERMINAL_DEBUG_SETTINGS_LIST = 1 << 7, | ||
71 | 35 | TERMINAL_DEBUG_APPMENU = 1 << 8, | ||
72 | 36 | - TERMINAL_DEBUG_SEARCH = 1 << 9 | ||
73 | 37 | + TERMINAL_DEBUG_SEARCH = 1 << 9, | ||
74 | 38 | + TERMINAL_DEBUG_NOTIFICATIONS = 1 << 10 | ||
75 | 39 | } TerminalDebugFlags; | ||
76 | 40 | |||
77 | 41 | void _terminal_debug_init(void); | ||
78 | 42 | diff --git a/src/terminal-screen.c b/src/terminal-screen.c | ||
79 | 43 | index 6c96227c2f20..897147903240 100644 | ||
80 | 44 | --- a/src/terminal-screen.c | ||
81 | 45 | +++ b/src/terminal-screen.c | ||
82 | 46 | @@ -1728,6 +1728,8 @@ terminal_screen_focus_in (GtkWidget *widget, | ||
83 | 47 | TerminalApp *app; | ||
84 | 48 | TerminalWindow *window; | ||
85 | 49 | |||
86 | 50 | + _terminal_debug_print (TERMINAL_DEBUG_NOTIFICATIONS, "Notification withdrawn\n"); | ||
87 | 51 | + | ||
88 | 52 | window = terminal_screen_get_window (screen); | ||
89 | 53 | if (window != NULL) | ||
90 | 54 | { | ||
91 | 55 | @@ -1866,6 +1868,8 @@ terminal_screen_notification_received (VteTerminal *terminal, | ||
92 | 56 | TerminalScreenPrivate *priv = screen->priv; | ||
93 | 57 | TerminalWindow *window; | ||
94 | 58 | |||
95 | 59 | + _terminal_debug_print (TERMINAL_DEBUG_NOTIFICATIONS, "Notification received: [%s]: %s\n", summary, body); | ||
96 | 60 | + | ||
97 | 61 | if (G_UNLIKELY (!priv->shell_prompt_shown)) | ||
98 | 62 | { | ||
99 | 63 | priv->shell_prompt_shown = TRUE; | ||
100 | 64 | @@ -1897,6 +1901,7 @@ terminal_screen_notification_received (VteTerminal *terminal, | ||
101 | 65 | tab_label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (mdi_container), GTK_WIDGET (screen_container)); | ||
102 | 66 | terminal_tab_label_set_bold (TERMINAL_TAB_LABEL (tab_label), TRUE); | ||
103 | 67 | terminal_tab_label_set_icon (TERMINAL_TAB_LABEL (tab_label), "dialog-information-symbolic", summary); | ||
104 | 68 | + _terminal_debug_print (TERMINAL_DEBUG_NOTIFICATIONS, "Notify tab\n"); | ||
105 | 69 | } | ||
106 | 70 | } | ||
107 | 71 | else | ||
108 | 72 | @@ -1912,6 +1917,7 @@ terminal_screen_notification_received (VteTerminal *terminal, | ||
109 | 73 | |||
110 | 74 | app = terminal_app_get (); | ||
111 | 75 | g_application_send_notification (G_APPLICATION (app), priv->uuid, notification); | ||
112 | 76 | + _terminal_debug_print (TERMINAL_DEBUG_NOTIFICATIONS, "Notify desktop\n"); | ||
113 | 77 | } | ||
114 | 78 | } | ||
115 | 79 | |||
116 | 80 | -- | ||
117 | 0 | 81 | ||
118 | === added file 'debian/patches/command-notify.patch' | |||
119 | --- debian/patches/command-notify.patch 1970-01-01 00:00:00 +0000 | |||
120 | +++ debian/patches/command-notify.patch 2018-01-15 15:00:04 +0000 | |||
121 | @@ -0,0 +1,319 @@ | |||
122 | 1 | From 5caa9e6a6179ea1408f0c546fb0022d022056de3 Mon Sep 17 00:00:00 2001 | ||
123 | 2 | From: Debarshi Ray <debarshir@gnome.org> | ||
124 | 3 | Date: Tue, 27 Jan 2015 18:40:13 +0100 | ||
125 | 4 | Subject: [PATCH] Support desktop notifications from OSC 777 | ||
126 | 5 | |||
127 | 6 | https://bugzilla.gnome.org/show_bug.cgi?id=711059 | ||
128 | 7 | --- | ||
129 | 8 | src/terminal-app.c | 32 ++++++++++++++ | ||
130 | 9 | src/terminal-screen.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++ | ||
131 | 10 | src/terminal-tab-label.c | 28 +++++++++++- | ||
132 | 11 | src/terminal-tab-label.h | 4 ++ | ||
133 | 12 | 4 files changed, 171 insertions(+), 1 deletion(-) | ||
134 | 13 | |||
135 | 14 | diff --git a/src/terminal-app.c b/src/terminal-app.c | ||
136 | 15 | index 6c783bc1df79..6a79e98183b3 100644 | ||
137 | 16 | --- a/src/terminal-app.c | ||
138 | 17 | +++ b/src/terminal-app.c | ||
139 | 18 | @@ -374,6 +374,31 @@ app_menu_quit_cb (GSimpleAction *action, | ||
140 | 19 | gtk_widget_destroy (GTK_WIDGET (window)); | ||
141 | 20 | } | ||
142 | 21 | |||
143 | 22 | +/* Other action callbacks */ | ||
144 | 23 | + | ||
145 | 24 | +static void | ||
146 | 25 | +action_activate_tab_cb (GSimpleAction *action, | ||
147 | 26 | + GVariant *parameter, | ||
148 | 27 | + gpointer user_data) | ||
149 | 28 | +{ | ||
150 | 29 | + GtkApplication *application = user_data; | ||
151 | 30 | + GtkWidget *toplevel; | ||
152 | 31 | + TerminalScreen *screen; | ||
153 | 32 | + const char *uuid; | ||
154 | 33 | + | ||
155 | 34 | + g_variant_get (parameter, "&s", &uuid); | ||
156 | 35 | + screen = terminal_app_get_screen_by_uuid (TERMINAL_APP (application), uuid); | ||
157 | 36 | + if (screen == NULL) | ||
158 | 37 | + return; | ||
159 | 38 | + | ||
160 | 39 | + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (screen)); | ||
161 | 40 | + if (!gtk_widget_is_toplevel (toplevel)) | ||
162 | 41 | + return; | ||
163 | 42 | + | ||
164 | 43 | + terminal_window_switch_screen (TERMINAL_WINDOW (toplevel), screen); | ||
165 | 44 | + gtk_window_present (GTK_WINDOW (toplevel)); | ||
166 | 45 | +} | ||
167 | 46 | + | ||
168 | 47 | /* Class implementation */ | ||
169 | 48 | |||
170 | 49 | G_DEFINE_TYPE (TerminalApp, terminal_app, GTK_TYPE_APPLICATION) | ||
171 | 50 | @@ -396,6 +421,10 @@ terminal_app_startup (GApplication *application) | ||
172 | 51 | { "quit", app_menu_quit_cb, NULL, NULL, NULL } | ||
173 | 52 | }; | ||
174 | 53 | |||
175 | 54 | + const GActionEntry other_actions[] = { | ||
176 | 55 | + { "activate-tab", action_activate_tab_cb, "s", NULL, NULL } | ||
177 | 56 | + }; | ||
178 | 57 | + | ||
179 | 58 | g_application_set_resource_base_path (application, TERMINAL_RESOURCES_PATH_PREFIX); | ||
180 | 59 | |||
181 | 60 | G_APPLICATION_CLASS (terminal_app_parent_class)->startup (application); | ||
182 | 61 | @@ -406,6 +435,9 @@ terminal_app_startup (GApplication *application) | ||
183 | 62 | g_action_map_add_action_entries (G_ACTION_MAP (application), | ||
184 | 63 | app_menu_actions, G_N_ELEMENTS (app_menu_actions), | ||
185 | 64 | application); | ||
186 | 65 | + g_action_map_add_action_entries (G_ACTION_MAP (application), | ||
187 | 66 | + other_actions, G_N_ELEMENTS (other_actions), | ||
188 | 67 | + application); | ||
189 | 68 | |||
190 | 69 | |||
191 | 70 | app_load_css (application); | ||
192 | 71 | diff --git a/src/terminal-screen.c b/src/terminal-screen.c | ||
193 | 72 | index c67de274f8a1..6c96227c2f20 100644 | ||
194 | 73 | --- a/src/terminal-screen.c | ||
195 | 74 | +++ b/src/terminal-screen.c | ||
196 | 75 | @@ -54,6 +54,7 @@ | ||
197 | 76 | #include "terminal-marshal.h" | ||
198 | 77 | #include "terminal-schemas.h" | ||
199 | 78 | #include "terminal-screen-container.h" | ||
200 | 79 | +#include "terminal-tab-label.h" | ||
201 | 80 | #include "terminal-util.h" | ||
202 | 81 | #include "terminal-window.h" | ||
203 | 82 | #include "terminal-info-bar.h" | ||
204 | 83 | @@ -89,6 +90,7 @@ struct _TerminalScreenPrivate | ||
205 | 84 | char **initial_env; | ||
206 | 85 | char **override_command; | ||
207 | 86 | gboolean shell; | ||
208 | 87 | + gboolean shell_prompt_shown; | ||
209 | 88 | int child_pid; | ||
210 | 89 | GSList *match_tags; | ||
211 | 90 | guint launch_child_source_id; | ||
212 | 91 | @@ -141,11 +143,16 @@ static gboolean terminal_screen_button_press (GtkWidget *widget, | ||
213 | 92 | GdkEventButton *event); | ||
214 | 93 | static void terminal_screen_hierarchy_changed (GtkWidget *widget, | ||
215 | 94 | GtkWidget *previous_toplevel); | ||
216 | 95 | +static gboolean terminal_screen_focus_in (GtkWidget *widget, | ||
217 | 96 | + GdkEventFocus *event); | ||
218 | 97 | static gboolean terminal_screen_do_exec (TerminalScreen *screen, | ||
219 | 98 | FDSetupData *data, | ||
220 | 99 | GError **error); | ||
221 | 100 | static void terminal_screen_child_exited (VteTerminal *terminal, | ||
222 | 101 | int status); | ||
223 | 102 | +static void terminal_screen_notification_received (VteTerminal *terminal, | ||
224 | 103 | + const char *summary, | ||
225 | 104 | + const char *body); | ||
226 | 105 | |||
227 | 106 | static void terminal_screen_window_title_changed (VteTerminal *vte_terminal, | ||
228 | 107 | TerminalScreen *screen); | ||
229 | 108 | @@ -485,6 +492,7 @@ terminal_screen_class_init (TerminalScreenClass *klass) | ||
230 | 109 | object_class->get_property = terminal_screen_get_property; | ||
231 | 110 | object_class->set_property = terminal_screen_set_property; | ||
232 | 111 | |||
233 | 112 | + widget_class->focus_in_event = terminal_screen_focus_in; | ||
234 | 113 | widget_class->realize = terminal_screen_realize; | ||
235 | 114 | widget_class->style_updated = terminal_screen_style_updated; | ||
236 | 115 | widget_class->drag_data_received = terminal_screen_drag_data_received; | ||
237 | 116 | @@ -493,6 +501,7 @@ terminal_screen_class_init (TerminalScreenClass *klass) | ||
238 | 117 | widget_class->hierarchy_changed = terminal_screen_hierarchy_changed; | ||
239 | 118 | |||
240 | 119 | terminal_class->child_exited = terminal_screen_child_exited; | ||
241 | 120 | + terminal_class->notification_received = terminal_screen_notification_received; | ||
242 | 121 | |||
243 | 122 | signals[PROFILE_SET] = | ||
244 | 123 | g_signal_new (I_("profile-set"), | ||
245 | 124 | @@ -602,6 +611,10 @@ terminal_screen_dispose (GObject *object) | ||
246 | 125 | TerminalScreen *screen = TERMINAL_SCREEN (object); | ||
247 | 126 | TerminalScreenPrivate *priv = screen->priv; | ||
248 | 127 | GtkSettings *settings; | ||
249 | 128 | + TerminalApp *app; | ||
250 | 129 | + | ||
251 | 130 | + app = terminal_app_get (); | ||
252 | 131 | + g_application_withdraw_notification (G_APPLICATION (app), priv->uuid); | ||
253 | 132 | |||
254 | 133 | settings = gtk_widget_get_settings (GTK_WIDGET (screen)); | ||
255 | 134 | g_signal_handlers_disconnect_matched (settings, G_SIGNAL_MATCH_DATA, | ||
256 | 135 | @@ -1707,6 +1720,43 @@ terminal_screen_button_press (GtkWidget *widget, | ||
257 | 136 | return FALSE; | ||
258 | 137 | } | ||
259 | 138 | |||
260 | 139 | +static gboolean | ||
261 | 140 | +terminal_screen_focus_in (GtkWidget *widget, | ||
262 | 141 | + GdkEventFocus *event) | ||
263 | 142 | +{ | ||
264 | 143 | + TerminalScreen *screen = TERMINAL_SCREEN (widget); | ||
265 | 144 | + TerminalApp *app; | ||
266 | 145 | + TerminalWindow *window; | ||
267 | 146 | + | ||
268 | 147 | + window = terminal_screen_get_window (screen); | ||
269 | 148 | + if (window != NULL) | ||
270 | 149 | + { | ||
271 | 150 | + TerminalScreenContainer *screen_container; | ||
272 | 151 | + | ||
273 | 152 | + screen_container = terminal_screen_container_get_from_screen (screen); | ||
274 | 153 | + if (screen_container != NULL) | ||
275 | 154 | + { | ||
276 | 155 | + GtkWidget *mdi_container; | ||
277 | 156 | + | ||
278 | 157 | + mdi_container = terminal_window_get_mdi_container (window); | ||
279 | 158 | + /* FIXME: add interface method to retrieve tab label */ | ||
280 | 159 | + if (GTK_IS_NOTEBOOK (mdi_container)) | ||
281 | 160 | + { | ||
282 | 161 | + GtkWidget *tab_label; | ||
283 | 162 | + | ||
284 | 163 | + tab_label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (mdi_container), GTK_WIDGET (screen_container)); | ||
285 | 164 | + terminal_tab_label_set_bold (TERMINAL_TAB_LABEL (tab_label), FALSE); | ||
286 | 165 | + terminal_tab_label_set_icon (TERMINAL_TAB_LABEL (tab_label), NULL, NULL); | ||
287 | 166 | + } | ||
288 | 167 | + } | ||
289 | 168 | + } | ||
290 | 169 | + | ||
291 | 170 | + app = terminal_app_get (); | ||
292 | 171 | + g_application_withdraw_notification (G_APPLICATION (app), screen->priv->uuid); | ||
293 | 172 | + | ||
294 | 173 | + return GTK_WIDGET_CLASS (terminal_screen_parent_class)->focus_in_event (widget, event); | ||
295 | 174 | +} | ||
296 | 175 | + | ||
297 | 176 | /** | ||
298 | 177 | * terminal_screen_get_current_dir: | ||
299 | 178 | * @screen: | ||
300 | 179 | @@ -1807,6 +1857,64 @@ terminal_screen_child_exited (VteTerminal *terminal, | ||
301 | 180 | } | ||
302 | 181 | } | ||
303 | 182 | |||
304 | 183 | +static void | ||
305 | 184 | +terminal_screen_notification_received (VteTerminal *terminal, | ||
306 | 185 | + const char *summary, | ||
307 | 186 | + const char *body) | ||
308 | 187 | +{ | ||
309 | 188 | + TerminalScreen *screen = TERMINAL_SCREEN (terminal); | ||
310 | 189 | + TerminalScreenPrivate *priv = screen->priv; | ||
311 | 190 | + TerminalWindow *window; | ||
312 | 191 | + | ||
313 | 192 | + if (G_UNLIKELY (!priv->shell_prompt_shown)) | ||
314 | 193 | + { | ||
315 | 194 | + priv->shell_prompt_shown = TRUE; | ||
316 | 195 | + return; | ||
317 | 196 | + } | ||
318 | 197 | + | ||
319 | 198 | + window = terminal_screen_get_window (screen); | ||
320 | 199 | + if (window == NULL) | ||
321 | 200 | + return; | ||
322 | 201 | + | ||
323 | 202 | + if (gtk_window_is_active (GTK_WINDOW (window))) | ||
324 | 203 | + { | ||
325 | 204 | + GtkWidget *mdi_container; | ||
326 | 205 | + TerminalScreenContainer *screen_container; | ||
327 | 206 | + | ||
328 | 207 | + if (screen == terminal_window_get_active (window)) | ||
329 | 208 | + return; | ||
330 | 209 | + | ||
331 | 210 | + screen_container = terminal_screen_container_get_from_screen (screen); | ||
332 | 211 | + if (screen_container == NULL) | ||
333 | 212 | + return; | ||
334 | 213 | + | ||
335 | 214 | + mdi_container = terminal_window_get_mdi_container (window); | ||
336 | 215 | + /* FIXME: add interface method to retrieve tab label */ | ||
337 | 216 | + if (GTK_IS_NOTEBOOK (mdi_container)) | ||
338 | 217 | + { | ||
339 | 218 | + GtkWidget *tab_label; | ||
340 | 219 | + | ||
341 | 220 | + tab_label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (mdi_container), GTK_WIDGET (screen_container)); | ||
342 | 221 | + terminal_tab_label_set_bold (TERMINAL_TAB_LABEL (tab_label), TRUE); | ||
343 | 222 | + terminal_tab_label_set_icon (TERMINAL_TAB_LABEL (tab_label), "dialog-information-symbolic", summary); | ||
344 | 223 | + } | ||
345 | 224 | + } | ||
346 | 225 | + else | ||
347 | 226 | + { | ||
348 | 227 | + gs_unref_object GNotification *notification = NULL; | ||
349 | 228 | + TerminalApp *app; | ||
350 | 229 | + gs_free char *detailed_action = NULL; | ||
351 | 230 | + | ||
352 | 231 | + notification = g_notification_new (summary); | ||
353 | 232 | + g_notification_set_body (notification, body); | ||
354 | 233 | + detailed_action = g_strdup_printf ("app.activate-tab::%s", priv->uuid); | ||
355 | 234 | + g_notification_set_default_action (notification, detailed_action); | ||
356 | 235 | + | ||
357 | 236 | + app = terminal_app_get (); | ||
358 | 237 | + g_application_send_notification (G_APPLICATION (app), priv->uuid, notification); | ||
359 | 238 | + } | ||
360 | 239 | +} | ||
361 | 240 | + | ||
362 | 241 | static void | ||
363 | 242 | terminal_screen_drag_data_received (GtkWidget *widget, | ||
364 | 243 | GdkDragContext *context, | ||
365 | 244 | diff --git a/src/terminal-tab-label.c b/src/terminal-tab-label.c | ||
366 | 245 | index cdd73d0653be..d6909a13ca65 100644 | ||
367 | 246 | --- a/src/terminal-tab-label.c | ||
368 | 247 | +++ b/src/terminal-tab-label.c | ||
369 | 248 | @@ -34,6 +34,7 @@ | ||
370 | 249 | struct _TerminalTabLabelPrivate | ||
371 | 250 | { | ||
372 | 251 | TerminalScreen *screen; | ||
373 | 252 | + GtkWidget *icon; | ||
374 | 253 | GtkWidget *label; | ||
375 | 254 | GtkWidget *close_button; | ||
376 | 255 | gboolean bold; | ||
377 | 256 | @@ -179,7 +180,7 @@ terminal_tab_label_constructed (GObject *object) | ||
378 | 257 | { | ||
379 | 258 | TerminalTabLabel *tab_label = TERMINAL_TAB_LABEL (object); | ||
380 | 259 | TerminalTabLabelPrivate *priv = tab_label->priv; | ||
381 | 260 | - GtkWidget *hbox, *label, *close_button; | ||
382 | 261 | + GtkWidget *hbox, *icon, *label, *close_button; | ||
383 | 262 | |||
384 | 263 | G_OBJECT_CLASS (terminal_tab_label_parent_class)->constructed (object); | ||
385 | 264 | |||
386 | 265 | @@ -189,6 +190,10 @@ terminal_tab_label_constructed (GObject *object) | ||
387 | 266 | |||
388 | 267 | gtk_box_set_spacing (GTK_BOX (hbox), SPACING); | ||
389 | 268 | |||
390 | 269 | + priv->icon = icon = gtk_image_new (); | ||
391 | 270 | + gtk_widget_set_no_show_all (icon, TRUE); | ||
392 | 271 | + gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0); | ||
393 | 272 | + | ||
394 | 273 | priv->label = label = gtk_label_new (NULL); | ||
395 | 274 | gtk_widget_set_halign (label, GTK_ALIGN_CENTER); | ||
396 | 275 | gtk_widget_set_valign (label, GTK_ALIGN_BASELINE); | ||
397 | 276 | @@ -376,6 +381,27 @@ terminal_tab_label_set_bold (TerminalTabLabel *tab_label, | ||
398 | 277 | pango_attr_list_unref (attr_list); | ||
399 | 278 | } | ||
400 | 279 | |||
401 | 280 | +/** | ||
402 | 281 | + * terminal_tab_label_set_icon: | ||
403 | 282 | + * @tab_label: a #TerminalTabLabel | ||
404 | 283 | + * @icon_name: (allow-none): an icon name | ||
405 | 284 | + * @tooltip: (allow-none): text to be used as tooltip | ||
406 | 285 | + * | ||
407 | 286 | + * Shows an icon at the beginning of @tab_label. If @icon_name is | ||
408 | 287 | + * %NULL, then the icon will be hidden. | ||
409 | 288 | + */ | ||
410 | 289 | +void | ||
411 | 290 | +terminal_tab_label_set_icon (TerminalTabLabel *tab_label, | ||
412 | 291 | + const char *icon_name, | ||
413 | 292 | + const char *tooltip) | ||
414 | 293 | +{ | ||
415 | 294 | + TerminalTabLabelPrivate *priv = tab_label->priv; | ||
416 | 295 | + | ||
417 | 296 | + gtk_widget_set_visible (priv->icon, icon_name != NULL); | ||
418 | 297 | + gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon), icon_name, GTK_ICON_SIZE_MENU); | ||
419 | 298 | + gtk_widget_set_tooltip_text (GTK_WIDGET (priv->icon), tooltip); | ||
420 | 299 | +} | ||
421 | 300 | + | ||
422 | 301 | /** | ||
423 | 302 | * terminal_tab_label_get_screen: | ||
424 | 303 | * @tab_label: a #TerminalTabLabel | ||
425 | 304 | diff --git a/src/terminal-tab-label.h b/src/terminal-tab-label.h | ||
426 | 305 | index 20cfbceb36b0..a987025e0524 100644 | ||
427 | 306 | --- a/src/terminal-tab-label.h | ||
428 | 307 | +++ b/src/terminal-tab-label.h | ||
429 | 308 | @@ -59,6 +59,10 @@ GtkWidget * terminal_tab_label_new (TerminalScreen *screen); | ||
430 | 309 | void terminal_tab_label_set_bold (TerminalTabLabel *tab_label, | ||
431 | 310 | gboolean bold); | ||
432 | 311 | |||
433 | 312 | +void terminal_tab_label_set_icon (TerminalTabLabel *tab_label, | ||
434 | 313 | + const char *icon_name, | ||
435 | 314 | + const char *tooltip); | ||
436 | 315 | + | ||
437 | 316 | TerminalScreen *terminal_tab_label_get_screen (TerminalTabLabel *tab_label); | ||
438 | 317 | |||
439 | 318 | G_END_DECLS | ||
440 | 319 | -- | ||
441 | 0 | 320 | ||
442 | === modified file 'debian/patches/series' | |||
443 | --- debian/patches/series 2017-07-13 15:05:17 +0000 | |||
444 | +++ debian/patches/series 2018-01-15 15:00:04 +0000 | |||
445 | @@ -11,3 +11,5 @@ | |||
446 | 11 | scrollbar-background-theming.patch | 11 | scrollbar-background-theming.patch |
447 | 12 | Provide-fallback-for-reading-current-directory-if-OS.patch | 12 | Provide-fallback-for-reading-current-directory-if-OS.patch |
448 | 13 | revert-pcre2.patch | 13 | revert-pcre2.patch |
449 | 14 | command-notify.patch | ||
450 | 15 | command-notify-debug.patch |
Putting them on hold for after GCI, Still some fixes to do (in addition to update debian/control.in)