Add Xinerama support for GHOST_GetMainDisplayDimensions() so X11 works as it should (previously would include all monitors).

Now the active monitor size is used on startup. 
Currently the cursor position is checked for intersection with the monitor bounds to find the active screen.
This commit is contained in:
Campbell Barton
2013-01-31 11:05:09 +00:00
parent 73f301c3a8
commit dbf54dacf7
5 changed files with 65 additions and 13 deletions

View File

@@ -166,6 +166,7 @@ unset(PLATFORM_DEFAULT)
if(UNIX AND NOT APPLE)
option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON)
option(WITH_X11_XINERAMA "Enable multi-monitor support" ON)
option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON)
option(WITH_SYSTEM_GLEW "Use GLEW OpenGL wrapper library provided by the operating system" ON)
@@ -414,6 +415,7 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
set(WITH_GHOST_XDND OFF)
set(WITH_X11_XF86VMODE OFF)
set(WITH_X11_XINPUT OFF)
set(WITH_X11_XINERAMA OFF)
endif()
if(MINGW)
@@ -800,6 +802,10 @@ if(UNIX AND NOT APPLE)
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_Xinput_LIB}")
endif()
if(WITH_X11_XINERAMA)
set(PLATFORM_LINKLIBS "${PLATFORM_LINKLIBS} ${X11_Xinerama_LIB}")
endif()
if(WITH_X11_XF86VMODE)
# XXX, why dont cmake make this available?
FIND_LIBRARY(X11_Xxf86vmode_LIB Xxf86vm ${X11_LIB_SEARCH_PATH})