From 82563d94f4c877b2194e70a2dd21afc9c8a9b52a Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 24 Jan 2020 14:51:38 +1000 Subject: [PATCH] HostInterface: Fix offset OSD messages in Qt frontend --- src/core/host_interface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 112b5301a..6c74e9db0 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -234,11 +234,14 @@ void HostInterface::DrawOSDMessages() ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoFocusOnAppearing; std::unique_lock lock(m_osd_messages_lock); + if (m_osd_messages.empty()) + return; + const float scale = ImGui::GetIO().DisplayFramebufferScale.x; auto iter = m_osd_messages.begin(); float position_x = 10.0f * scale; - float position_y = (10.0f + (m_settings.display_fullscreen ? 0.0f : 20.0f)) * scale; + float position_y = (10.0f + (static_cast(m_display->GetDisplayTopMargin()))) * scale; u32 index = 0; while (iter != m_osd_messages.end()) {