Merge branch 'respond-to-input-source-changes' into 'master'
Respond to input source changes See merge request Librem5/squeekboard!88
This commit is contained in:
@ -345,7 +345,6 @@ settings_update_layout(EekboardContextService *context)
|
|||||||
g_autofree gchar *keyboard_type = NULL;
|
g_autofree gchar *keyboard_type = NULL;
|
||||||
g_autofree gchar *keyboard_layout = NULL;
|
g_autofree gchar *keyboard_layout = NULL;
|
||||||
settings_get_layout(context->priv->settings, &keyboard_type, &keyboard_layout);
|
settings_get_layout(context->priv->settings, &keyboard_type, &keyboard_layout);
|
||||||
g_debug("type=%s, layout=%s", keyboard_type, keyboard_layout);
|
|
||||||
|
|
||||||
if (!keyboard_type) {
|
if (!keyboard_type) {
|
||||||
keyboard_type = g_strdup("us");
|
keyboard_type = g_strdup("us");
|
||||||
@ -358,6 +357,7 @@ settings_update_layout(EekboardContextService *context)
|
|||||||
static guint keyboard_id = 0;
|
static guint keyboard_id = 0;
|
||||||
EekKeyboard *keyboard = g_hash_table_lookup(context->priv->keyboard_hash,
|
EekKeyboard *keyboard = g_hash_table_lookup(context->priv->keyboard_hash,
|
||||||
GUINT_TO_POINTER(keyboard_id));
|
GUINT_TO_POINTER(keyboard_id));
|
||||||
|
g_debug("type=%s, layout=%s, keyboard=%p", keyboard_type, keyboard_layout, keyboard);
|
||||||
// create a keyboard
|
// create a keyboard
|
||||||
if (!keyboard) {
|
if (!keyboard) {
|
||||||
EekboardContextServiceClass *klass = EEKBOARD_CONTEXT_SERVICE_GET_CLASS(context);
|
EekboardContextServiceClass *klass = EEKBOARD_CONTEXT_SERVICE_GET_CLASS(context);
|
||||||
|
|||||||
@ -94,6 +94,15 @@ on_notify_keyboard (GObject *object,
|
|||||||
// but simpler than adding a check in the window showing procedure
|
// but simpler than adding a check in the window showing procedure
|
||||||
eekboard_context_service_set_keymap(EEKBOARD_CONTEXT_SERVICE(context),
|
eekboard_context_service_set_keymap(EEKBOARD_CONTEXT_SERVICE(context),
|
||||||
keyboard);
|
keyboard);
|
||||||
|
|
||||||
|
/* Recreate the keyboard widget to keep in sync with the keymap. */
|
||||||
|
gboolean visible;
|
||||||
|
g_object_get (context, "visible", &visible, NULL);
|
||||||
|
|
||||||
|
if (visible) {
|
||||||
|
eekboard_context_service_hide_keyboard(EEKBOARD_CONTEXT_SERVICE(context));
|
||||||
|
eekboard_context_service_show_keyboard(EEKBOARD_CONTEXT_SERVICE(context));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -250,8 +259,12 @@ server_context_service_real_show_keyboard (EekboardContextService *_context)
|
|||||||
|
|
||||||
if (!context->window)
|
if (!context->window)
|
||||||
make_window (context);
|
make_window (context);
|
||||||
if (!context->widget)
|
if (context->widget) {
|
||||||
make_widget (context);
|
gtk_widget_destroy(context->widget);
|
||||||
|
context->widget = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
make_widget (context);
|
||||||
|
|
||||||
EEKBOARD_CONTEXT_SERVICE_CLASS (server_context_service_parent_class)->
|
EEKBOARD_CONTEXT_SERVICE_CLASS (server_context_service_parent_class)->
|
||||||
show_keyboard (_context);
|
show_keyboard (_context);
|
||||||
|
|||||||
Reference in New Issue
Block a user