Skip to content

wayvnc and keymap format event #433

@CkNoSFeRaTU

Description

@CkNoSFeRaTU

When there is new session via wayvnc with swaylock active swaylock exits with the following message:
[swaylock-git/seat.c:17] Unknown keymap format 0, aborting
And so you are presented with non-interactable red screen of death.

Present on both last release and current master (commit 56c5025), behaviour is the same.
Wayvnc master (commit e12cb68) launched with the following arguments:
wayvnc -k 'us,ru-,winkeys'
Sway is also current master (commit 90d3270).

Not sure where the problem lies but the following patch workarounds the issue as the event with nokeymap can be safely ignored in my case and right after it there is another event which contains valid keymap.

Patch:

diff --git a/seat.c b/seat.c
index c47c192..10c87d7 100644
--- a/seat.c
+++ b/seat.c
@@ -12,11 +12,17 @@ static void keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
                uint32_t format, int32_t fd, uint32_t size) {
        struct swaylock_seat *seat = data;
        struct swaylock_state *state = seat->state;
+       if (format == WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP) {
+               swaylock_log(LOG_ERROR, "No keymap format, ignored");
+               return;
+       }
+
        if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
                close(fd);
                swaylock_log(LOG_ERROR, "Unknown keymap format %d, aborting", format);
                exit(1);
        }
+       swaylock_log(LOG_INFO, "Keymap format received");
        char *map_shm = mmap(NULL, size - 1, PROT_READ, MAP_PRIVATE, fd, 0);
        if (map_shm == MAP_FAILED) {
                close(fd);

Output with the patch:

2025-10-08 19:24:04 - [swaylock-git/seat.c:16] No keymap format, ignored
2025-10-08 19:24:04 - [swaylock-git/seat.c:25] Keymap format received

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions