Skip to content

Truly independent web browser

UI/Qt: Keep the page window's Vulkan device while it is unexposed

Andreas Kling3325ed5ac059
diff --git a/UI/Qt/WebContentViewLinux.cpp b/UI/Qt/WebContentViewLinux.cpp
index 56d154ed4c5..42cd4d8284e 100644
--- a/UI/Qt/WebContentViewLinux.cpp
+++ b/UI/Qt/WebContentViewLinux.cpp
@@ -1039,6 +1039,9 @@ void WebContentView::create_vulkan_window()
if (auto const& gpu = presentation_gpu(); gpu.has_value())
m_vulkan_window->setPhysicalDeviceIndex(gpu->physical_device_index);
m_vulkan_window->setDeviceExtensions(vulkan_dmabuf_device_extensions());
+ // NB: Without this, QVulkanWindow destroys its device every time the window is unexposed, which on Wayland happens
+ // whenever the compositor is late with a frame callback, as it often is during a resize.
+ m_vulkan_window->setFlags(QVulkanWindow::PersistentResources);
// Request an alpha channel so QVulkanWindow builds a blending swapchain (pre/post-multiplied composite alpha). This
// lets us punch transparent holes for hover-expanded vertical tabs, which this native window would otherwise occlude.