diff options
author | Brian Cameron <bcameron@src.gnome.org> | 2004-01-29 20:55:11 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2004-01-29 20:55:11 +0000 |
commit | c1dbf7c2f6d3c4d3b5a9f0b5e4e1921d6b7241b0 (patch) | |
tree | a66b7625a64efe3816dab97c51292fff907fff81 /gui | |
parent | 29b095a531b24ba9bdb78e8ae6adbc24ae2c32af (diff) | |
download | gdm-c1dbf7c2f6d3c4d3b5a9f0b5e4e1921d6b7241b0.tar.gz |
Tue Jan 29 Brian Cameron <Brian.Cameron@Sun.COM>
* gui/modules/keymouselistener.c: Fixed so that it accepts
key gestures with a timeout of <= 0 if n_times is 1. This
makes sense since timeout is not used if n_times is less
than 2.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/modules/keymouselistener.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gui/modules/keymouselistener.c b/gui/modules/keymouselistener.c index 3e3a88c0..978d3378 100644 --- a/gui/modules/keymouselistener.c +++ b/gui/modules/keymouselistener.c @@ -365,12 +365,22 @@ parse_line (gchar *buf) return NULL; } - if ((timeout=atoi(tmp_string)) <= 0) { - /* Add an error message */; - free_gesture (tmp_gesture); - return NULL; + /* + * A gesture with an n_times value greater than 1 and a + * non-positive timeout can never be triggered, so do not + * accept such gestures. The value of timeout is not used + * if n_times is 1, so don't bother setting the timeout in + * this case. + */ + tmp_gesture->timeout = 0; + if (tmp_gesture->n_times > 1) { + if ((timeout=atoi(tmp_string)) <= 0) { + /* Add an error message */; + free_gesture (tmp_gesture); + return NULL; + } + tmp_gesture->timeout = timeout; } - tmp_gesture->timeout = timeout; } /* @@ -718,7 +728,7 @@ G_MODULE_EXPORT void gtk_module_init(int *argc, char* argv[]); void gtk_module_init(int *argc, char* argv[]) { create_event_watcher(); -} +} /* EOF */ |