hw/xwin: Register native screens with pseudoramiX

Update man page to document pseudo-xinerama

v2: Make the use of PseudoramiXExtensionInit() match the prototype
v3: Update for nonsdk_extinit.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2014-11-06 14:28:17 +00:00
parent e036cbfccb
commit 23e07d71b6
2 changed files with 61 additions and 0 deletions

View File

@ -58,6 +58,11 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
HANDLE hToken,
DWORD dwFlags, LPTSTR pszPath);
#endif
#include "winmonitors.h"
#include "nonsdk_extinit.h"
#include "pseudoramiX/pseudoramiX.h"
#include "glx_extinit.h"
#ifdef XWIN_GLX_WINDOWS
#include "glx/glwindows.h"
@ -973,6 +978,59 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
}
}
/*
Unless full xinerama has been explicitly enabled, register all native screens with pseudoramiX
*/
if (!noPanoramiXExtension)
noPseudoramiXExtension = TRUE;
if ((g_ScreenInfo[0].fMultipleMonitors) && !noPseudoramiXExtension)
{
int pass;
PseudoramiXExtensionInit();
/* Add primary monitor on pass 0, other monitors on pass 1, to ensure
the primary monitor is first in XINERAMA list */
for (pass = 0; pass < 2; pass++)
{
int iMonitor;
for (iMonitor = 1; ; iMonitor++)
{
struct GetMonitorInfoData data;
QueryMonitor(iMonitor, &data);
if (data.bMonitorSpecifiedExists)
{
MONITORINFO mi;
mi.cbSize = sizeof(MONITORINFO);
if (GetMonitorInfo(data.monitorHandle, &mi))
{
/* pass == 1 XOR primary monitor flags is set */
if ((!(pass == 1)) != (!(mi.dwFlags & MONITORINFOF_PRIMARY)))
{
/*
Note the screen origin in a normalized coordinate space where (0,0) is at the top left
of the native virtual desktop area
*/
data.monitorOffsetX = data.monitorOffsetX - GetSystemMetrics(SM_XVIRTUALSCREEN);
data.monitorOffsetY = data.monitorOffsetY - GetSystemMetrics(SM_YVIRTUALSCREEN);
winDebug ("InitOutput - screen %d added at virtual desktop coordinate (%d,%d) (pseudoramiX) \n",
iMonitor-1, data.monitorOffsetX, data.monitorOffsetY);
PseudoramiXAddScreen(data.monitorOffsetX, data.monitorOffsetY,
data.monitorWidth, data.monitorHeight);
}
}
}
else
break;
}
}
}
#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
/* Generate a cookie used by internal clients for authorization */

View File

@ -76,6 +76,9 @@ preceeding \fB\-screen\fP parameter.
.B \-[no]multimonitors or \-[no]multiplemonitors
Create a screen 0 that covers all monitors [the primary monitor] on a system with
multiple monitors.
Fake XINERAMA data is created describing the individual monitors,
(This is similar to the 'merged framebuffer' or 'pseudo-xinerama' mode provided by
some drivers for the xorg X server).
This option is currently enabled by default in \fB\-multiwindow\fP mode.
.TP 8
.B "\-screen \fIscreen_number\fP [\fIW\fP \fIH\fP [\fIX\fP \fIY\fP] | [[\fIW\fPx\fIH\fP[+\fIX\fP+\fIY\fP]][@\fIM\fP]] ] "