Skip to content

Commit 5f695bb

Browse files
committed
Fixed window content being distorted with GLFW's X11 backend
1 parent 0668713 commit 5f695bb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/cpp/Cyph3D/Window.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <Cyph3D/VKObject/VKSwapchain.h>
66

77
#include <GLFW/glfw3.h>
8+
#include <thread>
89

910
c3d::Window::Window()
1011
{
@@ -14,6 +15,11 @@ c3d::Window::Window()
1415
glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE);
1516

1617
_glfwWindow = glfwCreateWindow(800, 600, "Cyph3D", nullptr, nullptr);
18+
19+
// WORKAROUND: X11 (or XWayland) is buggy and will not report the right window
20+
// extent until after some time has passed
21+
std::this_thread::sleep_for(std::chrono::milliseconds(100));
22+
1723
glfwSetInputMode(_glfwWindow, GLFW_RAW_MOUSE_MOTION, true);
1824

1925
VKContext& vkContext = Engine::getVKContext();

0 commit comments

Comments
 (0)