mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 10:48:05 +02:00
clients: keyboard: fix resize on layput change
If the content type changes, then the layout also changes, which means that the size must be adapted to the new layout and the widget must be redrawn. Signed-off-by: Joscha.Wloch <Joscha.Wloch@bruker.com>
This commit is contained in:
parent
74a7484ae6
commit
e0bfeb4f8f
1 changed files with 22 additions and 2 deletions
|
|
@ -894,8 +894,28 @@ handle_content_type(void *data,
|
|||
{
|
||||
struct virtual_keyboard *keyboard = data;
|
||||
|
||||
keyboard->content_hint = hint;
|
||||
keyboard->content_purpose = purpose;
|
||||
if ((keyboard->content_hint != hint) || (keyboard->content_purpose != purpose))
|
||||
{
|
||||
keyboard->content_hint = hint;
|
||||
keyboard->content_purpose = purpose;
|
||||
|
||||
// A change of the content type means a new layout.
|
||||
// So we have to update.
|
||||
const struct layout *layout = get_current_layout(keyboard);
|
||||
|
||||
zwp_input_method_context_v1_language(context,
|
||||
keyboard->serial,
|
||||
layout->language);
|
||||
zwp_input_method_context_v1_text_direction(context,
|
||||
keyboard->serial,
|
||||
layout->text_direction);
|
||||
|
||||
window_schedule_resize(keyboard->keyboard->window,
|
||||
layout->columns * key_width,
|
||||
layout->rows * key_height);
|
||||
|
||||
widget_schedule_redraw(keyboard->keyboard->widget);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue