private Element wrapper, wrapper2;
+ private boolean visibilityChangesDisabled;
+
public VWindow() {
super(false, false, true); // no autohide, not modal, shadow
// Different style of shadow for windows
setVaadinModality(!vaadinModality);
}
if (!isAttached()) {
+ setVisible(false); // hide until possible centering
show();
}
if (uidl.getBooleanAttribute("resizable") != resizable) {
setDraggable(!uidl.hasAttribute("fixedposition"));
}
+ visibilityChangesDisabled = true;
if (client.updateComponent(this, uidl, false)) {
return;
}
+ visibilityChangesDisabled = false;
immediate = uidl.hasAttribute("immediate");
setNaturalWidth();
}
- if (!dynamicWidth && !dynamicHeight
- && uidl.getBooleanAttribute("center")) {
- /*
- * Iff size is specified we can center the window at this point. By
- * doing it early we can avoid some flickering in some browsers. see
- * #5124
- */
- centered = true;
- center();
- }
-
layout.updateFromUIDL(childUidl, client);
if (!dynamicHeight && layoutRelativeWidth) {
/*
// don't try to center the window anymore
centered = false;
}
-
updateShadowSizeAndPosition();
+ setVisible(true);
boolean sizeReduced = false;
// ensure window is not larger than browser window
}
+ @Override
+ public void setVisible(boolean visible) {
+ /*
+ * Visibility with VWindow works differently than with other Paintables
+ * in Vaadin. Invisible VWindows are not attached to DOM at all. Flag is
+ * used to avoid visibility call from
+ * ApplicationConnection.updateComponent();
+ */
+ if (!visibilityChangesDisabled) {
+ super.setVisible(visible);
+ }
+ }
+
private void setDraggable(boolean draggable) {
if (this.draggable == draggable) {
return;