diff --git a/src/xml_widgets.cpp b/src/xml_widgets.cpp
index ad149d5c3..f19526f46 100644
--- a/src/xml_widgets.cpp
+++ b/src/xml_widgets.cpp
@@ -151,11 +151,9 @@ static Widget* convert_xmlelement_to_widget(TiXmlElement* elem, Widget* root)
setup_bevels(widget, b[0], b[1], b[2], b[3]);
}
- if (closewindow && root) {
- if (Frame* frame = dynamic_cast(root)) {
- static_cast