diff options
author | Max Kellermann <max@duempel.org> | 2015-05-05 18:45:51 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-05-26 09:59:23 +0200 |
commit | ced1ec2d623f25abded69755cf3ba5d8ccca1cc1 (patch) | |
tree | a9e1cbd577b6d619110d739c738d668af6dd62be | |
parent | f91d17216fdff7f9f7080e1374a3391826c46bcd (diff) |
WinSystemX11: make XRandR mandatory
On https://github.com/xbmc/xbmc/pull/7058 we discussed that XRandR
should be mandatory.
-rw-r--r-- | Makefile.in | 4 | ||||
-rw-r--r-- | configure.ac | 32 | ||||
-rw-r--r-- | xbmc/settings/DisplaySettings.cpp | 4 | ||||
-rw-r--r-- | xbmc/system.h | 3 | ||||
-rw-r--r-- | xbmc/windowing/WinEventsX11.cpp | 11 | ||||
-rw-r--r-- | xbmc/windowing/X11/WinSystemX11.cpp | 12 | ||||
-rw-r--r-- | xbmc/windowing/X11/XRandR.cpp | 4 | ||||
-rw-r--r-- | xbmc/windowing/X11/XRandR.h | 2 |
8 files changed, 10 insertions, 62 deletions
diff --git a/Makefile.in b/Makefile.in index 25be962a27..819a43ca07 100644 --- a/Makefile.in +++ b/Makefile.in @@ -488,7 +488,7 @@ else endif @APP_NAME_LC@-xrandr: xbmc-xrandr.c -ifneq (1,@USE_XRANDR@) +ifneq (1,@USE_X11@) # xbmc-xrandr.c gets picked up by the default make rules @echo "excluding @APP_NAME_LC@-xrandr" else @@ -515,7 +515,7 @@ install-binaries: install-scripts @echo "Copying @APP_NAME_LC@ binary to $(DESTDIR)$(libdir)/@APP_NAME_LC@/" @install -d $(DESTDIR)$(libdir)/@APP_NAME_LC@ @cd $(DESTDIR)$(libdir); [ -L xbmc ] || [ -d xbmc ] || ln -s @APP_NAME_LC@ xbmc -ifeq (1,@USE_XRANDR@) +ifeq (1,@USE_X11@) @install @APP_NAME_LC@-xrandr $(DESTDIR)$(libdir)/@APP_NAME_LC@/@APP_NAME_LC@-xrandr endif ifeq (@USE_LIBXBMC@,1) diff --git a/configure.ac b/configure.ac index 3810fe86ec..8f2319f50e 100644 --- a/configure.ac +++ b/configure.ac @@ -168,8 +168,6 @@ configure_debug="ERROR: this is a configure debug statement" missing_library="Could not find a required library. Please see the README for your platform." missing_headers="Could not find some required headers. Please see the README for your platform." missing_program="Could not find a required program. Please see the README for your platform." -xrandr_not_found="== Could not find libXRandR. SDL will be used for resolution support. ==" -xrandr_disabled="== XRandR support disabled. SDL will be used for resolution support. ==" waveform_enabled="== WAVEFORM enabled ==" waveform_disabled="== WAVEFORM disabled ==" spectrum_enabled="== SPECTRUM enabled ==" @@ -316,12 +314,6 @@ AC_ARG_ENABLE([joystick], [use_joystick=$enableval], [use_joystick=auto]) -AC_ARG_ENABLE([xrandr], - [AS_HELP_STRING([--enable-xrandr], - [enable XRandR support (default is yes)])], - [use_xrandr=$enableval], - [use_xrandr=yes]) - AC_ARG_ENABLE([waveform], [AS_HELP_STRING([--enable-waveform], [enable Waveform visualisation (default is yes)])], @@ -1413,6 +1405,8 @@ if test "$use_x11" = "yes"; then PKG_CHECK_MODULES([XEXT], [xext], [INCLUDES="$INCLUDES $XEXT_CFLAGS"; LIBS="$LIBS $XEXT_LIBS"], AC_MSG_ERROR($missing_library)) + AC_CHECK_LIB([Xrandr], [main],, + AC_MSG_ERROR($missing_library)) PKG_CHECK_MODULES([DRM], [libdrm], [INCLUDES="$INCLUDES $DRM_CFLAGS"; LIBS="$LIBS $DRM_LIBS"], AC_MSG_ERROR($missing_library)) @@ -1421,19 +1415,6 @@ else AC_MSG_RESULT($x11_disabled) fi -# XRandR -if test "$use_x11" = "no"; then - use_xrandr="no" - AC_MSG_RESULT($xrandr_disabled) -else - if test "$use_xrandr" = "yes" ; then - AC_CHECK_LIB([Xrandr], [main],, - use_xrandr="no";AC_MSG_RESULT($xrandr_not_found)) - else - AC_MSG_RESULT($xrandr_disabled) - fi -fi - # WAVEFORM if test "$use_waveform" = "yes"; then AC_MSG_NOTICE($waveform_enabled) @@ -2122,14 +2103,6 @@ else final_message="$final_message\n Joystick:\tNo" fi -if test "$use_xrandr" = "yes"; then - final_message="$final_message\n XRandR:\tYes" - USE_XRANDR=1 -else - final_message="$final_message\n XRandR:\tNo" - USE_XRANDR=0 -fi - if test "$use_waveform" = "yes"; then final_message="$final_message\n Waveform:\tYes" else @@ -2640,7 +2613,6 @@ AC_SUBST(USE_AIRPLAY) AC_SUBST(USE_OPENMAX) AC_SUBST(USE_PULSE) AC_SUBST(HAVE_LIBPULSE) -AC_SUBST(USE_XRANDR) AC_SUBST(USE_ALSA) AC_SUBST(USE_TEXTUREPACKER) AC_SUBST(TEXTUREPACKER) diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp index 7349104561..9fb5b8e084 100644 --- a/xbmc/settings/DisplaySettings.cpp +++ b/xbmc/settings/DisplaySettings.cpp @@ -115,7 +115,7 @@ bool CDisplaySettings::Load(const TiXmlNode *settings) XMLUtils::GetString(pResolution, "description", cal.strMode); XMLUtils::GetInt(pResolution, "subtitles", cal.iSubtitles); XMLUtils::GetFloat(pResolution, "pixelratio", cal.fPixelRatio); -#ifdef HAS_XRANDR +#ifdef HAVE_X11 XMLUtils::GetFloat(pResolution, "refreshrate", cal.fRefreshRate); XMLUtils::GetString(pResolution, "output", cal.strOutput); XMLUtils::GetString(pResolution, "xrandrid", cal.strId); @@ -179,7 +179,7 @@ bool CDisplaySettings::Save(TiXmlNode *settings) const XMLUtils::SetString(pNode, "description", it->strMode); XMLUtils::SetInt(pNode, "subtitles", it->iSubtitles); XMLUtils::SetFloat(pNode, "pixelratio", it->fPixelRatio); -#ifdef HAS_XRANDR +#ifdef HAVE_X11 XMLUtils::SetFloat(pNode, "refreshrate", it->fRefreshRate); XMLUtils::SetString(pNode, "output", it->strOutput); XMLUtils::SetString(pNode, "xrandrid", it->strId); diff --git a/xbmc/system.h b/xbmc/system.h index 8fe14970bc..2213421ee4 100644 --- a/xbmc/system.h +++ b/xbmc/system.h @@ -176,9 +176,6 @@ #ifdef HAVE_LIBPULSE #define HAS_PULSEAUDIO #endif -#ifdef HAVE_LIBXRANDR -#define HAS_XRANDR -#endif #ifdef HAVE_ALSA #define HAS_ALSA #endif diff --git a/xbmc/windowing/WinEventsX11.cpp b/xbmc/windowing/WinEventsX11.cpp index 1230b215a9..38a52df6db 100644 --- a/xbmc/windowing/WinEventsX11.cpp +++ b/xbmc/windowing/WinEventsX11.cpp @@ -28,6 +28,7 @@ #include "Application.h" #include "ApplicationMessenger.h" #include <X11/Xlib.h> +#include <X11/extensions/Xrandr.h> #include "X11/WinSystemX11GL.h" #include "X11/WinSystemX11GLES.h" #include "X11/keysymdef.h" @@ -38,10 +39,6 @@ #include "input/MouseStat.h" #include "input/InputManager.h" -#if defined(HAS_XRANDR) -#include <X11/extensions/Xrandr.h> -#endif - #ifdef HAS_SDL_JOYSTICK #include "input/SDLJoystick.h" #endif @@ -274,7 +271,6 @@ bool CWinEventsX11Imp::Init(Display *dpy, Window win) } // register for xrandr events -#if defined(HAS_XRANDR) int iReturn; XRRQueryExtension(WinEvents->m_display, &WinEvents->m_RREventBase, &iReturn); int numScreens = XScreenCount(WinEvents->m_display); @@ -282,7 +278,6 @@ bool CWinEventsX11Imp::Init(Display *dpy, Window win) { XRRSelectInput(WinEvents->m_display, RootWindow(WinEvents->m_display, i), RRScreenChangeNotifyMask | RRCrtcChangeNotifyMask | RROutputChangeNotifyMask | RROutputPropertyNotifyMask); } -#endif return true; } @@ -329,7 +324,6 @@ bool CWinEventsX11Imp::MessagePump() memset(&xevent, 0, sizeof (XEvent)); XNextEvent(WinEvents->m_display, &xevent); -#if defined(HAS_XRANDR) if (WinEvents && (xevent.type == WinEvents->m_RREventBase + RRScreenChangeNotify)) { XRRUpdateConfiguration(&xevent); @@ -347,7 +341,6 @@ bool CWinEventsX11Imp::MessagePump() serial = xevent.xgeneric.serial; continue; } -#endif if (XFilterEvent(&xevent, WinEvents->m_window)) continue; @@ -594,14 +587,12 @@ bool CWinEventsX11Imp::MessagePump() }// switch event.type }// while -#if defined(HAS_XRANDR) if (WinEvents && WinEvents->m_xrrEventPending && WinEvents->m_xrrFailSafeTimer.IsTimePast()) { CLog::Log(LOGERROR,"CWinEventsX11::MessagePump - missed XRR Events"); g_Windowing.NotifyXRREvent(); WinEvents->m_xrrEventPending = false; } -#endif #ifdef HAS_SDL_JOYSTICK SDL_Event event; diff --git a/xbmc/windowing/X11/WinSystemX11.cpp b/xbmc/windowing/X11/WinSystemX11.cpp index e6c82c28db..63bd0a7b6c 100644 --- a/xbmc/windowing/X11/WinSystemX11.cpp +++ b/xbmc/windowing/X11/WinSystemX11.cpp @@ -40,10 +40,7 @@ #include "windowing/WindowingFactory.h" #include "CompileInfo.h" #include <X11/Xatom.h> - -#if defined(HAS_XRANDR) #include <X11/extensions/Xrandr.h> -#endif #include "../WinEventsX11.h" #include "input/InputManager.h" @@ -93,7 +90,6 @@ bool CWinSystemX11::InitWindowSystem() bool CWinSystemX11::DestroyWindowSystem() { -#if defined(HAS_XRANDR) //restore desktop resolution on exit if (m_bFullScreen) { @@ -106,7 +102,6 @@ bool CWinSystemX11::DestroyWindowSystem() mode.id = CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP).strId; g_xrandr.SetMode(out, mode); } -#endif #if defined(HAS_GLX) if (m_dpy) @@ -240,7 +235,6 @@ bool CWinSystemX11::ResizeWindow(int newWidth, int newHeight, int newLeft, int n bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) { -#if defined(HAS_XRANDR) XOutput out; XMode mode; @@ -308,7 +302,6 @@ bool CWinSystemX11::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl } } } -#endif if (!SetWindow(res.iWidth, res.iHeight, fullScreen, m_userOutput)) return false; @@ -325,7 +318,6 @@ void CWinSystemX11::UpdateResolutions() { CWinSystemBase::UpdateResolutions(); -#if defined(HAS_XRANDR) int numScreens = XScreenCount(m_dpy); g_xrandr.SetNumScreens(numScreens); @@ -382,7 +374,6 @@ void CWinSystemX11::UpdateResolutions() CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP).strOutput = m_userOutput; } else -#endif { m_userOutput = "No Output"; m_nScreen = DefaultScreen(m_dpy); @@ -391,8 +382,6 @@ void CWinSystemX11::UpdateResolutions() UpdateDesktopResolution(CDisplaySettings::Get().GetResolutionInfo(RES_DESKTOP), 0, w, h, 0.0); } -#if defined(HAS_XRANDR) - // erase previous stored modes CDisplaySettings::Get().ClearCustomResolutions(); @@ -449,7 +438,6 @@ void CWinSystemX11::UpdateResolutions() } } CDisplaySettings::Get().ApplyCalibrations(); -#endif } bool CWinSystemX11::HasCalibration(const RESOLUTION_INFO &resInfo) diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp index 165fad1e8c..7ca89589d5 100644 --- a/xbmc/windowing/X11/XRandR.cpp +++ b/xbmc/windowing/X11/XRandR.cpp @@ -20,7 +20,7 @@ #include "XRandR.h" -#ifdef HAS_XRANDR +#ifdef HAVE_X11 #include <string.h> #include <sys/wait.h> @@ -508,7 +508,7 @@ int CXRandR::GetCrtc(int x, int y, float &hz) CXRandR g_xrandr; -#endif // HAS_XRANDR +#endif // HAVE_X11 /* int main() diff --git a/xbmc/windowing/X11/XRandR.h b/xbmc/windowing/X11/XRandR.h index 88f2a81418..4b1ff93c12 100644 --- a/xbmc/windowing/X11/XRandR.h +++ b/xbmc/windowing/X11/XRandR.h @@ -23,7 +23,7 @@ #include "system.h" -#ifdef HAS_XRANDR +#ifdef HAVE_X11 #include <string> #include <vector> |