public Window FindGtkSubWindow (Window mainWindow, string name)
{
AndCondition cond = new AndCondition (
new PropertyCondition (AutomationElementIdentifiers.ProcessIdProperty,
mainWindow.AutomationElement.Current.ProcessId),
new PropertyCondition (AutomationElementIdentifiers.ControlTypeProperty,
ControlType.Window),
new PropertyCondition (AutomationElementIdentifiers.NameProperty, name));
var ae = AutomationElement.RootElement.FindFirst (TreeScope.Children, cond);
return new Window (ae);
}