aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/terminal.vala
diff options
context:
space:
mode:
authorWolfgang Müller2021-06-18 16:15:04 +0200
committerWolfgang Müller2021-06-22 20:23:54 +0200
commita19f4b8c80d37f0940a6d7a0ba127ec9740cd6db (patch)
treee5cde0fad641d106b712317970a9b5db4a2cde24 /terminal.vala
parent20c7bc5cdf540094640a18f59ebb4a71bf118ea1 (diff)
downloadweltschmerz-a19f4b8c80d37f0940a6d7a0ba127ec9740cd6db.tar.gz
Use GtkBox and GtkScrollbar instead of GtkScrolledWindowbox-scroll
Upstream indicates that VTE is incompatible with GtkScrolledWindow. See [1] and [2] for more information. This commit contains a proof-of-concept implementation of an alternative solution using a GtkBox as the toplevel element. [1] https://gitlab.gnome.org/GNOME/vte/issues/11#note_264921 [2] https://bugzilla.gnome.org/show_bug.cgi?id=733210#c2
Diffstat (limited to 'terminal.vala')
-rw-r--r--terminal.vala16
1 files changed, 3 insertions, 13 deletions
diff --git a/terminal.vala b/terminal.vala
index d66fc51..69ae02e 100644
--- a/terminal.vala
+++ b/terminal.vala
@@ -1,5 +1,5 @@
[GtkTemplate (ui = "/weltschmerz/ui/terminal.ui")]
-class Terminal : Gtk.Overlay {
+class Terminal : Gtk.Box {
const string URL_REGEX = """(?>https?|ftp):\/\/[^\s\$.?#].(?>[^\s()"]*|\([^\s]*\)|"[^\s"]*")""";
const uint PCRE2_CASELESS = 0x00000008u;
const uint PCRE2_MULTILINE = 0x00000400u;
@@ -30,8 +30,8 @@ class Terminal : Gtk.Overlay {
[GtkChild] unowned Gtk.MenuItem copy_item_html;
[GtkChild] unowned Gtk.MenuItem open_directory_item;
[GtkChild] unowned Gtk.Revealer search_revealer;
- [GtkChild] unowned Gtk.ScrolledWindow scrolled_window;
[GtkChild] unowned Gtk.SearchEntry search_entry;
+ [GtkChild] unowned Gtk.Scrollbar scroll;
[GtkChild] unowned Vte.Terminal vte;
Gtk.Clipboard clipboard;
Gtk.Settings settings;
@@ -82,20 +82,10 @@ class Terminal : Gtk.Overlay {
}
}
- Gtk.PolicyType get_scrollbar_policy(bool want_scrollbar) {
- if (!want_scrollbar)
- return Gtk.PolicyType.NEVER;
-
- if (!settings.gtk_overlay_scrolling || overlay_scrolling_env_override)
- return Gtk.PolicyType.ALWAYS;
-
- return Gtk.PolicyType.AUTOMATIC;
- }
-
public void load_config(bool reload) {
var conf = new Config();
- scrolled_window.set_policy(Gtk.PolicyType.NEVER, get_scrollbar_policy(conf.scrollbar));
+ scroll.set_adjustment(vte.get_vadjustment());
vte.set_font(conf.font);
var char_width = (int)vte.get_char_width();