Hi,

Il 13/08/25 10:02, Moss Heim via Development ha scritto:
I would just like to point out that removing these calls (for example in tst_focus::policy) causes some tests to fail consistently with XCB on Ubuntu 24.04 and 25.04. As best I can tell this is due to "focus stealing prevention" behavior in GNOME[1]. We also saw this in the WebEngine project, both on CI and locally, which triggered me to ask the original question on Teams which is linked from the codereview comment.[2]

In other words, as best I can tell you are not guaranteed to get active focus when opening and closing several windows in rapid succession on GNOME, this could be from a race condition or from some throttling behavior. If it's expected that show()ing a window**/always/**gives it active focus in these instances, I believe there is some bug in Qt's XCB platform code.

TBH, if a WM decides not to give focus to a window (to prevent focus stealing and what not), it shouldn't give it even after a requestActivate() or somesuch. But that's another discussion.

More on topic: if ultimately it is platform specific whether show() alone is sufficient or one needs show()+requestAcivate() (+ QVERIFY), couldn't this combination be packaged in some QtTest helper function, so that people can simply call that function and it'll always do the right thing?

My 2 c,

--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - Trusted Software Excellence

Attachment: smime.p7s
Description: Firma crittografica S/MIME

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to