summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-03-03 20:10:21 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2015-02-08 17:38:50 +0000
commitcfbf05cc9ca4d7cba09b716e264908717e9b1c8c (patch)
tree449f3625047e121dd25c28cc8f44ebfe39161a6b
parentcd88e4fd93378ec996d296184d9730197b7abc70 (diff)
Register native screens with pseudoramiX
v2: Bring PseudoramiXExtensionInit() prototype into scope, and make the use match the prototype Don't wrap prototype with INXQUARTZ as pseudoramiX is now always built Wrap it in SDKSYMS so it is not included in sdksyms Remove duplicate declaration of noPseudoramiXExtension
-rw-r--r--hw/xwin/InitOutput.c56
-rw-r--r--include/extinit.h2
-rw-r--r--pseudoramiX/pseudoramiX.h2
3 files changed, 57 insertions, 3 deletions
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 65327d7c1..1d53db2d5 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -56,6 +56,9 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
HANDLE hToken,
DWORD dwFlags, LPTSTR pszPath);
#endif
+#include "winmonitors.h"
+#include "pseudoramiX/pseudoramiX.h"
+
#include "glx_extinit.h"
#ifdef XWIN_GLX_WINDOWS
#include "glx/glwindows.h"
@@ -985,6 +988,59 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
}
}
+ /*
+ Unless full xinerama has been explicitly enabled, register all native screens with pseduoramiX
+ */
+ 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 */
diff --git a/include/extinit.h b/include/extinit.h
index fa5f29378..10f7b4620 100644
--- a/include/extinit.h
+++ b/include/extinit.h
@@ -163,7 +163,7 @@ extern void SELinuxExtensionInit(void);
extern void XTestExtensionInit(void);
#endif
-#ifdef INXQUARTZ
+#ifndef SDKSYMS
extern _X_EXPORT Bool noPseudoramiXExtension;
extern void PseudoramiXExtensionInit(void);
#endif
diff --git a/pseudoramiX/pseudoramiX.h b/pseudoramiX/pseudoramiX.h
index f063919dd..5393062ee 100644
--- a/pseudoramiX/pseudoramiX.h
+++ b/pseudoramiX/pseudoramiX.h
@@ -2,8 +2,6 @@
* Minimal implementation of PanoramiX/Xinerama
*/
-extern int noPseudoramiXExtension;
-
void
PseudoramiXAddScreen(int x, int y, int w, int h);
void