Scrollbar on left side doesn't work

Bug #1520761 reported by Egmont Koblinger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Terminator
Fix Released
Medium
Stephen Boddy

Bug Description

Set the scrollbar to the left side, it's still on the right.

There's a "FIXME FOR GTK3" for this in terminatorlib/terminal.py.

Related branches

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

It takes effect in newly opened terminals, just not on the already existing ones.

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

reorder_child() was simply called on the wrong object. Changing that one only would already fix the bug.

However, I went for further cleanup.

The initialization in create_terminalbox() played with pack_start vs. pack_end. reconfigure(), on the other hand, checked whether the value actually changed and used reorder_child().

This pattern of reconfigure() checking for modification and only applying if it changed is a bad pattern (leads to code duplication as seen here) and is not used at other properties (well, hopefully not for too many of them). Instead, it's much simpler if reconfigure() is responsible for coming up the initial configuration as well.

I found it really confusing that the initial setup played with pack_start vs. pack_end, yet reconfigure didn't modify these properties but rather reordered the children. I actually expected this not to work and am still surprised that it works, it must be my misunderstanding of how these two properties relate to each other.

So, the initialization is way simpler now, and reconfigure is also simpler by omitting a conditional.

Another, equally correct approach could have been to play with the pack_start / pack_end properties, something like:

        if self.config['scrollbar_position'] == 'left':
            self.terminalbox.set_child_packing(self.vte, True, True, 0, Gtk.PackType.END)
            self.terminalbox.set_child_packing(self.scrollbar, False, True, 0, Gtk.PackType.END)
        elif self.config['scrollbar_position'] == 'right':
            self.terminalbox.set_child_packing(self.vte, True, True, 0, Gtk.PackType.START)
            self.terminalbox.set_child_packing(self.scrollbar, False, True, 0, Gtk.PackType.START)

or even setting scrollbar's packtype to the opposite of vte's.

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

... and there's no need for the instance variable scrollbar_position anymore.

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

Affected gtk2 too.

summary: - (gtk3) Scrollbar on left side doesn't work
+ Scrollbar on left side doesn't work
Changed in terminator:
status: New → Fix Committed
Changed in terminator:
status: Fix Committed → In Progress
assignee: nobody → Egmont Koblinger (egmont-gmail)
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Hi Egmont, it seems this causes a regression. If the user has the scrollbar set to disabled, it works when a window is first opened, but splitting panes or creating tabs causes both the old and new panes to have scrollbars.

It's an easy one-line fix readding one of the deleted lines.
    self.scrollbar.set_no_show_all(True)

Without this the show_all calls scattered around descend the widget tree, and make everything visible including the hidden scrollbars.

I'll put this back to Fix Committed - found the fix while writing this comment.

Changed in terminator:
status: In Progress → Fix Committed
assignee: Egmont Koblinger (egmont-gmail) → Stephen Boddy (stephen-j-boddy)
importance: Undecided → Low
importance: Low → Medium
Revision history for this message
Teresa e Junior (teresaejunior) wrote :

The status on this bug was changed to "Fix Committed", but the fix was never committed! It causes other annoyances, as in bug #1522568.

Changed in terminator:
status: Fix Committed → Fix Released
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

See also the discussion in bug 1645704.

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

Other bug subscribers

Remote bug watches

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