diff --git a/data/org.fedorahosted.eekboard.gschema.xml.in b/data/org.fedorahosted.eekboard.gschema.xml.in index fdfb3ca0..6b87e157 100644 --- a/data/org.fedorahosted.eekboard.gschema.xml.in +++ b/data/org.fedorahosted.eekboard.gschema.xml.in @@ -1,6 +1,11 @@ + + 'us' + Keyboard types + keyboard types (comma separated). + 'gtk' GUI toolkit used to render keyboard diff --git a/src/client-main.c b/src/client-main.c index 0420db38..31218b07 100644 --- a/src/client-main.c +++ b/src/client-main.c @@ -38,12 +38,9 @@ static gboolean opt_system = FALSE; static gboolean opt_session = FALSE; static gchar *opt_address = NULL; -static gboolean opt_use_system_layout = FALSE; static gboolean opt_focus = FALSE; static gboolean opt_keystroke = FALSE; -static gchar *opt_keyboard = NULL; - static gboolean opt_fullscreen = FALSE; static const GOptionEntry options[] = { @@ -53,8 +50,6 @@ static const GOptionEntry options[] = { N_("Connect to the session bus")}, {"address", 'a', 0, G_OPTION_ARG_STRING, &opt_address, N_("Connect to the given D-Bus address")}, - {"use-system-layout", 'x', 0, G_OPTION_ARG_NONE, &opt_use_system_layout, - N_("Use system keyboard layout")}, #if ENABLE_FOCUS_LISTENER {"listen-focus", 'f', 0, G_OPTION_ARG_NONE, &opt_focus, N_("Listen focus change events")}, @@ -63,8 +58,6 @@ static const GOptionEntry options[] = { {"listen-keystroke", 's', 0, G_OPTION_ARG_NONE, &opt_keystroke, N_("Listen keystroke events with AT-SPI")}, #endif /* HAVE_ATSPI */ - {"keyboard", 'k', 0, G_OPTION_ARG_STRING, &opt_keyboard, - N_("Specify keyboard")}, {"fullscreen", 'F', 0, G_OPTION_ARG_NONE, &opt_fullscreen, N_("Create window in fullscreen mode")}, {NULL} @@ -122,6 +115,7 @@ main (int argc, char **argv) GMainLoop *loop; gint focus; GSettings *settings; + gchar *keyboard; if (!gtk_init_check (&argc, &argv)) { g_printerr ("Can't init GTK\n"); @@ -251,12 +245,6 @@ main (int argc, char **argv) } #endif /* HAVE_IBUS */ - if (opt_use_system_layout && opt_keyboard) { - g_printerr ("Can't use --use-system-layout option with keyboard options\n"); - g_object_unref (client); - exit (1); - } - if (!eekboard_client_enable_xkl (client)) { g_printerr ("Can't register xklavier event listeners\n"); g_object_unref (client); @@ -271,7 +259,9 @@ main (int argc, char **argv) } #endif /* HAVE_XTEST */ - eekboard_client_set_keyboard (client, opt_keyboard ? opt_keyboard : DEFAULT_KEYBOARD); + keyboard = g_settings_get_string (settings, "keyboard"); + eekboard_client_set_keyboard (client, keyboard); + g_free (keyboard); loop = g_main_loop_new (NULL, FALSE); if (!opt_focus) { diff --git a/src/server-context.c b/src/server-context.c index 3c7535f8..229d9291 100644 --- a/src/server-context.c +++ b/src/server-context.c @@ -562,32 +562,17 @@ server_context_init (ServerContext *context) GdkScreen *screen; GError *error; - context->connection = NULL; error = NULL; context->introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, &error); g_assert (context->introspection_data != NULL); - context->registration_id = 0; - context->object_path = NULL; - context->enabled = FALSE; - context->last_keyboard_visible = FALSE; - - context->keyboard = NULL; context->keyboard_hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)g_object_unref); - context->widget = NULL; - context->window = NULL; - context->key_pressed_handler = 0; - context->key_released_handler = 0; - - context->repeat_key = NULL; - context->repeat_timeout_id = 0; - context->ui_toolkit = UI_TOOLKIT_DEFAULT; context->settings = g_settings_new ("org.fedorahosted.eekboard"); @@ -883,7 +868,7 @@ handle_method_call (GDBusConnection *connection, g_dbus_method_invocation_return_value (invocation, NULL); - eek_element_get_group (EEK_ELEMENT(context->keyboard)); + group = eek_element_get_group (EEK_ELEMENT(context->keyboard)); emit_group_changed_signal (context, group); return;