WindowInfo: Linux build fix

This commit is contained in:
Connor McLaughlin 2022-07-26 20:10:19 +10:00
parent 1057e42956
commit 13b2cf6b1c

View file

@ -87,7 +87,7 @@ bool WindowInfo::QueryRefreshRateForWindow(const WindowInfo& wi, float* refresh_
#ifdef USE_X11 #ifdef USE_X11
#include "common/scope_guard.h" #include "common/scoped_guard.h"
#include "gl/x11_window.h" #include "gl/x11_window.h"
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
@ -107,7 +107,7 @@ static bool GetRefreshRateFromXRandR(const WindowInfo& wi, float* refresh_rate)
return false; return false;
} }
Common::ScopeGuard res_guard([res]() { XRRFreeScreenResources(res); }); ScopedGuard res_guard([res]() { XRRFreeScreenResources(res); });
int num_monitors; int num_monitors;
XRRMonitorInfo* mi = XRRGetMonitors(display, window, True, &num_monitors); XRRMonitorInfo* mi = XRRGetMonitors(display, window, True, &num_monitors);
@ -121,7 +121,7 @@ static bool GetRefreshRateFromXRandR(const WindowInfo& wi, float* refresh_rate)
Log_WarningPrintf("XRRGetMonitors() returned %d monitors, using first", num_monitors); Log_WarningPrintf("XRRGetMonitors() returned %d monitors, using first", num_monitors);
} }
Common::ScopeGuard mi_guard([mi]() { XRRFreeMonitors(mi); }); ScopedGuard mi_guard([mi]() { XRRFreeMonitors(mi); });
if (mi->noutput <= 0) if (mi->noutput <= 0)
{ {
Log_ErrorPrint("Monitor has no outputs"); Log_ErrorPrint("Monitor has no outputs");
@ -139,7 +139,7 @@ static bool GetRefreshRateFromXRandR(const WindowInfo& wi, float* refresh_rate)
return false; return false;
} }
Common::ScopeGuard oi_guard([oi]() { XRRFreeOutputInfo(oi); }); ScopedGuard oi_guard([oi]() { XRRFreeOutputInfo(oi); });
XRRCrtcInfo* ci = XRRGetCrtcInfo(display, res, oi->crtc); XRRCrtcInfo* ci = XRRGetCrtcInfo(display, res, oi->crtc);
if (!ci) if (!ci)
@ -148,7 +148,7 @@ static bool GetRefreshRateFromXRandR(const WindowInfo& wi, float* refresh_rate)
return false; return false;
} }
Common::ScopeGuard ci_guard([ci]() { XRRFreeCrtcInfo(ci); }); ScopedGuard ci_guard([ci]() { XRRFreeCrtcInfo(ci); });
XRRModeInfo* mode = nullptr; XRRModeInfo* mode = nullptr;
for (int i = 0; i < res->nmode; i++) for (int i = 0; i < res->nmode; i++)