diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-12-05 15:36:12 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-12-05 15:36:12 +0000 |
commit | a90ee792d96752ad1b71b9ada922fa6afe478c99 (patch) | |
tree | 6143b00f7646951d23dfe2a4fe2992ca40b77069 /xserver/Xi | |
parent | bc97d4ecc0aa9e1b823565b07282f848700bd11a (diff) |
Upgrade to xorg-server 1.9.2.
Tested by ajacoutot@, krw@, shadchin@ and jasper@ on various configurations
including multihead with both zaphod and xrandr.
Diffstat (limited to 'xserver/Xi')
-rw-r--r-- | xserver/Xi/Makefile.in | 30 | ||||
-rw-r--r-- | xserver/Xi/closedev.c | 2 | ||||
-rw-r--r-- | xserver/Xi/exevents.c | 170 | ||||
-rw-r--r-- | xserver/Xi/exglobals.h | 4 | ||||
-rw-r--r-- | xserver/Xi/extinit.c | 8 | ||||
-rw-r--r-- | xserver/Xi/getdctl.c | 4 | ||||
-rw-r--r-- | xserver/Xi/getfctl.c | 4 | ||||
-rw-r--r-- | xserver/Xi/getkmap.c | 4 | ||||
-rw-r--r-- | xserver/Xi/getmmap.c | 2 | ||||
-rw-r--r-- | xserver/Xi/getprop.c | 6 | ||||
-rw-r--r-- | xserver/Xi/getselev.c | 4 | ||||
-rw-r--r-- | xserver/Xi/gtmotion.c | 3 | ||||
-rw-r--r-- | xserver/Xi/listdev.c | 10 | ||||
-rw-r--r-- | xserver/Xi/opendev.c | 2 | ||||
-rw-r--r-- | xserver/Xi/queryst.c | 4 | ||||
-rw-r--r-- | xserver/Xi/sendexev.c | 5 | ||||
-rw-r--r-- | xserver/Xi/stubs.c | 8 | ||||
-rw-r--r-- | xserver/Xi/xichangecursor.c | 4 | ||||
-rw-r--r-- | xserver/Xi/xichangehierarchy.c | 12 | ||||
-rw-r--r-- | xserver/Xi/xipassivegrab.c | 6 | ||||
-rw-r--r-- | xserver/Xi/xiproperty.c | 61 | ||||
-rw-r--r-- | xserver/Xi/xiquerydevice.c | 13 | ||||
-rw-r--r-- | xserver/Xi/xiquerypointer.c | 13 | ||||
-rw-r--r-- | xserver/Xi/xiselectev.c | 6 |
24 files changed, 189 insertions, 196 deletions
diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in index f451fc17d..bba894359 100644 --- a/xserver/Xi/Makefile.in +++ b/xserver/Xi/Makefile.in @@ -118,10 +118,6 @@ BUILDDOCS_TRUE = @BUILDDOCS_TRUE@ BUILD_DATE = @BUILD_DATE@ BUILD_KDRIVEFBDEVLIB_FALSE = @BUILD_KDRIVEFBDEVLIB_FALSE@ BUILD_KDRIVEFBDEVLIB_TRUE = @BUILD_KDRIVEFBDEVLIB_TRUE@ -BUILD_LINUXDOC_FALSE = @BUILD_LINUXDOC_FALSE@ -BUILD_LINUXDOC_TRUE = @BUILD_LINUXDOC_TRUE@ -BUILD_PDFDOC_FALSE = @BUILD_PDFDOC_FALSE@ -BUILD_PDFDOC_TRUE = @BUILD_PDFDOC_TRUE@ BUILD_TIME = @BUILD_TIME@ CC = @CC@ CCAS = @CCAS@ @@ -209,6 +205,8 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ENABLE_DEVEL_DOCS_FALSE = @ENABLE_DEVEL_DOCS_FALSE@ +ENABLE_DEVEL_DOCS_TRUE = @ENABLE_DEVEL_DOCS_TRUE@ EXEEXT = @EXEEXT@ F77 = @F77@ FBDEVHW_FALSE = @FBDEVHW_FALSE@ @@ -223,6 +221,7 @@ FONTOTFDIR = @FONTOTFDIR@ FONTROOTDIR = @FONTROOTDIR@ FONTTTFDIR = @FONTTTFDIR@ FONTTYPE1DIR = @FONTTYPE1DIR@ +FOP = @FOP@ FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@ FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@ GLIB_CFLAGS = @GLIB_CFLAGS@ @@ -240,10 +239,14 @@ HAVE_DBUS_FALSE = @HAVE_DBUS_FALSE@ HAVE_DBUS_TRUE = @HAVE_DBUS_TRUE@ HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@ HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@ -HAVE_PS2PDF_FALSE = @HAVE_PS2PDF_FALSE@ -HAVE_PS2PDF_TRUE = @HAVE_PS2PDF_TRUE@ +HAVE_FOP_FALSE = @HAVE_FOP_FALSE@ +HAVE_FOP_TRUE = @HAVE_FOP_TRUE@ HAVE_STYLESHEETS_FALSE = @HAVE_STYLESHEETS_FALSE@ HAVE_STYLESHEETS_TRUE = @HAVE_STYLESHEETS_TRUE@ +HAVE_XMLTO_FALSE = @HAVE_XMLTO_FALSE@ +HAVE_XMLTO_TEXT_FALSE = @HAVE_XMLTO_TEXT_FALSE@ +HAVE_XMLTO_TEXT_TRUE = @HAVE_XMLTO_TEXT_TRUE@ +HAVE_XMLTO_TRUE = @HAVE_XMLTO_TRUE@ HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@ HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@ HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@ @@ -299,10 +302,11 @@ LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ LIBDRM_LIBS = @LIBDRM_LIBS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ +LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ +LIBSHA1_LIBS = @LIBSHA1_LIBS@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LINUXDOC = @LINUXDOC@ LINUX_ALPHA_FALSE = @LINUX_ALPHA_FALSE@ LINUX_ALPHA_TRUE = @LINUX_ALPHA_TRUE@ LINUX_IA64_FALSE = @LINUX_IA64_FALSE@ @@ -320,17 +324,11 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ -MAKE_HTML = @MAKE_HTML@ -MAKE_PDF = @MAKE_PDF@ -MAKE_PS = @MAKE_PS@ -MAKE_TEXT = @MAKE_TEXT@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MITSHM_FALSE = @MITSHM_FALSE@ MITSHM_TRUE = @MITSHM_TRUE@ -MULTIBUFFER_FALSE = @MULTIBUFFER_FALSE@ -MULTIBUFFER_TRUE = @MULTIBUFFER_TRUE@ NEED_STRLCAT_FALSE = @NEED_STRLCAT_FALSE@ NEED_STRLCAT_TRUE = @NEED_STRLCAT_TRUE@ NEED_VSNPRINTF_FALSE = @NEED_VSNPRINTF_FALSE@ @@ -357,20 +355,23 @@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ PCIACCESS_LIBS = @PCIACCESS_LIBS@ PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ PERL = @PERL@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PPC_VIDEO_FALSE = @PPC_VIDEO_FALSE@ PPC_VIDEO_TRUE = @PPC_VIDEO_TRUE@ PROJECTROOT = @PROJECTROOT@ -PS2PDF = @PS2PDF@ RANLIB = @RANLIB@ RAWCPP = @RAWCPP@ RAWCPPFLAGS = @RAWCPPFLAGS@ RECORD_FALSE = @RECORD_FALSE@ RECORD_TRUE = @RECORD_TRUE@ +RELEASE_DATE = @RELEASE_DATE@ RES_FALSE = @RES_FALSE@ RES_TRUE = @RES_TRUE@ SCREENSAVER_FALSE = @SCREENSAVER_FALSE@ SCREENSAVER_TRUE = @SCREENSAVER_TRUE@ +SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ SECURE_RPC_FALSE = @SECURE_RPC_FALSE@ SECURE_RPC_TRUE = @SECURE_RPC_TRUE@ SED = @SED@ @@ -462,6 +463,7 @@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ XLIB_CFLAGS = @XLIB_CFLAGS@ XLIB_LIBS = @XLIB_LIBS@ +XMLTO = @XMLTO@ XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_FALSE = @XNEST_FALSE@ diff --git a/xserver/Xi/closedev.c b/xserver/Xi/closedev.c index 159ead55c..e319c737a 100644 --- a/xserver/Xi/closedev.c +++ b/xserver/Xi/closedev.c @@ -156,7 +156,7 @@ ProcXCloseDevice(ClientPtr client) * Delete passive grabs from all windows for this device. */ for (i = 0; i < screenInfo.numScreens; i++) { - pWin = WindowTable[i]; + pWin = screenInfo.screens[i]->root; DeleteDeviceEvents(d, pWin, client); p1 = pWin->firstChild; DeleteEventsFromChildren(d, p1, client); diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c index 566b0ef60..e19e207fd 100644 --- a/xserver/Xi/exevents.c +++ b/xserver/Xi/exevents.c @@ -94,9 +94,6 @@ Bool ShouldFreeInputMasks(WindowPtr /* pWin */ , static Bool MakeInputMasks(WindowPtr /* pWin */ ); -/* Used to sture classes currently not in use by an MD */ -extern DevPrivateKey UnusedClassesPrivateKey; - /* * Only let the given client know of core events which will affect its * interpretation of input events, if the client's ClientPointer (or the @@ -224,9 +221,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) if (!to->intfeed) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->intfeed = classes->intfeed; + classes->intfeed = NULL; } i = &to->intfeed; @@ -234,7 +231,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*i)) { - *i = xcalloc(1, sizeof(IntegerFeedbackClassRec)); + *i = calloc(1, sizeof(IntegerFeedbackClassRec)); if (!(*i)) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -249,7 +246,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->intfeed && !from->intfeed) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->intfeed = to->intfeed; to->intfeed = NULL; } @@ -260,9 +257,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) if (!to->stringfeed) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->stringfeed = classes->stringfeed; + classes->stringfeed = NULL; } s = &to->stringfeed; @@ -270,7 +267,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*s)) { - *s = xcalloc(1, sizeof(StringFeedbackClassRec)); + *s = calloc(1, sizeof(StringFeedbackClassRec)); if (!(*s)) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -285,7 +282,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->stringfeed && !from->stringfeed) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->stringfeed = to->stringfeed; to->stringfeed = NULL; } @@ -296,9 +293,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) if (!to->bell) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->bell = classes->bell; + classes->bell = NULL; } b = &to->bell; @@ -306,7 +303,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*b)) { - *b = xcalloc(1, sizeof(BellFeedbackClassRec)); + *b = calloc(1, sizeof(BellFeedbackClassRec)); if (!(*b)) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -322,7 +319,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->bell && !from->bell) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->bell = to->bell; to->bell = NULL; } @@ -333,9 +330,9 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) if (!to->leds) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->leds = classes->leds; + classes->leds = NULL; } l = &to->leds; @@ -343,7 +340,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*l)) { - *l = xcalloc(1, sizeof(LedFeedbackClassRec)); + *l = calloc(1, sizeof(LedFeedbackClassRec)); if (!(*l)) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -361,7 +358,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->leds && !from->leds) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->leds = to->leds; to->leds = NULL; } @@ -381,12 +378,12 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) if (!to->kbdfeed) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->kbdfeed = classes->kbdfeed; if (!to->kbdfeed) InitKeyboardDeviceStruct(to, NULL, NULL, NULL); + classes->kbdfeed = NULL; } k = &to->kbdfeed; @@ -394,7 +391,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*k)) { - *k = xcalloc(1, sizeof(KbdFeedbackClassRec)); + *k = calloc(1, sizeof(KbdFeedbackClassRec)); if (!*k) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -413,7 +410,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->kbdfeed && !from->kbdfeed) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->kbdfeed = to->kbdfeed; to->kbdfeed = NULL; } @@ -422,8 +419,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!to->key) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->key = classes->key; if (!to->key) InitKeyboardDeviceStruct(to, NULL, NULL, NULL); @@ -435,7 +431,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->key && !from->key) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->key = to->key; to->key = NULL; } @@ -472,12 +468,11 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) { WindowPtr *oldTrace; - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->focus = classes->focus; if (!to->focus) { - to->focus = xcalloc(1, sizeof(FocusClassRec)); + to->focus = calloc(1, sizeof(FocusClassRec)); if (!to->focus) FatalError("[Xi] no memory for class shift.\n"); } else @@ -485,7 +480,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) oldTrace = to->focus->trace; memcpy(to->focus, from->focus, sizeof(FocusClassRec)); - to->focus->trace = xrealloc(oldTrace, + to->focus->trace = realloc(oldTrace, to->focus->traceSize * sizeof(WindowPtr)); if (!to->focus->trace && to->focus->traceSize) FatalError("[Xi] no memory for trace.\n"); @@ -496,7 +491,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->focus) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->focus = to->focus; to->focus = NULL; } @@ -514,9 +509,9 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) PtrFeedbackPtr *p, it; if (!to->ptrfeed) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->ptrfeed = classes->ptrfeed; + classes->ptrfeed = NULL; } p = &to->ptrfeed; @@ -524,7 +519,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!(*p)) { - *p = xcalloc(1, sizeof(PtrFeedbackClassRec)); + *p = calloc(1, sizeof(PtrFeedbackClassRec)); if (!*p) { ErrorF("[Xi] Cannot alloc memory for class copy."); @@ -539,7 +534,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->ptrfeed && !from->ptrfeed) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->ptrfeed = to->ptrfeed; to->ptrfeed = NULL; } @@ -549,14 +544,13 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) ValuatorClassPtr v; if (!to->valuator) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->valuator = classes->valuator; if (to->valuator) classes->valuator = NULL; } - to->valuator = xrealloc(to->valuator, sizeof(ValuatorClassRec) + + to->valuator = realloc(to->valuator, sizeof(ValuatorClassRec) + from->valuator->numAxes * sizeof(AxisInfo) + from->valuator->numAxes * sizeof(double)); v = to->valuator; @@ -573,7 +567,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->valuator && !from->valuator) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->valuator = to->valuator; to->valuator = NULL; } @@ -582,12 +576,11 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!to->button) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->button = classes->button; if (!to->button) { - to->button = xcalloc(1, sizeof(ButtonClassRec)); + to->button = calloc(1, sizeof(ButtonClassRec)); if (!to->button) FatalError("[Xi] no memory for class shift.\n"); } else @@ -598,14 +591,14 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!to->button->xkb_acts) { - to->button->xkb_acts = xcalloc(1, sizeof(XkbAction)); + to->button->xkb_acts = calloc(1, sizeof(XkbAction)); if (!to->button->xkb_acts) FatalError("[Xi] not enough memory for xkb_acts.\n"); } memcpy(to->button->xkb_acts, from->button->xkb_acts, sizeof(XkbAction)); } else - xfree(to->button->xkb_acts); + free(to->button->xkb_acts); memcpy(to->button->labels, from->button->labels, from->button->numButtons * sizeof(Atom)); @@ -613,7 +606,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->button && !from->button) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->button = to->button; to->button = NULL; } @@ -622,12 +615,11 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!to->proximity) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->proximity = classes->proximity; if (!to->proximity) { - to->proximity = xcalloc(1, sizeof(ProximityClassRec)); + to->proximity = calloc(1, sizeof(ProximityClassRec)); if (!to->proximity) FatalError("[Xi] no memory for class shift.\n"); } else @@ -638,7 +630,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->proximity) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->proximity = to->proximity; to->proximity = NULL; } @@ -647,12 +639,11 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) { if (!to->absolute) { - classes = dixLookupPrivate(&to->devPrivates, - UnusedClassesPrivateKey); + classes = to->unused_classes; to->absolute = classes->absolute; if (!to->absolute) { - to->absolute = xcalloc(1, sizeof(AbsoluteClassRec)); + to->absolute = calloc(1, sizeof(AbsoluteClassRec)); if (!to->absolute) FatalError("[Xi] no memory for class shift.\n"); } else @@ -663,7 +654,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) } else if (to->absolute) { ClassesPtr classes; - classes = dixLookupPrivate(&to->devPrivates, UnusedClassesPrivateKey); + classes = to->unused_classes; classes->absolute = to->absolute; to->absolute = NULL; } @@ -709,7 +700,7 @@ XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master, DeviceChanged /* we don't actually swap if there's a NullClient, swapping is done * later when event is delivered. */ SendEventToAllWindows(master, XI_DeviceChangedMask, (xEvent*)dcce, 1); - xfree(dcce); + free(dcce); } static void @@ -762,7 +753,6 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) KeyClassPtr k = NULL; ButtonClassPtr b = NULL; ValuatorClassPtr v = NULL; - BYTE *kptr = NULL; /* This event is always the first we get, before the actual events with * the data. However, the way how the DDX is set up, "device" will @@ -829,32 +819,31 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) if (!k) return DONT_PROCESS; - kptr = &k->down[key >> 3]; - /* don't allow ddx to generate multiple downs, but repeats are okay */ - if ((*kptr & bit) && !event->key_repeat) + /* don't allow ddx to generate multiple downs, but repeats are okay */ + if (key_is_down(device, key, KEY_PROCESSED) && !event->key_repeat) return DONT_PROCESS; + if (device->valuator) device->valuator->motionHintWindow = NullWindow; - *kptr |= bit; + set_key_down(device, key, KEY_PROCESSED); } else if (event->type == ET_KeyRelease) { if (!k) return DONT_PROCESS; - kptr = &k->down[key >> 3]; - if (!(*kptr & bit)) /* guard against duplicates */ + if (!key_is_down(device, key, KEY_PROCESSED)) /* guard against duplicates */ return DONT_PROCESS; if (device->valuator) device->valuator->motionHintWindow = NullWindow; - *kptr &= ~bit; + set_key_up(device, key, KEY_PROCESSED); } else if (event->type == ET_ButtonPress) { Mask mask; if (!b) return DONT_PROCESS; - kptr = &b->down[key >> 3]; - if ((*kptr & bit) != 0) + if (button_is_down(device, key, BUTTON_PROCESSED)) return DONT_PROCESS; - *kptr |= bit; + + set_button_down(device, key, BUTTON_PROCESSED); if (device->valuator) device->valuator->motionHintWindow = NullWindow; if (!b->map[key]) @@ -874,8 +863,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) if (!b) return DONT_PROCESS; - kptr = &b->down[key>>3]; - if (!(*kptr & bit)) + if (!button_is_down(device, key, BUTTON_PROCESSED)) return DONT_PROCESS; if (IsMaster(device)) { DeviceIntPtr sd; @@ -890,11 +878,11 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) continue; if (!sd->button) continue; - if ((sd->button->down[key>>3] & bit) != 0) + if (button_is_down(sd, key, BUTTON_PROCESSED)) return DONT_PROCESS; } } - *kptr &= ~bit; + set_button_up(device, key, BUTTON_PROCESSED); if (device->valuator) device->valuator->motionHintWindow = NullWindow; if (!b->map[key]) @@ -937,9 +925,9 @@ ProcessRawEvent(RawDeviceEvent *ev, DeviceIntPtr device) } for (i = 0; i < screenInfo.numScreens; i++) - DeliverEventsToWindow(device, WindowTable[i], xi, 1, + DeliverEventsToWindow(device, screenInfo.screens[i]->root, xi, 1, GetEventFilter(device, xi), NULL); - xfree(xi); + free(xi); } } @@ -1053,7 +1041,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) /* see comment in EnqueueEvents regarding the next three lines */ if (ev->any.type == ET_Motion) - ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id; + ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id; eventinfo.device = device; eventinfo.event = ev; @@ -1127,7 +1115,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) { ProximityClassPtr proxc; - proxc = (ProximityClassPtr) xalloc(sizeof(ProximityClassRec)); + proxc = (ProximityClassPtr) malloc(sizeof(ProximityClassRec)); if (!proxc) return FALSE; proxc->sourceid = dev->id; @@ -1243,7 +1231,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, btlen = bytes_to_int32(btlen); len = sizeof(xXIFocusInEvent) + btlen * 4; - xi2event = xcalloc(1, len); + xi2event = calloc(1, len); xi2event->type = GenericEvent; xi2event->extension = IReqCode; xi2event->evtype = type; @@ -1279,7 +1267,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeliverEventsToWindow(dev, pWin, (xEvent*)xi2event, 1, GetEventFilter(dev, (xEvent*)xi2event), NullGrab); - xfree(xi2event); + free(xi2event); /* XI 1.x event */ event.deviceid = dev->id; @@ -1333,7 +1321,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, } } - sev = ev = (deviceStateNotify *) xalloc(evcount * sizeof(xEvent)); + sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent)); FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); if (b != NULL) { @@ -1388,7 +1376,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, DeliverEventsToWindow(dev, pWin, (xEvent *) sev, evcount, DeviceStateNotifyMask, NullGrab); - xfree(sev); + free(sev); } } @@ -1456,7 +1444,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, if (rc != Success) { client->errorValue = param->cursor; - return (rc == BadValue) ? BadCursor : rc; + return rc; } access_mode |= DixForceAccess; } @@ -1554,7 +1542,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type, if (rc != Success) { client->errorValue = param->cursor; - return (rc == BadValue) ? BadCursor : rc; + return rc; } access_mode |= DixForceAccess; } @@ -1638,7 +1626,7 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx) if (!pWin->optional && !MakeWindowOptional(pWin)) return BadAlloc; - others = xcalloc(1, sizeof(InputClients)); + others = calloc(1, sizeof(InputClients)); if (!others) return BadAlloc; if (!pWin->optional->inputMasks && !MakeInputMasks(pWin)) @@ -1657,7 +1645,7 @@ MakeInputMasks(WindowPtr pWin) { struct _OtherInputMasks *imasks; - imasks = xcalloc(1, sizeof(struct _OtherInputMasks)); + imasks = calloc(1, sizeof(struct _OtherInputMasks)); if (!imasks) return FALSE; pWin->optional->inputMasks = imasks; @@ -1713,21 +1701,21 @@ InputClientGone(WindowPtr pWin, XID id) InputClientsPtr other, prev; if (!wOtherInputMasks(pWin)) - return (Success); + return Success; prev = 0; for (other = wOtherInputMasks(pWin)->inputClients; other; other = other->next) { if (other->resource == id) { if (prev) { prev->next = other->next; - xfree(other); + free(other); } else if (!(other->next)) { if (ShouldFreeInputMasks(pWin, TRUE)) { wOtherInputMasks(pWin)->inputClients = other->next; - xfree(wOtherInputMasks(pWin)); + free(wOtherInputMasks(pWin)); pWin->optional->inputMasks = (OtherInputMasks *) NULL; CheckWindowOptionalNeed(pWin); - xfree(other); + free(other); } else { other->resource = FakeClientID(0); if (!AddResource(other->resource, RT_INPUTCLIENT, @@ -1736,10 +1724,10 @@ InputClientGone(WindowPtr pWin, XID id) } } else { wOtherInputMasks(pWin)->inputClients = other->next; - xfree(other); + free(other); } RecalculateDeviceDeliverableEvents(pWin); - return (Success); + return Success; } prev = other; } @@ -1840,7 +1828,7 @@ ChangeKeyMapping(ClientPtr client, KeyClassPtr k = dev->key; if (k == NULL) - return (BadMatch); + return BadMatch; if (len != (keyCodes * keySymsPerKeyCode)) return BadLength; @@ -1862,7 +1850,7 @@ ChangeKeyMapping(ClientPtr client, XkbApplyMappingChange(dev, &keysyms, firstKeyCode, keyCodes, NULL, serverClient); - return client->noClientException; + return Success; } static void @@ -1983,7 +1971,7 @@ MaybeSendDeviceMotionNotifyHint(deviceKeyButtonPointer * pEvents, Mask mask) pEvents->detail = NotifyNormal; } } - return (0); + return 0; } void @@ -2131,7 +2119,7 @@ SendEventToAllWindows(DeviceIntPtr dev, Mask mask, xEvent * ev, int count) WindowPtr pWin, p1; for (i = 0; i < screenInfo.numScreens; i++) { - pWin = WindowTable[i]; + pWin = screenInfo.screens[i]->root; if (!pWin) continue; DeliverEventsToWindow(dev, pWin, ev, count, mask, NullGrab); diff --git a/xserver/Xi/exglobals.h b/xserver/Xi/exglobals.h index 2d2d25c0b..f7557079e 100644 --- a/xserver/Xi/exglobals.h +++ b/xserver/Xi/exglobals.h @@ -78,5 +78,7 @@ extern int DevicePropertyNotify; extern int RT_INPUTCLIENT; -extern DevPrivateKey XIClientPrivateKey; +extern DevPrivateKeyRec XIClientPrivateKeyRec; +#define XIClientPrivateKey (&XIClientPrivateKeyRec) + #endif /* EXGLOBALS_H */ diff --git a/xserver/Xi/extinit.c b/xserver/Xi/extinit.c index 37f985664..eda4efb50 100644 --- a/xserver/Xi/extinit.c +++ b/xserver/Xi/extinit.c @@ -377,9 +377,7 @@ Mask PropagateMask[MAXDEVICES]; * */ -static int XIClientPrivateKeyIndex; -DevPrivateKey XIClientPrivateKey = &XIClientPrivateKeyIndex; - +DevPrivateKeyRec XIClientPrivateKeyRec; /***************************************************************** * @@ -1156,7 +1154,7 @@ void AssignTypeAndName(DeviceIntPtr dev, Atom type, char *name) { dev->xinput_type = type; - dev->name = (char *)xalloc(strlen(name) + 1); + dev->name = (char *)malloc(strlen(name) + 1); strcpy(dev->name, name); } @@ -1256,7 +1254,7 @@ XInputExtensionInit(void) SERVER_XI_MINOR_VERSION, }; - if (!dixRequestPrivate(XIClientPrivateKey, sizeof(XIClientRec))) + if (!dixRegisterPrivateKey(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec))) FatalError("Cannot request private for XI.\n"); if (!AddCallback(&ClientStateCallback, XIClientCallback, 0)) diff --git a/xserver/Xi/getdctl.c b/xserver/Xi/getdctl.c index 68181fa61..3e81e9479 100644 --- a/xserver/Xi/getdctl.c +++ b/xserver/Xi/getdctl.c @@ -281,7 +281,7 @@ ProcXGetDeviceControl(ClientPtr client) return BadValue; } - buf = (char *)xalloc(total_length); + buf = (char *)malloc(total_length); if (!buf) return BadAlloc; savbuf = buf; @@ -309,6 +309,6 @@ ProcXGetDeviceControl(ClientPtr client) rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep); WriteToClient(client, total_length, savbuf); - xfree(savbuf); + free(savbuf); return Success; } diff --git a/xserver/Xi/getfctl.c b/xserver/Xi/getfctl.c index 607765e98..9563d63d6 100644 --- a/xserver/Xi/getfctl.c +++ b/xserver/Xi/getfctl.c @@ -340,7 +340,7 @@ ProcXGetFeedbackControl(ClientPtr client) if (total_length == 0) return BadMatch; - buf = (char *)xalloc(total_length); + buf = (char *)malloc(total_length); if (!buf) return BadAlloc; savbuf = buf; @@ -361,6 +361,6 @@ ProcXGetFeedbackControl(ClientPtr client) rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep); WriteToClient(client, total_length, savbuf); - xfree(savbuf); + free(savbuf); return Success; } diff --git a/xserver/Xi/getkmap.c b/xserver/Xi/getkmap.c index 78449e212..c38467b96 100644 --- a/xserver/Xi/getkmap.c +++ b/xserver/Xi/getkmap.c @@ -133,8 +133,8 @@ ProcXGetDeviceKeyMapping(ClientPtr client) syms->mapWidth * stuff->count * sizeof(KeySym), &syms->map[syms->mapWidth * (stuff->firstKeyCode - syms->minKeyCode)]); - xfree(syms->map); - xfree(syms); + free(syms->map); + free(syms); return Success; } diff --git a/xserver/Xi/getmmap.c b/xserver/Xi/getmmap.c index ddf27a5f0..bd652e9d4 100644 --- a/xserver/Xi/getmmap.c +++ b/xserver/Xi/getmmap.c @@ -113,7 +113,7 @@ ProcXGetDeviceModifierMapping(ClientPtr client) WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep); WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap); - xfree(modkeymap); + free(modkeymap); return Success; } diff --git a/xserver/Xi/getprop.c b/xserver/Xi/getprop.c index 1f28a8a40..ba98fc80f 100644 --- a/xserver/Xi/getprop.c +++ b/xserver/Xi/getprop.c @@ -119,7 +119,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) &count, COUNT); if (count) { rep.count = count; - buf = (XEventClass *) xalloc(rep.count * sizeof(XEventClass)); + buf = (XEventClass *) malloc(rep.count * sizeof(XEventClass)); rep.length = bytes_to_int32(rep.count * sizeof(XEventClass)); tbuf = buf; @@ -134,7 +134,7 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) if (count) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, count * sizeof(XEventClass), buf); - xfree(buf); + free(buf); } return Success; } @@ -164,7 +164,7 @@ XEventClass *buf++ = (id << 8) | EventInfo[j].type; } } - return (buf); + return buf; } /*********************************************************************** diff --git a/xserver/Xi/getselev.c b/xserver/Xi/getselev.c index 90f6284e5..d63b661cd 100644 --- a/xserver/Xi/getselev.c +++ b/xserver/Xi/getselev.c @@ -132,7 +132,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) total_length = (rep.all_clients_count + rep.this_client_count) * sizeof(XEventClass); rep.length = bytes_to_int32(total_length); - buf = (XEventClass *) xalloc(total_length); + buf = (XEventClass *) malloc(total_length); tclient = buf; aclient = buf + rep.this_client_count; @@ -152,7 +152,7 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) if (total_length) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, total_length, buf); - xfree(buf); + free(buf); } return Success; } diff --git a/xserver/Xi/gtmotion.c b/xserver/Xi/gtmotion.c index 8e91c5a47..9132f4f47 100644 --- a/xserver/Xi/gtmotion.c +++ b/xserver/Xi/gtmotion.c @@ -153,8 +153,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) } WriteToClient(client, length * 4, (char *)coords); } - if (coords) - xfree(coords); + free(coords); return Success; } diff --git a/xserver/Xi/listdev.c b/xserver/Xi/listdev.c index 98ef7aa43..3b2272bc3 100644 --- a/xserver/Xi/listdev.c +++ b/xserver/Xi/listdev.c @@ -269,7 +269,7 @@ CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf) *buf += sizeof(xAxisInfo); } } - return (i); + return i; } static void @@ -360,7 +360,7 @@ ProcXListInputDevices(ClientPtr client) AddOtherInputDevices(); /* allocate space for saving skip value */ - skip = xcalloc(sizeof(Bool), inputInfo.numDevices); + skip = calloc(sizeof(Bool), inputInfo.numDevices); if (!skip) return BadAlloc; @@ -386,7 +386,7 @@ ProcXListInputDevices(ClientPtr client) /* allocate space for reply */ total_length = numdevs * sizeof(xDeviceInfo) + size + namesize; - devbuf = (char *)xcalloc(1, total_length); + devbuf = (char *)calloc(1, total_length); classbuf = devbuf + (numdevs * sizeof(xDeviceInfo)); namebuf = classbuf + size; savbuf = devbuf; @@ -411,8 +411,8 @@ ProcXListInputDevices(ClientPtr client) rep.length = bytes_to_int32(total_length); WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep); WriteToClient(client, total_length, savbuf); - xfree(savbuf); - xfree(skip); + free(savbuf); + free(skip); return Success; } diff --git a/xserver/Xi/opendev.c b/xserver/Xi/opendev.c index 3844d25a2..e4c02d32a 100644 --- a/xserver/Xi/opendev.c +++ b/xserver/Xi/opendev.c @@ -154,7 +154,7 @@ ProcXOpenDevice(ClientPtr client) rep.num_classes = j; WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep); WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase); - return (Success); + return Success; } /*********************************************************************** diff --git a/xserver/Xi/queryst.c b/xserver/Xi/queryst.c index 78b97a769..65a43d1d2 100644 --- a/xserver/Xi/queryst.c +++ b/xserver/Xi/queryst.c @@ -119,7 +119,7 @@ ProcXQueryDeviceState(ClientPtr client) total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int))); num_classes++; } - buf = (char *)xcalloc(total_length, 1); + buf = (char *)calloc(total_length, 1); if (!buf) return BadAlloc; savbuf = buf; @@ -169,7 +169,7 @@ ProcXQueryDeviceState(ClientPtr client) WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep); if (total_length > 0) WriteToClient(client, total_length, savbuf); - xfree(savbuf); + free(savbuf); return Success; } diff --git a/xserver/Xi/sendexev.c b/xserver/Xi/sendexev.c index 8629dd202..16cbd6f77 100644 --- a/xserver/Xi/sendexev.c +++ b/xserver/Xi/sendexev.c @@ -97,7 +97,7 @@ SProcXSendExtensionEvent(ClientPtr client) for (i = 0; i < stuff->num_events; i++, eventP++) { proc = EventSwapVector[eventP->u.u.type & 0177]; if (proc == NotImplemented) /* no swapping proc; invalid event type? */ - return (BadValue); + return BadValue; (*proc) (eventP, &eventT); *eventP = eventT; } @@ -138,9 +138,10 @@ ProcXSendExtensionEvent(ClientPtr client) first = ((xEvent *) & stuff[1]); if (!((EXTENSION_EVENT_BASE <= first->u.u.type) && - (first->u.u.type < lastEvent))) + (first->u.u.type < lastEvent))) { client->errorValue = first->u.u.type; return BadValue; + } list = (XEventClass *) (first + stuff->num_events); if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev, diff --git a/xserver/Xi/stubs.c b/xserver/Xi/stubs.c index 04ba9769e..296a8c4a5 100644 --- a/xserver/Xi/stubs.c +++ b/xserver/Xi/stubs.c @@ -207,14 +207,14 @@ ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, { switch (control->control) { case DEVICE_RESOLUTION: - return (BadMatch); + return BadMatch; case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: - return (BadMatch); + return BadMatch; case DEVICE_CORE: - return (BadMatch); + return BadMatch; default: - return (BadMatch); + return BadMatch; } } diff --git a/xserver/Xi/xichangecursor.c b/xserver/Xi/xichangecursor.c index f071e8406..215339331 100644 --- a/xserver/Xi/xichangecursor.c +++ b/xserver/Xi/xichangecursor.c @@ -93,7 +93,7 @@ int ProcXIChangeCursor(ClientPtr client) if (stuff->cursor == None) { - if (pWin == WindowTable[pWin->drawable.pScreen->myNum]) + if (pWin == pWin->drawable.pScreen->root) pCursor = rootCursor; else pCursor = (CursorPtr)None; @@ -103,7 +103,7 @@ int ProcXIChangeCursor(ClientPtr client) rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) - return (rc == BadValue) ? BadCursor : rc; + return rc; } ChangeWindowDeviceCursor(pWin, pDev, pCursor); diff --git a/xserver/Xi/xichangehierarchy.c b/xserver/Xi/xichangehierarchy.c index 1a06e4555..c1899e109 100644 --- a/xserver/Xi/xichangehierarchy.c +++ b/xserver/Xi/xichangehierarchy.c @@ -68,7 +68,7 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) if (!flags) return; - ev = xcalloc(1, sizeof(xXIHierarchyEvent) + + ev = calloc(1, sizeof(xXIHierarchyEvent) + MAXDEVICES * sizeof(xXIHierarchyInfo)); ev->type = GenericEvent; ev->extension = IReqCode; @@ -116,7 +116,7 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) dummyDev.id = XIAllDevices; SendEventToAllWindows(&dummyDev, (XI_HierarchyChangedMask >> 8), (xEvent*)ev, 1); - xfree(ev); + free(ev); } @@ -172,7 +172,7 @@ ProcXIChangeHierarchy(ClientPtr client) char* name; SWAPIF(swaps(&c->name_len, n)); - name = xcalloc(c->name_len + 1, sizeof(char)); + name = calloc(c->name_len + 1, sizeof(char)); strncpy(name, (char*)&c[1], c->name_len); @@ -181,7 +181,7 @@ ProcXIChangeHierarchy(ClientPtr client) TRUE); if (rc != Success) { - xfree(name); + free(name); goto unwind; } @@ -194,7 +194,7 @@ ProcXIChangeHierarchy(ClientPtr client) if (rc != Success) { - xfree(name); + free(name); goto unwind; } @@ -228,7 +228,7 @@ ProcXIChangeHierarchy(ClientPtr client) flags[XTestptr->id] |= XISlaveAttached; flags[XTestkeybd->id] |= XISlaveAttached; - xfree(name); + free(name); } break; case XIRemoveMaster: diff --git a/xserver/Xi/xipassivegrab.c b/xserver/Xi/xipassivegrab.c index 41a56b14e..296614510 100644 --- a/xserver/Xi/xipassivegrab.c +++ b/xserver/Xi/xipassivegrab.c @@ -147,7 +147,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) if (status != Success) { client->errorValue = stuff->cursor; - return (status == BadValue) ? BadCursor : status; + return status; } } @@ -158,7 +158,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) status = CheckGrabValues(client, ¶m); modifiers = (uint32_t*)&stuff[1] + stuff->mask_len; - modifiers_failed = xcalloc(stuff->num_modifiers, sizeof(xXIGrabModifierInfo)); + modifiers_failed = calloc(stuff->num_modifiers, sizeof(xXIGrabModifierInfo)); if (!modifiers_failed) return BadAlloc; @@ -204,7 +204,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, rep.num_modifiers * 4, (char*)modifiers_failed); } - xfree(modifiers_failed); + free(modifiers_failed); return ret; } diff --git a/xserver/Xi/xiproperty.c b/xserver/Xi/xiproperty.c index 8b8063776..b9f53f7dc 100644 --- a/xserver/Xi/xiproperty.c +++ b/xserver/Xi/xiproperty.c @@ -177,7 +177,9 @@ static struct dev_properties {0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP}, {0, BTN_LABEL_PROP_BTN_GEAR_DOWN}, - {0, BTN_LABEL_PROP_BTN_GEAR_UP} + {0, BTN_LABEL_PROP_BTN_GEAR_UP}, + + {0, XI_PROP_TRANSFORM} }; static long XIPropHandlerID = 1; @@ -225,7 +227,7 @@ static int list_atoms(DeviceIntPtr dev, int *natoms, Atom **atoms_return) { Atom *a; - atoms = xalloc(nprops * sizeof(Atom)); + atoms = malloc(nprops * sizeof(Atom)); if(!atoms) return BadAlloc; a = atoms; @@ -252,18 +254,18 @@ get_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type, if (!ValidAtom(property)) { client->errorValue = property; - return(BadAtom); + return BadAtom; } if ((delete != xTrue) && (delete != xFalse)) { client->errorValue = delete; - return(BadValue); + return BadValue; } if ((type != AnyPropertyType) && !ValidAtom(type)) { client->errorValue = type; - return(BadAtom); + return BadAtom; } for (prop = dev->properties.properties; prop; prop = prop->next) @@ -348,12 +350,12 @@ check_change_property(ClientPtr client, Atom property, Atom type, int format, if (!ValidAtom(property)) { client->errorValue = property; - return(BadAtom); + return BadAtom; } if (!ValidAtom(type)) { client->errorValue = type; - return(BadAtom); + return BadAtom; } return Success; @@ -457,7 +459,7 @@ XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return) if (!buf && !(*nelem_return)) { - buf = xcalloc(val->size, sizeof(int)); + buf = calloc(val->size, sizeof(int)); if (!buf) return BadAlloc; *buf_return = buf; @@ -517,7 +519,7 @@ XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return) if (!buf && !(*nelem_return)) { - buf = xcalloc(val->size, sizeof(float)); + buf = calloc(val->size, sizeof(float)); if (!buf) return BadAlloc; *buf_return = buf; @@ -549,7 +551,7 @@ XIRegisterPropertyHandler(DeviceIntPtr dev, { XIPropertyHandlerPtr new_handler; - new_handler = xcalloc(1, sizeof(XIPropertyHandler)); + new_handler = calloc(1, sizeof(XIPropertyHandler)); if (!new_handler) return 0; @@ -583,7 +585,7 @@ XIUnregisterPropertyHandler(DeviceIntPtr dev, long id) else prev->next = curr->next; - xfree(curr); + free(curr); } static XIPropertyPtr @@ -591,7 +593,7 @@ XICreateDeviceProperty (Atom property) { XIPropertyPtr prop; - prop = (XIPropertyPtr)xalloc(sizeof(XIPropertyRec)); + prop = (XIPropertyPtr)malloc(sizeof(XIPropertyRec)); if (!prop) return NULL; @@ -620,9 +622,8 @@ XIFetchDeviceProperty(DeviceIntPtr dev, Atom property) static void XIDestroyDeviceProperty (XIPropertyPtr prop) { - if (prop->value.data) - xfree(prop->value.data); - xfree(prop); + free(prop->value.data); + free(prop); } /* This function destroys all of the device's property-related stuff, @@ -649,7 +650,7 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device) while(curr_handler) { next_handler = curr_handler->next; - xfree(curr_handler); + free(curr_handler); curr_handler = next_handler; } @@ -682,7 +683,7 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient) if (handler->DeleteProperty) rc = handler->DeleteProperty(device, prop->propertyName); if (rc != Success) - return (rc); + return rc; handler = handler->next; } } @@ -719,7 +720,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, { prop = XICreateDeviceProperty (property); if (!prop) - return(BadAlloc); + return BadAlloc; add = TRUE; mode = PropModeReplace; } @@ -731,9 +732,9 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, "PropModeReplace" since they will be written over. */ if ((format != prop_value->format) && (mode != PropModeReplace)) - return(BadMatch); + return BadMatch; if ((prop_value->type != type) && (mode != PropModeReplace)) - return(BadMatch); + return BadMatch; new_value = *prop_value; if (mode == PropModeReplace) total_len = len; @@ -745,7 +746,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, pointer new_data = NULL, old_data = NULL; total_size = total_len * size_in_bytes; - new_value.data = (pointer)xalloc (total_size); + new_value.data = (pointer)malloc(total_size); if (!new_value.data && total_size) { if (add) @@ -796,9 +797,8 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, &new_value, checkonly); if (checkonly && rc != Success) { - if (new_value.data) - xfree (new_value.data); - return (rc); + free(new_value.data); + return rc; } } handler = handler->next; @@ -806,8 +806,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, checkonly = !checkonly; } while (!checkonly); } - if (prop_value->data) - xfree (prop_value->data); + free(prop_value->data); *prop_value = new_value; } else if (len == 0) { @@ -824,7 +823,7 @@ XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, send_property_event(dev, prop->propertyName, (add) ? XIPropertyCreated : XIPropertyModified); - return(Success); + return Success; } int @@ -905,7 +904,7 @@ ProcXListDeviceProperties (ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms); - xfree(atoms); + free(atoms); } return rc; } @@ -957,7 +956,7 @@ ProcXDeleteDeviceProperty (ClientPtr client) if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; - return (BadAtom); + return BadAtom; } rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE); @@ -1149,7 +1148,7 @@ ProcXIListProperties(ClientPtr client) { client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write; WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms); - xfree(atoms); + free(atoms); } return rc; } @@ -1200,7 +1199,7 @@ ProcXIDeleteProperty(ClientPtr client) if (!ValidAtom(stuff->property)) { client->errorValue = stuff->property; - return (BadAtom); + return BadAtom; } rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE); diff --git a/xserver/Xi/xiquerydevice.c b/xserver/Xi/xiquerydevice.c index 435868de2..303c8b27d 100644 --- a/xserver/Xi/xiquerydevice.c +++ b/xserver/Xi/xiquerydevice.c @@ -87,7 +87,7 @@ ProcXIQueryDevice(ClientPtr client) } else { - skip = xcalloc(sizeof(Bool), inputInfo.numDevices); + skip = calloc(sizeof(Bool), inputInfo.numDevices); if (!skip) return BadAlloc; @@ -106,7 +106,7 @@ ProcXIQueryDevice(ClientPtr client) } } - info = xcalloc(1, len); + info = calloc(1, len); if (!info) return BadAlloc; @@ -155,8 +155,8 @@ ProcXIQueryDevice(ClientPtr client) WriteReplyToClient(client, sizeof(xXIQueryDeviceReply), &rep); WriteToClient(client, rep.length * 4, ptr); - xfree(ptr); - xfree(skip); + free(ptr); + free(skip); return rc; } @@ -247,6 +247,9 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState) int mask_len; int i; + if (!dev || !dev->button) + return 0; + mask_len = bytes_to_int32(bits_to_bytes(dev->button->numButtons)); info->type = ButtonClass; @@ -259,7 +262,7 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState) memset(bits, 0, mask_len * 4); if (reportState) - for (i = 0; dev && dev->button && i < dev->button->numButtons; i++) + for (i = 0; i < dev->button->numButtons; i++) if (BitIsOn(dev->button->down, i)) SetBit(bits, i); diff --git a/xserver/Xi/xiquerypointer.c b/xserver/Xi/xiquerypointer.c index 93ceba4c3..b521c48ef 100644 --- a/xserver/Xi/xiquerypointer.c +++ b/xserver/Xi/xiquerypointer.c @@ -43,6 +43,7 @@ #include "exevents.h" #include "exglobals.h" #include "eventconvert.h" +#include "scrnintstr.h" #include "xkbsrv.h" #ifdef PANORAMIX @@ -144,7 +145,7 @@ ProcXIQueryPointer(ClientPtr client) rep.buttons_len = bytes_to_int32(bits_to_bytes(pDev->button->numButtons)); rep.length += rep.buttons_len; buttons_size = rep.buttons_len * 4; - buttons = xcalloc(1, buttons_size); + buttons = calloc(1, buttons_size); if (!buttons) return BadAlloc; @@ -181,12 +182,12 @@ ProcXIQueryPointer(ClientPtr client) #ifdef PANORAMIX if(!noPanoramiXExtension) { - rep.root_x += FP1616(panoramiXdataPtr[0].x, 0); - rep.root_y += FP1616(panoramiXdataPtr[0].y, 0); + rep.root_x += FP1616(screenInfo.screens[0]->x, 0); + rep.root_y += FP1616(screenInfo.screens[0]->y, 0); if (stuff->win == rep.root) { - rep.win_x += FP1616(panoramiXdataPtr[0].x, 0); - rep.win_y += FP1616(panoramiXdataPtr[0].y, 0); + rep.win_x += FP1616(screenInfo.screens[0]->x, 0); + rep.win_y += FP1616(screenInfo.screens[0]->y, 0); } } #endif @@ -195,7 +196,7 @@ ProcXIQueryPointer(ClientPtr client) if (buttons) WriteToClient(client, buttons_size, buttons); - xfree(buttons); + free(buttons); return Success; } diff --git a/xserver/Xi/xiselectev.c b/xserver/Xi/xiselectev.c index 672edab3b..7aa3f0ab6 100644 --- a/xserver/Xi/xiselectev.c +++ b/xserver/Xi/xiselectev.c @@ -173,7 +173,7 @@ ProcXISelectEvents(ClientPtr client) RecalculateDeliverableEvents(win); - xfree(types); + free(types); return Success; } @@ -234,7 +234,7 @@ ProcXIGetSelectedEvents(ClientPtr client) return Success; } - buffer = xcalloc(MAXDEVICES, sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE)); + buffer = calloc(MAXDEVICES, sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE)); if (!buffer) return BadAlloc; @@ -281,7 +281,7 @@ ProcXIGetSelectedEvents(ClientPtr client) if (reply.num_masks) WriteToClient(client, reply.length * 4, buffer); - xfree(buffer); + free(buffer); return Success; } |