diff options
Diffstat (limited to 'xorg-server/hw/xwin/InitOutput.c')
-rwxr-xr-x | xorg-server/hw/xwin/InitOutput.c | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c index fe4755c03..5a3d80f7f 100755 --- a/xorg-server/hw/xwin/InitOutput.c +++ b/xorg-server/hw/xwin/InitOutput.c @@ -53,6 +53,11 @@ typedef HRESULT (__stdcall * 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" @@ -754,13 +759,12 @@ winUseMsg(void) ErrorF("-engine engine_type_id\n" "\tOverride the server's automatically selected engine type:\n" "\t\t1 - Shadow GDI\n" - "\t\t2 - Shadow DirectDraw\n" "\t\t4 - Shadow DirectDraw4 Non-Locking\n" ); ErrorF("-fullscreen\n" "\tRun the server in fullscreen mode.\n"); - ErrorF("-hostintitle\n" + ErrorF("-[no]hostintitle\n" "\tIn multiwindow mode, add remote host names to window titles.\n"); ErrorF("-ignoreinput\n" "\tIgnore keyboard and mouse input.\n"); @@ -987,6 +991,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 */ |