1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
|
From 89b4d1f4b6d247c840048c2d3f0a22e0a18f9522 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Wed, 7 Jan 2015 16:01:00 +0100
Subject: [PATCH 1/5] Add sequences and signals for desktop notification
Add sequences
OSC 777 ; notify ; SUMMARY ; BODY BEL
OSC 777 ; notify ; SUMMARY BEL
OSC 777 ; notify ; SUMMARY ; BODY ST
OSC 777 ; notify ; SUMMARY ST
that let terminal applications send a notification to the desktop
environment.
Based on Enlightenment's Terminology:
https://phab.enlightenment.org/T1765
https://bugzilla.gnome.org/show_bug.cgi?id=711059
---
src/caps.cc | 4 +++
src/marshal.list | 1 +
src/vte.cc | 12 +++++++
src/vte/vteterminal.h | 4 ++-
src/vtegtk.cc | 21 ++++++++++++
src/vtegtk.hh | 1 +
src/vteinternal.hh | 5 +++
src/vteseq-n.gperf | 1 +
src/vteseq.cc | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++
9 files changed, 138 insertions(+), 1 deletion(-)
diff --git a/src/caps.cc b/src/caps.cc
index 47571269b883..3e496ff33194 100644
--- a/src/caps.cc
+++ b/src/caps.cc
@@ -255,6 +255,8 @@ const char _vte_xterm_capability_strings[] =
ENTRY(OSC "118" BEL, "reset-tek-cursor-color")
ENTRY(OSC "119" BEL, "reset-highlight-foreground-color")
ENTRY(OSC "777;%s" BEL, "urxvt-777")
+ ENTRY(OSC "777;%s;%s;%s" BEL, "send-notification")
+ ENTRY(OSC "777;%s;%s" BEL, "send-notification")
ENTRY(OSC "1337;%s" BEL, "iterm2-1337")
COMMENT(/* Set text parameters, ST-terminated versions. */)
@@ -292,6 +294,8 @@ const char _vte_xterm_capability_strings[] =
ENTRY(OSC "118" ST, "reset-tek-cursor-color")
ENTRY(OSC "119" ST, "reset-highlight-foreground-color")
ENTRY(OSC "777;%s" ST, "urxvt-777")
+ ENTRY(OSC "777;%s;%s;%s" ST, "send-notification")
+ ENTRY(OSC "777;%s;%s" ST, "send-notification")
ENTRY(OSC "1337;%s" ST, "iterm2-1337")
COMMENT(/* These may be bogus, I can't find docs for them anywhere (#104154). */)
diff --git a/src/marshal.list b/src/marshal.list
index 0276422ec6d4..2c35c685930a 100644
--- a/src/marshal.list
+++ b/src/marshal.list
@@ -1,4 +1,5 @@
VOID:INT,INT
VOID:OBJECT,OBJECT
+VOID:STRING,STRING
VOID:STRING,UINT
VOID:UINT,UINT
diff --git a/src/vte.cc b/src/vte.cc
index 14f6bf55ae4b..2e9c798ac016 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -8292,6 +8292,9 @@ VteTerminalPrivate::~VteTerminalPrivate()
remove_update_timeout(this);
+ g_free (m_notification_summary);
+ g_free (m_notification_body);
+
/* discard title updates */
g_free(m_window_title);
g_free(m_window_title_changed);
@@ -10328,6 +10331,15 @@ VteTerminalPrivate::emit_pending_signals()
emit_adjustment_changed();
+ if (m_notification_received) {
+ _vte_debug_print (VTE_DEBUG_SIGNALS,
+ "Emitting `notification-received'.\n");
+ g_signal_emit(object, signals[SIGNAL_NOTIFICATION_RECEIVED], 0,
+ m_notification_summary,
+ m_notification_body);
+ m_notification_received = FALSE;
+ }
+
if (m_window_title_changed) {
g_free (m_window_title);
m_window_title = m_window_title_changed;
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
index 7836271db108..f514c3b227f9 100644
--- a/src/vte/vteterminal.h
+++ b/src/vte/vteterminal.h
@@ -104,8 +104,10 @@ struct _VteTerminalClass {
void (*bell)(VteTerminal* terminal);
+ void (*notification_received)(VteTerminal* terminal, const gchar *summary, const gchar *body);
+
/* Padding for future expansion. */
- gpointer padding[16];
+ gpointer padding[15];
VteTerminalClassPrivate *priv;
};
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index 924b5a084dd3..a65a2a98b44a 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -657,6 +657,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
klass->child_exited = NULL;
klass->encoding_changed = NULL;
klass->char_size_changed = NULL;
+ klass->notification_received = NULL;
klass->window_title_changed = NULL;
klass->icon_title_changed = NULL;
klass->selection_changed = NULL;
@@ -733,6 +734,26 @@ vte_terminal_class_init(VteTerminalClass *klass)
1, G_TYPE_INT);
/**
+ * VteTerminal::notification-received:
+ * @vteterminal: the object which received the signal
+ * @summary: The summary
+ * @body: (allow-none): Extra optional text
+ *
+ * Emitted when a process running in the terminal wants to
+ * send a notification to the desktop environment.
+ */
+ signals[SIGNAL_NOTIFICATION_RECEIVED] =
+ g_signal_new(I_("notification-received"),
+ G_OBJECT_CLASS_TYPE(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(VteTerminalClass, notification_received),
+ NULL,
+ NULL,
+ _vte_marshal_VOID__STRING_STRING,
+ G_TYPE_NONE,
+ 2, G_TYPE_STRING, G_TYPE_STRING);
+
+ /**
* VteTerminal::window-title-changed:
* @vteterminal: the object which received the signal
*
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
index 5340725d374c..f8a83525b18c 100644
--- a/src/vtegtk.hh
+++ b/src/vtegtk.hh
@@ -55,6 +55,7 @@ enum {
SIGNAL_TEXT_INSERTED,
SIGNAL_TEXT_MODIFIED,
SIGNAL_TEXT_SCROLLED,
+ SIGNAL_NOTIFICATION_RECEIVED,
SIGNAL_WINDOW_TITLE_CHANGED,
LAST_SIGNAL
};
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index cff2157cc0d0..31636f0bc56b 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -493,6 +493,11 @@ public:
gboolean m_cursor_moved_pending;
gboolean m_contents_changed_pending;
+ /* desktop notification */
+ gboolean m_notification_received;
+ gchar *m_notification_summary;
+ gchar *m_notification_body;
+
/* window name changes */
char* m_window_title;
char* m_window_title_changed;
diff --git a/src/vteseq-n.gperf b/src/vteseq-n.gperf
index f060c98200dd..b530e3194eac 100644
--- a/src/vteseq-n.gperf
+++ b/src/vteseq-n.gperf
@@ -169,4 +169,5 @@ struct vteseq_n_struct {
"set-current-directory-uri", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_current_directory_uri)
"set-current-file-uri", VTE_SEQUENCE_HANDLER(vte_sequence_handler_set_current_file_uri)
"urxvt-777", VTE_SEQUENCE_HANDLER(vte_sequence_handler_urxvt_777)
+"send-notification", VTE_SEQUENCE_HANDLER(vte_sequence_handler_send_notification)
"iterm2-1337", VTE_SEQUENCE_HANDLER(vte_sequence_handler_iterm2_1337)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 2330939d8068..53ade2e3d4ad 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -2322,6 +2322,96 @@ vte_sequence_handler_return_terminal_id (VteTerminalPrivate *that, GValueArray *
vte_sequence_handler_send_primary_device_attributes (that, params);
}
+static void
+vte_sequence_handler_send_notification (VteTerminalPrivate *that, GValueArray *params)
+{
+ GValue *value;
+ const char *end;
+ char *option = NULL;
+ char *str = NULL;
+ char *p, *validated;
+
+ g_clear_pointer (&that->m_notification_summary, g_free);
+ g_clear_pointer (&that->m_notification_body, g_free);
+
+ value = g_value_array_get_nth (params, 0);
+ if (value == NULL) {
+ goto out;
+ }
+
+ if (G_VALUE_HOLDS_STRING (value)) {
+ option = g_value_dup_string (value);
+ } else if (G_VALUE_HOLDS_POINTER (value)) {
+ option = that->ucs4_to_utf8 ((const guchar *)g_value_get_pointer (value));
+ } else {
+ goto out;
+ }
+
+ if (g_strcmp0 (option, "notify") != 0) {
+ goto out;
+ }
+
+ value = g_value_array_get_nth (params, 1);
+ if (value == NULL) {
+ goto out;
+ }
+
+ if (G_VALUE_HOLDS_STRING (value)) {
+ str = g_value_dup_string (value);
+ } else if (G_VALUE_HOLDS_POINTER (value)) {
+ str = that->ucs4_to_utf8 ((const guchar *)g_value_get_pointer (value));
+ } else {
+ goto out;
+ }
+
+ g_utf8_validate (str, strlen (str), &end);
+ validated = g_strndup (str, end - str);
+
+ /* No control characters allowed. */
+ for (p = validated; *p != '\0'; p++) {
+ if ((*p & 0x1f) == *p) {
+ *p = ' ';
+ }
+ }
+
+ that->m_notification_summary = validated;
+ g_free (str);
+
+ that->m_notification_received = TRUE;
+ if (params->n_values == 2) {
+ goto out;
+ }
+
+ value = g_value_array_get_nth (params, 2);
+ if (value == NULL) {
+ goto out;
+ }
+
+ if (G_VALUE_HOLDS_STRING (value)) {
+ str = g_value_dup_string (value);
+ } else if (G_VALUE_HOLDS_POINTER (value)) {
+ str = that->ucs4_to_utf8 ((const guchar *)g_value_get_pointer (value));
+ } else {
+ goto out;
+ }
+
+ g_utf8_validate (str, strlen (str), &end);
+ validated = g_strndup (str, end - str);
+
+ /* No control characters allowed. */
+ for (p = validated; *p != '\0'; p++) {
+ if ((*p & 0x1f) == *p) {
+ *p = ' ';
+ }
+ }
+
+ that->m_notification_body = validated;
+ g_free (str);
+
+ out:
+ g_free (option);
+}
+
/* Send secondary device attributes. */
static void
vte_sequence_handler_send_secondary_device_attributes (VteTerminalPrivate *that, GValueArray *params)
--
2.9.3
From a1d5c9c46f967dc2eeee0dd696b1da4efbad0e7a Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 29 Jan 2015 13:09:17 +0100
Subject: [PATCH 2/5] vte.sh: Emit OSC 777 from PROMPT_COMMAND
https://bugzilla.gnome.org/show_bug.cgi?id=711059
---
src/vte.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/vte.sh b/src/vte.sh
index 2d211caa2f17..1c0543bd9d26 100644
--- a/src/vte.sh
+++ b/src/vte.sh
@@ -50,9 +50,11 @@ __vte_osc7 () {
}
__vte_prompt_command() {
+ local command=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]\+ *//')
+ command="${command//;/ }"
local pwd='~'
[ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
- printf "\033]0;%s@%s:%s\007%s" "${USER}" "${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"
+ printf "\033]777;notify;Command completed;%s\007\033]0;%s@%s:%s\007%s" "${command}" "${USER}" "${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"
}
case "$TERM" in
--
2.9.3
From 40d6105ed753298695c4fa87a5b3ffc7e1b803a2 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 22 Jan 2015 16:37:10 +0100
Subject: [PATCH 3/5] vteapp: Add a test for the notification-received signal
---
src/app.vala | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/app.vala b/src/app.vala
index 58698f92fc10..464a02a00230 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -309,6 +309,8 @@ class Window : Gtk.ApplicationWindow
if (App.Options.object_notifications)
terminal.notify.connect(notify_cb);
+ terminal.notification_received.connect(notification_received_cb);
+
/* Settings */
if (App.Options.no_double_buffer)
terminal.set_double_buffered(false);
@@ -772,6 +774,11 @@ class Window : Gtk.ApplicationWindow
set_title(terminal.get_window_title());
}
+ private void notification_received_cb(Vte.Terminal terminal, string summary, string? body)
+ {
+ print ("[%s]: %s\n", summary, body);
+ }
+
} /* class Window */
class App : Gtk.Application
--
2.9.3
From cb3a4f0cc2648ed310cdceceb4d5a7a3536a6432 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Fri, 13 May 2016 17:53:54 +0200
Subject: [PATCH 4/5] Add a property to configure the scroll speed
By default, it is set to zero which gives the current behaviour of
moving the buffer by a function of the number of visible rows.
https://bugzilla.redhat.com/show_bug.cgi?id=1103380
---
doc/reference/vte-sections.txt | 1 +
src/vte.cc | 19 +++++++++++++++++-
src/vte/vteterminal.h | 4 ++++
src/vtegtk.cc | 45 ++++++++++++++++++++++++++++++++++++++++++
src/vtegtk.hh | 1 +
src/vteinternal.hh | 2 ++
6 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt
index 56ae7754491d..58ce6c2c5c23 100644
--- a/doc/reference/vte-sections.txt
+++ b/doc/reference/vte-sections.txt
@@ -41,6 +41,7 @@ vte_terminal_set_cursor_shape
vte_terminal_get_cursor_shape
vte_terminal_get_cursor_blink_mode
vte_terminal_set_cursor_blink_mode
+vte_terminal_set_scroll_speed
vte_terminal_set_scrollback_lines
vte_terminal_set_font
vte_terminal_get_font
diff --git a/src/vte.cc b/src/vte.cc
index 2e9c798ac016..b402a96a7e80 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -9611,6 +9611,7 @@ void
VteTerminalPrivate::widget_scroll(GdkEventScroll *event)
{
gdouble delta_x, delta_y;
+ gdouble scroll_speed;
gdouble v;
gint cnt, i;
int button;
@@ -9664,7 +9665,13 @@ VteTerminalPrivate::widget_scroll(GdkEventScroll *event)
return;
}
- v = MAX (1., ceil (gtk_adjustment_get_page_increment (m_vadjustment) / 10.));
+ if (m_scroll_speed == 0) {
+ scroll_speed = ceil (gtk_adjustment_get_page_increment (m_vadjustment) / 10.);
+ } else {
+ scroll_speed = m_scroll_speed;
+ }
+
+ v = MAX (1., scroll_speed);
_vte_debug_print(VTE_DEBUG_EVENTS,
"Scroll speed is %d lines per non-smooth scroll unit\n",
(int) v);
@@ -9881,6 +9888,16 @@ VteTerminalPrivate::decscusr_cursor_shape()
}
bool
+VteTerminalPrivate::set_scroll_speed(unsigned int scroll_speed)
+{
+ if (scroll_speed == m_scroll_speed)
+ return false;
+
+ m_scroll_speed = scroll_speed;
+ return true;
+}
+
+bool
VteTerminalPrivate::set_scrollback_lines(long lines)
{
glong low, high, next;
diff --git a/src/vte/vteterminal.h b/src/vte/vteterminal.h
index f514c3b227f9..89c267555cf9 100644
--- a/src/vte/vteterminal.h
+++ b/src/vte/vteterminal.h
@@ -267,6 +267,10 @@ void vte_terminal_set_cursor_shape(VteTerminal *terminal,
_VTE_PUBLIC
VteCursorShape vte_terminal_get_cursor_shape(VteTerminal *terminal) _VTE_GNUC_NONNULL(1);
+_VTE_PUBLIC
+void vte_terminal_set_scroll_speed(VteTerminal *terminal,
+ guint scroll_speed) _VTE_GNUC_NONNULL(1);
+
/* Set the number of scrollback lines, above or at an internal minimum. */
_VTE_PUBLIC
void vte_terminal_set_scrollback_lines(VteTerminal *terminal,
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index a65a2a98b44a..20d36449368c 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -464,6 +464,9 @@ vte_terminal_get_property (GObject *object,
case PROP_REWRAP_ON_RESIZE:
g_value_set_boolean (value, vte_terminal_get_rewrap_on_resize (terminal));
break;
+ case PROP_SCROLL_SPEED:
+ g_value_set_uint (value, impl->m_scroll_speed);
+ break;
case PROP_SCROLLBACK_LINES:
g_value_set_uint (value, impl->m_scrollback_lines);
break;
@@ -550,6 +553,9 @@ vte_terminal_set_property (GObject *object,
case PROP_REWRAP_ON_RESIZE:
vte_terminal_set_rewrap_on_resize (terminal, g_value_get_boolean (value));
break;
+ case PROP_SCROLL_SPEED:
+ vte_terminal_set_scroll_speed (terminal, g_value_get_uint (value));
+ break;
case PROP_SCROLLBACK_LINES:
vte_terminal_set_scrollback_lines (terminal, g_value_get_uint (value));
break;
@@ -1406,6 +1412,21 @@ vte_terminal_class_init(VteTerminalClass *klass)
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
/**
+ * VteTerminal:scroll-speed:
+ *
+ * The number of lines by which the buffer is moved when
+ * scrolling with a mouse wheel on top of the terminal
+ * Setting it to zero will cause the buffer to be moved by an
+ * amount depending on the number of visible rows the widget
+ * can display.
+ */
+ pspecs[PROP_SCROLL_SPEED] =
+ g_param_spec_uint ("scroll-speed", NULL, NULL,
+ 0, G_MAXUINT,
+ 0,
+ (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY));
+
+ /**
* VteTerminal:scrollback-lines:
*
* The length of the scrollback buffer used by the terminal. The size of
@@ -3448,6 +3469,30 @@ vte_terminal_get_row_count(VteTerminal *terminal)
}
/**
+ * vte_terminal_set_scroll_speed:
+ * @terminal: a #VteTerminal
+ * @scroll_speed: move the buffer by this number of lines while scrolling
+ *
+ * Sets the number of lines by which the buffer is moved when
+ * scrolling with a mouse wheel. Setting it to zero will cause the
+ * buffer to be moved by an amount depending on the number of visible
+ * rows the widget can display.
+ */
+void
+vte_terminal_set_scroll_speed(VteTerminal *terminal, guint scroll_speed)
+{
+ g_return_if_fail(VTE_IS_TERMINAL(terminal));
+
+ GObject *object = G_OBJECT(terminal);
+ g_object_freeze_notify(object);
+
+ if (IMPL(terminal)->set_scroll_speed(scroll_speed))
+ g_object_notify_by_pspec(object, pspecs[PROP_SCROLL_SPEED]);
+
+ g_object_thaw_notify(object);
+}
+
+/**
* vte_terminal_set_scrollback_lines:
* @terminal: a #VteTerminal
* @lines: the length of the history buffer
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
index f8a83525b18c..98c616f54de6 100644
--- a/src/vtegtk.hh
+++ b/src/vtegtk.hh
@@ -80,6 +80,7 @@ enum {
PROP_MOUSE_POINTER_AUTOHIDE,
PROP_PTY,
PROP_REWRAP_ON_RESIZE,
+ PROP_SCROLL_SPEED,
PROP_SCROLLBACK_LINES,
PROP_SCROLL_ON_KEYSTROKE,
PROP_SCROLL_ON_OUTPUT,
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 31636f0bc56b..e38176cb3ff5 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -385,6 +385,7 @@ public:
gboolean m_scroll_on_output;
gboolean m_scroll_on_keystroke;
gboolean m_alternate_screen_scroll;
+ guint m_scroll_speed;
vte::grid::row_t m_scrollback_lines;
/* Restricted scrolling */
@@ -1093,6 +1094,7 @@ public:
bool set_mouse_autohide(bool autohide);
bool set_pty(VtePty *pty);
bool set_rewrap_on_resize(bool rewrap);
+ bool set_scroll_speed(unsigned int scroll_speed);
bool set_scrollback_lines(long lines);
bool set_scroll_on_keystroke(bool scroll);
bool set_scroll_on_output(bool scroll);
--
2.9.3
From 20c4541a4e3bc3d8ddb5332c730808e35bdbe48e Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Fri, 13 May 2016 17:54:57 +0200
Subject: [PATCH 5/5] vteapp: Add a test for the scroll-speed property
https://bugzilla.redhat.com/show_bug.cgi?id=1103380
---
src/app.vala | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/app.vala b/src/app.vala
index 464a02a00230..31b10aef55d2 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -334,6 +334,7 @@ class Window : Gtk.ApplicationWindow
terminal.set_rewrap_on_resize(!App.Options.no_rewrap);
terminal.set_scroll_on_output(false);
terminal.set_scroll_on_keystroke(true);
+ terminal.set_scroll_speed(App.Options.scroll_speed);
terminal.set_scrollback_lines(App.Options.scrollback_lines);
/* Style */
@@ -847,6 +848,7 @@ class App : Gtk.Application
public static bool object_notifications = false;
public static string? output_filename = null;
public static bool reverse = false;
+ public static uint scroll_speed = 0;
public static int scrollback_lines = 512;
public static int transparency_percent = 0;
public static bool version = false;
@@ -1038,6 +1040,8 @@ class App : Gtk.Application
"Save terminal contents to file at exit", null },
{ "reverse", 0, 0, OptionArg.NONE, ref reverse,
"Reverse foreground/background colors", null },
+ { "scroll-speed", 0, 0, OptionArg.INT, ref scroll_speed,
+ "Specify the scroll speed", null },
{ "scrollback-lines", 'n', 0, OptionArg.INT, ref scrollback_lines,
"Specify the number of scrollback-lines", null },
{ "transparent", 'T', 0, OptionArg.INT, ref transparency_percent,
--
2.9.3
|