From b705b92075a6ae8a746b80556ba21d2a3931575c Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Fri, 17 Jun 2011 13:14:55 +0000 Subject: [PATCH] On linux don't check to see if the xdg-screensaver program is present at build time. Just build in the code to call the program. If the program does not exist it will silently fail, and the screensaver will not be inhibited. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7606 8ced0084-cf51-0410-be5f-012b33b47a6e --- CMakeLists.txt | 9 --------- Source/Core/DolphinWX/Src/FrameTools.cpp | 5 ++--- Source/Core/DolphinWX/Src/MainNoGUI.cpp | 4 ---- Source/Core/DolphinWX/Src/VideoConfigDiag.cpp | 1 - Source/Core/DolphinWX/Src/X11Utils.cpp | 4 ---- Source/Core/DolphinWX/Src/X11Utils.h | 2 -- 6 files changed, 2 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b6f2cfb77..aa784e0b16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,15 +231,6 @@ if(ENCODE_FRAMEDUMPS) check_libav() endif() -find_program(XDG_SCREENSAVER xdg-screensaver) -if(XDG_SCREENSAVER) - message("xdg-screensaver found, enabling screensaver inhibition") - add_definitions(-DHAVE_XDG_SCREENSAVER=1) -else() - message("xdg-screensaver not found, disabling screensaver inhibition") - add_definitions(-DHAVE_XDG_SCREENSAVER=0) -endif() - include(CheckCXXSourceRuns) set(CMAKE_REQUIRED_LIBRARIES portaudio) CHECK_CXX_SOURCE_RUNS( diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 462baffc46..e8ba372f55 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -936,7 +936,7 @@ void CFrame::StartGame(const std::string& filename) } else { -#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER +#if defined(HAVE_X11) && HAVE_X11 X11Utils::InhibitScreensaver(X11Utils::XDisplayFromHandle(GetHandle()), X11Utils::XWindowFromHandle(GetHandle()), true); #endif @@ -971,7 +971,6 @@ void CFrame::StartGame(const std::string& filename) m_RenderParent->Connect(wxID_ANY, wxEVT_SIZE, wxSizeEventHandler(CFrame::OnRenderParentResize), (wxObject*)0, this); - } wxEndBusyCursor(); @@ -1055,7 +1054,7 @@ void CFrame::DoStop() BootManager::Stop(); wxEndBusyCursor(); -#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER +#if defined(HAVE_X11) && HAVE_X11 X11Utils::InhibitScreensaver(X11Utils::XDisplayFromHandle(GetHandle()), X11Utils::XWindowFromHandle(GetHandle()), false); #endif diff --git a/Source/Core/DolphinWX/Src/MainNoGUI.cpp b/Source/Core/DolphinWX/Src/MainNoGUI.cpp index 2f1dffc9e9..537a7e5551 100644 --- a/Source/Core/DolphinWX/Src/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/Src/MainNoGUI.cpp @@ -146,9 +146,7 @@ void X11_MainLoop() Window win = (Window)Core::GetWindowHandle(); XSelectInput(dpy, win, KeyPressMask | FocusChangeMask); -#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER X11Utils::InhibitScreensaver(dpy, win, true); -#endif #if defined(HAVE_XRANDR) && HAVE_XRANDR X11Utils::XRRConfiguration *XRRConfig = new X11Utils::XRRConfiguration(dpy, win); @@ -261,9 +259,7 @@ void X11_MainLoop() delete XRRConfig; #endif -#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER X11Utils::InhibitScreensaver(dpy, win, false); -#endif if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor) XFreeCursor(dpy, blankCursor); diff --git a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp index b411bc7752..8753fc78c9 100644 --- a/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp +++ b/Source/Core/DolphinWX/Src/VideoConfigDiag.cpp @@ -220,7 +220,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con for (; it != itend; ++it) choice_backend->AppendString(wxGetTranslation(wxString::FromAscii((*it)->GetName().c_str()))); - // TODO: How to get the translated plugin name? choice_backend->SetStringSelection(wxGetTranslation(wxString::FromAscii(g_video_backend->GetName().c_str()))); _connect_macro_(choice_backend, VideoConfigDiag::Event_Backend, wxEVT_COMMAND_CHOICE_SELECTED, this); diff --git a/Source/Core/DolphinWX/Src/X11Utils.cpp b/Source/Core/DolphinWX/Src/X11Utils.cpp index 0944d55cc1..c5d883736b 100644 --- a/Source/Core/DolphinWX/Src/X11Utils.cpp +++ b/Source/Core/DolphinWX/Src/X11Utils.cpp @@ -17,13 +17,11 @@ #include "X11Utils.h" -#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER #include #include #include extern char **environ; -#endif #if defined(HAVE_WX) && HAVE_WX #include @@ -135,7 +133,6 @@ Display *XDisplayFromHandle(void *Handle) } #endif -#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER void InhibitScreensaver(Display *dpy, Window win, bool suspend) { char id[11]; @@ -156,7 +153,6 @@ void InhibitScreensaver(Display *dpy, Window win, bool suspend) DEBUG_LOG(VIDEO, "Started xdg-screensaver (PID = %d)", (int)pid); } } -#endif #if defined(HAVE_XRANDR) && HAVE_XRANDR XRRConfiguration::XRRConfiguration(Display *_dpy, Window _win) diff --git a/Source/Core/DolphinWX/Src/X11Utils.h b/Source/Core/DolphinWX/Src/X11Utils.h index aee0185eee..ff4171e249 100644 --- a/Source/Core/DolphinWX/Src/X11Utils.h +++ b/Source/Core/DolphinWX/Src/X11Utils.h @@ -54,9 +54,7 @@ Window XWindowFromHandle(void *Handle); Display *XDisplayFromHandle(void *Handle); #endif -#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER void InhibitScreensaver(Display *dpy, Window win, bool suspend); -#endif #if defined(HAVE_XRANDR) && HAVE_XRANDR class XRRConfiguration