mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
WindowInfo: Linux build fix
This commit is contained in:
parent
1057e42956
commit
13b2cf6b1c
|
@ -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++)
|
||||||
|
|
Loading…
Reference in a new issue