diff options
author | Joshua Ashton <joshua@froggi.es> | 2024-03-02 14:11:10 +0000 |
---|---|---|
committer | flightlessmango <42713625+flightlessmango@users.noreply.github.com> | 2024-03-02 23:44:18 +0100 |
commit | 7349a1cf29da3c8fd2f96b2941275e721eb3763e (patch) | |
tree | b78f20b480348b382a80e618f2caa828415bda9b | |
parent | 54df529eba14dddaadd2f914582577d9ee7bbb73 (diff) |
main: Don't resize the window if we aren't horizontal
Fixes weird janking when using this in Gamescope and the window gets resized
-rw-r--r-- | src/app/main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp index 33bbb64..74899a2 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -261,6 +261,11 @@ static bool render(GLFWwindow* window) { if (HUDElements.colors.update) HUDElements.convert_colors(params); + if (screenWidth && screenHeight && params.enabled[OVERLAY_PARAM_ENABLED_horizontal]) + glfwSetWindowSize(window, screenWidth, params.height); + else + glfwSetWindowSize(window, params.width, params.height); + ImVec2 last_window_size = window_size; ImGui_ImplGlfw_NewFrame(); ImGui_ImplOpenGL3_NewFrame(); @@ -270,8 +275,6 @@ static bool render(GLFWwindow* window) { render_imgui(sw_stats, params, window_size, true); get_atom_info(); overlay_end_frame(); - if (screenWidth && screenHeight) - glfwSetWindowSize(window, screenWidth, screenHeight); ImGui::EndFrame(); return last_window_size.x != window_size.x || last_window_size.y != window_size.y; } |