summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--libxklavier/xklavier_evt.c7
-rw-r--r--libxklavier/xklavier_private.h2
3 files changed, 15 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index dd9817b..2e3d7a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-03 svu
+
+ * libxklavier/xklavier_evt.c, libxklavier/xklavier_private.h: fixed
+ one race condition, https://bugzilla.gnome.org/show_bug.cgi?id=638332
+
+
2010-09-13 svu
* configure.in: accessing X11 api using pkg-config
diff --git a/libxklavier/xklavier_evt.c b/libxklavier/xklavier_evt.c
index 6f5f2ce..316bd4a 100644
--- a/libxklavier/xklavier_evt.c
+++ b/libxklavier/xklavier_evt.c
@@ -248,6 +248,7 @@ xkl_engine_process_focus_in_evt(XklEngine * engine,
xkl_engine_lock_group
(engine,
selected_window_state.group);
+ xkl_engine_priv(engine, skip_one_save) = TRUE;
} else {
xkl_debug(150,
"Both old and new focused window "
@@ -560,6 +561,12 @@ xkl_engine_process_state_modification(XklEngine * engine,
gboolean have_old_state = TRUE;
gboolean set_group = change_type == GROUP_CHANGED;
+ if (xkl_engine_priv(engine, skip_one_save)) {
+ xkl_debug(160, "Skipping one callback");
+ xkl_engine_priv(engine, skip_one_save) = FALSE;
+ return;
+ }
+
XGetInputFocus(xkl_engine_get_display(engine), &focused, &revert);
if ((focused == None) || (focused == PointerRoot)) {
diff --git a/libxklavier/xklavier_private.h b/libxklavier/xklavier_private.h
index e270ef0..35fc8a5 100644
--- a/libxklavier/xklavier_private.h
+++ b/libxklavier/xklavier_private.h
@@ -53,6 +53,8 @@ struct _XklEnginePrivate {
gboolean skip_one_restore;
+ gboolean skip_one_save;
+
gint default_group;
/*