GNOME Bugzilla – Bug 345308
Keypad does not work properly
Last modified: 2006-08-27 06:27:32 UTC
Please describe the problem: When I press slowly 0418 with the keypad, ekiga understands 0418. When I press faster 0418 with the keypad, ekiga understands 4081 (or 4018 or 0481)... In fact, when typing to much fast, you type the second key before releasing the first... Steps to reproduce: Actual results: Expected results: Does this happen every time? yes Other information:
I remember such a bug... I can't find it in the list, though. I think the conclusion was that it was a GTK+ bug.
Indeed, GTK+ callbacks are asynchronous. There is no way to change that.
So why using these callbacks, why is this working fine in every other GTK+ applications ?
(In reply to comment #1) > I remember such a bug... I can't find it in the list, though. I think the > conclusion was that it was a GTK+ bug. > No it is not a GTK+ bug : the fact is that you are emulating a mouse click on the keypad buttons when the user press a key from the keypad...
The result is the same. Do you have an idea to fix this if you think it is not a bug?
You have to write the number pressed as soon as the key is pressed and not when it's released. This is exactly what are doing keyboard events handlers... or you can use some more high level stuff like "KeyPressed" event (I do not know how this is working in GTK but it should exist).
The callback is connected to the "clicked" event, so not when it is released. As I do not see a solution to this problem, but you seem to have an idea, it would be nice if you could spend some time on a patch that fixes the problem. That would be a great help for us (I'm currently a bit over busy). Thanks,
sure, i'll do that when i'll have some spare time !
This seems to be working (it's less visual when you type in the keypad but it's work) : --- src/gui/main.cpp 2006-05-06 21:49:43.000000000 +0200 +++ /tmp/src/gui/main.cpp 2006-06-21 14:25:48.000000000 +0200 @@ -1285,7 +1285,7 @@ gtk_container_set_border_width (GTK_CONTAINER (button), 0); gtk_container_add (GTK_CONTAINER (button), box); - gtk_widget_add_accelerator (button, "activate", + gtk_widget_add_accelerator (button, "clicked", mw->accel, key_kp [i], (GdkModifierType) 0, (GtkAccelFlags) 0);
Tested the patch successfully, thank you Philippe! However the patch is mangled, please find an updated one attached.
Created attachment 67833 [details] [review] Patch against ekiga 2.0.2 src/gui/main.cpp
Applied to cvs. Thanks!
*** Bug 353037 has been marked as a duplicate of this bug. ***