Comment 6 for bug 286617

Revision history for this message
Julian Kniephoff (jules-k) wrote :

Sorry for double posting but I should add two other things, that I found out:
First the bug seems to occur with other characters that involve pressing AltGr. I tested this with "|", which -- on a German keyboard -- is typed as AltGr+<.
As this worked in hardy and the corresponding code did not change in keepassx (the original reporter of this bug and me, too, used 0.3.3 already in hardy), some other change has to cause this and I think I found it:
Running this little program:
"#include <stdio.h>

#include <X11/Xlib.h>
#include <X11/keysymdef.h>

int main (int argc, char *argv[])
{
        Display *d = XOpenDisplay (NULL);
        int n, i;
        KeySym *syms = XGetKeyboardMapping (d, 24, 1, &n); // KeyCode 24 is "@".
        for (i = 0; i < n; ++i)
        {
                printf("%x\n", syms[i]);
        }
        XFree (syms);
        XCloseDisplay (d);
}"
on a hardy machine yields:
"71
51
40
7d9
40
7d9
0"
With 0x40 being the KeySym of "@" HelperX11::getModifiers returns 2, which is interpreted as AltGr by HelperX11::pressModifiers.
On my new intrepid install, this gives me:
"71
51
71
51
40
7d9
40"
Which makes getModifiers return 4 (or crash with an assertion, if you didn't apply the change I mentioned in the last post), which can not be interpreted by pressModifiers.

As said, I am not an X11 guru and thus cannot judge, whether this is a bug in intrepids X11 or a design flaw in keepassx (or maybe in a completely different place like a keyboard map...).