summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHuang Peng <shawn.p.huang@gmail.com>2009-03-05 14:39:12 +0800
committerHuang Peng <shawn.p.huang@gmail.com>2009-03-05 14:39:12 +0800
commitd415e945d62d69c097cf6aae701f42806529dfb7 (patch)
tree6869b129f47c6891d3757c18d9e48ded18ad5015 /src
parent740acea3c7103af63f4e572c4e4c3ae39153430e (diff)
downloadibus-d415e945d62d69c097cf6aae701f42806529dfb7.tar.gz
ibus-d415e945d62d69c097cf6aae701f42806529dfb7.tar.xz
ibus-d415e945d62d69c097cf6aae701f42806529dfb7.zip
Process release key event correctly.
Diffstat (limited to 'src')
-rw-r--r--src/ibushotkey.c6
-rw-r--r--src/ibushotkey.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ibushotkey.c b/src/ibushotkey.c
index 0f1b314..1d3a4b3 100644
--- a/src/ibushotkey.c
+++ b/src/ibushotkey.c
@@ -459,6 +459,8 @@ GQuark
ibus_hotkey_profile_filter_key_event (IBusHotkeyProfile *profile,
guint keyval,
guint modifiers,
+ guint prev_keyval,
+ guint prev_modifiers,
gpointer user_data)
{
IBusHotkeyProfilePrivate *priv;
@@ -469,6 +471,10 @@ ibus_hotkey_profile_filter_key_event (IBusHotkeyProfile *profile,
.modifiers = modifiers & priv->mask,
};
+ if ((modifiers & IBUS_RELEASE_MASK) && keyval != prev_keyval) {
+ return 0;
+ }
+
GQuark event = (GQuark) GPOINTER_TO_UINT (g_tree_lookup (priv->hotkeys, &hotkey));
if (event != 0) {
diff --git a/src/ibushotkey.h b/src/ibushotkey.h
index 75b0844..03331dd 100644
--- a/src/ibushotkey.h
+++ b/src/ibushotkey.h
@@ -80,6 +80,8 @@ GQuark ibus_hotkey_profile_filter_key_event
(IBusHotkeyProfile *profile,
guint keyval,
guint modifiers,
+ guint prev_keyval,
+ guint prev_modifiers,
gpointer user_data);
G_END_DECLS