|
Lines 612-623
DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
Link Here
|
| 612 |
|
612 |
|
| 613 |
if (from->button->xkb_acts) { |
613 |
if (from->button->xkb_acts) { |
| 614 |
if (!to->button->xkb_acts) { |
614 |
if (!to->button->xkb_acts) { |
| 615 |
to->button->xkb_acts = calloc(1, sizeof(XkbAction)); |
615 |
to->button->xkb_acts = calloc(from->button->numButtons, sizeof(XkbAction)); |
| 616 |
if (!to->button->xkb_acts) |
616 |
if (!to->button->xkb_acts) |
| 617 |
FatalError("[Xi] not enough memory for xkb_acts.\n"); |
617 |
FatalError("[Xi] not enough memory for xkb_acts.\n"); |
|
|
618 |
} else { |
| 619 |
to->button->xkb_acts = xnfreallocarray(to->button->xkb_acts, |
| 620 |
from->button->numButtons, |
| 621 |
sizeof(XkbAction)); |
| 618 |
} |
622 |
} |
| 619 |
memcpy(to->button->xkb_acts, from->button->xkb_acts, |
623 |
memcpy(to->button->xkb_acts, from->button->xkb_acts, |
| 620 |
sizeof(XkbAction)); |
624 |
from->button->numButtons * sizeof(XkbAction)); |
| 621 |
} |
625 |
} |
| 622 |
else { |
626 |
else { |
| 623 |
free(to->button->xkb_acts); |
627 |
free(to->button->xkb_acts); |