-
Notifications
You must be signed in to change notification settings - Fork 597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad argument #1 to 'registerlock' (userdata expected, got nil) #3394
Comments
This is an upstream issue. Since that issue exists for more than 2 years now, and this is the second time I heard this from a Manjaro user recently, it's most likely caused by a change in Manjaro. |
@sclu1034 I also found the issue you mentioned, but it didn't seem to provide any solution I was able to implement. Does this mean I cannot use awesome with Manjaro? Or maybe I can but I need to do some complex hack in the lua files? |
You cannot use LGI, or any project that depends on it, with GTK4. The maintainers of LGI may be able to help, or the people on the Manjaro forums. But to Awesome, this is an upstream issue and I don't see any way to "hack around it" in Awesome's Lua config. |
@MattiaSilvestri @sclu1034 then as workaround you can choose to not use gtk4 - specify version with (Not using awesomewm, but stumbled upon similar issue in @actionless you might want to reopen |
i'm using arch linux and have both gtk3 and gtk4 installed and after merging https://github.com/awesomeWM/awesome/pull/3297/files the problem disappeared could be smth manjaro-specific then |
Had the same issue today when application nautilus recently updated to use gnome-desktop-4 and gtk4
is there workaround to use gtk4 and gtk3 both installed in os and still using awesomewm? |
@zhisme for me what it worked was modifying all the files described here: lgi-devs/lgi#226 (comment) |
To re-iterate: |
i think the problem is old LGI version being installed (also very weird output of |
Seeing as lgi hasn't been updated in years now (5 years on luarocks), will the fix here be pushed to a fork? |
lgi dev has not had a new release since 2017, and development has been mostly at a halt for longer. beautiful/gtk.lua works around this by explicitly loading Gtk 3.0. Could this be done for other places where Gtk is loaded? If this can't be worked around by changing AwesomeWM code, at least we should update the AwesomeWM docs to say that you need to install lgi from git, and saying how to do so. lgi-devs/lgi#305 added a rockspec allowing building from the git repo.
|
which places? |
Hello @dyfrgi, I think there are some confusions that need to be clarified here: LGI is a GObject bindings using GObject-Introspection. Basically, its role is to allow Lua code to interact with external code from other applications that expose the appropriate interfaces. We can mention here GLib and Cairo that Awesome uses as its core libraries. → As a user, you need to manually build LGI from source only if you want to use Lua5.4 (BTW, Awesome supports Lua5.4 only when building from source). Otherwise, (when using Lua5.1 to Lua5.3 and LuaJIT) you should stick to the LGI distributed by your package manager. GTK is a lib Awesome can interact with thanks to LGI. The migration from GTK 3 to GTK 4 introduced a lot of breaking changes. They need to be taken care at LGI first, then it will reverb to the Awesome codebase. As a workaround, Awesome forces the usage of GTK 3. → As a user, there is nothing you have to do (maybe you need to install GTK 3, but most likely you already have it because a lot of software still have it as a dependency (including Awesome)). Because nobody had the will to write the new code (and as you mentioned: as a user you can still use GTK 3, so no one is forced to complete the migration), the support of GTK 4 in LGI is still in an unknown status lgi-devs/lgi#278. |
Seems like some of the tests load it, on my system - running The final binary seems to run fine, though, so perhaps this is a test-only issue. I'd still like a way to run all the tests to pass, though. Perhaps I should open a separate issue for that problem. Doing a quick search, it looks like tests/test-selection-watcher.lua, tests/test-selection-transfer.lua, and tests/test-selection-getter.lua load Gtk without setting a version. I'll try changing those and send a PR if it works. @Aire-One Thanks for the extra explanation! Is Awesome forcing GTK 3 just via |
ah, i wasn't thinking about the tests - then yup, feel free to PR that fix indeed |
read a bit abot GObject Introspection, basically lgi gives support for GI - and GI itself knows Gtk3, Gtk4, Gstreamer and other glib-based libs which spport GI version check could be forced in cmake - but it's an optional dependency, so it won't be also when packaging for repository - the packager could add GTK>3,<4 to optional dependencies |
Output of
awesome --version
:How to reproduce the issue:
Install gtk4 through system upgrade (Manjaro Linux). Other packages were installed, but I read that gtk4 is incompatible with LGI so I think that package is the origin of the error.
Actual result:
When I login into the awesome session, the default configuration is loaded and I get a red window with the following error message:
/usr/share/lua/5.3/lgi/override/Gdk.lua:23: bad argument #1 to 'registerlock' (userdata expected, got nil)
Expected result:
My personal config should be loaded and awesome should work as usual even with gtk4.
Comments: I'm not an expert and I don't know what LGI is. I'm not even sure whether I already had gtk4 installed and an update to the package caused awesome to break, or whether gtk4 was actually installed for the first time during the upgrade and this caused the error.
The text was updated successfully, but these errors were encountered: