mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-10 22:24:13 +02:00
7866a37f14
tst_menubarkeyboard sends Alt+F and F10 right after the test window is exposed, then sleeps 300 ms and checks. Menu mnemonics and the F10 shortcut (a Qt::WindowShortcut) only fire in the active window, and being exposed does not mean being active: on a loaded Xvfb, or on macOS with another application in front, activation arrives later and the key is dropped. The sleep comes after the key and cannot help. This made shortcutOpensMenuBar fail on #1420's Linux CI ("F10 did not activate the menu bar") while the same base passed on #1421 and #1422, and made the Alt+F control fail in 1 of about 33 local runs with the cocoa platform. Every test now waits for the window to be active before pressing a key (qWaitForWindowActive, with its own failure message), and the two tests that expect a menu poll for it with QTRY_VERIFY2 instead of a fixed sleep. plainF10DoesNothingInQt keeps its 300 ms: it checks that nothing happens, which cannot be polled for; with the window now active first, that check can no longer pass merely because the key went nowhere. Test-only change. Checked: with a second window active, F10 sent to the exposed but inactive window does not activate its menu bar (offscreen and cocoa); once it is active, it does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>