xemacs/xemacs-21.4.8-xevent.patch

22 lines
714 B
Diff

Index: src/event-Xt.c
===================================================================
--- src/event-Xt.c.orig
+++ src/event-Xt.c
@@ -1224,9 +1224,13 @@ x_event_to_emacs_event (XEvent *x_event,
if (modifiers & XEMACS_MOD_SHIFT)
{
- int Mode_switch_p = *state & xd->ModeMask;
- KeySym bot = XLookupKeysym (ev, Mode_switch_p ? 2 : 0);
- KeySym top = XLookupKeysym (ev, Mode_switch_p ? 3 : 1);
+ KeySym top, bot;
+ XKeyEvent tmpev = *ev;
+
+ tmpev.state = *state & (xd->ModeMask | ~0xff);
+ XLookupString(&tmpev, NULL, 0, &bot, NULL);
+ tmpev.state |= ShiftMask;
+ XLookupString(&tmpev, NULL, 0, &top, NULL);
if (top && bot && top != bot)
modifiers &= ~XEMACS_MOD_SHIFT;
}