summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2015-02-13 20:35:26 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2015-02-13 20:35:26 +0000
commitf64037c29e8ee9443e57914106170f19d6671bec (patch)
treead8f3df2be9523bc758ea4071708a1037771781d
parentaa344f5cf111efb0d77bce8262060f79881a33ff (diff)
parent475df3976c162f6d4ed8475308f4a4f0496342a0 (diff)
Merge branch 'cygwin-patches-for-1.17' into cygwin-release-1.17xserver-cygwin-1.17.1-1
-rw-r--r--hw/xwin/winrandr.c81
-rw-r--r--os/xdmcp.c17
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) {