Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.3, 6.9.0
-
None
-
Debian 12.0
KDE Plasma 5.27.5
GPU: AMD Ryzen 7 PRO 4750U with Radeon Graphics (16)
Description
This bug breaks the unmodified hellovulkancubes example under Wayland, preventing the user from moving around using Shift+WASD. The example handles key press events using QVulkanWindow::keyPressEvent to move around the scene:
// Examples/Qt-6.9.0/vulkan/hellovulkancubes/vulkanwindow.cpp void VulkanWindow::keyPressEvent(QKeyEvent *e) { const float amount = e->modifiers().testFlag(Qt::ShiftModifier) ? 1.0f : 0.1f; switch (e->key()) { case Qt::Key_W: m_renderer->walk(amount); break; case Qt::Key_S: m_renderer->walk(-amount); break; case Qt::Key_A: m_renderer->strafe(-amount); break; case Qt::Key_D: m_renderer->strafe(amount); break; default: break; } }
This method never gets called under Wayland, meaning the user cannot move around. It does work as expected under X11, so this issue seems to be Wayland-specific. Mouse events work as expected under both X11 and Wayland.
Exploration shows that under Wayland key events get delivered to the parent MainWindow instead of to VulkanWindow. This issue might be related to focus handling. It is possible to implement a workaround for the hellovulkancubes example by listening for key press events on MainWindow instead of on QVulkanWindow, although that would not fix the underlying issue.