Sun 28 Mar 2004 03:19:44 AM UTC, original submission:
Problem: Despite the fixes for bug 8149 (and thank you for them), keyboard auto repeat mode is still broken when using option --retype-file.
Version affected: CVS
How to reproduce the problem:
1. Ensure that you are working with a session that has autorepat turned on.
2.Create text file /tmp/test.xnee. The content of the file does not matter.
3. Enter the following command:
cnee --verbose --retype-file /tmp/test.xnee
After running cnee, press and hold down a key. As you will be able to see, autorepeat mode is turned off.
Cause:
Further examination of verbose mode indicates that the following actions are performed: First, the state of autorepeat mode is saved. Then autorepeat mode is turned off. Then the state of autorepeat mode is saved again! Finally, when the program terminates the state of auto repeat mode is retored. It's the action of saving the state of autorepeat mode after cnee has turned if off that is causing the problem.
After checking the source code, I think I have located the problem.
Upon startup, subroutine xnee_start (in file xnee.c) calls xnee_prepare, which in turn calls xnee_rep_prepare. Subroutine xnee_rep_prepare is always called and it always stores the state of autorepeat mode. There is no reason to call it again.
However, subroutine xnee_type_file (in file xnee_fake.c) calls xnee_set_autorepeat. Not only is that call not needed, it causes this bug. Commented out this call fixes the bug!
Here are the first few lines of subroutine xnee_type_file, with the offending code commented out.
int
xnee_type_file(xnee_data *xd)
{
char tmp[256] ;
int i;
xnee_key_code x_kc;
KeyCode shift_kc ;
KeyCode return_kc ;
KeyCode alt_kc ;
KeyCode alt_gr_kc ;
xnee_verbose ((xd,"---> xnee_type_file\n"));
xnee_setup_display (xd);
xnee_replay_init (xd);
/* xnee_set_autorepeat (xd); */
xnee_verbose ((xd,"--- xnee_type_file\n"));
Please try my change on your computer. If you find that this change is the correct fix for this bug, please update CVS.
Thank you for your time.
- Joe
|