Revision: 5101 http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5101&view=rev Author: ossman_ Date: 2013-05-22 12:55:36 +0000 (Wed, 22 May 2013) Log Message: ----------- Copy r5098 from trunk.
Revision Links: -------------- http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5098&view=rev Modified Paths: -------------- branches/1_3/unix/xserver/hw/vnc/xvnc.cc Modified: branches/1_3/unix/xserver/hw/vnc/xvnc.cc =================================================================== --- branches/1_3/unix/xserver/hw/vnc/xvnc.cc 2013-05-22 12:52:27 UTC (rev 5100) +++ branches/1_3/unix/xserver/hw/vnc/xvnc.cc 2013-05-22 12:55:36 UTC (rev 5101) @@ -1091,6 +1091,9 @@ } RRModePtr vncRandRModeGet(int width, int height); +static Bool vncRandRCrtcSet(ScreenPtr pScreen, RRCrtcPtr crtc, RRModePtr mode, + int x, int y, Rotation rotation, int num_outputs, + RROutputPtr *outputs); static Bool vncRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, @@ -1192,11 +1195,9 @@ /* Fully outside? */ if ((crtc->x >= width) || (crtc->y >= height)) { /* Disable it */ - ret = RRCrtcNotify(crtc, NULL, crtc->x, crtc->y, crtc->rotation, -#if XORG >= 16 - NULL, -#endif - crtc->numOutputs, crtc->outputs); + ret = vncRandRCrtcSet(pScreen, crtc, NULL, + crtc->x, crtc->y, crtc->rotation, + crtc->numOutputs, crtc->outputs); if (!ret) ErrorF("Warning: Unable to disable CRTC that is outside of new screen dimensions"); continue; @@ -1210,11 +1211,9 @@ continue; } - ret = RRCrtcNotify(crtc, mode, crtc->x, crtc->y, crtc->rotation, -#if XORG >= 16 - NULL, -#endif - crtc->numOutputs, crtc->outputs); + ret = vncRandRCrtcSet(pScreen, crtc, mode, + crtc->x, crtc->y, crtc->rotation, + crtc->numOutputs, crtc->outputs); RRModeDestroy(mode); if (!ret) ErrorF("Warning: Unable to crop CRTC to new screen dimensions"); @@ -1228,7 +1227,22 @@ RROutputPtr *outputs) { Bool ret; + int i; + /* + * Some applications get confused by a connected output without a + * mode or CRTC, so we need to fiddle with the connection state as well. + */ + for (i = 0;i < crtc->numOutputs;i++) + RROutputSetConnection(crtc->outputs[i], RR_Disconnected); + + for (i = 0;i < num_outputs;i++) { + if (mode != NULL) + RROutputSetConnection(outputs[i], RR_Connected); + else + RROutputSetConnection(outputs[i], RR_Disconnected); + } + /* Let RandR know we approve, and let it update its internal state */ ret = RRCrtcNotify(crtc, mode, x, y, rotation, #if XORG >= 16 @@ -1301,14 +1315,10 @@ output = RROutputCreate(pScreen, name, strlen(name), NULL); RROutputSetCrtcs(output, &crtc, 1); - RROutputSetConnection(output, RR_Connected); + RROutputSetConnection(output, RR_Disconnected); /* Make sure the CRTC has this output set */ - RRCrtcNotify(crtc, NULL, 0, 0, RR_Rotate_0, -#if XORG >= 16 - NULL, -#endif - 1, &output); + vncRandRCrtcSet(pScreen, crtc, NULL, 0, 0, RR_Rotate_0, 1, &output); /* Populate a list of default modes */ RRModePtr modes[sizeof(vncRandRWidths)/sizeof(*vncRandRWidths)]; @@ -1362,11 +1372,8 @@ if (mode == NULL) return FALSE; - RRCrtcNotify(crtc, mode, 0, 0, RR_Rotate_0, -#if XORG >= 16 - NULL, -#endif - crtc->numOutputs, crtc->outputs); + vncRandRCrtcSet(pScreen, crtc, mode, 0, 0, RR_Rotate_0, + crtc->numOutputs, crtc->outputs); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may _______________________________________________ Tigervnc-commits mailing list Tigervnc-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-commits