From 16995b71b3f02a5ab6f8f17fe77b3bfe1b5fa281 Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Tue, 14 Jan 2025 16:38:16 -0800 Subject: [PATCH] Use is_maximized and fix incorrect ifdef --- backends/ui/imgui/RendererBackend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/ui/imgui/RendererBackend.cpp b/backends/ui/imgui/RendererBackend.cpp index a636845..df03633 100644 --- a/backends/ui/imgui/RendererBackend.cpp +++ b/backends/ui/imgui/RendererBackend.cpp @@ -471,7 +471,7 @@ SDL_HitTestResult RendererBackend::HitTest(SDL_Window *window, const SDL_Point * } void RendererBackend::EndMainMenuBar() { -#ifndef __EMSCRIPTEN +#ifndef __EMSCRIPTEN__ menubar_end = ImGui::GetCursorPosX(); ImVec2 size = ImGui::GetWindowSize(); float btnw = size.y; @@ -483,7 +483,7 @@ void RendererBackend::EndMainMenuBar() { SDL_MinimizeWindow(window); } ImGui::SetCursorPosX(size.x - (btnw * 2)); - if (SDL_GetWindowFlags(window) & SDL_WINDOW_MAXIMIZED) { + if (is_maximized()) { if (ImGui::Button(ICON_FK_WINDOW_RESTORE, btn_size)) SDL_RestoreWindow(window); } else { if (ImGui::Button(ICON_FK_WINDOW_MAXIMIZE, btn_size)) SDL_MaximizeWindow(window);