[Xfce4-commits] <xfce4-xkb-plugin:4.10_panel_support> Reset xkb config when new keyboard is detected
Igor Slepchin
noreply at xfce.org
Wed Apr 3 01:44:09 CEST 2013
Updating branch refs/heads/4.10_panel_support
to 0aab3c44d1f19583fe5d9affa9034c199b772cdc (commit)
from d764e65233009d38537012b927699c21982b9789 (commit)
commit 0aab3c44d1f19583fe5d9affa9034c199b772cdc
Author: Igor Slepchin <igor.slepchin at gmail.com>
Date: Tue Apr 2 16:31:03 2013 -0400
Reset xkb config when new keyboard is detected
This should help to avoid losing xkb-plugin config.
panel-plugin/xkb-config.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/panel-plugin/xkb-config.c b/panel-plugin/xkb-config.c
index f2c86df..e34c036 100644
--- a/panel-plugin/xkb-config.c
+++ b/panel-plugin/xkb-config.c
@@ -76,6 +76,8 @@ static void xkb_config_state_changed (XklEngine *engine,
static void xkb_config_xkl_config_changed (XklEngine *engine,
gpointer user_data);
+void xkb_config_reset_xkl_config (XklEngine *engine,
+ gpointer user_data);
static GdkFilterReturn handle_xevent (GdkXEvent * xev,
GdkEvent * event);
@@ -121,6 +123,10 @@ xkb_config_initialize (t_xkb_settings *settings,
"X-config-changed",
G_CALLBACK (xkb_config_xkl_config_changed),
NULL);
+ g_signal_connect (config->engine,
+ "X-new-device",
+ G_CALLBACK (xkb_config_reset_xkl_config),
+ NULL);
gdk_window_add_filter (NULL, (GdkFilterFunc) handle_xevent, NULL);
return TRUE;
@@ -593,6 +599,15 @@ xkb_config_xkl_config_changed (XklEngine *engine, gpointer user_data)
}
}
+void
+xkb_config_reset_xkl_config (XklEngine *engine,
+ gpointer user_data)
+{
+ TRACE ("X-new-device: %d", config->settings->never_modify_config);
+ if (!config->settings->never_modify_config)
+ xkb_config_activate_xkl_record ();
+}
+
gint
xkb_config_variant_index_for_group (gint group)
{
More information about the Xfce4-commits
mailing list