diff options
author | Pavel Machek <pavel@suse.cz> | 2005-05-27 15:53:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-28 14:14:01 -0400 |
commit | c1e4c8d3ee3300f363a52fd4cf3d90fdf5098f5a (patch) | |
tree | 56f22aa02101434c13fa38e6729e45d92521c3d9 /drivers | |
parent | 8bd7f125e2f217c8aa3dff005ae291c81246c340 (diff) |
[PATCH] fix jumpy mouse cursor on console
Do not send empty events to gpm. (Keyboards are assumed to have scroll
wheel these days, that makes them part-mouse. That means typing on
keyboard generates empty mouse events).
From: Dmitry Torokhov <dtor_core@ameritech.net>
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/mousedev.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 564974ce5793..96fb9870834a 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
@@ -101,6 +101,7 @@ struct mousedev_list { | |||
101 | unsigned char ready, buffer, bufsiz; | 101 | unsigned char ready, buffer, bufsiz; |
102 | unsigned char imexseq, impsseq; | 102 | unsigned char imexseq, impsseq; |
103 | enum mousedev_emul mode; | 103 | enum mousedev_emul mode; |
104 | unsigned long last_buttons; | ||
104 | }; | 105 | }; |
105 | 106 | ||
106 | #define MOUSEDEV_SEQ_LEN 6 | 107 | #define MOUSEDEV_SEQ_LEN 6 |
@@ -224,7 +225,7 @@ static void mousedev_notify_readers(struct mousedev *mousedev, struct mousedev_h | |||
224 | spin_lock_irqsave(&list->packet_lock, flags); | 225 | spin_lock_irqsave(&list->packet_lock, flags); |
225 | 226 | ||
226 | p = &list->packets[list->head]; | 227 | p = &list->packets[list->head]; |
227 | if (list->ready && p->buttons != packet->buttons) { | 228 | if (list->ready && p->buttons != mousedev->packet.buttons) { |
228 | unsigned int new_head = (list->head + 1) % PACKET_QUEUE_LEN; | 229 | unsigned int new_head = (list->head + 1) % PACKET_QUEUE_LEN; |
229 | if (new_head != list->tail) { | 230 | if (new_head != list->tail) { |
230 | p = &list->packets[list->head = new_head]; | 231 | p = &list->packets[list->head = new_head]; |
@@ -249,10 +250,13 @@ static void mousedev_notify_readers(struct mousedev *mousedev, struct mousedev_h | |||
249 | p->dz += packet->dz; | 250 | p->dz += packet->dz; |
250 | p->buttons = mousedev->packet.buttons; | 251 | p->buttons = mousedev->packet.buttons; |
251 | 252 | ||
252 | list->ready = 1; | 253 | if (p->dx || p->dy || p->dz || p->buttons != list->last_buttons) |
254 | list->ready = 1; | ||
253 | 255 | ||
254 | spin_unlock_irqrestore(&list->packet_lock, flags); | 256 | spin_unlock_irqrestore(&list->packet_lock, flags); |
255 | kill_fasync(&list->fasync, SIGIO, POLL_IN); | 257 | |
258 | if (list->ready) | ||
259 | kill_fasync(&list->fasync, SIGIO, POLL_IN); | ||
256 | } | 260 | } |
257 | 261 | ||
258 | wake_up_interruptible(&mousedev->wait); | 262 | wake_up_interruptible(&mousedev->wait); |
@@ -477,9 +481,10 @@ static void mousedev_packet(struct mousedev_list *list, signed char *ps2_data) | |||
477 | } | 481 | } |
478 | 482 | ||
479 | if (!p->dx && !p->dy && !p->dz) { | 483 | if (!p->dx && !p->dy && !p->dz) { |
480 | if (list->tail == list->head) | 484 | if (list->tail == list->head) { |
481 | list->ready = 0; | 485 | list->ready = 0; |
482 | else | 486 | list->last_buttons = p->buttons; |
487 | } else | ||
483 | list->tail = (list->tail + 1) % PACKET_QUEUE_LEN; | 488 | list->tail = (list->tail + 1) % PACKET_QUEUE_LEN; |
484 | } | 489 | } |
485 | 490 | ||