diff options
author | Brian Cameron <bcameron@src.gnome.org> | 2004-01-23 20:16:00 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2004-01-23 20:16:00 +0000 |
commit | e371c4d90e1fea8926047a2d2d71097e44ba7486 (patch) | |
tree | d19a37ef50d1e03aac73f1ac3783205e0fc00628 /gui | |
parent | 7e9b9644614bdc656b380803f02d28f3f92021f5 (diff) | |
download | gdm-e371c4d90e1fea8926047a2d2d71097e44ba7486.tar.gz |
Tue Jan 23 Brian Cameron <Brian.Cameron@Sun.COM>
* gui/modules/keymouselistener.c: Fixed so that the state
is checked when KeyRelease events are processed.
Previously the code would think that a Control-G gesture
was made when only the "G" key was actually pressed.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/modules/keymouselistener.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gui/modules/keymouselistener.c b/gui/modules/keymouselistener.c index c0129e03..3e3a88c0 100644 --- a/gui/modules/keymouselistener.c +++ b/gui/modules/keymouselistener.c @@ -511,16 +511,18 @@ gestures_filter (GdkXEvent *gdk_xevent, } /* - * Find the associated gesture for this keycode &state + * Find the associated gesture for this keycode & state * TODO: write a custom g_slist_find function. * - * Note that here we don't check the state, otherwise key gestures based on - * modifier keys such as Control_R won't work. + * Note that here we check the state against the last_event, + * otherwise key gestures based on modifier keys such as + * Control_R won't work. */ for (li = gesture_list; li != NULL; li = li->next) { Gesture *gesture = (Gesture *) li->data; if (gesture->type == GESTURE_TYPE_KEY && - xevent->xkey.keycode == gesture->input.key.keycode) { + xevent->xkey.keycode == gesture->input.key.keycode && + last_event->xkey.state == gesture->input.key.state) { /* * OK Found the gesture. * Now check if it has a duration value > 0. |