Commit 70fda8ba authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz

Fix releasing buttons when dragged

parent 5cc40798
Pipeline #5687 passed with stage
in 1 minute and 19 seconds
......@@ -77,6 +77,7 @@ struct _EekboardContextServicePrivate {
gulong key_pressed_handler;
gulong key_released_handler;
gulong key_cancelled_handler;
EekKey *repeat_key;
guint repeat_timeout_id;
......@@ -621,6 +622,12 @@ disconnect_keyboard_signals (EekboardContextService *context)
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 void
......@@ -749,6 +756,15 @@ on_key_released (EekKeyboard *keyboard,
on_key_activated(keyboard, key, context, FALSE);
}
static void
on_key_cancelled (EekKeyboard *keyboard,
EekKey *key,
gpointer user_data)
{
on_key_released(keyboard, key, user_data);
// TODO: special handling when composing text via text-input? text may not be committed until button released
}
static void
connect_keyboard_signals (EekboardContextService *context)
{
......@@ -760,6 +776,10 @@ connect_keyboard_signals (EekboardContextService *context)
g_signal_connect (context->priv->keyboard, "key-released",
G_CALLBACK(on_key_released),
context);
context->priv->key_cancelled_handler =
g_signal_connect (context->priv->keyboard, "key-cancelled",
G_CALLBACK(on_key_cancelled),
context);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment