diff options
-rw-r--r-- | hw/xwin/winrandr.c | 81 | ||||
-rw-r--r-- | os/xdmcp.c | 17 |
2 files changed, 87 insertions, 11 deletions
diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 6a93c44cc..829d46515 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -34,11 +34,6 @@ #include <xwin-config.h> #endif #include "win.h" -#include "mivalidate.h" // for union _Validate used by windowstr.h - -#ifndef RANDR_12_INTERFACE -#error X server must have RandR 1.2 interface -#endif /* * Answer queries about the RandR features supported. @@ -47,17 +42,42 @@ static Bool winRandRGetInfo(ScreenPtr pScreen, Rotation * pRotations) { + rrScrPrivPtr pRRScrPriv; + RROutputPtr output; + + pRRScrPriv = rrGetScrPriv(pScreen); + output = pRRScrPriv->outputs[0]; + winDebug("winRandRGetInfo ()\n"); /* Don't support rotations */ *pRotations = RR_Rotate_0; - /* - The screen doesn't have to be limited to the actual - monitor size (we can have scrollbars :-), so what is - the upper limit? - */ - RRScreenSetSizeRange(pScreen, 0, 0, 4096, 4096); + /* Delete previous mode */ + if (output->modes[0]) + RRModeDestroy(output->modes[0]); + + /* Register current mode */ + { + xRRModeInfo modeInfo; + RRModePtr mode; + char name[100]; + + memset(&modeInfo, '\0', sizeof(modeInfo)); + snprintf(name, sizeof(name), "%dx%d", pScreen->width, pScreen->height); + + modeInfo.width = pScreen->width; + modeInfo.height = pScreen->height; + modeInfo.hTotal = pScreen->width; + modeInfo.vTotal = pScreen->height; + modeInfo.dotClock = 0; + modeInfo.nameLength = strlen(name); + mode = RRModeGet(&modeInfo, name); + + output->modes[0] = mode; + output->numModes = 1; + output->crtc->mode = mode; + } return TRUE; } @@ -74,6 +94,11 @@ winDoRandRScreenSetSize(ScreenPtr pScreen, winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; WindowPtr pRoot = pScreen->root; + /* Ignore changes which do nothing */ + if ((pScreen->width == width) && (pScreen->height == height) && + (pScreen->mmWidth == mmWidth) && (pScreen->mmHeight == mmHeight)) + return; + // Prevent screen updates while we change things around SetRootClip(pScreen, FALSE); @@ -213,5 +238,39 @@ winRandRInit(ScreenPtr pScreen) pRRScrPriv->rrCrtcSet = NULL; pRRScrPriv->rrCrtcSetGamma = NULL; + /* Create a CRTC and an output for the screen, and hook them together */ + { + RRCrtcPtr crtc; + RROutputPtr output; + + crtc = RRCrtcCreate(pScreen, NULL); + if (!crtc) + return FALSE; + + crtc->rotations = RR_Rotate_0; + + output = RROutputCreate(pScreen, "default", 7, NULL); + if (!output) + return FALSE; + + RROutputSetCrtcs(output, &crtc, 1); + RROutputSetConnection(output, RR_Connected); + RROutputSetSubpixelOrder(output, PictureGetSubpixelOrder(pScreen)); + + output->crtc = crtc; + pRRScrPriv->primaryOutput = output; + + /* Ensure we have space for exactly one mode */ + output->modes = malloc(sizeof(RRModePtr)); + output->modes[0] = NULL; + } + + /* + The screen doesn't have to be limited to the actual + monitor size (we can have scrollbars :-), so what is + the upper limit? + */ + RRScreenSetSizeRange(pScreen, 0, 0, 4096, 4096); + return TRUE; } diff --git a/os/xdmcp.c b/os/xdmcp.c index b6e97c928..bc5a70706 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -48,6 +48,11 @@ #include <netdir.h> #endif +#define XSERV_t +#define TRANS_SERVER +#define TRANS_REOPEN +#include <X11/Xtrans/Xtrans.h> + #ifdef XDMCP #undef REQUEST @@ -242,6 +247,14 @@ XdmcpUseMsg(void) ErrorF("-displayID display-id manufacturer display ID for request\n"); } +static void +XdmcpDefaultListen(void) +{ + /* Even when configured --disable-listen-tcp, we should listen on tcp in + XDMCP modes */ + _XSERVTransListen("tcp"); +} + int XdmcpOptions(int argc, char **argv, int i) { @@ -249,11 +262,13 @@ XdmcpOptions(int argc, char **argv, int i) get_manager_by_name(argc, argv, i++); XDM_INIT_STATE = XDM_QUERY; AccessUsingXdmcp(); + XdmcpDefaultListen(); return i + 1; } if (strcmp(argv[i], "-broadcast") == 0) { XDM_INIT_STATE = XDM_BROADCAST; AccessUsingXdmcp(); + XdmcpDefaultListen(); return i + 1; } #if defined(IPv6) && defined(AF_INET6) @@ -261,6 +276,7 @@ XdmcpOptions(int argc, char **argv, int i) i = get_mcast_options(argc, argv, ++i); XDM_INIT_STATE = XDM_MULTICAST; AccessUsingXdmcp(); + XdmcpDefaultListen(); return i + 1; } #endif @@ -268,6 +284,7 @@ XdmcpOptions(int argc, char **argv, int i) get_manager_by_name(argc, argv, i++); XDM_INIT_STATE = XDM_INDIRECT; AccessUsingXdmcp(); + XdmcpDefaultListen(); return i + 1; } if (strcmp(argv[i], "-port") == 0) { |