Skip to content
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

BUG: On cosmic-comp error 0: modifiers sent before keymap. #70

Open
Quackdoc opened this issue Mar 30, 2024 · 7 comments
Open

BUG: On cosmic-comp error 0: modifiers sent before keymap. #70

Quackdoc opened this issue Mar 30, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@Quackdoc
Copy link

When using wvkbd on cosmic I get the error mentioned when I press a key, full error below

> wvkbd-mobintl -L 250 --landscape-layers landscape
Initializing keyboard
Found 54 layouts
layer #1 = landscape
Found 2 layers
Resize 2746x250 1.400000, 55 layouts <-------- Before Key press
zwp_virtual_keyboard_v1@15: error 0: `modifiers` sent before keymap. <-------- After Key press
Wayland socket has been disconnected.

However if I open squeekboard, type, and then open wvkbd it works, but with wrong characters. Sway does not exhibit this issue, and since squeekboard works I decided to file here first. Further debugging guidence would be appreciated

@proycon proycon added the bug Something isn't working label Mar 30, 2024
@proycon
Copy link
Collaborator

proycon commented Mar 30, 2024

That suggests that a call to zwp_virtual_keyboard_v1_modifiers() preceeds this one to zwp_virtual_keyboard_v1_keymap():

zwp_virtual_keyboard_v1_keymap(kb->vkbd, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
, which would indeed be invalid. I haven't seen this occur in other situations.

Could you try it again with both WAYLAND_DEBUG on and wvkbd's debug (-D) on?

WAYLAND_DEBUG=1 wvkbd-mobintl -D -L 250 --landscape-layers landscape

The resulting log should give some further insight.

@Quackdoc
Copy link
Author

Quackdoc commented Mar 30, 2024

I added some fprintfs to make it easier to find since I wanted to take a look at this when I could too

Send Keymap <------- DEBUG latin

Send Modifers #LINENUM <------- DEBUG latin

seems to be this line

zwp_virtual_keyboard_v1_modifiers(kb->vkbd, k->code_mod, 0, 0,

Keymap does seem to be sent first which is odd.

log.txt

EDIT: let me know if you want squeekboards logs, I need to reset my compositor so I havent provided them yet but can if needed.

EDIT2: looks like this was also reported to smithay so it seems like cosmic-comp might not be the only issue Smithay/smithay#1355

@proycon
Copy link
Collaborator

proycon commented Mar 30, 2024

That's odd indeed, the logs and your debug statement suggest everything is done in the proper order so I think the error lies with the compositor.

As far as I can tell, cosmis-comp builds on smithay (and both in Rust), so I assume there may be a bug there.

@proycon
Copy link
Collaborator

proycon commented Mar 30, 2024

The behaviour might be explained if the compositor doesn't accept the keymap for some reason, like invalid size like in the case of #35?, but that supposed to be already fixed a while back. Just to be sure, you're running either 0.14.4 or the latest git version right? Anything prior to v0.14 may still have this issue.

@Quackdoc
Copy link
Author

I just compilied niri-git which I think uses the latest git commit

@minego
Copy link

minego commented May 26, 2024

I'm getting the same issue on niri, using the latest niri and wvkbd built from a git checkout.

If this is an issue with the compositor, can you help provide more details about what the compositor could be doing wrong? I would be happy to debug and/or try to create an MR for niri, or to at least provide a bug report but right now I don't feel like I know enough to describe the issue properly...

@proycon
Copy link
Collaborator

proycon commented May 26, 2024

I provided some writeup in Smithay/smithay#1355 (comment), I think the issue is in xkb::Keymap::new_from_fd() in xkbcommon-rs (which Smithay uses, and Niri in turn uses Smithay).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants