(gtk3-only) Use GTK3 overlay scrollbars

Bug #1512106 reported by Stephen Boddy
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Terminator
New
Wishlist
Unassigned

Bug Description

Ubuntu 15.10 uses the new overlay scrollbars added in Gnome 3.16+. The Terminator scrollbars are using the old scrollbar style.

The applications using the new overlays are almost certainly using (subclassing, or are subclasses of) the GtkScrolledWindow widget, and setting the overlay:
https://developer.gnome.org/gtk3/stable/GtkScrolledWindow.html#gtk-scrolled-window-set-overlay-scrolling

GNOME-Terminal and Terminator work differently. They both create a horizontal box, and pack the terminal widget in one, and the scrollbar widget in the other. The adjustment of the terminal is connected to the scrollbar when the scrollbar is created:
https://developer.gnome.org/gtk3/stable/GtkScrollable.html#gtk-scrollable-get-vadjustment
https://developer.gnome.org/gtk3/stable/GtkScrollbar.html#gtk-scrollbar-new

I see that the GtkScrolledWindow can have a widget added to it that implements the GtkScrollable interface, and the Vte widget does implement that interface. So by changing the HBox to a GtkScrolledWindow and adding the VteTerminal to it, and dropping the separate scrollbar, it should work. It would be quite invasive to do though - lots of things would probably need to change.

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Minimal proof of concept for embedding the VTE widget into a GtkScrolledWindow, tested as working by leoheck, raiser of https://answers.launchpad.net/terminator/+question/273386

Couple of notes:
Checks for 3.16+ before trying to set the overlay option
Does not currently theme the background - probably requires messing with styling somehow.
Also enables the kinetic scrolling feature. Anyone with a touchscreen want to test that and let me know if it works?

Changed in terminator:
importance: Undecided → Wishlist
description: updated
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Hmm. Interesting, and highlights a number of problems that we would also have. Can't believe I never thought of the one about being unable to select characters with the overlay in the way :-) My excuse is that I'm not running 15.10 so can't see the effect myself.

For me it's not a highly desirable addition, so I'm probably not going to expend further effort, but I'll leave this item here in case someone else wants to have a crack at it.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

I'm not familiar with how it goes/should go, just linked that :) I haven't tried that g-t patch.

The script you attached here works kinda nicely for me. No problem with selecting text. No problem with reporting mouse to non-alternate-screen apps that are interested.

Enabling or disabling kinetic scrolling doesn't make a difference at all. It works for vte anyways, and apparently works for the scrollbar itself too.

Problem 1: When you click on the gray part of the scrollbar, the viewport moves there in maybe half a second, showing intermediate positions in between. This is until I drag the scrollbar. If I drag the scrollbar once, from that moment onwards I never get this animated scroll, it always suddenly jumps to the position where I click. Could this be a Gtk bug?

Problem 2: A giant gray/white-ish overlay at the bottom of the terminal window, in its full width. No clue about it.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

On kinetic scrolling, my understanding from reading the docs is that this only works on devices with a touchscreen (i.e. some laptops and tablets).

On Problem 1: I think I'd have to give a strong suspicious sideways look at GTK and/or VTE over the erratic behaviour you see. That script is completely stripped back. I can't see how it is hiding a bug or deficiency, so logically it is either in GTK, VTE, or the interaction between VTE's GtkScrollable interface and the GtkScrolledWindow class and it's components (range, adjustment etc.).

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

On kinetic scrolling: Probably you're right. I read on a random forum that it's the same as smooth scrolling, but most likely that's false information.

On problem 1: I managed to file a bug with a beautiful number :) https://bugzilla.gnome.org/show_bug.cgi?id=757500

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

I'm pretty sure kinetic scrolling is about touch interfaces where you "flick" a page, and it continues scrolling and comes to a stop slowly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.