context: Moved keymap setting together with its generation

This commit is contained in:
Dorota Czaplejewicz
2020-01-09 16:42:17 +00:00
parent 4c2cef30f2
commit 7dd8bd54c2
2 changed files with 7 additions and 19 deletions

View File

@ -78,17 +78,6 @@ on_notify_keyboard (GObject *object,
GParamSpec *spec,
ServerContextService *context)
{
const LevelKeyboard *keyboard = eekboard_context_service_get_keyboard (EEKBOARD_CONTEXT_SERVICE(context));
if (!keyboard)
g_error("Programmer error: keyboard layout was unset!");
// The keymap will get set even if the window is hidden.
// It's not perfect,
// but simpler than adding a check in the window showing procedure
eekboard_context_service_set_keymap(EEKBOARD_CONTEXT_SERVICE(context),
keyboard);
/* Recreate the keyboard widget to keep in sync with the keymap. */
if (context->window)
make_widget(context);