@@ -34,7 +34,7 @@ class TerminalWindow : Gtk.Window
3434 private const string link_expr = " (((file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\ .)[-A-Za-z0-9\\ .]+(:[0-9]*)?(/[-A-Za-z0-9_\\ $\\ .\\ +\\ !\\ *\\ (\\ ),;:@&=\\ ?/~\\ #\\ %]*[^]'\\ .}>\\ ) ,\\\" ])?" ;
3535 private int link_tag;
3636
37- private const Gdk . ModifierType key_mask = Gdk . ModifierType . SHIFT_MASK | Gdk . ModifierType . CONTROL_MASK | Gdk . ModifierType . MOD1_MASK |
37+ private const Gdk . ModifierType key_mask = Gdk . ModifierType . SHIFT_MASK | Gdk . ModifierType . CONTROL_MASK | Gdk . ModifierType . ALT_MASK |
3838 Gdk . ModifierType . SUPER_MASK | Gdk . ModifierType . HYPER_MASK | Gdk . ModifierType . META_MASK ;
3939
4040 public TerminalWindow (Gtk .Application app , string [] command , string ? title ,
@@ -46,15 +46,17 @@ class TerminalWindow : Gtk.Window
4646 this . font = font;
4747
4848 terminal = new Vte .Terminal ();
49- add (terminal);
49+ set_child (terminal);
5050
5151 terminal. child_exited. connect(() = > { destroy(); });
5252 terminal. decrease_font_size. connect(decrease_font_size_cb);
5353 terminal. increase_font_size. connect(increase_font_size_cb);
5454 terminal. window_title_changed. connect(window_title_changed_cb);
55+ /*
5556 terminal.key_press_event.connect(key_press_event_cb);
5657 terminal.button_press_event.connect(button_press_event_cb);
5758 terminal.drag_data_received.connect(drag_data_received_cb);
59+ */
5860
5961 terminal. set_audible_bell(false );
6062 terminal. set_cursor_blink_mode(Vte . CursorBlinkMode . SYSTEM );
@@ -69,8 +71,10 @@ class TerminalWindow : Gtk.Window
6971 if (font != null )
7072 terminal. set_font(Pango . FontDescription . from_string(this . font));
7173
74+ /*
7275 if (role != null)
7376 this.set_role(role);
77+ */
7478
7579 try {
7680 var regex = new Vte .Regex .for_match(link_expr, - 1 , PCRE2_MULTILINE );
@@ -81,9 +85,11 @@ class TerminalWindow : Gtk.Window
8185 // ignored
8286 }
8387
88+ /*
8489 Gtk.drag_dest_set(terminal, Gtk.DestDefaults.ALL, {}, Gdk.DragAction.COPY);
8590 Gtk.drag_dest_add_uri_targets(terminal); // prefer URIs to text
8691 Gtk.drag_dest_add_text_targets(terminal);
92+ */
8793
8894 try {
8995 terminal. spawn_sync(Vte . PtyFlags . DEFAULT ,
@@ -99,10 +105,10 @@ class TerminalWindow : Gtk.Window
99105 Idle . add(() = > { destroy(); return false ; });
100106 }
101107
102- show_all ();
108+ present ();
103109 }
104110
105- private static Gdk .RGBA ? get_color (string str )
111+ private static Gdk .RGBA ? parse_color (string str )
106112 {
107113 var color = Gdk . RGBA ();
108114 if (! color. parse(str)) {
@@ -143,6 +149,7 @@ class TerminalWindow : Gtk.Window
143149 }
144150 }
145151
152+ /*
146153 public override bool delete_event(Gdk.EventAny event)
147154 {
148155 var pty = terminal.get_pty();
@@ -165,6 +172,7 @@ class TerminalWindow : Gtk.Window
165172 dialog.destroy();
166173 return result != Gtk.ResponseType.ACCEPT;
167174 }
175+ */
168176
169177 private void decrease_font_size_cb ()
170178 {
@@ -181,6 +189,7 @@ class TerminalWindow : Gtk.Window
181189 set_title(terminal. get_window_title());
182190 }
183191
192+ /*
184193 private bool button_press_event_cb(Gdk.EventButton event)
185194 {
186195 if (((event.state & key_mask) == Gdk.ModifierType.CONTROL_MASK) && (event.button == 1)) {
@@ -239,6 +248,7 @@ class TerminalWindow : Gtk.Window
239248 }
240249 Gtk.drag_finish(context, true, false, time);
241250 }
251+ */
242252
243253 public void update_colors (string fg , string bg , string palette )
244254 {
@@ -248,8 +258,8 @@ class TerminalWindow : Gtk.Window
248258
249259 Gdk . RGBA [] colors = null ;
250260 foreach (var color in palette. split(" ," ))
251- colors + = get_color (color);
252- terminal. set_colors(get_color (fg), get_color (bg), colors);
261+ colors + = parse_color (color);
262+ terminal. set_colors(parse_color (fg), parse_color (bg), colors);
253263 }
254264}
255265
0 commit comments