diff options
author | Keith Packard <keithp@keithp.com> | 2012-06-03 20:24:24 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-06-03 20:24:24 -0700 |
commit | 3476eb38063473a7a5fcd78e2095e284118de839 (patch) | |
tree | 5f008b7a2ba1cb5d2d6e013f00e795b50bd89602 | |
parent | 78f0d9cdc441a575e15e5f7200ce74750d2f7ad2 (diff) | |
parent | 42ae2e8199fe875319978249963de7499607988b (diff) |
Merge remote-tracking branch 'whot/for-keith'
-rw-r--r-- | dix/getevents.c | 2 | ||||
-rw-r--r-- | xkb/XKBMAlloc.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index ae4112ffc..4fbaa6c94 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1615,7 +1615,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, /* Now turn the smooth-scrolling axes back into emulated button presses * for legacy clients, based on the integer delta between before and now */ for (i = 0; i < valuator_mask_size(&mask); i++) { - if (i >= pDev->valuator->numAxes) + if ( !pDev->valuator || (i >= pDev->valuator->numAxes)) break; if (!valuator_mask_isset(&mask, i)) diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index 645e90544..3ffd5dad1 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -375,8 +375,10 @@ XkbResizeKeyType(XkbDescPtr xkb, nResize = 0; for (nTotal = 1, i = xkb->min_key_code; i <= xkb->max_key_code; i++) { width = XkbKeyGroupsWidth(xkb, i); - if (width < type->num_levels) + if (width < type->num_levels || width >= new_num_lvls) { + nTotal += XkbKeyNumSyms(xkb,i); continue; + } for (match = 0, g = XkbKeyNumGroups(xkb, i) - 1; (g >= 0) && (!match); g--) { if (XkbKeyKeyTypeIndex(xkb, i, g) == type_ndx) { @@ -384,7 +386,7 @@ XkbResizeKeyType(XkbDescPtr xkb, match = 1; } } - if ((!match) || (width >= new_num_lvls)) + if (!match) nTotal += XkbKeyNumSyms(xkb, i); else { nTotal += XkbKeyNumGroups(xkb, i) * new_num_lvls; |