Squish: Stabilize menuVisibleAtEditor() even more

If the machine fails to correctly initialize the desktop
environment we end up with a rather small resolution which
in turn makes the condition useless.

Change-Id: Idcea7f4e2a5dd265442b5c9d98bf42ed7f01c8af
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2020-07-22 09:56:25 +02:00
parent aee2094c33
commit e17ebc7a6e
+3 -1
View File
@@ -73,8 +73,10 @@ def menuVisibleAtEditor(editor, menuInList):
menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500)
topLeft = menu.mapToGlobal(QPoint(0, 0))
bottomLeft = menu.mapToGlobal(QPoint(0, menu.height))
center = menu.mapToGlobal(QPoint(menu.width / 2, menu.height / 2))
success = menu.visible and (widgetContainsPoint(editor, topLeft)
or widgetContainsPoint(editor, bottomLeft))
or widgetContainsPoint(editor, bottomLeft)
or widgetContainsPoint(editor, center))
if success:
menuInList[0] = menu
return success