From 3c422ded895e2c7491f4e4a1f012c291dcf39a38 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Sat, 22 Jun 2024 15:50:30 -0600 Subject: [PATCH] Fix GetDisplaySize --- src/opcodemgr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/opcodemgr.cpp b/src/opcodemgr.cpp index b279a95..44a907d 100644 --- a/src/opcodemgr.cpp +++ b/src/opcodemgr.cpp @@ -499,11 +499,11 @@ static RTN_TYPE RUNTIME_API ImGuiGetWindowSize(RUNTIME_CONTEXT ctx) { static RTN_TYPE RUNTIME_API ImGuiGetDisplaySize(RUNTIME_CONTEXT ctx) { ScriptExData* data = ScriptExData::Get(); - MONITORINFO info = {sizeof(info)}; - GetMonitorInfo(MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY), &info); + RECT rect; + GetClientRect(GetForegroundWindow(), &rect); - wSetFloatParam(ctx, info.rcMonitor.right - info.rcMonitor.left); - wSetFloatParam(ctx, info.rcMonitor.bottom - info.rcMonitor.top); + wSetFloatParam(ctx, rect.right - rect.left); + wSetFloatParam(ctx, rect.bottom - rect.top); return RTN_CONTINUE; }