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
This commit is contained in:
parent
73744a991a
commit
b705b92075
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -17,13 +17,11 @@
|
|||
|
||||
#include "X11Utils.h"
|
||||
|
||||
#if defined(HAVE_XDG_SCREENSAVER) && HAVE_XDG_SCREENSAVER
|
||||
#include <unistd.h>
|
||||
#include <spawn.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_WX) && HAVE_WX
|
||||
#include <string>
|
||||
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue