aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/panoramiX.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xext/panoramiX.c')
-rw-r--r--xorg-server/Xext/panoramiX.c99
1 files changed, 55 insertions, 44 deletions
diff --git a/xorg-server/Xext/panoramiX.c b/xorg-server/Xext/panoramiX.c
index de62a35e7..5653c08e1 100644
--- a/xorg-server/Xext/panoramiX.c
+++ b/xorg-server/Xext/panoramiX.c
@@ -59,7 +59,7 @@ Equipment Corporation.
#ifdef COMPOSITE
#include "compint.h"
#endif
-#include "modinit.h"
+#include "extinit.h"
#include "protocol-versions.h"
#ifdef GLXPROXY
@@ -434,7 +434,7 @@ XineramaReinitData(void)
*/
void
-PanoramiXExtensionInit(int argc, char *argv[])
+PanoramiXExtensionInit(void)
{
int i;
Bool success = FALSE;
@@ -895,6 +895,9 @@ PanoramiXResetProc(ExtensionEntry * extEntry)
#ifdef XFIXES
PanoramiXFixesReset();
#endif
+#ifdef COMPOSITE
+ PanoramiXCompositeReset ();
+#endif
screenInfo.numScreens = PanoramiXNumScreens;
for (i = 256; i--;)
ProcVector[i] = SavedProcVector[i];
@@ -904,21 +907,22 @@ int
ProcPanoramiXQueryVersion(ClientPtr client)
{
/* REQUEST(xPanoramiXQueryVersionReq); */
- xPanoramiXQueryVersionReply rep;
+ xPanoramiXQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = SERVER_PANORAMIX_MAJOR_VERSION,
+ .minorVersion = SERVER_PANORAMIX_MINOR_VERSION
+ };
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
- rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep);
return Success;
}
@@ -935,17 +939,19 @@ ProcPanoramiXGetState(ClientPtr client)
if (rc != Success)
return rc;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPanoramiXExtension;
- rep.window = stuff->window;
+ rep = (xPanoramiXGetStateReply) {
+ .type = X_Reply,
+ .state = !noPanoramiXExtension,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .window = stuff->window
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.window);
}
- WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep);
return Success;
}
@@ -963,17 +969,19 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
if (rc != Success)
return rc;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.ScreenCount = PanoramiXNumScreens;
- rep.window = stuff->window;
+ rep = (xPanoramiXGetScreenCountReply) {
+ .type = X_Reply,
+ .ScreenCount = PanoramiXNumScreens,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .window = stuff->window
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.window);
}
- WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep);
return Success;
}
@@ -993,14 +1001,16 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
if (rc != Success)
return rc;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
+ rep = (xPanoramiXGetScreenSizeReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
/* screen dimensions */
- rep.width = screenInfo.screens[stuff->screen]->width;
- rep.height = screenInfo.screens[stuff->screen]->height;
- rep.window = stuff->window;
- rep.screen = stuff->screen;
+ .width = screenInfo.screens[stuff->screen]->width,
+ .height = screenInfo.screens[stuff->screen]->height,
+ .window = stuff->window,
+ .screen = stuff->screen
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -1009,7 +1019,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
swapl(&rep.window);
swapl(&rep.screen);
}
- WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
+ WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep);
return Success;
}
@@ -1021,24 +1031,24 @@ ProcXineramaIsActive(ClientPtr client)
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
+ rep = (xXineramaIsActiveReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
#if 1
- {
/* The following hack fools clients into thinking that Xinerama
* is disabled even though it is not. */
- rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack;
- }
+ .state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack
#else
- rep.state = !noPanoramiXExtension;
+ .state = !noPanoramiXExtension;
#endif
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.state);
}
- WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep);
return Success;
}
@@ -1046,20 +1056,21 @@ int
ProcXineramaQueryScreens(ClientPtr client)
{
/* REQUEST(xXineramaQueryScreensReq); */
- xXineramaQueryScreensReply rep;
+ xXineramaQueryScreensReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = bytes_to_int32(rep.number * sz_XineramaScreenInfo),
+ .number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens
+ };
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
- rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.number);
}
- WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
+ WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
if (!noPanoramiXExtension) {
xXineramaScreenInfo scratch;
@@ -1077,7 +1088,7 @@ ProcXineramaQueryScreens(ClientPtr client)
swaps(&scratch.width);
swaps(&scratch.height);
}
- WriteToClient(client, sz_XineramaScreenInfo, (char *) &scratch);
+ WriteToClient(client, sz_XineramaScreenInfo, &scratch);
}
}