Skip to content

Commit

Permalink
rdp backend: reset default keymap if mapping fails
Browse files Browse the repository at this point in the history
Reload default global compositor keymap when no xkb mapping is found for
current keyboard layout. This will default to the keymap in weston.ini
or to "us" if no keymap is defined there. Should allow to use custom KLC
layouts for keymaps that exist in Linux but have no correspondence in
Windows (e.g. altgr-intl). This should also partially fix #173. Still
need a way to export weston.ini to the user.
  • Loading branch information
fargiolas committed Apr 16, 2023
1 parent db64e98 commit 79205c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libweston/backend-rdp/rdprail.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,14 @@ rail_client_LanguageImeInfo_callback(bool freeOnly, void *arg)
__func__, new_keyboard_layout,
settings->KeyboardType,
settings->KeyboardSubType);

rdp_debug_error(b, "%s: Resetting default keymap\n", __func__);
keymap = xkb_keymap_new_from_names(peer_ctx->item.seat->compositor->xkb_context,
&peer_ctx->item.seat->compositor->xkb_names,
0);
weston_seat_update_keymap(peer_ctx->item.seat, keymap);
xkb_keymap_unref(keymap);
settings->KeyboardLayout = new_keyboard_layout;
}
}
}
Expand Down

0 comments on commit 79205c3

Please sign in to comment.