Compare commits
4 Commits
eekboard-1
...
eekboard-1
| Author | SHA1 | Date | |
|---|---|---|---|
| 20c1f8cbe3 | |||
| f2ee3b4966 | |||
| 57a072746e | |||
| 497f21a5bd |
@ -20,7 +20,7 @@ AC_PREREQ(2.63)
|
|||||||
dnl AC_CONFIG_SRCDIR([configure.ac])
|
dnl AC_CONFIG_SRCDIR([configure.ac])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
|
|
||||||
AC_INIT([eekboard], [1.0.0], [ueno@unixuser.org])
|
AC_INIT([eekboard], [1.0.1], [ueno@unixuser.org])
|
||||||
|
|
||||||
dnl Init automake
|
dnl Init automake
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
|
|||||||
@ -16,6 +16,11 @@
|
|||||||
<summary>Hide keyboard automatically when focus is out</summary>
|
<summary>Hide keyboard automatically when focus is out</summary>
|
||||||
<description>If true, hide keyboard automatically when focus is out.</description>
|
<description>If true, hide keyboard automatically when focus is out.</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key name="auto-hide-delay" type="d">
|
||||||
|
<default>0.5</default>
|
||||||
|
<summary>Delay seconds before hiding keyboard</summary>
|
||||||
|
<description>Delay seconds before hiding keyboard. This is useful when focus listener is enabled.</description>
|
||||||
|
</key>
|
||||||
<key name="start-fullscreen" type="b">
|
<key name="start-fullscreen" type="b">
|
||||||
<default>false</default>
|
<default>false</default>
|
||||||
<summary>Switch to fullscreen mode when startup</summary>
|
<summary>Switch to fullscreen mode when startup</summary>
|
||||||
|
|||||||
@ -201,20 +201,32 @@ eek_gtk_keyboard_real_button_press_event (GtkWidget *self,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
eek_gtk_keyboard_real_button_release_event (GtkWidget *self,
|
clear_dragged_key (EekGtkKeyboard *keyboard)
|
||||||
GdkEventButton *event)
|
|
||||||
{
|
{
|
||||||
EekGtkKeyboardPrivate *priv = EEK_GTK_KEYBOARD_GET_PRIVATE(self);
|
EekGtkKeyboardPrivate *priv = EEK_GTK_KEYBOARD_GET_PRIVATE(keyboard);
|
||||||
|
|
||||||
if (priv->dragged_key) {
|
if (priv->dragged_key) {
|
||||||
g_signal_emit_by_name (priv->dragged_key, "released", priv->keyboard);
|
g_signal_emit_by_name (priv->dragged_key, "released", priv->keyboard);
|
||||||
priv->dragged_key = NULL;
|
priv->dragged_key = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
eek_gtk_keyboard_real_button_release_event (GtkWidget *self,
|
||||||
|
GdkEventButton *event)
|
||||||
|
{
|
||||||
|
clear_dragged_key (EEK_GTK_KEYBOARD(self));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
eek_gtk_keyboard_real_unmap (GtkWidget *self)
|
||||||
|
{
|
||||||
|
clear_dragged_key (EEK_GTK_KEYBOARD(self));
|
||||||
|
GTK_WIDGET_CLASS (eek_gtk_keyboard_parent_class)->unmap (self);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
eek_gtk_keyboard_set_keyboard (EekGtkKeyboard *self,
|
eek_gtk_keyboard_set_keyboard (EekGtkKeyboard *self,
|
||||||
EekKeyboard *keyboard)
|
EekKeyboard *keyboard)
|
||||||
@ -308,6 +320,7 @@ eek_gtk_keyboard_class_init (EekGtkKeyboardClass *klass)
|
|||||||
sizeof (EekGtkKeyboardPrivate));
|
sizeof (EekGtkKeyboardPrivate));
|
||||||
|
|
||||||
widget_class->realize = eek_gtk_keyboard_real_realize;
|
widget_class->realize = eek_gtk_keyboard_real_realize;
|
||||||
|
widget_class->unmap = eek_gtk_keyboard_real_unmap;
|
||||||
#if GTK_CHECK_VERSION (2, 91, 2)
|
#if GTK_CHECK_VERSION (2, 91, 2)
|
||||||
widget_class->draw = eek_gtk_keyboard_real_draw;
|
widget_class->draw = eek_gtk_keyboard_real_draw;
|
||||||
#else /* GTK_CHECK_VERSION (2, 91, 2) */
|
#else /* GTK_CHECK_VERSION (2, 91, 2) */
|
||||||
|
|||||||
@ -192,7 +192,6 @@ main (int argc, char **argv)
|
|||||||
if (opt_focus) {
|
if (opt_focus) {
|
||||||
gchar *focus_listener = g_settings_get_string (settings,
|
gchar *focus_listener = g_settings_get_string (settings,
|
||||||
"focus-listener");
|
"focus-listener");
|
||||||
g_object_unref (settings);
|
|
||||||
|
|
||||||
if (g_strcmp0 (focus_listener, "atspi") == 0)
|
if (g_strcmp0 (focus_listener, "atspi") == 0)
|
||||||
focus = FOCUS_ATSPI;
|
focus = FOCUS_ATSPI;
|
||||||
@ -208,10 +207,11 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
#ifdef HAVE_ATSPI
|
#ifdef HAVE_ATSPI
|
||||||
if (focus == FOCUS_ATSPI || opt_keystroke) {
|
if (focus == FOCUS_ATSPI || opt_keystroke) {
|
||||||
GSettings *settings = g_settings_new ("org.gnome.desktop.interface");
|
GSettings *desktop_settings =
|
||||||
|
g_settings_new ("org.gnome.desktop.interface");
|
||||||
gboolean accessibility_enabled =
|
gboolean accessibility_enabled =
|
||||||
g_settings_get_boolean (settings, "toolkit-accessibility");
|
g_settings_get_boolean (settings, "toolkit-accessibility");
|
||||||
g_object_unref (settings);
|
g_object_unref (desktop_settings);
|
||||||
|
|
||||||
if (accessibility_enabled) {
|
if (accessibility_enabled) {
|
||||||
if (atspi_init () != 0) {
|
if (atspi_init () != 0) {
|
||||||
@ -327,6 +327,7 @@ main (int argc, char **argv)
|
|||||||
g_main_loop_run (loop);
|
g_main_loop_run (loop);
|
||||||
g_main_loop_unref (loop);
|
g_main_loop_unref (loop);
|
||||||
g_object_unref (client);
|
g_object_unref (client);
|
||||||
|
g_object_unref (settings);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
22
src/client.c
22
src/client.c
@ -77,6 +77,7 @@ struct _EekboardClient {
|
|||||||
gulong key_released_handler;
|
gulong key_released_handler;
|
||||||
|
|
||||||
gboolean follows_focus;
|
gboolean follows_focus;
|
||||||
|
guint hide_keyboard_timeout_id;
|
||||||
|
|
||||||
#ifdef HAVE_ATSPI
|
#ifdef HAVE_ATSPI
|
||||||
AtspiAccessible *acc;
|
AtspiAccessible *acc;
|
||||||
@ -296,6 +297,7 @@ eekboard_client_init (EekboardClient *client)
|
|||||||
client->xkl_state_changed_handler = 0;
|
client->xkl_state_changed_handler = 0;
|
||||||
#if ENABLE_FOCUS_LISTENER
|
#if ENABLE_FOCUS_LISTENER
|
||||||
client->follows_focus = FALSE;
|
client->follows_focus = FALSE;
|
||||||
|
client->hide_keyboard_timeout_id = 0;
|
||||||
#endif /* ENABLE_FOCUS_LISTENER */
|
#endif /* ENABLE_FOCUS_LISTENER */
|
||||||
#ifdef HAVE_ATSPI
|
#ifdef HAVE_ATSPI
|
||||||
client->keystroke_listener = NULL;
|
client->keystroke_listener = NULL;
|
||||||
@ -592,6 +594,14 @@ add_match_rule (GDBusConnection *connection,
|
|||||||
g_object_unref (message);
|
g_object_unref (message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
on_hide_keyboard_timeout (EekboardClient *client)
|
||||||
|
{
|
||||||
|
eekboard_context_hide_keyboard (client->context, NULL);
|
||||||
|
client->hide_keyboard_timeout_id = 0;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static GDBusMessage *
|
static GDBusMessage *
|
||||||
focus_message_filter (GDBusConnection *connection,
|
focus_message_filter (GDBusConnection *connection,
|
||||||
GDBusMessage *message,
|
GDBusMessage *message,
|
||||||
@ -606,10 +616,19 @@ focus_message_filter (GDBusConnection *connection,
|
|||||||
const gchar *member = g_dbus_message_get_member (message);
|
const gchar *member = g_dbus_message_get_member (message);
|
||||||
|
|
||||||
if (g_strcmp0 (member, "FocusIn") == 0) {
|
if (g_strcmp0 (member, "FocusIn") == 0) {
|
||||||
|
if (client->hide_keyboard_timeout_id > 0) {
|
||||||
|
g_source_remove (client->hide_keyboard_timeout_id);
|
||||||
|
client->hide_keyboard_timeout_id = 0;
|
||||||
|
}
|
||||||
eekboard_context_show_keyboard (client->context, NULL);
|
eekboard_context_show_keyboard (client->context, NULL);
|
||||||
} else if (g_settings_get_boolean (client->settings, "auto-hide") &&
|
} else if (g_settings_get_boolean (client->settings, "auto-hide") &&
|
||||||
g_strcmp0 (member, "FocusOut") == 0) {
|
g_strcmp0 (member, "FocusOut") == 0) {
|
||||||
eekboard_context_hide_keyboard (client->context, NULL);
|
gdouble delay = g_settings_get_double (client->settings,
|
||||||
|
"auto-hide-delay");
|
||||||
|
client->hide_keyboard_timeout_id =
|
||||||
|
g_timeout_add ((guint)(delay * 1000),
|
||||||
|
(GSourceFunc)on_hide_keyboard_timeout,
|
||||||
|
client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,7 +640,6 @@ _ibus_connect_focus_handlers (IBusBus *bus, gpointer user_data)
|
|||||||
{
|
{
|
||||||
EekboardClient *client = user_data;
|
EekboardClient *client = user_data;
|
||||||
GDBusConnection *connection;
|
GDBusConnection *connection;
|
||||||
GError *error;
|
|
||||||
|
|
||||||
connection = ibus_bus_get_connection (bus);
|
connection = ibus_bus_get_connection (bus);
|
||||||
add_match_rule (connection,
|
add_match_rule (connection,
|
||||||
|
|||||||
Reference in New Issue
Block a user