Split terminal does not maximize or zoom on terminator-gtk3

Bug #1485293 reported by Daniel Olivares
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Terminator
Fix Released
Medium
Stephen Boddy

Bug Description

When I split the terminal and try to maximize one of them, it fails. This is the log it puts out:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/terminatorlib/window.py", line 497, in zoom
    self.zoom_data = widget.get_zoom_data()
  File "/usr/lib/python2.7/site-packages/terminatorlib/terminal.py", line 1234, in get_zoom_data
    data['old_padding'] = self.vte.get_padding()
AttributeError: 'Terminal' object has no attribute 'get_padding'

This is running on Arch Linux with up to date packages as of 2AM Central with Plasma 5 using the terminator-gtk3-bzr AUR package.

Related branches

summary: - Split terminal does not maximize or zoom
+ Split terminal does not maximize or zoom on terminator-gtk3
description: updated
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Yeah, I have noticed and "fixed" this before, then forgot to commit the thing. Unfortunately, the fix also exposes a *really* nasty bug.
At some point (not predictable) the restore from zoom can cause a segfault or even nuke the whole desktop. I've tracked it down to setting the font of the restored terminal back to the old setting so far, but I don't yet know why it dies.

Changed in terminator:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Stephen Boddy (stephen-j-boddy)
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

OK, I also sussed out the zoom issue. We are getting the font from the vte widget, and then trying to use it later. By which time vte has freed it, and we are accessing a corrupt font description. Big difference between behaviour in the older vte. Simple fix is to make an immediate local copy of the font description. Need to clean up the tree from my investigations before I submit.

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

Fixed in gtk3 rev. 1585

Changed in terminator:
status: In Progress → Fix Committed
Revision history for this message
Daniel Olivares (fuzzoli87) wrote :

I can confirm that the fix works. Thanks for the quick turnaround. I'm not too familiar with the gtk3/vte/everything libraries, well until last night when I got into understanding the tool I work with. I tried to run Terminator locally but it was late and didn't want to play with setting my virtualenvwrapper stuff.

Anyways, I figured the issue was that the "get_padding" function was deprecated as the libvtemm docs say. After looking at your fix though, I'm completely lost as to the structure and dependencies of Terminator. I've caught the "learn this now" bug though so I'm planning on diving into the code.

Thanks for the quick fix!

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

"After looking at your fix though, I'm completely lost as to the structure and dependencies of Terminator."

Not sure what you meant by this, if this is because I didn't explain the fix well, or just a general observation that you don't understand Terminator code well enough yet to have fixed this yourself.

The GTK3 port is still suffering from lingering porting'itus. There are some really annoying and gruesome changes between GTK2 and GTK3. The removal of the padding attribute is just one in a long line of "WTF" moments I've had. I haven't figured out exactly what needs to be done for GTK3 with regards to replacing the padding. The lines 1234 & 1252-1259 fix/workaround the first issue with padding.

The second part in line 1230 is to stop the segfaults. As near as I can tell between GTK2 VTE and GTK3 VTE behaviour has changed and the font description requested from the VTE get's freed immediately on return to the VTE code, meaning that Terminator later tries to access invalid data. The simple fix is to copy it immediately so that we don't care if VTE frees it.

If it was a general observation, then don't worry. It takes a little while, but it'll click into place. The best thing to do is find things that annoy you and find a way to fix them. That helps you learn the layout. If you're going to do that assign the bugs to yourself, and if you get stuck it's as good a place as any to ask for a pointer.

Revision history for this message
Daniel Olivares (fuzzoli87) wrote :

I wasn't clear enough. I'm sorry, I tend to type how I think and don't really consider how much of it makes sense to others. I meant that I thought the fix was using the "inner-body" property somehow. As stated here,
https://developer.gnome.org/libvtemm/unstable/deprecated.html#_deprecated000002

So I was expecting your fix to include that somehow. Yet, it was completely somewhere else. So my comment was simply that it revealed my ignorance of the architecture of the application and these libraries. Heck, I'm not even sure if I was looking at the right docs!

I intend to get it running locally, I checked out the branch and tried to run it but I had to do some extra maneuvering to get virtualenv to get all the dependencies to do it.

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

Don't worry, usually takes me three tries to get from stream-of-conscious to vaguely coherent.

Actually, as memory serves you are on the right track with the inner-body. I just couldn't figure it out when I first looked at this. To be sure, the "fix" I provided is not the whole thing, and simply gets the Zoom/Maximise working. I don't know exactly why the padding value is read in the GTK2 version, or if it was necessary. I see no ill-effects of not having it in GTK3, so...

 ¯\_(ツ)_/¯

BTW: https://developer.gnome.org/vte/ is the official API docs as far as I know. I think the docs you linked to are with C++ OO wrapping. Of course, nothing is straightforward, so sometimes there are differences between the C calls, and how to use the API in Python.

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

And I should probably mention http://lazka.github.io/pgi-docs/Vte-2.91/index.html which seems to be an autodoc of the gobject introspection of the VTE component.

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

Okay, so I was looking at the zoom scaling code, and it dawned on me that we do not use padding in any way in GTK2. So I'm going to remove that code from GTK2 and remove the related GTK3 FIXME's.

Changed in terminator:
status: Fix Committed → Fix Released
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.