XKB modifiers are strange things, and i don't know how to read them properly in modkeys.c and convert it all to the x core stuff. so we use this to get the state of the modifiers, otherwise we end up missing them sometimes (like on PPC)
This commit is contained in:
parent
5a468756c0
commit
162a97e158
1 changed files with 20 additions and 4 deletions
|
@ -247,6 +247,10 @@ static void event_set_curtime(XEvent *e)
|
||||||
|
|
||||||
static void event_hack_mods(XEvent *e)
|
static void event_hack_mods(XEvent *e)
|
||||||
{
|
{
|
||||||
|
#ifdef XKB
|
||||||
|
XkbStateRec xkb_state;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (e->type) {
|
switch (e->type) {
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
|
@ -256,10 +260,22 @@ static void event_hack_mods(XEvent *e)
|
||||||
e->xkey.state = modkeys_only_modifier_masks(e->xkey.state);
|
e->xkey.state = modkeys_only_modifier_masks(e->xkey.state);
|
||||||
break;
|
break;
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
e->xkey.state = modkeys_only_modifier_masks(e->xkey.state);
|
#ifdef XKB
|
||||||
/* remove from the state the mask of the modifier key being released,
|
/* If XKB is present, then the modifiers are all strange from its
|
||||||
if it is a modifier key being released that is */
|
magic. Our X core protocol stuff won't work, so we use this to
|
||||||
e->xkey.state &= ~modkeys_keycode_to_mask(e->xkey.keycode);
|
find what the modifier state is instead. */
|
||||||
|
if (XkbGetState(ob_display, XkbUseCoreKbd, &xkb_state) == Success) {
|
||||||
|
e->xkey.state = xkb_state.compat_state;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
e->xkey.state = modkeys_only_modifier_masks(e->xkey.state);
|
||||||
|
/* remove from the state the mask of the modifier key being
|
||||||
|
released, if it is a modifier key being released that is */
|
||||||
|
e->xkey.state &= ~modkeys_keycode_to_mask(e->xkey.keycode);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
e->xmotion.state = modkeys_only_modifier_masks(e->xmotion.state);
|
e->xmotion.state = modkeys_only_modifier_masks(e->xmotion.state);
|
||||||
|
|
Loading…
Reference in a new issue