aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xfixes
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-11 11:55:48 +0200
committermarha <marha@users.sourceforge.net>2012-07-11 11:55:48 +0200
commit6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab (patch)
tree21e1af7ee94600e349ae21353dc11963a06e988d /xorg-server/xfixes
parent75f57cf199b6c042b0f7515e3a1ab80f7ccecfab (diff)
parentd137057fd13e83ec15ab416c7fe774741da06047 (diff)
downloadvcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.tar.gz
vcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.tar.bz2
vcxsrv-6cab6b3ebc8ed1a81ced93d621ea3abf05e282ab.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/Xext/shm.c xorg-server/Xext/sync.c xorg-server/Xext/xf86bigfont.c xorg-server/Xi/opendev.c xorg-server/dix/dispatch.c xorg-server/include/globals.h xorg-server/mi/miinitext.c
Diffstat (limited to 'xorg-server/xfixes')
-rw-r--r--xorg-server/xfixes/cursor.c18
-rw-r--r--xorg-server/xfixes/region.c5
-rw-r--r--xorg-server/xfixes/select.c8
-rw-r--r--xorg-server/xfixes/xfixes.c5
-rw-r--r--xorg-server/xfixes/xfixesint.h5
5 files changed, 18 insertions, 23 deletions
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index 648271ec8..8f55c291e 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -175,7 +175,6 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
for (e = cursorEvents; e; e = e->next) {
if ((e->eventMask & XFixesDisplayCursorNotifyMask)) {
xXFixesCursorNotifyEvent ev;
-
ev.type = XFixesEventBase + XFixesCursorNotify;
ev.subtype = XFixesDisplayCursorNotify;
ev.window = e->pWindow->drawable.id;
@@ -382,7 +381,8 @@ ProcXFixesGetCursorImage(ClientPtr client)
width = pCursor->bits->width;
height = pCursor->bits->height;
npixels = width * height;
- rep = malloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32));
+ rep = calloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32),
+ 1);
if (!rep)
return BadAlloc;
@@ -411,8 +411,8 @@ ProcXFixesGetCursorImage(ClientPtr client)
swapl(&rep->cursorSerial);
SwapLongs(image, npixels);
}
- WriteToClient(client, sizeof(xXFixesGetCursorImageReply) +
- (npixels << 2), (char *) rep);
+ WriteToClient(client,
+ sizeof(xXFixesGetCursorImageReply) + (npixels << 2), rep);
free(rep);
return Success;
}
@@ -475,11 +475,13 @@ ProcXFixesGetCursorName(ClientPtr client)
str = "";
len = strlen(str);
+
reply.type = X_Reply;
- reply.length = bytes_to_int32(len);
reply.sequenceNumber = client->sequence;
+ reply.length = bytes_to_int32(len);
reply.atom = pCursor->name;
reply.nbytes = len;
+
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
@@ -531,8 +533,8 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
name = pCursor->name ? NameForAtom(pCursor->name) : "";
nbytes = strlen(name);
nbytesRound = pad_to_int32(nbytes);
- rep = malloc(sizeof(xXFixesGetCursorImageAndNameReply) +
- npixels * sizeof(CARD32) + nbytesRound);
+ rep = calloc(sizeof(xXFixesGetCursorImageAndNameReply) +
+ npixels * sizeof(CARD32) + nbytesRound, 1);
if (!rep)
return BadAlloc;
@@ -567,7 +569,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client)
SwapLongs(image, npixels);
}
WriteToClient(client, sizeof(xXFixesGetCursorImageAndNameReply) +
- (npixels << 2) + nbytesRound, (char *) rep);
+ (npixels << 2) + nbytesRound, rep);
free(rep);
return Success;
}
diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c
index 0acbadae2..0e9ca443f 100644
--- a/xorg-server/xfixes/region.c
+++ b/xorg-server/xfixes/region.c
@@ -557,7 +557,8 @@ ProcXFixesFetchRegion(ClientPtr client)
pBox = RegionRects(pRegion);
nBox = RegionNumRects(pRegion);
- reply = malloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle));
+ reply = calloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle),
+ 1);
if (!reply)
return BadAlloc;
reply->type = X_Reply;
@@ -584,7 +585,7 @@ ProcXFixesFetchRegion(ClientPtr client)
swaps(&reply->height);
SwapShorts((INT16 *) pRect, nBox * 4);
}
- (void) WriteToClient(client, sizeof(xXFixesFetchRegionReply) +
+ WriteToClient(client, sizeof(xXFixesFetchRegionReply) +
nBox * sizeof(xRectangle), (char *) reply);
free(reply);
return Success;
diff --git a/xorg-server/xfixes/select.c b/xorg-server/xfixes/select.c
index a896846a7..17fb0b583 100644
--- a/xorg-server/xfixes/select.c
+++ b/xorg-server/xfixes/select.c
@@ -78,15 +78,11 @@ XFixesSelectionCallback(CallbackListPtr *callbacks, pointer data, pointer args)
for (e = selectionEvents; e; e = e->next) {
if (e->selection == selection->selection && (e->eventMask & eventMask)) {
xXFixesSelectionNotifyEvent ev;
-
- memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent));
ev.type = XFixesEventBase + XFixesSelectionNotify;
ev.subtype = subtype;
ev.window = e->pWindow->drawable.id;
- if (subtype == XFixesSetSelectionOwnerNotify)
- ev.owner = selection->window;
- else
- ev.owner = 0;
+ ev.owner = (subtype == XFixesSetSelectionOwnerNotify) ?
+ selection->window : 0;
ev.selection = e->selection;
ev.timestamp = currentTime.milliseconds;
ev.selectionTimestamp = selection->lastTimeChanged.milliseconds;
diff --git a/xorg-server/xfixes/xfixes.c b/xorg-server/xfixes/xfixes.c
index f80230fd3..533482c56 100644
--- a/xorg-server/xfixes/xfixes.c
+++ b/xorg-server/xfixes/xfixes.c
@@ -48,6 +48,7 @@
#include "xfixesint.h"
#include "protocol-versions.h"
+#include "extinit.h"
static unsigned char XFixesReqCode;
int XFixesEventBase;
@@ -68,8 +69,8 @@ ProcXFixesQueryVersion(ClientPtr client)
REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
memset(&rep, 0, sizeof(xXFixesQueryVersionReply));
rep.type = X_Reply;
- rep.length = 0;
rep.sequenceNumber = client->sequence;
+ rep.length = 0;
if (version_compare(stuff->majorVersion, stuff->minorVersion,
SERVER_XFIXES_MAJOR_VERSION,
@@ -90,7 +91,7 @@ ProcXFixesQueryVersion(ClientPtr client)
swapl(&rep.majorVersion);
swapl(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXFixesQueryVersionReply), &rep);
return Success;
}
diff --git a/xorg-server/xfixes/xfixesint.h b/xorg-server/xfixes/xfixesint.h
index 71f88a93d..334c71fbf 100644
--- a/xorg-server/xfixes/xfixesint.h
+++ b/xorg-server/xfixes/xfixesint.h
@@ -71,11 +71,6 @@ typedef struct _XFixesClient {
extern int (*ProcXFixesVector[XFixesNumberRequests]) (ClientPtr);
-/* Initialize extension at server startup time */
-
-void
- XFixesExtensionInit(void);
-
/* Save set */
int
ProcXFixesChangeSaveSet(ClientPtr client);