Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xdot/ui/elements: Bugfix: Check if GTK default settings are Null
When GTK default settings are not present in the system "xdot" fails with the following error: AttributeError: 'NoneType' object has no attribute 'get_property' This is because "Gtk.Settings.get_default()" return value can be "Null" when the GTK default settings are not present (see <https://docs.gtk.org/gtk3/type_func.Settings.get_default.html>.) This patch fixes this error by adding additional check for Null object before setting the default font name. * xdot/ui/elements.py (TextShape): Don't set "DEFAULT_FONTNAME" constant. (TextShape.__init__): Set the default font name as "default_fontname" class field with an additional check for "Null" value. (TextShape._draw): Use "self.default_fontname".
- Loading branch information