From b69f87d5c3d29196d3380c5b14635a2cb57ba9d1 Mon Sep 17 00:00:00 2001 From: Tomek Bury Date: Tue, 14 Feb 2017 18:52:02 +0000 Subject: [PATCH] Don't wait for Wayland This allows to run at full speed in MAILBOX mode. --- base/vulkanexamplebase.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 128e56a2..76e323bf 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -414,7 +414,13 @@ void VulkanExampleBase::renderLoop() viewUpdated = false; viewChanged(); } - wl_display_dispatch(display); + + while (wl_display_prepare_read(display) != 0) + wl_display_dispatch_pending(display); + wl_display_flush(display); + wl_display_read_events(display); + wl_display_dispatch_pending(display); + render(); frameCounter++; auto tEnd = std::chrono::high_resolution_clock::now(); @@ -1494,6 +1500,7 @@ void VulkanExampleBase::initWaylandConnection() { registryGlobalCb, registryGlobalRemoveCb }; wl_registry_add_listener(registry, ®istry_listener, this); wl_display_dispatch(display); + wl_display_roundtrip(display); if (!compositor || !shell || !seat) { std::cout << "Could not bind Wayland protocols!\n";