Re: [wmii] snap: 20060329 -- shortcuts bug

From: Stefan Tibus <sjti_AT_gmx.net>
Date: Thu, 30 Mar 2006 14:08:41 +0200

More information:
I now list nkey and the key currently being destroyed, as well as then
the index i and the keys in the list at the end of update_keys:
- 77: Mod4-Control-b
- 76: Mod4-Control-c
- 75: Mod4-Control-w,y
- 73: Mod4-Control-q,y
- 71: Mod4-Control-p
- 70: Mod4-Control-a
- 69: Mod4-Control-Left
- 68: Mod4-Control-Right
- 67: Mod4-Shift-Left
- 66: Mod4-Shift-Right
- 65: Mod4-Shift-Down
- 64: Mod4-Shift-Up
- 63: Mod4-space
- 62: Mod4-Shift-space
- 61: Mod4-Return
- 60: Mod4-Left
- 59: Mod4-Right
- 58: Mod4-Down
- 57: Mod4-Up
- 56: Mod4-Control-n
- 55: Mod4-Control-m
- 54: Mod4-Control-s
- 53: Mod4-Control-e
- 52: Mod4-t
- 51: Mod4-Shift-t
- 50: Mod4-0
- 49: Mod4-1
- 48: Mod4-2
- 47: Mod4-3
- 46: Mod4-4
- 45: Mod4-5
- 44: Mod4-6
- 43: Mod4-7
- 42: Mod4-8
- 41: Mod4-9
- 40: Mod4-Shift-0
- 39: Mod4-Shift-1
- 38: Mod4-Shift-2
- 37: Mod4-Shift-3
- 36: Mod4-Shift-4
- 35: Mod4-Shift-5
- 34: Mod4-Shift-6
- 33: Mod4-Shift-7
- 32: Mod4-Shift-8
- 31: Mod4-Shift-9
- 30: Mod4-F1
- 29: Mod4-F2
- 28: Mod4-F3
- 27: Mod4-F4
- 26: Mod4-F5
- 25: Mod4-F6
- 24: Mod4-F7
- 23: Mod4-F8
- 22: Mod4-F9
- 21: Mod4-F10
- 20: Mod4-F11
- 19: Mod4-F12
- 18: Mod4-Shift-F1
- 17: Mod4-Shift-F2
- 16: Mod4-Shift-F3
- 15: Mod4-Shift-F4
- 14: Mod4-Shift-F5
- 13: Mod4-Shift-F6
- 12: Mod4-Shift-F7
- 11: Mod4-Shift-F8
- 10: Mod4-Shift-F9
- 9: Mod4-Shift-F10
- 8: Mod4-Shift-F11
- 7: Mod4-Shift-F12
- 6: Mod4-g
- 5: Mod4-Shift-g
- 4: Mod4-m
- 3: Mod4-Shift-m
- 2: Mod4-v
- 1: Mod4-Shift-v
+ 0: Mod4-w
+ 1: Mod4-Shift-w
+ 2: Mod4-Control-b
+ 3: Mod4-Control-c
+ 4: Mod4-Control-w,y
+ 5: Mod4-Control-q,y
+ 6: Mod4-Control-p
+ 7: Mod4-Control-a
+ 8: Mod4-Control-Left
+ 9: Mod4-Control-Right
+ 10: Mod4-Shift-Left
+ 11: Mod4-Shift-Right
+ 12: Mod4-Shift-Down
+ 13: Mod4-Shift-Up
+ 14: Mod4-space
+ 15: Mod4-Shift-space
+ 16: Mod4-Return
+ 17: Mod4-Left
+ 18: Mod4-Right
+ 19: Mod4-Down
+ 20: Mod4-Up
+ 21: Mod4-Control-n
+ 22: Mod4-Control-m
+ 23: Mod4-Control-s
+ 24: Mod4-Control-e
+ 25: Mod4-t
+ 26: Mod4-Shift-t
+ 27: Mod4-0
+ 28: Mod4-1
+ 29: Mod4-2
+ 30: Mod4-3
+ 31: Mod4-4
+ 32: Mod4-5
+ 33: Mod4-6
+ 34: Mod4-7
+ 35: Mod4-8
+ 36: Mod4-9
+ 37: Mod4-Shift-0
+ 38: Mod4-Shift-1
+ 39: Mod4-Shift-2
+ 40: Mod4-Shift-3
+ 41: Mod4-Shift-4
+ 42: Mod4-Shift-5
+ 43: Mod4-Shift-6
+ 44: Mod4-Shift-7
+ 45: Mod4-Shift-8
+ 46: Mod4-Shift-9
+ 47: Mod4-F1
+ 48: Mod4-F2
+ 49: Mod4-F3
+ 50: Mod4-F4
+ 51: Mod4-F5
+ 52: Mod4-F6
+ 53: Mod4-F7
+ 54: Mod4-F8
+ 55: Mod4-F9
+ 56: Mod4-F10
+ 57: Mod4-F11
+ 58: Mod4-F12
+ 59: Mod4-Shift-F1
+ 60: Mod4-Shift-F2
+ 61: Mod4-Shift-F3
+ 62: Mod4-Shift-F4
+ 63: Mod4-Shift-F5
+ 64: Mod4-Shift-F6
+ 65: Mod4-Shift-F7
+ 66: Mod4-Shift-F8
+ 67: Mod4-Shift-F9
+ 68: Mod4-Shift-F10
+ 69: Mod4-Shift-F11
+ 70: Mod4-Shift-F12
+ 71: Mod4-g
+ 72: Mod4-Shift-g
+ 73: Mod4-m
+ 74: Mod4-Shift-m

As one can see:
- 75: Mod4-Control-w,y
- 73: Mod4-Control-q,y
- 71: Mod4-Control-p
on double key codes the counter is decreased by two instead of one, so the
last two entries Mod4-(Shift-)w do not get deleted but nkey is zero.
However I can't see yet, why Mod4-(Shift-)v is not added to the list.

So one bug is here:
void
destroy_key(Key *k)
{
        cext_array_detach((void **)key, k, &keysz);
        nkey--;
        if(k->next)
                destroy_key(k->next);
        free(k);
}

I changed it to read:
void
destroy_key(Key *k)
{
        cext_array_detach((void **)key, k, &keysz);
        if(k->next)
                destroy_key(k->next);
        else
                nkey--;
        free(k);
}

and it works well for me right now. I suppose decreasing the counter
after deletion of the entire sequence only is the wanted behaviour.

Regards,
Stefan

P.S. Sorry for those long mails...
Received on Thu Mar 30 2006 - 14:09:18 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:01:45 UTC