[Xquartz-changes] xserver: Branch 'master' - 8 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sun May 2 15:27:50 PDT 2010


Rebased ref, commits from common ancestor:
commit 0efd7b8d82a48793341e27d4c224986e0971687c
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Apr 27 13:14:47 2010 -0700

    XQuartz GLX: Change around includes for better compatability with different OS versions
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 70558ed..ad9ebbd 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -42,6 +42,8 @@
 #define GL_GLEXT_WUNDEF_SUPPORT
 
 #include <OpenGL/OpenGL.h>
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
 #include <OpenGL/CGLContext.h>
 
 /* These next few GL_EXT pre-processing blocks are to explicitly define 
diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index bef27f0..cecc902 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -35,9 +35,10 @@
 #include "dri.h"
 
 #include <OpenGL/OpenGL.h>
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
 #include <OpenGL/CGLContext.h>
 
-#include <GL/gl.h>
 #include <GL/glxproto.h>
 #include <windowstr.h>
 #include <resource.h>
commit 7b506fdc840aebed6b5acb91437a2cb620b5bddc
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Apr 21 08:38:53 2010 -0700

    rootless: Add some sanity checking to miPaintWindow
    
    This avoids painting the root window when it isn't actually drawable.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/mi/miexpose.c b/mi/miexpose.c
index 1c9c3a4..f52b492 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -552,6 +552,9 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     DrawablePtr	drawable = &pWin->drawable;
 
 #ifdef ROOTLESS
+    if(!drawable || drawable->type == UNDRAWABLE_WINDOW)
+	return;
+
     if(IsFramedWindow(pWin)) {
         RootlessStartDrawing(pWin);
         RootlessDamageRegion(pWin, prgn);
commit 4d3789c9b3fbe6aad32fcacd964353b612640f27
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun Apr 18 01:22:27 2010 -0700

    rootless: Remove an unneeded comment
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c
index e78e2c8..55c7b96 100644
--- a/miext/rootless/rootlessWindow.c
+++ b/miext/rootless/rootlessWindow.c
@@ -1553,10 +1553,6 @@ RootlessDisableRoot (ScreenPtr pScreen)
 	return;
            
     RootlessDestroyFrame (pRoot, winRec);
-    /* 
-     * gstaplin: I fixed the usage of this DeleteProperty so that it would compile.
-     * QUESTION: Where is this xa_native_window_id set?
-     */
     DeleteProperty (serverClient, pRoot, xa_native_window_id ());
 }
 
commit 048d15192af39ba5111882d18a957b6ff4e34cad
Author: Oliver McFadden <oliver.mcfadden at nokia.com>
Date:   Thu Apr 22 10:29:44 2010 +0300

    x-list.c: null-returning function malloc() was called without checking
    
    Signed-off-by: Oliver McFadden <oliver.mcfadden at nokia.com>
    Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/xpr/x-list.c b/hw/xquartz/xpr/x-list.c
index 3596dd3..77c9309 100644
--- a/hw/xquartz/xpr/x-list.c
+++ b/hw/xquartz/xpr/x-list.c
@@ -97,6 +97,7 @@ X_PFX (list_prepend) (x_list *lst, void *data)
         int i;
 
         b = malloc (sizeof (x_list_block));
+        assert(b != NULL);
 
         for (i = 0; i < NODES_PER_BLOCK - 1; i++)
             b->l[i].next = &(b->l[i+1]);
commit 40858960c02a7694b0e1b72e2a986805580ff6f1
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Apr 29 12:24:51 2010 -0700

    Delete loop with no effect from GlyphUninit
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/render/glyph.c b/render/glyph.c
index f0f3b19..6b81118 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -113,15 +113,6 @@ GlyphUninit (ScreenPtr pScreen)
 	    }
 	}
     }
-
-    for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++)
-    {
-	if (!globalGlyphs[fdepth].hashSet)
-	    continue;
-	
-	for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++)
-	    glyph = globalGlyphs[fdepth].table[i].glyph;    
-    }
 }
 
 GlyphHashSetPtr
commit 65e961fcc1da0f1e6c1c477701b2eeb36955ed24
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Apr 29 12:24:49 2010 -0700

    Replace some input devPrivates with regular struct fields
    
    In the process, fixes a memory leak in CloseDevice, and an unchecked
    memory allocation in InitializePredictableAccelerationProperties.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index e680f6f..949efe7 100644
--- a/Xi/exevents.c
+++ b/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
@@ -228,8 +225,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
 
         if (!to->intfeed)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->intfeed = classes->intfeed;
         }
 
@@ -253,7 +249,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;
     }
@@ -264,8 +260,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
 
         if (!to->stringfeed)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->stringfeed = classes->stringfeed;
         }
 
@@ -289,7 +284,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;
     }
@@ -300,8 +295,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
 
         if (!to->bell)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->bell = classes->bell;
         }
 
@@ -326,7 +320,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;
     }
@@ -337,8 +331,7 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to)
 
         if (!to->leds)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->leds = classes->leds;
         }
 
@@ -365,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;
     }
@@ -385,8 +378,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
 
         if (!to->kbdfeed)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
 
             to->kbdfeed = classes->kbdfeed;
             if (!to->kbdfeed)
@@ -417,7 +409,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;
     }
@@ -426,8 +418,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);
@@ -439,7 +430,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;
     }
@@ -476,8 +467,7 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
         {
             WindowPtr *oldTrace;
 
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->focus = classes->focus;
             if (!to->focus)
             {
@@ -500,7 +490,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;
     }
@@ -518,8 +508,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
         PtrFeedbackPtr *p, it;
         if (!to->ptrfeed)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->ptrfeed = classes->ptrfeed;
         }
 
@@ -543,7 +532,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;
     }
@@ -553,8 +542,7 @@ 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;
@@ -577,7 +565,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;
     }
@@ -586,8 +574,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
     {
         if (!to->button)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->button = classes->button;
             if (!to->button)
             {
@@ -617,7 +604,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;
     }
@@ -626,8 +613,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
     {
         if (!to->proximity)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->proximity = classes->proximity;
             if (!to->proximity)
             {
@@ -642,7 +628,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;
     }
@@ -651,8 +637,7 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
     {
         if (!to->absolute)
         {
-            classes = dixLookupPrivate(&to->devPrivates,
-                                       UnusedClassesPrivateKey);
+            classes = to->unused_classes;
             to->absolute = classes->absolute;
             if (!to->absolute)
             {
@@ -667,7 +652,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;
     }
diff --git a/dix/devices.c b/dix/devices.c
index 6119dce..1386491 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -89,13 +89,6 @@ SOFTWARE.
  * This file handles input device-related stuff.
  */
 
-static int CoreDevicePrivateKeyIndex;
-DevPrivateKey CoreDevicePrivateKey = &CoreDevicePrivateKeyIndex;
-/* Used to store classes currently not in use by an MD */
-static int UnusedClassesPrivateKeyIndex;
-DevPrivateKey UnusedClassesPrivateKey = &UnusedClassesPrivateKeyIndex;
-
-
 static void RecalculateMasterButtons(DeviceIntPtr slave);
 
 /**
@@ -852,8 +845,9 @@ CloseDevice(DeviceIntPtr dev)
 
     if (IsMaster(dev))
     {
-        classes = dixLookupPrivate(&dev->devPrivates, UnusedClassesPrivateKey);
+        classes = dev->unused_classes;
         FreeAllDeviceClasses(classes);
+	xfree(classes);
     }
 
     if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
@@ -2465,7 +2459,6 @@ AllocDevicePair (ClientPtr client, char* name,
 {
     DeviceIntPtr pointer;
     DeviceIntPtr keyboard;
-    ClassesPtr classes;
     *ptr = *keybd = NULL;
 
     pointer = AddInputDevice(client, ptr_proc, TRUE);
@@ -2511,12 +2504,9 @@ AllocDevicePair (ClientPtr client, char* name,
     keyboard->last.slave = NULL;
     keyboard->type = (master) ? MASTER_KEYBOARD : SLAVE;
 
-
     /* The ClassesRec stores the device classes currently not used. */
-    classes = xcalloc(1, sizeof(ClassesRec));
-    dixSetPrivate(&pointer->devPrivates, UnusedClassesPrivateKey, classes);
-    classes = xcalloc(1, sizeof(ClassesRec));
-    dixSetPrivate(&keyboard->devPrivates, UnusedClassesPrivateKey, classes);
+    pointer->unused_classes = xcalloc(1, sizeof(ClassesRec));
+    keyboard->unused_classes = xcalloc(1, sizeof(ClassesRec));
 
     *ptr = pointer;
     *keybd = keyboard;
diff --git a/dix/events.c b/dix/events.c
index b26e28a..60dd162 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1408,12 +1408,8 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
     ComputeFreezes();
 }
 
-/* Only ever used if a grab is called on an attached slave device. */
-static int GrabPrivateKeyIndex;
-static DevPrivateKey GrabPrivateKey = &GrabPrivateKeyIndex;
-
 /**
- * Save the device's master device in the devPrivates. This needs to be done
+ * Save the device's master device id. This needs to be done
  * if a client directly grabs a slave device that is attached to a master. For
  * the duration of the grab, the device is detached, ungrabbing re-attaches it
  * though.
@@ -1424,35 +1420,28 @@ static DevPrivateKey GrabPrivateKey = &GrabPrivateKeyIndex;
 static void
 DetachFromMaster(DeviceIntPtr dev)
 {
-    intptr_t id;
     if (!dev->u.master)
         return;
 
-    id = dev->u.master->id;
+    dev->saved_master_id = dev->u.master->id;
 
-    dixSetPrivate(&dev->devPrivates, GrabPrivateKey, (void *)id);
     AttachDevice(NULL, dev, NULL);
 }
 
 static void
 ReattachToOldMaster(DeviceIntPtr dev)
 {
-    int id;
-    void *p;
     DeviceIntPtr master = NULL;
 
     if (IsMaster(dev))
         return;
 
-
-    p = dixLookupPrivate(&dev->devPrivates, GrabPrivateKey);
-    id = (intptr_t) p; /* silence gcc warnings */
-    dixLookupDevice(&master, id, serverClient, DixUseAccess);
+    dixLookupDevice(&master, dev->saved_master_id, serverClient, DixUseAccess);
 
     if (master)
     {
         AttachDevice(serverClient, dev, master);
-        dixSetPrivate(&dev->devPrivates, GrabPrivateKey, NULL);
+	dev->saved_master_id = 0;
     }
 }
 
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index c2f4378..100d6f8 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -83,8 +83,6 @@ GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
 /* some int which is not a profile number */
 #define PROFILE_UNINITIALIZE (-100)
 
-/* number of properties for predictable acceleration */
-#define NPROPS_PREDICTABLE_ACCEL 4
 
 /**
  * Init struct so it should match the average case
@@ -323,26 +321,18 @@ AccelInitScaleProperty(DeviceIntPtr dev, DeviceVelocityPtr vel)
     return XIRegisterPropertyHandler(dev, AccelSetScaleProperty, NULL, NULL);
 }
 
-static int AccelPropHandlerPrivateKeyIndex;
-DevPrivateKey AccelPropHandlerPrivateKey = &AccelPropHandlerPrivateKeyIndex;
-
 BOOL
 InitializePredictableAccelerationProperties(DeviceIntPtr dev)
 {
     DeviceVelocityPtr  vel = GetDevicePredictableAccelData(dev);
-    long *prop_handlers;
 
     if(!vel)
 	return FALSE;
-    prop_handlers = xalloc(NPROPS_PREDICTABLE_ACCEL * sizeof(long));
-
-    prop_handlers[0] = AccelInitProfileProperty(dev, vel);
-    prop_handlers[1] = AccelInitDecelProperty(dev, vel);
-    prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel);
-    prop_handlers[3] = AccelInitScaleProperty(dev, vel);
 
-    dixSetPrivate(&dev->devPrivates, AccelPropHandlerPrivateKey,
-                  prop_handlers);
+    vel->prop_handlers[0] = AccelInitProfileProperty(dev, vel);
+    vel->prop_handlers[1] = AccelInitDecelProperty(dev, vel);
+    vel->prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel);
+    vel->prop_handlers[3] = AccelInitScaleProperty(dev, vel);
 
     return TRUE;
 }
@@ -350,8 +340,8 @@ InitializePredictableAccelerationProperties(DeviceIntPtr dev)
 BOOL
 DeletePredictableAccelerationProperties(DeviceIntPtr dev)
 {
+    DeviceVelocityPtr  vel;
     Atom prop;
-    long *prop_handlers;
     int i;
 
     prop = XIGetKnownProperty(ACCEL_PROP_VELOCITY_SCALING);
@@ -363,13 +353,10 @@ DeletePredictableAccelerationProperties(DeviceIntPtr dev)
     prop = XIGetKnownProperty(ACCEL_PROP_PROFILE_NUMBER);
     XIDeleteDeviceProperty(dev, prop, FALSE);
 
-    prop_handlers = dixLookupPrivate(&dev->devPrivates,
-                                     AccelPropHandlerPrivateKey);
-    dixSetPrivate(&dev->devPrivates, AccelPropHandlerPrivateKey, NULL);
-
-    for (i = 0; prop_handlers && i < NPROPS_PREDICTABLE_ACCEL; i++)
-        XIUnregisterPropertyHandler(dev, prop_handlers[i]);
-    xfree(prop_handlers);
+    vel = GetDevicePredictableAccelData(dev);
+    for (i = 0; vel && i < NPROPS_PREDICTABLE_ACCEL; i++)
+	if (vel->prop_handlers[i])
+	    XIUnregisterPropertyHandler(dev, vel->prop_handlers[i]);
 
     return TRUE;
 }
diff --git a/include/inputstr.h b/include/inputstr.h
index de4026c..6da3f38 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -514,8 +514,9 @@ typedef struct _DeviceIntRec {
     LedFeedbackPtr	leds;
     struct _XkbInterest *xkb_interest;
     char                *config_info; /* used by the hotplug layer */
+    ClassesPtr		unused_classes; /* for master devices */
+    int			saved_master_id;	/* for slaves while grabbed */
     PrivateRec		*devPrivates;
-    int			nPrivates;
     DeviceUnwrapProc    unwrapProc;
     SpriteInfoPtr       spriteInfo;
     union {
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 676c464..6f999a8 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -62,6 +62,9 @@ typedef struct _MotionTracker {
     int dir;        /* initial direction bitfield */
 } MotionTracker, *MotionTrackerPtr;
 
+/* number of properties for predictable acceleration */
+#define NPROPS_PREDICTABLE_ACCEL 4
+
 /**
  * Contains all data needed to implement mouse ballistics
  */
@@ -88,9 +91,9 @@ typedef struct _DeviceVelocityRec {
     struct {   /* to be able to query this information */
         int     profile_number;
     } statistics;
+    long    prop_handlers[NPROPS_PREDICTABLE_ACCEL];
 } DeviceVelocityRec, *DeviceVelocityPtr;
 
-
 extern _X_EXPORT void
 InitVelocityData(DeviceVelocityPtr vel);
 
commit 998e982b775073da59412dce8ce609ea2ad7967c
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Apr 29 12:24:48 2010 -0700

    Move callback definitions to their own file
    
    Needed as the privates stuff uses the callbacks before they would have
    been defined in dix.h
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/include/Makefile.am b/include/Makefile.am
index eddc86c..e76de05 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -3,6 +3,7 @@ sdk_HEADERS =		\
 	XIstubs.h	\
 	bstore.h	\
 	bstorestr.h	\
+	callback.h	\
 	closestr.h	\
 	closure.h	\
 	colormap.h	\
diff --git a/include/callback.h b/include/callback.h
new file mode 100644
index 0000000..632ed4f
--- /dev/null
+++ b/include/callback.h
@@ -0,0 +1,87 @@
+/***********************************************************
+
+Copyright 1987, 1998  The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+                        All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef CALLBACK_H
+#define CALLBACK_H
+
+#include <X11/X.h>	/* for GContext, Mask */
+#include <X11/Xdefs.h>	/* for Bool */
+#include <X11/Xproto.h>
+#include <X11/Xfuncproto.h>
+
+/*
+ *  callback manager stuff
+ */
+
+#ifndef _XTYPEDEF_CALLBACKLISTPTR
+typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
+#define _XTYPEDEF_CALLBACKLISTPTR
+#endif
+
+typedef void (*CallbackProcPtr) (
+    CallbackListPtr *, pointer, pointer);
+
+extern _X_EXPORT Bool AddCallback(
+    CallbackListPtr * /*pcbl*/,
+    CallbackProcPtr /*callback*/,
+    pointer /*data*/);
+
+extern _X_EXPORT Bool DeleteCallback(
+    CallbackListPtr * /*pcbl*/,
+    CallbackProcPtr /*callback*/,
+    pointer /*data*/);
+
+extern _X_EXPORT void CallCallbacks(
+    CallbackListPtr * /*pcbl*/,
+    pointer /*call_data*/);
+
+extern _X_EXPORT void DeleteCallbackList(
+    CallbackListPtr * /*pcbl*/);
+
+extern _X_EXPORT void InitCallbackManager(void);
+
+#endif /* CALLBACK_H */
diff --git a/include/dix.h b/include/dix.h
index 6505fd0..dc86257 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -48,6 +48,7 @@ SOFTWARE.
 #ifndef DIX_H
 #define DIX_H
 
+#include "callback.h"
 #include "gc.h"
 #include "window.h"
 #include "input.h"
@@ -512,36 +513,6 @@ ScreenRestructured (ScreenPtr pScreen);
 
 extern _X_EXPORT int ffs(int i);
 
-/*
- *  callback manager stuff
- */
-
-#ifndef _XTYPEDEF_CALLBACKLISTPTR
-typedef struct _CallbackList *CallbackListPtr; /* also in misc.h */
-#define _XTYPEDEF_CALLBACKLISTPTR
-#endif
-
-typedef void (*CallbackProcPtr) (
-    CallbackListPtr *, pointer, pointer);
-
-extern _X_EXPORT Bool AddCallback(
-    CallbackListPtr * /*pcbl*/,
-    CallbackProcPtr /*callback*/,
-    pointer /*data*/);
-
-extern _X_EXPORT Bool DeleteCallback(
-    CallbackListPtr * /*pcbl*/,
-    CallbackProcPtr /*callback*/,
-    pointer /*data*/);
-
-extern _X_EXPORT void CallCallbacks(
-    CallbackListPtr * /*pcbl*/,
-    pointer /*call_data*/);
-
-extern _X_EXPORT void DeleteCallbackList(
-    CallbackListPtr * /*pcbl*/);
-
-extern _X_EXPORT void InitCallbackManager(void);
 
 /*
  *  ServerGrabCallback stuff
commit 7dde50c649089b03650d6497079a690feea65e22
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Apr 29 12:24:47 2010 -0700

    Move X_DEPRECATED to misc.h so it can be used outside resource.h
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>

diff --git a/include/misc.h b/include/misc.h
index 62d813e..c7add25 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -100,6 +100,12 @@ typedef unsigned long ATOM;
 #define FALSE 0
 #endif
 
+#ifdef __GNUC__
+#define X_DEPRECATED __attribute__((deprecated))
+#else
+#define X_DEPRECATED
+#endif
+
 #ifndef _XTYPEDEF_CALLBACKLISTPTR
 typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */
 #define _XTYPEDEF_CALLBACKLISTPTR
diff --git a/include/resource.h b/include/resource.h
index 7948af5..56450d6 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -251,12 +251,6 @@ extern _X_EXPORT RESTYPE TypeMask;
  * Please use the noted replacements instead.
  */
 
-#ifdef __GNUC__
-#define X_DEPRECATED __attribute__((deprecated))
-#else
-#define X_DEPRECATED
-#endif
-
 /* replaced by dixLookupResourceByType */
 extern _X_EXPORT pointer SecurityLookupIDByType(
     ClientPtr client,


More information about the Xquartz-changes mailing list