Closed rolandlo closed 3 years ago
Is there a fix for that problem?
Well... I never saw that error message before. Which piece of code is loading GTK 3 and which piece is loading GTK 4? Did one of them recently-ish upgrade? I tried to find some Lua code, but "that repo" does not contain the code, just flatpack-things.
A random guess would be: You are doing require("lgi").Gtk
. This loads the latest version of Gtk
that is available. If I understood your discussion link correctly, previously there was just Gtk 3 available, but now there is Gtk 4. Thus, this now loads Gtk 4. You want require("lgi").require("Gtk", "3.0")
instead (no idea if it really is 3.0
that you want nor do I really know the meaning of this string. This is just taken from some code of out of lgi's samples/
that `git grep found.)
Yup, you just load the latest version of Gtk that is available: https://github.com/xournalpp/xournalpp/blob/e25f0b0a731d497659a83803e4e8399ceff98624/plugins/MigrateFontSizes/main.lua#L30
Put differently: Sorry, but you are getting what you ask for and I don't think lgi can do anything about this.
@psychon Thanks a lot. Indeed this simple change in the Lua plugin fixes the problem.
Thanks for the feedback. I'm glad my random guess was right.
The Xournal++ flatpak, see also github repo, has worked fine with Lua lgi using the Gnome 3.38 runtime and lgi commit 0fdcf8c677094d0c109dfb199031fdbc0c9c47ea. We use
lgi
for some plugins, in particular a plugin to migrate font sizes from Xournal++ version 1.0.x to version 1.1.0. After updating to lgi commit 4071f902b635d3a7078c65162fce347367b1371d and using Gnome 41 runtime, that plugin does not work any longer. Other Lua plugins (that do not uselgi
) still work.The error messages I got (reproduced by another developer) are:
Is there a fix for that problem? For further information see this discussion.
CC @psychon