aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-11 09:26:35 +0000
committermarha <marha@users.sourceforge.net>2010-09-11 09:26:35 +0000
commit35b29c19707341bbfa32f7f6136ce09e59cb332c (patch)
treea795242657a2b96a463a11774517472fa4c64953 /xorg-server/dix
parentba6498fea6d935aff0856f9851cb47d5657952fa (diff)
parente172c89783326e2378e4793ff31a0f44210c5534 (diff)
downloadvcxsrv-35b29c19707341bbfa32f7f6136ce09e59cb332c.tar.gz
vcxsrv-35b29c19707341bbfa32f7f6136ce09e59cb332c.tar.bz2
vcxsrv-35b29c19707341bbfa32f7f6136ce09e59cb332c.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/devices.c23
-rw-r--r--xorg-server/dix/eventconvert.c9
-rw-r--r--xorg-server/dix/extension.c6
-rw-r--r--xorg-server/dix/inpututils.c24
-rw-r--r--xorg-server/dix/privates.c4
-rw-r--r--xorg-server/dix/property.c1
-rw-r--r--xorg-server/dix/selection.c3
7 files changed, 41 insertions, 29 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index 625fd3aaa..b124a7da4 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -2026,8 +2026,9 @@ ProcChangeKeyboardControl (ClientPtr client)
keyboard = PickKeyboard(client);
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
- if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
- pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
+ if ((pDev == keyboard ||
+ (!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
+ && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
ret = XaceHook(XACE_DEVICE_ACCESS, client, pDev, DixManageAccess);
if (ret != Success)
return ret;
@@ -2035,8 +2036,9 @@ ProcChangeKeyboardControl (ClientPtr client)
}
for (pDev = inputInfo.devices; pDev; pDev = pDev->next) {
- if ((pDev == keyboard || (!IsMaster(pDev) && pDev->u.master == keyboard)) &&
- pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
+ if ((pDev == keyboard ||
+ (!IsMaster(pDev) && GetMaster(pDev, MASTER_KEYBOARD) == keyboard))
+ && pDev->kbdfeed && pDev->kbdfeed->CtrlProc) {
ret = DoChangeKeyboardControl(client, pDev, vlist, vmask);
if (ret != Success)
error = ret;
@@ -2096,7 +2098,8 @@ ProcBell(ClientPtr client)
newpercent = base - newpercent + stuff->percent;
for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev == keybd || (!IsMaster(dev) && dev->u.master == keybd)) &&
+ if ((dev == keybd ||
+ (!IsMaster(dev) && GetMaster(dev, MASTER_KEYBOARD) == keybd)) &&
dev->kbdfeed && dev->kbdfeed->BellProc) {
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixBellAccess);
@@ -2165,7 +2168,8 @@ ProcChangePointerControl(ClientPtr client)
}
for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) &&
+ if ((dev == mouse ||
+ (!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
dev->ptrfeed) {
rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixManageAccess);
if (rc != Success)
@@ -2174,7 +2178,8 @@ ProcChangePointerControl(ClientPtr client)
}
for (dev = inputInfo.devices; dev; dev = dev->next) {
- if ((dev == mouse || (!IsMaster(dev) && dev->u.master == mouse)) &&
+ if ((dev == mouse ||
+ (!IsMaster(dev) && GetMaster(dev, MASTER_POINTER) == mouse)) &&
dev->ptrfeed) {
dev->ptrfeed->ctrl = ctrl;
}
@@ -2344,7 +2349,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
maxbuttons = max(maxbuttons, dev->button->numButtons);
}
- if (master->button->numButtons != maxbuttons)
+ if (master->button && master->button->numButtons != maxbuttons)
{
int i;
DeviceChangedEvent event;
@@ -2355,7 +2360,7 @@ RecalculateMasterButtons(DeviceIntPtr slave)
event.header = ET_Internal;
event.type = ET_DeviceChanged;
- event.time = CurrentTime;
+ event.time = GetTimeInMillis();
event.deviceid = master->id;
event.flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE;
event.buttons.num_buttons = maxbuttons;
diff --git a/xorg-server/dix/eventconvert.c b/xorg-server/dix/eventconvert.c
index aa72708ed..e891f0698 100644
--- a/xorg-server/dix/eventconvert.c
+++ b/xorg-server/dix/eventconvert.c
@@ -102,6 +102,15 @@ EventToCore(InternalEvent *event, xEvent *core)
switch(event->any.type)
{
case ET_Motion:
+ {
+ DeviceEvent *e = &event->device_event;
+ /* Don't create core motion event if neither x nor y are
+ * present */
+ if (!BitIsOn(e->valuators.mask, 0) &&
+ !BitIsOn(e->valuators.mask, 1))
+ return BadMatch;
+ }
+ /* fallthrough */
case ET_ButtonPress:
case ET_ButtonRelease:
case ET_KeyPress:
diff --git a/xorg-server/dix/extension.c b/xorg-server/dix/extension.c
index f6b33d64c..b7f5c9c8c 100644
--- a/xorg-server/dix/extension.c
+++ b/xorg-server/dix/extension.c
@@ -96,7 +96,7 @@ AddExtension(char *name, int NumEvents, int NumErrors,
free(ext);
return NULL;
}
- ext->name = malloc(strlen(name) + 1);
+ ext->name = strdup(name);
ext->num_aliases = 0;
ext->aliases = (char **)NULL;
if (!ext->name)
@@ -105,7 +105,6 @@ AddExtension(char *name, int NumEvents, int NumErrors,
free(ext);
return((ExtensionEntry *) NULL);
}
- strcpy(ext->name, name);
i = NumExtensions;
newexts = (ExtensionEntry **) realloc(extensions,
(i + 1) * sizeof(ExtensionEntry *));
@@ -164,10 +163,9 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
if (!aliases)
return FALSE;
ext->aliases = aliases;
- name = malloc(strlen(alias) + 1);
+ name = strdup(alias);
if (!name)
return FALSE;
- strcpy(name, alias);
ext->aliases[ext->num_aliases] = name;
ext->num_aliases++;
return TRUE;
diff --git a/xorg-server/dix/inpututils.c b/xorg-server/dix/inpututils.c
index 9e6ba0325..39e65064a 100644
--- a/xorg-server/dix/inpututils.c
+++ b/xorg-server/dix/inpututils.c
@@ -286,7 +286,7 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
{
CARD8 keys_per_mod[8];
int max_keys_per_mod;
- KeyCode *modkeymap;
+ KeyCode *modkeymap = NULL;
int i, j, ret;
ret = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixGetAttrAccess);
@@ -310,18 +310,20 @@ int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
}
}
- modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
- if (!modkeymap)
- return BadAlloc;
+ if (max_keys_per_mod != 0) {
+ modkeymap = calloc(max_keys_per_mod * 8, sizeof(KeyCode));
+ if (!modkeymap)
+ return BadAlloc;
- for (i = 0; i < 8; i++)
- keys_per_mod[i] = 0;
+ for (i = 0; i < 8; i++)
+ keys_per_mod[i] = 0;
- for (i = 8; i < MAP_LENGTH; i++) {
- for (j = 0; j < 8; j++) {
- if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
- modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
- keys_per_mod[j]++;
+ for (i = 8; i < MAP_LENGTH; i++) {
+ for (j = 0; j < 8; j++) {
+ if (dev->key->xkbInfo->desc->map->modmap[i] & (1 << j)) {
+ modkeymap[(j * max_keys_per_mod) + keys_per_mod[j]] = i;
+ keys_per_mod[j]++;
+ }
}
}
}
diff --git a/xorg-server/dix/privates.c b/xorg-server/dix/privates.c
index 75f665678..09014b6e6 100644
--- a/xorg-server/dix/privates.c
+++ b/xorg-server/dix/privates.c
@@ -72,11 +72,11 @@ static struct {
static const Bool xselinux_private[PRIVATE_LAST] = {
/* PRIVATE_XSELINUX,*/ FALSE,
- /* PRIVATE_SCREEN,*/ FALSE,
+ /* PRIVATE_SCREEN,*/ TRUE,
/* [PRIVATE_EXTENSION] =*/TRUE,
/* [PRIVATE_COLORMAP] =*/ TRUE,
/* [PRIVATE_DEVICE] =*/ TRUE,
- /*[PRIVATE_CLIENT] = */ TRUE,
+ /* [PRIVATE_CLIENT] = */ TRUE,
/* [PRIVATE_PROPERTY] =*/ TRUE,
/* [PRIVATE_SELECTION] =*/TRUE,
/* [PRIVATE_WINDOW] =*/ TRUE,
diff --git a/xorg-server/dix/property.c b/xorg-server/dix/property.c
index 9d30e726d..2ba3f4419 100644
--- a/xorg-server/dix/property.c
+++ b/xorg-server/dix/property.c
@@ -284,7 +284,6 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
pProp->format = format;
pProp->data = data;
pProp->size = len;
- pProp->devPrivates = NULL;
rc = XaceHookPropertyAccess(pClient, pWin, &pProp,
DixCreateAccess|DixWriteAccess);
if (rc != Success) {
diff --git a/xorg-server/dix/selection.c b/xorg-server/dix/selection.c
index 428408f8e..732ba34e5 100644
--- a/xorg-server/dix/selection.c
+++ b/xorg-server/dix/selection.c
@@ -196,12 +196,11 @@ ProcSetSelectionOwner(ClientPtr client)
/*
* It doesn't exist, so add it...
*/
- pSel = malloc(sizeof(Selection));
+ pSel = dixAllocateObjectWithPrivates(Selection, PRIVATE_SELECTION);
if (!pSel)
return BadAlloc;
pSel->selection = stuff->selection;
- pSel->devPrivates = NULL;
/* security creation/labeling check */
rc = XaceHookSelectionAccess(client, &pSel,