forked from enlightenment/efl
ecore-x - use last modifier mask found, not first to match xserver logic
this makes altgr not conflict as per https://phab.enlightenment.org/T1273 by using the last, not first occurance of the key in the mask modifier bits
This commit is contained in:
parent
21bb0531fb
commit
4af9664622
|
@ -361,19 +361,13 @@ _ecore_xcb_keymap_mask_get(void *reply,
|
||||||
|
|
||||||
for (j = 0; j < 8; j++)
|
for (j = 0; j < 8; j++)
|
||||||
{
|
{
|
||||||
sym2 =
|
sym2 = xcb_key_symbols_get_keysym(_ecore_xcb_keysyms,
|
||||||
xcb_key_symbols_get_keysym(_ecore_xcb_keysyms,
|
|
||||||
modmap[i], j);
|
modmap[i], j);
|
||||||
if (sym2 != 0) break;
|
if (sym2 != 0) break;
|
||||||
}
|
}
|
||||||
if (sym2 == sym)
|
if (sym2 == sym) mask = masks[i / rep->keycodes_per_modifier];
|
||||||
{
|
|
||||||
mask = masks[i / rep->keycodes_per_modifier];
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1124,7 +1124,7 @@ _ecore_x_key_mask_get(KeySym sym)
|
||||||
{
|
{
|
||||||
XModifierKeymap *mod;
|
XModifierKeymap *mod;
|
||||||
KeySym sym2;
|
KeySym sym2;
|
||||||
int i, j;
|
int i, j, mask = 0;
|
||||||
const int masks[8] =
|
const int masks[8] =
|
||||||
{
|
{
|
||||||
ShiftMask, LockMask, ControlMask,
|
ShiftMask, LockMask, ControlMask,
|
||||||
|
@ -1133,6 +1133,7 @@ _ecore_x_key_mask_get(KeySym sym)
|
||||||
|
|
||||||
mod = XGetModifierMapping(_ecore_x_disp);
|
mod = XGetModifierMapping(_ecore_x_disp);
|
||||||
if ((mod) && (mod->max_keypermod > 0))
|
if ((mod) && (mod->max_keypermod > 0))
|
||||||
|
{
|
||||||
for (i = 0; i < (8 * mod->max_keypermod); i++)
|
for (i = 0; i < (8 * mod->max_keypermod); i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 8; j++)
|
for (j = 0; j < 8; j++)
|
||||||
|
@ -1142,28 +1143,15 @@ _ecore_x_key_mask_get(KeySym sym)
|
||||||
if (sym2 != 0)
|
if (sym2 != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (sym2 == sym)
|
if (sym2 == sym) mask = masks[i / mod->max_keypermod];
|
||||||
{
|
|
||||||
int mask;
|
|
||||||
|
|
||||||
mask = masks[i / mod->max_keypermod];
|
|
||||||
if (mod->modifiermap)
|
|
||||||
XFree(mod->modifiermap);
|
|
||||||
|
|
||||||
XFree(mod);
|
|
||||||
return mask;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mod)
|
if (mod)
|
||||||
{
|
{
|
||||||
if (mod->modifiermap)
|
if (mod->modifiermap) XFree(mod->modifiermap);
|
||||||
XFree(mod->modifiermap);
|
|
||||||
|
|
||||||
XFree(mod);
|
XFree(mod);
|
||||||
}
|
}
|
||||||
|
return mask;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue