summaryrefslogtreecommitdiff
path: root/dix/privates.c
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2005-05-22 01:12:49 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2005-05-22 01:12:49 +0000
commit62343f5162066f19ca6e62d1c85a4a40d45b3295 (patch)
tree801fac4154f316c82e9cb25997bbdc2fd6c81427 /dix/privates.c
parenta8a61bbe22361b12d4a2dd511894987a338e3eef (diff)
Bugzilla #2800 <https://bugs.freedesktop.org/show_bug.cgi?id=2800> Xevie
extension crash with signal 11 on keyboard Bugzilla #1205 <https://bugs.freedesktop.org/show_bug.cgi?id=1205> Xevie client receives two KeyPress events on consumed keys when XKB is enabled Patch #2223 <https://bugs.freedesktop.org/attachment.cgi?id=2223> Fixes for both of these and some other Xevie bugs (Derek Wang - Sun Microsystems)
Diffstat (limited to 'dix/privates.c')
-rw-r--r--dix/privates.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/dix/privates.c b/dix/privates.c
index 1353e29aa..a8f3ee9aa 100644
--- a/dix/privates.c
+++ b/dix/privates.c
@@ -1,4 +1,5 @@
/* $Xorg: privates.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
+/* $XdotOrg: $ */
/*
Copyright 1993, 1998 The Open Group
@@ -39,6 +40,7 @@ from The Open Group.
#include "colormapst.h"
#include "servermd.h"
#include "site.h"
+#include "inputstr.h"
/*
* See the Wrappers and devPrivates section in "Definition of the
@@ -354,3 +356,39 @@ AllocateColormapPrivateIndex (InitCmapPrivFunc initPrivFunc)
return index;
}
+
+/*
+ * device private machinery
+ */
+
+static int devicePrivateIndex = 0;
+
+int
+AllocateDevicePrivateIndex()
+{
+ return devicePrivateIndex++;
+}
+
+Bool
+AllocateDevicePrivate(DeviceIntPtr device, int index)
+{
+ if (device->nPrivates < ++index) {
+ DevUnion *nprivs = (DevUnion *) xrealloc(device->devPrivates,
+ index * sizeof(DevUnion));
+ if (!nprivs)
+ return FALSE;
+ device->devPrivates = nprivs;
+ bzero(&nprivs[device->nPrivates], sizeof(DevUnion)
+ * (index - device->nPrivates));
+ device->nPrivates = index;
+ return TRUE;
+ } else {
+ return TRUE;
+ }
+}
+
+void
+ResetDevicePrivateIndex(void)
+{
+ devicePrivateIndex = 0;
+}