GGUI 中 alt 按键报错?

背景

在使用 GGUI 绘制图形后,我想用普通的 alt+Tab 从图形窗口切换到其他窗口,这时窗口会退出并报错:

Assertion failed: (key_mod_flags == 0 || g.IO.KeyMods == key_mod_flags) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods", file C:/Users/buildbot/actions-runner/_work/taichi/taichi/external/imgui/imgui.cpp, line 7234

如下一份很简单的按下 ESC 键退出窗口的代码中,偶尔也会报错;如果按一次 alt 没反应,多运行几次多按几次就会发生同样的错误 :face_holding_back_tears::face_holding_back_tears::face_holding_back_tears:

import taichi as ti
ti.init()
window = ti.ui.Window('TEST', (768, 512))
while window.running:
	for e in window.get_events(ti.ui.PRESS):
		if e.key == ti.ui.ESCAPE:
			window.running = False
	window.show()

不过若将 while 循环中的控制代码全删掉,只留下 show(), 就不会报错了。依稀记得以前的版本也没有出现过这个问题。推测是某个地方出现了按键映射方面的问题?

P.S. 完整运行信息:

[Taichi] version 1.2.1, llvm 10.0.0, commit 12ab828a, win, python 3.9.13
[Taichi] Starting on arch=x64
[I 11/02/22 16:20:57.951 24704] [C:/Users/buildbot/actions-runner/_work/taichi/taichi/taichi/rhi/vulkan/vulkan_device_creator.cpp:pick_physical_device@394] Found Vulkan Device 0 (NVIDIA GeForce RTX 3060 Laptop GPU)
[I 11/02/22 16:20:57.951 24704] [C:/Users/buildbot/actions-runner/_work/taichi/taichi/taichi/rhi/vulkan/vulkan_device_creator.cpp:find_queue_families@148] Async compute queue 2, graphics queue 0
[I 11/02/22 16:20:57.951 24704] [C:/Users/buildbot/actions-runner/_work/taichi/taichi/taichi/rhi/vulkan/vulkan_device_creator.cpp:find_queue_families@148] Async compute queue 2, graphics queue 0
[I 11/02/22 16:20:57.952 24704] [C:/Users/buildbot/actions-runner/_work/taichi/taichi/taichi/rhi/vulkan/vulkan_device_creator.cpp:create_logical_device@462] Vulkan Device "NVIDIA GeForce RTX 3060 Laptop GPU" supports Vulkan 0 version 1.3.194
[I 11/02/22 16:20:58.090 24704] [C:/Users/buildbot/actions-runner/_work/taichi/taichi/taichi/rhi/vulkan/vulkan_device.cpp:create_swap_chain@2416] Creating suface of 768x512
Assertion failed: (key_mod_flags == 0 || g.IO.KeyMods == key_mod_flags) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods", file C:/Users/buildbot/actions-runner/_work/taichi/taichi/external/imgui/imgui.cpp, line 7234

感谢汇报bug,我在我的电脑上并没有复现,你可以在 Issues · taichi-dev/taichi · GitHub 上开一个issue并附上你运行的环境吗?这样比较方便我们来跟踪这个bug。

已提

1 个赞