diff --git a/gajim/application.py b/gajim/application.py index 22d4a5aae..c46a39c05 100644 --- a/gajim/application.py +++ b/gajim/application.py @@ -182,8 +182,8 @@ class GajimApplication(Gtk.Application): # Set Application Menu app.app = self - from gajim import gtkgui_helpers - builder = gtkgui_helpers.get_gtk_builder('application_menu.ui') + from gajim.gtk.util import get_builder + builder = get_builder('application_menu.ui') menubar = builder.get_object("menubar") appmenu = builder.get_object("appmenu") if app.prefers_app_menu(): diff --git a/gajim/gtk/util.py b/gajim/gtk/util.py index 4c918f6b4..eafc626ce 100644 --- a/gajim/gtk/util.py +++ b/gajim/gtk/util.py @@ -68,7 +68,10 @@ def get_builder(file_name, widget=None): if widget is not None: builder.add_objects_from_string(xml_text, [widget]) else: - builder.add_from_string(xml_text) + # Workaround + # https://gitlab.gnome.org/GNOME/pygobject/issues/255 + Gtk.Builder.__mro__[1].add_from_string( + builder, xml_text, len(xml_text.encode("utf-8"))) else: if widget is not None: builder.add_objects_from_file(file_path, [widget]) diff --git a/gajim/gtkgui_helpers.py b/gajim/gtkgui_helpers.py index 8afeaf27a..c9d36d82d 100644 --- a/gajim/gtkgui_helpers.py +++ b/gajim/gtkgui_helpers.py @@ -140,7 +140,10 @@ def get_gtk_builder(file_name, widget=None): if widget is not None: builder.add_objects_from_string(xml_text, [widget]) else: - builder.add_from_string(xml_text) + # Workaround + # https://gitlab.gnome.org/GNOME/pygobject/issues/255 + Gtk.Builder.__mro__[1].add_from_string( + builder, xml_text, len(xml_text.encode("utf-8"))) else: if widget is not None: builder.add_objects_from_file(file_path, [widget])