r1573 for me breaks running on KDE Plasma on Arch Linux

Bug #1476072 reported by James Harvey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Terminator
Fix Released
Low
Unassigned

Bug Description

Up to r1572 works fine.

Starting with r1573 and any revision after, when attempting to launch Terminator, its icon bounces around my mouse cursor for about 5 seconds in KDE Plasma, then disappears, but the app itself never even starts to load.

If I start r1572 from console, I see:
===============
/usr/lib/python2.7/site-packages/terminatorlib/window.py:65: Warning: The property GtkWindow:allow-shrink is deprecated and shouldn't be used anymore. It will be removed in a future version.
  self.set_property('allow-shrink', True)

** (terminator:30042): WARNING **: Binding '<Shift><Control><Alt>a' failed!
Unable to bind hide_window key, another instance/window has it.
PluginRegistry::load_plugins: Importing plugin __init__.py failed: 'module' object has no attribute 'AVAILABLE'
<Window object at 0x7f4de83fc050 (terminatorlib+window+Window at 0x5583765c8070)> is not in registered window list
===============

r1573 from console shows:
===============
/usr/lib/python2.7/site-packages/terminatorlib/window.py:65: Warning: The property GtkWindow:allow-shrink is deprecated and shouldn't be used anymore. It will be removed in a future version.
  self.set_property('allow-shrink', True)

** (terminator:30079): WARNING **: Binding '<Shift><Control><Alt>a' failed!
Unable to bind hide_window key, another instance/window has it.
PluginRegistry::load_plugins: Importing plugin __init__.py failed: 'module' object has no attribute 'AVAILABLE'
-----> After here is new to r1573 -----<
Traceback (most recent call last):
  File "/usr/bin/terminator", line 110, in <module>
    TERMINATOR.create_layout(OPTIONS.layout)
  File "/usr/lib/python2.7/site-packages/terminatorlib/terminator.py", line 264, in create_layout
    window, terminal = self.new_window()
  File "/usr/lib/python2.7/site-packages/terminatorlib/terminator.py", line 191, in new_window
    terminal = maker.make('Terminal')
  File "/usr/lib/python2.7/site-packages/terminatorlib/factory.py", line 94, in make
    output = func(**kwargs)
  File "/usr/lib/python2.7/site-packages/terminatorlib/factory.py", line 106, in make_terminal
    return(terminal.Terminal())
  File "/usr/lib/python2.7/site-packages/terminatorlib/terminal.py", line 178, in __init__
    self.reconfigure()
  File "/usr/lib/python2.7/site-packages/terminatorlib/terminal.py", line 762, in reconfigure
    self.titlebar.update()
  File "/usr/lib/python2.7/site-packages/terminatorlib/titlebar.py", line 112, in update
    title_font = pango.FontDescription(self.config.get_system_prop_font())
  File "/usr/lib/python2.7/site-packages/terminatorlib/config.py", line 365, in get_system_prop_font
    self.system_prop_font = value.get_string()
AttributeError: 'NoneType' object has no attribute 'get_string'
===============

KDE System Settings -> Fonts -> Fonts shows:
  General: Oxygen-Sans 10
  Fixed width: Oxygen Mono 9
  Small: Oxygen-Sans 8
  Toolbar: Oxygen-Sans 9
  Menu: Oxygen-Sans 10
  Window title: Oxygen-Sans 10

Not sure what a prop_font is, for what it's trying to do at :365.

gconf 3.2.6(-3 arch package) and python2-gconf 2.28.1(-9 arch package) are installed on my system.

Never heard of gconf before. Looks like it was installed as a dependency when I installed virt-manager, which I've installed but haven't gotten around to using yet.

Revision history for this message
James Harvey (jamespharvey20) wrote :

(python2-gconf was installed at the same time as a dependency to virt-manager.)

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

Hi James, it's all down to you being really strange ;-) Running a GNOME terminal emulator under KDE? The pitchfork brigade will be coming for you!

The gconf is the GNOME configuration store, which is similar to the windows registry - a database of key values pairs in a tree structure.

The code is trying to find the font that is set as desktop default for PROPortional use (as opposed to monospace, and use this as the titlebar font. It seems that as a KDE user this value was never added on your system, hence the return value when it gets looked up is None, instead of a GValue type object. The method call to get_string on a None object causes the exception.

This is relatively simple to fix. It just needs to fall back to a predefined string if the gconf lookup returns None.

What I do find curious is that the code is *identical* for the monospace lookup in the following method. Did you have a custom font defined for the terminal in the profile? If not and you were using the system monospaced font, then I would expect an issue before r1573. If there wasn't an issue then it would seem the gconf on your system has some bits and pieces defined.

This problem should not happen on systems where the gconf is properly populated (i.e. GNOME, xfce, elementary etc.)

If you feel adventurous you could apply the following locally to r1573 and tell me if it fixes it for you:
line 365 in config.py:
self.system_prop_font = value.get_string()

should be changed to:
if value:
  self.system_prop_font = value.get_string()
else:
  self.system_prop_font = "Sans 10"

Revision history for this message
James Harvey (jamespharvey20) wrote :

The pitchfork brigade knows where I live. :-) Absolutely love terminator. And, not just because it's my favorite movie series. (1, 2, and 5 anyway.) Prever KDE over GNOME. Terminator has always worked fine for me on KDE. :-) And, thankfully it doesn't pull in the whole gnome system as dependencies!

Making your suggested change does the trick. r1573 works fine. Most recent, r1583, also works fine.

"gconftool-2 --recursive-list /" I think is the command that would dump all keys/values in the gconf database, and returns nothing at all. So I don't think its database has ever been populated with anything.

Terminator defaults to my system default. I don't have a custom font chosen.

Looking back to when I set up fonts, in /etc/fonts/conf.avail, I created a 61-oxygen-mono.conf linking monospace and Oxygen Mono, a 61-oxygen-sans.conf linking sans-serif to Oxygen-Sans, and symlinked those into /etc/fonts/conf.d.

Never set up anything for proportional because In KDE 's fonts configuration (KDE System Settings -> Fonts -> Fonts), it doesn't list a proportional category. Just General, Fixed width, Small, Toolbar, Menu, and Window title.

But, I am also at a loss for why before r1573 this issue didn't manifest itself, now looking at the code. gconf was installed about two weeks ago, and I've started terminator a bunch since then...

By the way, what happens if get_system_{prop,mono}_font() returns nothing? This can happen if self.system_prop_font is none and 'gconf' not in globals. Same in self.system_mono_font. Should that situation also return a predefined string like "Sans 10" or "Mono 10"?

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

Hi James, Reading the code, I'm baffled you didn't have issues. But hey-ho.

The two places where the get_system_{prop,mono}_font() functions get called immediately check for the None value and skip trying to set the widget font if it is None.

OK, so I have the fix in my local working repos. I'll push it next time I'm doing code changes and pushing them.

Changed in terminator:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Committed in rev 1584

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