Skip to content

Commit

Permalink
Use XRandR 1.2 to set fullscreen resolution for single output
Browse files Browse the repository at this point in the history
Squash of roothorick's PR #497
(also includes Kyzentun's CMake changes from PR #716)
  • Loading branch information
roothorick authored and drewbarbs committed Feb 23, 2016
1 parent 2afefb3 commit 4fe1b44
Show file tree
Hide file tree
Showing 6 changed files with 438 additions and 68 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ matrix:
- libvorbis-dev
- libxtst-dev
- libxrandr-dev
- libxxf86vm-dev
- libglew-dev

-
Expand Down
2 changes: 1 addition & 1 deletion StepmaniaCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ elseif(LINUX)
if (${XRANDR_FOUND})
set(HAS_XRANDR TRUE)
else()
set(HAX_XRANDR FALSE)
set(HAS_XRANDR FALSE)
endif()

find_package(PulseAudio)
Expand Down
32 changes: 26 additions & 6 deletions autoconf/m4/x11.m4
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ AC_DEFUN([SM_X11],
fi
# Check for Xrandr
# Can someone fix this for me? This is producing bizarre warnings from
# configure... I have no clue what I'm doing -Ben
AC_CHECK_LIB(Xrandr, XRRSizes,
AC_CHECK_LIB(Xrandr, XRRQueryVersion,
have_xrandr=yes,
have_xrandr=no,
[$XLIBS])
Expand All @@ -45,14 +43,36 @@ AC_DEFUN([SM_X11],
have_xrandr=no
fi
if test "$have_xrandr" = "no"; then
# Check for Xxf86vm
AC_CHECK_LIB(Xxf86vm, XF86VidModeSwitchToMode,
have_xf86vm=yes,
have_xf86vm=no,
[$XLIBS])
AC_CHECK_HEADER(X11/extensions/xf86vmode.h, have_xf86vm_header=yes, have_xf86vm_header=no, [#include <X11/Xlib.h>])
if test "$have_xf86vm_header" = "no"; then
have_xf86vm=no
fi
no_modeset=yes
if test "$have_xrandr" = "yes"; then
XLIBS="$XLIBS -lXrandr"
AC_DEFINE(HAVE_XRANDR, 1, [Xrandr is available])
no_modeset=no
fi
if test "$have_xf86vm" = "yes"; then
XLIBS="$XLIBS -lXxf86vm"
AC_DEFINE(HAVE_XF86VIDMODE, 1, [XF86VidMode is available])
no_modeset=no
fi
if test "$no_modeset" = "yes"; then
if test "$unix" = "yes"; then
AC_MSG_ERROR("Couldn't find X11 libraries.")
else
no_x=yes
fi
else
XLIBS="$XLIBS -lXrandr"
fi
AM_CONDITIONAL(HAVE_X11, test "$no_x" != "yes")
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ else() # Linux
if (${HAS_FFMPEG})
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_FFMPEG)
endif()
if (${HAS_XRANDR})
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_XRANDR)
endif()
if (BSD)
sm_add_compile_definition("${SM_EXE_NAME}" BSD)
endif()
Expand Down
2 changes: 2 additions & 0 deletions src/RageDisplay_OGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,9 @@ void SetupExtensions()
const float fGLUVersion = StringToFloat( (const char *) gluGetString(GLU_VERSION) );
g_gluVersion = std::lrint( fGLUVersion * 10 );

#ifndef HAVE_X11 // LLW_X11 needs to init GLEW early for GLX exts
glewInit();
#endif

g_iMaxTextureUnits = 1;
if (GLEW_ARB_multitexture)
Expand Down
Loading

0 comments on commit 4fe1b44

Please sign in to comment.