#7850·libgdx

[Linux/sway] Window having a seizure on resize

Author: M0rganeDevCreated Aug 18, 2026Updated Aug 19, 2026

Describe the bug

On linux when running sway using the LWJGL3 backend, trying to resize a floating libgdx-powered window will cause it to have a seizure. The issue comes from Libgdx, as even the liftoff program has this bug.

From my tests, the window goes between several of its previous sizes and will call the ApplicationAdapter#resize in a loop.

Judging by a previous project of mine, this issue was introduced somewhere between 1.13.1 and 1.14.0, and is present in 1.14.2.

The "fix" I have found is to remove the GLFW.glfwSwapBuffers call at the end of the GFLWFrameBufferRezise callback as such:

patch
	gl20.glViewport(0, 0, backBufferWidth, backBufferHeight);
	window.getListener().resize(getWidth(), getHeight());
	update();
	window.getListener().render();
-	GLFW.glfwSwapBuffers(windowHandle);
} else {
	window.asyncResized = true;
}

in Lwjgl3Graphics.java:L86.

From my (limited) testing, this fix the issue, without creating any bugs I could see right away, and could be a fix (although I'd rather first know if it is a proper fix).

Attached video to see what I'm talking about (warning for possible seizures): https://github.com/user-attachments/assets/924de179-5d20-40b1-b596-8853a4444206

Thank you for your time and effort !

Reproduction

If running Linux and sway, open the lift-off program, and press whatever keybind you have set up to put the window in floating mode rather than tiled (shift + super + space by default)

press super and right click on the window, and try to resize it. It will not work as it should.

version

??? up to 1.14.2, LWJGL3 as a backend

Stack trace

bash
not applicable

Affected platforms

  • Android
  • iOS
  • HTML/GWT
  • Windows
  • Linux
  • macOS