forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user