Merge whot@wombat:~/potoroo/xserver into mpx

This commit is contained in:
Peter Hutterer 2008-04-09 10:46:46 +09:30
commit cbe01b3083

View File

@ -241,6 +241,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
k = &(*k)->next; k = &(*k)->next;
} }
} else if (to->kbdfeed && !from->kbdfeed)
{
FreeFeedbackClass(KbdFeedbackClass, (pointer)&to->kbdfeed);
} }
if (from->ptrfeed) if (from->ptrfeed)
@ -264,6 +267,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
p = &(*p)->next; p = &(*p)->next;
} }
} else if (to->ptrfeed && !from->ptrfeed)
{
FreeFeedbackClass(PtrFeedbackClass, (pointer)&to->ptrfeed);
} }
if (from->intfeed) if (from->intfeed)
@ -286,6 +292,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
i = &(*i)->next; i = &(*i)->next;
} }
} else if (to->intfeed && !from->intfeed)
{
FreeFeedbackClass(IntegerFeedbackClass, (pointer)&to->intfeed);
} }
if (from->stringfeed) if (from->stringfeed)
@ -308,6 +317,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
s = &(*s)->next; s = &(*s)->next;
} }
} else if (to->stringfeed && !from->stringfeed)
{
FreeFeedbackClass(StringFeedbackClass, (pointer)&to->stringfeed);
} }
if (from->bell) if (from->bell)
@ -331,6 +343,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
b = &(*b)->next; b = &(*b)->next;
} }
} else if (to->bell && !from->bell)
{
FreeFeedbackClass(BellFeedbackClass, (pointer)&to->bell);
} }
if (from->leds) if (from->leds)
@ -354,6 +369,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
l = &(*l)->next; l = &(*l)->next;
} }
} else if (to->leds && !from->leds)
{
FreeFeedbackClass(LedFeedbackClass, (pointer)&to->leds);
} }
} }
@ -378,18 +396,23 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
} }
ALLOC_COPY_CLASS_IF(key, KeyClassRec); ALLOC_COPY_CLASS_IF(key, KeyClassRec);
if (to->key) if (to->key && from->key)
{ {
#ifdef XKB #ifdef XKB
to->key->xkbInfo = NULL; to->key->xkbInfo = NULL;
#endif #endif
to->key->curKeySyms.map = NULL; to->key->curKeySyms.map = NULL;
CopyKeyClass(from, to); CopyKeyClass(from, to);
} else if (to->key && !from->key)
{
FreeDeviceClass(KeyClass, (pointer)&to->key);
} }
if (from->valuator) if (from->valuator)
{ {
ValuatorClassPtr v; ValuatorClassPtr v;
if (to->valuator)
xfree(to->valuator->motion);
to->valuator = xrealloc(to->valuator, sizeof(ValuatorClassRec) + to->valuator = xrealloc(to->valuator, sizeof(ValuatorClassRec) +
from->valuator->numAxes * sizeof(AxisInfo) + from->valuator->numAxes * sizeof(AxisInfo) +
from->valuator->numAxes * sizeof(unsigned int)); from->valuator->numAxes * sizeof(unsigned int));
@ -404,6 +427,9 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo)); memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo));
v->axisVal = (int*)(v->axes + from->valuator->numAxes); v->axisVal = (int*)(v->axes + from->valuator->numAxes);
} else if (to->valuator && !from->valuator)
{
FreeDeviceClass(ValuatorClass, (pointer)&to->valuator);
} }
ALLOC_COPY_CLASS_IF(button, ButtonClassRec); ALLOC_COPY_CLASS_IF(button, ButtonClassRec);
@ -427,10 +453,28 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
to->button->xkb_acts = NULL; to->button->xkb_acts = NULL;
/* XXX: XkbAction needs to be copied */ /* XXX: XkbAction needs to be copied */
#endif #endif
} else if (to->button && !from->button)
{
FreeDeviceClass(ButtonClass, (pointer)&to->button);
} }
ALLOC_COPY_CLASS_IF(focus, FocusClassRec); ALLOC_COPY_CLASS_IF(focus, FocusClassRec);
if (to->focus && !from->focus)
{
FreeDeviceClass(FocusClass, (pointer)&to->focus);
}
ALLOC_COPY_CLASS_IF(proximity, ProximityClassRec); ALLOC_COPY_CLASS_IF(proximity, ProximityClassRec);
if (to->proximity && !from->proximity)
{
FreeDeviceClass(ProximityClass, (pointer)&to->proximity);
}
ALLOC_COPY_CLASS_IF(absolute, AbsoluteClassRec); ALLOC_COPY_CLASS_IF(absolute, AbsoluteClassRec);
if (to->absolute && !from->absolute)
{
xfree(to->absolute);
to->absolute = NULL;
}
DeepCopyFeedbackClasses(from, to); DeepCopyFeedbackClasses(from, to);
} }