> 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?
I would also very much be in favor of this, would save me a lot of headache. ________________________________ From: Development <development-boun...@qt-project.org> on behalf of Giuseppe D'Angelo via Development <development@qt-project.org> Sent: Wednesday, August 13, 2025 11:30 AM To: development@qt-project.org <development@qt-project.org> Subject: Re: [Development] Calling QWindow::requestActivate after QWindow::show and before QTest::qWaitForWindowActive 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, https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kdab.com%2F&data=05%7C02%7C%7Ce67527f29552461aaacd08ddda4c6d9e%7C20d0b167794d448a9d01aaeccc1124ac%7C0%7C0%7C638906743986929458%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=2SCuvilfVxEVcUYyR8QjNVc80K4SDTF2IP9Xb2XaeXo%3D&reserved=0<http://www.kdab.com/> KDAB - Trusted Software Excellence
-- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development