diff options
author | Sergey Udaltsov <svu@gnome.org> | 2011-01-03 23:54:52 +0000 |
---|---|---|
committer | Sergey Udaltsov <svu@gnome.org> | 2011-01-03 23:54:52 +0000 |
commit | e81321dc5725678553e3d0aec09620b8353c3b64 (patch) | |
tree | 2dde166ad56697627ec78dfbf914d4c1afbae9d8 | |
parent | 49b628f03af27374e27cc6f325aa4e45924d67e6 (diff) | |
download | libxklavier-e81321dc5725678553e3d0aec09620b8353c3b64.tar.gz |
fixed race condition, https://bugzilla.gnome.org/show_bug.cgi?id=638332
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | libxklavier/xklavier_evt.c | 7 | ||||
-rw-r--r-- | libxklavier/xklavier_private.h | 2 |
3 files changed, 15 insertions, 0 deletions
@@ -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; /* |