diff --git a/eekboard/eekboard-context-service.c b/eekboard/eekboard-context-service.c index ac1c9aff..58e71ef2 100644 --- a/eekboard/eekboard-context-service.c +++ b/eekboard/eekboard-context-service.c @@ -60,20 +60,12 @@ static guint signals[LAST_SIGNAL] = { 0, }; struct _EekboardContextServicePrivate { GDBusNodeInfo *introspection_data; - guint registration_id; - char *object_path; - char *client_name; - gboolean enabled; gboolean visible; gboolean fullscreen; - EekKeyboard *keyboard; - GHashTable *keyboard_hash; - - gulong key_pressed_handler; - gulong key_released_handler; - gulong key_cancelled_handler; + EekKeyboard *keyboard; // currently used keyboard + GHashTable *keyboard_hash; // a table of available keyboards, per layout EekKey *repeat_key; guint repeat_timeout_id; @@ -84,54 +76,6 @@ struct _EekboardContextServicePrivate { G_DEFINE_TYPE (EekboardContextService, eekboard_context_service, G_TYPE_OBJECT); -static const gchar introspection_xml[] = - "" - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - /* signals */ - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - " " - ""; - static void connect_keyboard_signals (EekboardContextService *context); static void disconnect_keyboard_signals (EekboardContextService *context); @@ -274,11 +218,6 @@ eekboard_context_service_dispose (GObject *object) context->priv->keyboard_hash = NULL; } - if (context->priv->introspection_data) { - g_dbus_node_info_unref (context->priv->introspection_data); - context->priv->introspection_data = NULL; - } - G_OBJECT_CLASS (eekboard_context_service_parent_class)-> dispose (object); } @@ -288,9 +227,6 @@ eekboard_context_service_finalize (GObject *object) { EekboardContextService *context = EEKBOARD_CONTEXT_SERVICE(object); - g_free (context->priv->object_path); - g_free (context->priv->client_name); - G_OBJECT_CLASS (eekboard_context_service_parent_class)-> finalize (object); } @@ -335,7 +271,7 @@ settings_update_layout(EekboardContextService *context) { EekKeyboard *keyboard = g_hash_table_lookup(context->priv->keyboard_hash, GUINT_TO_POINTER(keyboard_id)); -// create a keyboard + // create a keyboard if (!keyboard) { keyboard = klass->create_keyboard (context, keyboard_layout); eek_keyboard_set_modifier_behavior (keyboard, @@ -349,12 +285,8 @@ settings_update_layout(EekboardContextService *context) { GUINT_TO_POINTER(keyboard_id)); keyboard_id++; } -// set as current - if (context->priv->keyboard) - disconnect_keyboard_signals (context); - + // set as current context->priv->keyboard = keyboard; - connect_keyboard_signals (context); // TODO: this used to save the group, why? //group = eek_element_get_group (EEK_ELEMENT(context->priv->keyboard)); @@ -494,17 +426,7 @@ eekboard_context_service_class_init (EekboardContextServiceClass *klass) static void eekboard_context_service_init (EekboardContextService *self) { - GError *error; - self->priv = EEKBOARD_CONTEXT_SERVICE_GET_PRIVATE(self); - error = NULL; - self->priv->introspection_data = - g_dbus_node_info_new_for_xml (introspection_xml, &error); - if (self->priv->introspection_data == NULL) { - g_warning ("failed to parse D-Bus XML: %s", error->message); - g_error_free (error); - g_assert_not_reached (); - } self->priv->keyboard_hash = g_hash_table_new_full (g_direct_hash, @@ -522,25 +444,6 @@ eekboard_context_service_init (EekboardContextService *self) } } -static void -disconnect_keyboard_signals (EekboardContextService *context) -{ - if (g_signal_handler_is_connected (context->priv->keyboard, - context->priv->key_pressed_handler)) - g_signal_handler_disconnect (context->priv->keyboard, - context->priv->key_pressed_handler); - if (g_signal_handler_is_connected (context->priv->keyboard, - context->priv->key_released_handler)) - g_signal_handler_disconnect (context->priv->keyboard, - context->priv->key_released_handler); - - if (g_signal_handler_is_connected (context->priv->keyboard, - context->priv->key_cancelled_handler)) { - g_signal_handler_disconnect (context->priv->keyboard, - context->priv->key_cancelled_handler); - } -} - static gboolean on_repeat_timeout (EekboardContextService *context); static gboolean @@ -586,11 +489,6 @@ on_repeat_timeout_init (EekboardContextService *context) return FALSE; } -static void -connect_keyboard_signals (EekboardContextService *context) -{ -} - /** * eekboard_context_service_enable: * @context: an #EekboardContextService @@ -693,16 +591,3 @@ eekboard_context_service_get_fullscreen (EekboardContextService *context) { return context->priv->fullscreen; } - -/** - * eekboard_context_service_get_client_name: - * @context: an #EekboardContextService - * - * Get the name of client which created @context. - * Returns: (transfer none): a string - */ -const gchar * -eekboard_context_service_get_client_name (EekboardContextService *context) -{ - return context->priv->client_name; -} diff --git a/eekboard/eekboard-context-service.h b/eekboard/eekboard-context-service.h index 4d415e20..136d827e 100644 --- a/eekboard/eekboard-context-service.h +++ b/eekboard/eekboard-context-service.h @@ -93,8 +93,6 @@ EekKeyboard *eekboard_context_service_get_keyboard (EekboardContextService *context); gboolean eekboard_context_service_get_fullscreen (EekboardContextService *context); -const gchar * eekboard_context_service_get_client_name - (EekboardContextService *context); G_END_DECLS #endif /* EEKBOARD_CONTEXT_SERVICE_H */ diff --git a/src/server-context-service.c b/src/server-context-service.c index 65cd2e0d..10c13c57 100644 --- a/src/server-context-service.c +++ b/src/server-context-service.c @@ -296,12 +296,16 @@ make_window (ServerContextService *context) { g_signal_connect (context->window, "notify::visible", G_CALLBACK(on_notify_visible), context); + // The properties below are just to make hacking easier. + // The way we use layer-shell overrides some, + // and there's no space in the protocol for others. + // Those may still be useful in the future, + // or for hacks with regular windows. gtk_widget_set_can_focus (context->window, FALSE); g_object_set (G_OBJECT(context->window), "accept_focus", FALSE, NULL); - const gchar *client_name = eekboard_context_service_get_client_name (EEKBOARD_CONTEXT_SERVICE(context)); gtk_window_set_title (GTK_WINDOW(context->window), - client_name ? client_name : _("Keyboard")); - gtk_window_set_icon_name (GTK_WINDOW(context->window), "eekboard"); + _("Squeekboard")); + gtk_window_set_icon_name (GTK_WINDOW(context->window), "squeekboard"); gtk_window_set_keep_above (GTK_WINDOW(context->window), TRUE); } @@ -310,7 +314,6 @@ destroy_window (ServerContextService *context) { context->window = NULL; } - static void update_widget (ServerContextService *context) {