sway icon indicating copy to clipboard operation
sway copied to clipboard

Lagging GLFW window gets closed

Open ev1313 opened this issue 6 months ago • 1 comments

  • Sway Version: 1.9

  • Description: I am using imgui with glfw and opengl3.

When the program "lags" - does not call SwapBuffers in a few seconds - the window closes. GLFW sets the "window should close flag", if I ignore it, the window is gone anyway.

For reproducing you can apply this patch to the branch "docking" of the imgui repository:

diff --git a/imgui_demo.cpp b/imgui_demo.cpp
index 5fbfcd89..5d81b132 100644
--- a/imgui_demo.cpp
+++ b/imgui_demo.cpp
@@ -1,3 +1,4 @@
+#include <unistd.h>
 // dear imgui, v1.91.1 WIP
 // (demo code)

@@ -715,6 +716,9 @@ static void ShowDemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
         {
             IMGUI_DEMO_MARKER("Menu/Examples");
             ImGui::MenuItem("Main menu bar", NULL, &demo_data->ShowMainMenuBar);
+                if(ImGui::MenuItem("Lag Test")) {
+                    sleep(5);
+                }

             ImGui::SeparatorText("Mini apps");
             ImGui::MenuItem("Assets Browser", NULL, &demo_data->ShowAppAssetsBrowser);

If you compile the example and press the button "Lag Test" the window closes afterwards.

This doesn't happen with XWayland / KDE / X11.

I tested on different machines using Intel / AMD drivers.

ev1313 avatar Aug 08 '24 14:08 ev1313