diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp index def748832f..0d7a84137e 100644 --- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp +++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp @@ -191,7 +191,7 @@ class PlatformX11 : public Platform s_window_handle = (void*)win; if (SConfig::GetInstance().bDisableScreenSaver) - X11Utils::InhibitScreensaver(dpy, win, true); + X11Utils::InhibitScreensaver(win, true); #if defined(HAVE_XRANDR) && HAVE_XRANDR XRRConfig = new X11Utils::XRRConfiguration(dpy, win); diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index 6d0c452050..e5f9806af9 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -972,10 +972,7 @@ void MainWindow::NetPlayQuit() void MainWindow::EnableScreenSaver(bool enable) { #if defined(HAVE_XRANDR) && HAVE_XRANDR - UICommon::EnableScreenSaver( - static_cast(QGuiApplication::platformNativeInterface()->nativeResourceForWindow( - "display", windowHandle())), - winId(), enable); + UICommon::EnableScreenSaver(winId(), enable); #else UICommon::EnableScreenSaver(enable); #endif diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index eaebe056d4..69000530e8 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -708,8 +708,7 @@ WXLRESULT CFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) void CFrame::EnableScreenSaver(bool enable) { #if defined(HAVE_XRANDR) && HAVE_XRANDR - UICommon::EnableScreenSaver(X11Utils::XDisplayFromHandle(GetHandle()), - X11Utils::XWindowFromHandle(GetHandle()), enable); + UICommon::EnableScreenSaver(X11Utils::XWindowFromHandle(GetHandle()), enable); #else UICommon::EnableScreenSaver(enable); #endif diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index f761313add..557ddcc22b 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -338,7 +338,7 @@ bool TriggerSTMPowerEvent() } #if defined(HAVE_XRANDR) && HAVE_X11 -void EnableScreenSaver(Display* display, Window win, bool enable) +void EnableScreenSaver(Window win, bool enable) #else void EnableScreenSaver(bool enable) #endif @@ -349,7 +349,7 @@ void EnableScreenSaver(bool enable) #if defined(HAVE_X11) && HAVE_X11 if (SConfig::GetInstance().bDisableScreenSaver) { - X11Utils::InhibitScreensaver(display, win, !enable); + X11Utils::InhibitScreensaver(win, !enable); } #endif diff --git a/Source/Core/UICommon/UICommon.h b/Source/Core/UICommon/UICommon.h index 5cef603a83..b7169bfb15 100644 --- a/Source/Core/UICommon/UICommon.h +++ b/Source/Core/UICommon/UICommon.h @@ -8,17 +8,13 @@ #include "Common/CommonTypes.h" -#if defined(HAVE_XRANDR) && HAVE_XRANDR -#include -#endif - namespace UICommon { void Init(); void Shutdown(); #if defined(HAVE_XRANDR) && HAVE_XRANDR -void EnableScreenSaver(Display* display, Window win, bool enable); +void EnableScreenSaver(unsigned long win, bool enable); #else void EnableScreenSaver(bool enable); #endif diff --git a/Source/Core/UICommon/X11Utils.cpp b/Source/Core/UICommon/X11Utils.cpp index 84273488a5..bd89d2197c 100644 --- a/Source/Core/UICommon/X11Utils.cpp +++ b/Source/Core/UICommon/X11Utils.cpp @@ -43,7 +43,7 @@ bool ToggleFullscreen(Display* dpy, Window win) return true; } -void InhibitScreensaver(Display* dpy, Window win, bool suspend) +void InhibitScreensaver(Window win, bool suspend) { char id[11]; snprintf(id, sizeof(id), "0x%lx", win); diff --git a/Source/Core/UICommon/X11Utils.h b/Source/Core/UICommon/X11Utils.h index 87bb518d0c..363a7df95a 100644 --- a/Source/Core/UICommon/X11Utils.h +++ b/Source/Core/UICommon/X11Utils.h @@ -24,7 +24,7 @@ bool ToggleFullscreen(Display* dpy, Window win); Window XWindowFromHandle(void* Handle); Display* XDisplayFromHandle(void* Handle); -void InhibitScreensaver(Display* dpy, Window win, bool suspend); +void InhibitScreensaver(Window win, bool suspend); #if defined(HAVE_XRANDR) && HAVE_XRANDR class XRRConfiguration