-
Notifications
You must be signed in to change notification settings - Fork 3
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
If XKB_DEFAULT_LAYOUT doesn't exist the program segfaults #29
Comments
Sorry, I should cc @johnraff because he discovered the bug. |
Can confirm. |
Ok, #30 is a bit simplistic and dare I say frivolous. (though it wasn't meant to be) I suppose we should check the environment first; |
At least on my (Debian based) system There is also Absolutely agree on some hardcoded fallback as last choice. |
Actually that's all nonsense. All we need to do is test that if (COMBO_TEXT(state->widgets.keyboard_layout)) {
environment_set("XKB_DEFAULT_LAYOUT", first_field(COMBO_TEXT(state->widgets.keyboard_layout), ' '));
} We're not messing with anything that way, no need of a fallback. The program will carry on quite happily. |
On a Debian Trixie VM with XKB_DEFAULT_LAYOUT=jp in the environment, labwc-tweaks-gtk still segfaults when the user attempts to change the gtk theme, so there's more to the story. |
FWIW the current proposed BunsenLabs Wayland setup runs this at login:
|
Is that just exported to the environment or in |
Could you run with ASAN and post a stacktrace?
|
@01micko Suggest a more generic approach. How about something like:
For completeness, if |
Here's a stacktrace on bare metal from ASAN. This is with trace
|
@johanmalm I like that fix. It addresses the actual bug.
Future proofs |
It's in the environment, exported by the startup scripting, not in any labwc-specific file, but the export is done before starting labwc. It sets my keyboard layout to jp, so I guess labwc is seeing it. |
context
We are in early stages of testing
labwc
in VMs over atbunsenlabs
and I have a package forlabwc-tweaks-gtk
that is installable viaapt
because I have a tiny repo setup with just a few things that debian don't provide. Things aren't quite up to date but in an earlynetinstall
installation only some very basics were provided in the~/.config/labwc/environment/
andXKB_DEFAULT_LAYOUT
isn't one of them!current state of play
If env vars for
XCURSOR_THEME
andXCURSOR_SIZE
aren't there it doesn't matter (values obtained from gsettings). However ifXKB_DEFAULT_LAYOUT
isn't there the program stops with a segfault inupdate
. There is a super simple "fix"; next point.super simple fix
why?
Well a segfault looks crappy and at least this stops it with a legit entry that works. There are probably a thousand better ways with a quite a few more lines of code but I think the proposed fix is a small price to pay; most non-English speakers would likely want to change the layout anyway and if they hit
Update
because they did the mouse or the corner radius beforehand they will just throw their PC out the window, and it's our fault!The text was updated successfully, but these errors were encountered: